From owner-svn-src-all@freebsd.org Sun May 13 09:47:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04EBBFD17CE; Sun, 13 May 2018 09:47:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA47178007; Sun, 13 May 2018 09:47:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2A83C25; Sun, 13 May 2018 09:47:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4D9lTs7080463; Sun, 13 May 2018 09:47:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4D9lSBq080459; Sun, 13 May 2018 09:47:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805130947.w4D9lSBq080459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 13 May 2018 09:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333576 - in head/sys: kern sys ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys ufs/ffs X-SVN-Commit-Revision: 333576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 09:47:30 -0000 Author: kib Date: Sun May 13 09:47:28 2018 New Revision: 333576 URL: https://svnweb.freebsd.org/changeset/base/333576 Log: Detect and optimize reads from the hole on UFS. - Create getblkx(9) variant of getblk(9) which can return error. - Add GB_NOSPARSE flag for getblk()/getblkx() which requests that BMAP was performed before the buffer is created, and EJUSTRETURN returned in case the requested block does not exist. - Make ffs_read() use GB_NOSPARSE to avoid instantiating buffer (and allocating the pages for it), copying from zero_region instead. The end result is less page allocations and buffer recycling when a hole is read, which is important for some benchmarks. Requested and reviewed by: jeff Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D14917 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat May 12 20:00:29 2018 (r333575) +++ head/sys/kern/vfs_bio.c Sun May 13 09:47:28 2018 (r333576) @@ -2138,30 +2138,37 @@ breadn_flags(struct vnode *vp, daddr_t blkno, int size void (*ckhashfunc)(struct buf *), struct buf **bpp) { struct buf *bp; - int readwait, rv; + struct thread *td; + int error, readwait, rv; CTR3(KTR_BUF, "breadn(%p, %jd, %d)", vp, blkno, size); + td = curthread; /* - * Can only return NULL if GB_LOCK_NOWAIT flag is specified. + * Can only return NULL if GB_LOCK_NOWAIT or GB_SPARSE flags + * are specified. */ - *bpp = bp = getblk(vp, blkno, size, 0, 0, flags); - if (bp == NULL) - return (EBUSY); + error = getblkx(vp, blkno, size, 0, 0, flags, &bp); + if (error != 0) { + *bpp = NULL; + return (error); + } + flags &= ~GB_NOSPARSE; + *bpp = bp; /* * If not found in cache, do some I/O */ readwait = 0; if ((bp->b_flags & B_CACHE) == 0) { - if (!TD_IS_IDLETHREAD(curthread)) { + if (!TD_IS_IDLETHREAD(td)) { #ifdef RACCT if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 0); - PROC_UNLOCK(curproc); + PROC_LOCK(td->td_proc); + racct_add_buf(td->td_proc, bp, 0); + PROC_UNLOCK(td->td_proc); } #endif /* RACCT */ - curthread->td_ru.ru_inblock++; + td->td_ru.ru_inblock++; } bp->b_iocmd = BIO_READ; bp->b_flags &= ~B_INVAL; @@ -3822,8 +3829,21 @@ has_addr: } } +struct buf * +getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo, + int flags) +{ + struct buf *bp; + int error; + + error = getblkx(vp, blkno, size, slpflag, slptimeo, flags, &bp); + if (error != 0) + return (NULL); + return (bp); +} + /* - * getblk: + * getblkx: * * Get a block given a specified block and offset into a file/device. * The buffers B_DONE bit will be cleared on return, making it almost @@ -3858,12 +3878,13 @@ has_addr: * intends to issue a READ, the caller must clear B_INVAL and BIO_ERROR * prior to issuing the READ. biodone() will *not* clear B_INVAL. */ -struct buf * -getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo, - int flags) +int +getblkx(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo, + int flags, struct buf **bpp) { struct buf *bp; struct bufobj *bo; + daddr_t d_blkno; int bsize, error, maxsize, vmio; off_t offset; @@ -3878,6 +3899,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int flags &= ~(GB_UNMAPPED | GB_KVAALLOC); bo = &vp->v_bufobj; + d_blkno = blkno; loop: BO_RLOCK(bo); bp = gbincore(bo, blkno); @@ -3889,7 +3911,7 @@ loop: */ lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK; - if (flags & GB_LOCK_NOWAIT) + if ((flags & GB_LOCK_NOWAIT) != 0) lockflags |= LK_NOWAIT; error = BUF_TIMELOCK(bp, lockflags, @@ -3902,8 +3924,8 @@ loop: if (error == ENOLCK) goto loop; /* We timed out or were interrupted. */ - else if (error) - return (NULL); + else if (error != 0) + return (error); /* If recursed, assume caller knows the rules. */ else if (BUF_LOCKRECURSED(bp)) goto end; @@ -4008,10 +4030,10 @@ loop: * here. */ if (flags & GB_NOCREAT) - return NULL; + return (EEXIST); if (bdomain[bo->bo_domain].bd_freebuffers == 0 && TD_IS_IDLETHREAD(curthread)) - return NULL; + return (EBUSY); bsize = vn_isdisk(vp, NULL) ? DEV_BSIZE : bo->bo_bsize; KASSERT(bsize != 0, ("bsize == 0, check bo->bo_bsize")); @@ -4025,11 +4047,22 @@ loop: flags &= ~(GB_UNMAPPED | GB_KVAALLOC); } maxsize = imax(maxsize, bsize); + if ((flags & GB_NOSPARSE) != 0 && vmio && + !vn_isdisk(vp, NULL)) { + error = VOP_BMAP(vp, blkno, NULL, &d_blkno, 0, 0); + KASSERT(error != EOPNOTSUPP, + ("GB_NOSPARSE from fs not supporting bmap, vp %p", + vp)); + if (error != 0) + return (error); + if (d_blkno == -1) + return (EJUSTRETURN); + } bp = getnewbuf(vp, slpflag, slptimeo, maxsize, flags); if (bp == NULL) { if (slpflag || slptimeo) - return NULL; + return (ETIMEDOUT); /* * XXX This is here until the sleep path is diagnosed * enough to work under very low memory conditions. @@ -4075,7 +4108,8 @@ loop: * Insert the buffer into the hash, so that it can * be found by incore. */ - bp->b_blkno = bp->b_lblkno = blkno; + bp->b_lblkno = blkno; + bp->b_blkno = d_blkno; bp->b_offset = offset; bgetvp(vp, bp); BO_UNLOCK(bo); @@ -4110,7 +4144,8 @@ end: buf_track(bp, __func__); KASSERT(bp->b_bufobj == bo, ("bp %p wrong b_bufobj %p should be %p", bp, bp->b_bufobj, bo)); - return (bp); + *bpp = bp; + return (0); } /* Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Sat May 12 20:00:29 2018 (r333575) +++ head/sys/kern/vfs_cluster.c Sun May 13 09:47:28 2018 (r333576) @@ -94,12 +94,14 @@ cluster_read(struct vnode *vp, u_quad_t filesize, dadd { struct buf *bp, *rbp, *reqbp; struct bufobj *bo; + struct thread *td; daddr_t blkno, origblkno; int maxra, racluster; int error, ncontig; int i; error = 0; + td = curthread; bo = &vp->v_bufobj; if (!unmapped_buf_allowed) gbflags &= ~GB_UNMAPPED; @@ -118,10 +120,14 @@ cluster_read(struct vnode *vp, u_quad_t filesize, dadd /* * get the requested block */ - *bpp = reqbp = bp = getblk(vp, lblkno, size, 0, 0, gbflags); - if (bp == NULL) - return (EBUSY); + error = getblkx(vp, lblkno, size, 0, 0, gbflags, &bp); + if (error != 0) { + *bpp = NULL; + return (error); + } + gbflags &= ~GB_NOSPARSE; origblkno = lblkno; + *bpp = reqbp = bp; /* * if it is in the cache, then check to see if the reads have been @@ -243,12 +249,12 @@ cluster_read(struct vnode *vp, u_quad_t filesize, dadd bstrategy(bp); #ifdef RACCT if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, bp, 0); - PROC_UNLOCK(curproc); + PROC_LOCK(td->td_proc); + racct_add_buf(td->td_proc, bp, 0); + PROC_UNLOCK(td->td_proc); } #endif /* RACCT */ - curthread->td_ru.ru_inblock++; + td->td_ru.ru_inblock++; } /* @@ -303,12 +309,12 @@ cluster_read(struct vnode *vp, u_quad_t filesize, dadd bstrategy(rbp); #ifdef RACCT if (racct_enable) { - PROC_LOCK(curproc); - racct_add_buf(curproc, rbp, 0); - PROC_UNLOCK(curproc); + PROC_LOCK(td->td_proc); + racct_add_buf(td->td_proc, rbp, 0); + PROC_UNLOCK(td->td_proc); } #endif /* RACCT */ - curthread->td_ru.ru_inblock++; + td->td_ru.ru_inblock++; } if (reqbp) { Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Sat May 12 20:00:29 2018 (r333575) +++ head/sys/sys/buf.h Sun May 13 09:47:28 2018 (r333576) @@ -479,6 +479,7 @@ buf_track(struct buf *bp, const char *location) #define GB_UNMAPPED 0x0008 /* Do not mmap buffer pages. */ #define GB_KVAALLOC 0x0010 /* But allocate KVA. */ #define GB_CKHASH 0x0020 /* If reading, calc checksum hash */ +#define GB_NOSPARSE 0x0040 /* Do not instantiate holes */ #ifdef _KERNEL extern int nbuf; /* The number of buffer headers */ @@ -540,6 +541,8 @@ struct buf * getpbuf(int *); struct buf *incore(struct bufobj *, daddr_t); struct buf *gbincore(struct bufobj *, daddr_t); struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); +int getblkx(struct vnode *vp, daddr_t blkno, int size, int slpflag, + int slptimeo, int flags, struct buf **bpp); struct buf *geteblk(int, int); int bufwait(struct buf *); int bufwrite(struct buf *); Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sat May 12 20:00:29 2018 (r333575) +++ head/sys/ufs/ffs/ffs_vnops.c Sun May 13 09:47:28 2018 (r333576) @@ -462,6 +462,26 @@ ffs_lock(ap) #endif } +static int +ffs_read_hole(struct uio *uio, long xfersize, long *size) +{ + ssize_t saved_resid, tlen; + int error; + + while (xfersize > 0) { + tlen = min(xfersize, ZERO_REGION_SIZE); + saved_resid = uio->uio_resid; + error = vn_io_fault_uiomove(__DECONST(void *, zero_region), + tlen, uio); + if (error != 0) + return (error); + tlen = saved_resid - uio->uio_resid; + xfersize -= tlen; + *size -= tlen; + } + return (0); +} + /* * Vnode op for reading. */ @@ -483,9 +503,7 @@ ffs_read(ap) off_t bytesinfile; long size, xfersize, blkoffset; ssize_t orig_resid; - int error; - int seqcount; - int ioflag; + int bflag, error, ioflag, seqcount; vp = ap->a_vp; uio = ap->a_uio; @@ -529,6 +547,7 @@ ffs_read(ap) uio->uio_offset >= fs->fs_maxfilesize) return (EOVERFLOW); + bflag = GB_UNMAPPED | (uio->uio_segflg == UIO_NOCOPY ? 0 : GB_NOSPARSE); for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) { if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0) break; @@ -565,8 +584,7 @@ ffs_read(ap) /* * Don't do readahead if this is the end of the file. */ - error = bread_gb(vp, lbn, size, NOCRED, - GB_UNMAPPED, &bp); + error = bread_gb(vp, lbn, size, NOCRED, bflag, &bp); } else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { /* * Otherwise if we are allowed to cluster, @@ -577,7 +595,7 @@ ffs_read(ap) */ error = cluster_read(vp, ip->i_size, lbn, size, NOCRED, blkoffset + uio->uio_resid, - seqcount, GB_UNMAPPED, &bp); + seqcount, bflag, &bp); } else if (seqcount > 1) { /* * If we are NOT allowed to cluster, then @@ -589,17 +607,21 @@ ffs_read(ap) */ u_int nextsize = blksize(fs, ip, nextlbn); error = breadn_flags(vp, lbn, size, &nextlbn, - &nextsize, 1, NOCRED, GB_UNMAPPED, NULL, &bp); + &nextsize, 1, NOCRED, bflag, NULL, &bp); } else { /* * Failing all of the above, just read what the * user asked for. Interestingly, the same as * the first option above. */ - error = bread_gb(vp, lbn, size, NOCRED, - GB_UNMAPPED, &bp); + error = bread_gb(vp, lbn, size, NOCRED, bflag, &bp); } - if (error) { + if (error == EJUSTRETURN) { + error = ffs_read_hole(uio, xfersize, &size); + if (error == 0) + continue; + } + if (error != 0) { brelse(bp); bp = NULL; break; From owner-svn-src-all@freebsd.org Sun May 13 09:54:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02EE6FD1F81; Sun, 13 May 2018 09:54:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A06C578D45; Sun, 13 May 2018 09:54:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63EC23DFB; Sun, 13 May 2018 09:54: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 w4D9sauW085692; Sun, 13 May 2018 09:54:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4D9sYdY085681; Sun, 13 May 2018 09:54:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805130954.w4D9sYdY085681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 13 May 2018 09:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333577 - in head: include lib/libc/softfloat/bits64 lib/msun lib/msun/man lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include lib/libc/softfloat/bits64 lib/msun lib/msun/man lib/msun/src X-SVN-Commit-Revision: 333577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 09:54:37 -0000 Author: kib Date: Sun May 13 09:54:34 2018 New Revision: 333577 URL: https://svnweb.freebsd.org/changeset/base/333577 Log: Add implementations for clog(3), clogf(3), and clog(3). PR: 216863 Submitted by: bde, Steven G. Kargl MFC after: 2 weeks Added: head/lib/msun/man/clog.3 (contents, props changed) head/lib/msun/src/s_clog.c (contents, props changed) head/lib/msun/src/s_clogf.c (contents, props changed) head/lib/msun/src/s_clogl.c (contents, props changed) Modified: head/include/complex.h head/lib/libc/softfloat/bits64/softfloat-macros head/lib/msun/Makefile head/lib/msun/Symbol.map head/lib/msun/man/complex.3 head/lib/msun/src/math_private.h Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Sun May 13 09:47:28 2018 (r333576) +++ head/include/complex.h Sun May 13 09:54:34 2018 (r333577) @@ -101,6 +101,10 @@ float complex cexpf(float complex); double cimag(double complex) __pure2; float cimagf(float complex) __pure2; long double cimagl(long double complex) __pure2; +double complex clog(double complex); +float complex clogf(float complex); +long double complex + clogl(long double complex); double complex conj(double complex) __pure2; float complex conjf(float complex) __pure2; long double complex Modified: head/lib/libc/softfloat/bits64/softfloat-macros ============================================================================== --- head/lib/libc/softfloat/bits64/softfloat-macros Sun May 13 09:47:28 2018 (r333576) +++ head/lib/libc/softfloat/bits64/softfloat-macros Sun May 13 09:54:34 2018 (r333577) @@ -157,7 +157,7 @@ INLINE void z0 = a0>>count; } else { - z1 = ( count < 64 ) ? ( a0>>( count & 63 ) ) : 0; + z1 = ( count < 128 ) ? ( a0>>( count & 63 ) ) : 0; z0 = 0; } *z1Ptr = z1; Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Sun May 13 09:47:28 2018 (r333576) +++ head/lib/msun/Makefile Sun May 13 09:54:34 2018 (r333577) @@ -57,7 +57,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \ k_cos.c k_cosf.c k_exp.c k_expf.c k_rem_pio2.c k_sin.c k_sinf.c \ k_tan.c k_tanf.c \ s_asinh.c s_asinhf.c s_atan.c s_atanf.c s_carg.c s_cargf.c s_cargl.c \ - s_cbrt.c s_cbrtf.c s_ceil.c s_ceilf.c \ + s_cbrt.c s_cbrtf.c s_ceil.c s_ceilf.c s_clog.c s_clogf.c \ s_copysign.c s_copysignf.c s_cos.c s_cosf.c \ s_csqrt.c s_csqrtf.c s_erf.c s_erff.c \ s_exp2.c s_exp2f.c s_expm1.c s_expm1f.c s_fabsf.c s_fdim.c \ @@ -101,7 +101,8 @@ COMMON_SRCS+= catrigl.c \ e_lgammal.c e_lgammal_r.c \ e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ - s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ + s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c \ + s_clogl.c s_cosl.c s_cprojl.c \ s_csqrtl.c s_erfl.c s_exp2l.c s_expl.c s_floorl.c s_fmal.c \ s_fmaxl.c s_fminl.c s_frexpl.c s_logbl.c s_logl.c s_nanl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ @@ -133,7 +134,8 @@ INCS+= fenv.h math.h MAN= acos.3 acosh.3 asin.3 asinh.3 atan.3 atan2.3 atanh.3 \ ceil.3 cacos.3 ccos.3 ccosh.3 cexp.3 \ - cimag.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 exp.3 fabs.3 fdim.3 \ + cimag.3 clog.3 copysign.3 cos.3 cosh.3 csqrt.3 erf.3 \ + exp.3 fabs.3 fdim.3 \ feclearexcept.3 feenableexcept.3 fegetenv.3 \ fegetround.3 fenv.3 floor.3 \ fma.3 fmax.3 fmod.3 hypot.3 ieee.3 ieee_test.3 ilogb.3 j0.3 \ @@ -166,6 +168,7 @@ MLINKS+=cimag.3 cimagf.3 cimag.3 cimagl.3 \ cimag.3 conj.3 cimag.3 conjf.3 cimag.3 conjl.3 \ cimag.3 cproj.3 cimag.3 cprojf.3 cimag.3 cprojl.3 \ cimag.3 creal.3 cimag.3 crealf.3 cimag.3 creall.3 +MLINKS+=clog.3 clogf.3 clog.3 clogl.3 MLINKS+=copysign.3 copysignf.3 copysign.3 copysignl.3 MLINKS+=cos.3 cosf.3 cos.3 cosl.3 MLINKS+=cosh.3 coshf.3 cosh.3 coshl.3 Modified: head/lib/msun/Symbol.map ============================================================================== --- head/lib/msun/Symbol.map Sun May 13 09:47:28 2018 (r333576) +++ head/lib/msun/Symbol.map Sun May 13 09:54:34 2018 (r333577) @@ -294,6 +294,9 @@ FBSD_1.5 { casinl; catanl; catanhl; + clog; + clogf; + clogl; sincos; sincosf; sincosl; Added: head/lib/msun/man/clog.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/man/clog.3 Sun May 13 09:54:34 2018 (r333577) @@ -0,0 +1,103 @@ +.\" Copyright (c) 2017 Steven G. Kargl +.\" 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 February 13, 2017 +.Dt CLOG 3 +.Os +.Sh NAME +.Nm clog , +.Nm clogf , +and +.Nm clogl +.Nd complex natural logrithm functions +.Sh LIBRARY +.Lb libm +.Sh SYNOPSIS +.In complex.h +.Ft double complex +.Fn clog "double complex z" +.Ft float complex +.Fn clogf "float complex z" +.Ft long double complex +.Fn clogl "long double complex z" +.Sh DESCRIPTION +The +.Fn clog , +.Fn clogf , +and +.Fn clogl +functions compute the complex natural logrithm of +.Fa z . +with a branch cut along the negative real axis . +.Sh RETURN VALUES +The +.Fn clog +function returns the complex natural logarithm value, in the +range of a strip mathematically unbounded along the real axis and in +the interval [-I* \*(Pi , +I* \*(Pi ] along the imaginary axis. +The function satisfies the relationship: +.Fo clog +.Fn conj "z" Fc += +.Fo conj +.Fn clog "z" Fc . +.Pp + +.\" Table is formatted for an 80-column xterm. +.Bl -column ".Sy +\*(If + I*\*(Na" ".Sy Return value" ".Sy Divide-by-zero exception" +.It Sy Argument Ta Sy Return value Ta Sy Comment +.It -0 + I*0 Ta -\*(If + I*\*(Pi Ta Divide-by-zero exception +.It Ta Ta raised +.It +0 + I*0 Ta -\*(If + I*0 Ta Divide by zero exception +.It Ta Ta raised +.It x + I*\*(If Ta +\*(If + I*\*(Pi/2 Ta For finite x +.It x + I*\*(Na Ta \*(Na + I*\*(Na Ta Optionally raises invalid +.It Ta Ta floating-point exception +.It Ta Ta for finite x +.It -\*(If + I*y Ta +\*(If + I*\*(Pi Ta For finite positive-signed y +.It +\*(If + I*y Ta +\*(If + I*0 Ta For finite positive-signed y +.It -\*(If + I*\*(If Ta +\*(If + I*3\*(Pi/4 +.It +\*(If + I*\*(If Ta +\*(If + I*\*(Pi/4 +.It \*(Pm\*(If + I*\*(Na Ta +\*(If + I*\*(Na +.It \*(Na + I*y Ta \*(Na + I*\*(Na Ta Optionally raises invalid +.It Ta Ta floating-point exception +.It Ta Ta for finite y +.It \*(Na + I*\*(If Ta +\*(If + I*\*(Na +.It \*(Na + I*\*(Na Ta \*(Na + I*\*(Na +.El + +.Sh SEE ALSO +.Xr complex 3 , +.Xr log 3 , +.Xr math 3 +.Sh STANDARDS +The +.Fn clog , +.Fn cexpf , +and +.Fn clogl +functions conform to +.St -isoC-99 . Modified: head/lib/msun/man/complex.3 ============================================================================== --- head/lib/msun/man/complex.3 Sun May 13 09:47:28 2018 (r333576) +++ head/lib/msun/man/complex.3 Sun May 13 09:54:34 2018 (r333577) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2011 +.Dd May 13, 2018 .Dt COMPLEX 3 .Os .Sh NAME @@ -77,6 +77,10 @@ csqrt complex square root .Cl cexp exponential base e .El +.Ss Natural logrithm Function +.Cl +clog natural logrithm +.El .\" Section 7.3.9 of ISO C99 standard .Ss Manipulation Functions .Cl @@ -117,8 +121,6 @@ The functions described here conform to .St -isoC-99 . .Sh BUGS -The logarithmic functions -.Fn clog -and the power functions +The power functions .Fn cpow are not implemented. Modified: head/lib/msun/src/math_private.h ============================================================================== --- head/lib/msun/src/math_private.h Sun May 13 09:47:28 2018 (r333576) +++ head/lib/msun/src/math_private.h Sun May 13 09:54:34 2018 (r333577) @@ -294,8 +294,9 @@ do { \ /* Support switching the mode to FP_PE if necessary. */ #if defined(__i386__) && !defined(NO_FPSETPREC) -#define ENTERI() \ - long double __retval; \ +#define ENTERI() ENTERIT(long double) +#define ENTERIT(returntype) \ + returntype __retval; \ fp_prec_t __oprec; \ \ if ((__oprec = fpgetprec()) != FP_PE) \ @@ -318,6 +319,7 @@ do { \ } while (0) #else #define ENTERI() +#define ENTERIT(x) #define RETURNI(x) RETURNF(x) #define ENTERV() #define RETURNV() return Added: head/lib/msun/src/s_clog.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_clog.c Sun May 13 09:54:34 2018 (r333577) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 2013 Bruce D. Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +#define MANT_DIG DBL_MANT_DIG +#define MAX_EXP DBL_MAX_EXP +#define MIN_EXP DBL_MIN_EXP + +static const double +ln2_hi = 6.9314718055829871e-1, /* 0x162e42fefa0000.0p-53 */ +ln2_lo = 1.6465949582897082e-12; /* 0x1cf79abc9e3b3a.0p-92 */ + +double complex +clog(double complex z) +{ + double_t ax, ax2h, ax2l, axh, axl, ay, ay2h, ay2l, ayh, ayl, sh, sl, t; + double x, y, v; + uint32_t hax, hay; + int kx, ky; + + x = creal(z); + y = cimag(z); + v = atan2(y, x); + + ax = fabs(x); + ay = fabs(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + GET_HIGH_WORD(hax, ax); + kx = (hax >> 20) - 1023; + GET_HIGH_WORD(hay, ay); + ky = (hay >> 20) - 1023; + + /* Handle NaNs and Infs using the general formula. */ + if (kx == MAX_EXP || ky == MAX_EXP) + return (CMPLX(log(hypot(x, y)), v)); + + /* Avoid spurious underflow, and reduce inaccuracies when ax is 1. */ + if (ax == 1) { + if (ky < (MIN_EXP - 1) / 2) + return (CMPLX((ay / 2) * ay, v)); + return (CMPLX(log1p(ay * ay) / 2, v)); + } + + /* Avoid underflow when ax is not small. Also handle zero args. */ + if (kx - ky > MANT_DIG || ay == 0) + return (CMPLX(log(ax), v)); + + /* Avoid overflow. */ + if (kx >= MAX_EXP - 1) + return (CMPLX(log(hypot(x * 0x1p-1022, y * 0x1p-1022)) + + (MAX_EXP - 2) * ln2_lo + (MAX_EXP - 2) * ln2_hi, v)); + if (kx >= (MAX_EXP - 1) / 2) + return (CMPLX(log(hypot(x, y)), v)); + + /* Reduce inaccuracies and avoid underflow when ax is denormal. */ + if (kx <= MIN_EXP - 2) + return (CMPLX(log(hypot(x * 0x1p1023, y * 0x1p1023)) + + (MIN_EXP - 2) * ln2_lo + (MIN_EXP - 2) * ln2_hi, v)); + + /* Avoid remaining underflows (when ax is small but not denormal). */ + if (ky < (MIN_EXP - 1) / 2 + MANT_DIG) + return (CMPLX(log(hypot(x, y)), v)); + + /* Calculate ax*ax and ay*ay exactly using Dekker's algorithm. */ + t = (double)(ax * (0x1p27 + 1)); + axh = (double)(ax - t) + t; + axl = ax - axh; + ax2h = ax * ax; + ax2l = axh * axh - ax2h + 2 * axh * axl + axl * axl; + t = (double)(ay * (0x1p27 + 1)); + ayh = (double)(ay - t) + t; + ayl = ay - ayh; + ay2h = ay * ay; + ay2l = ayh * ayh - ay2h + 2 * ayh * ayl + ayl * ayl; + + /* + * When log(|z|) is far from 1, accuracy in calculating the sum + * of the squares is not very important since log() reduces + * inaccuracies. We depended on this to use the general + * formula when log(|z|) is very far from 1. When log(|z|) is + * moderately far from 1, we go through the extra-precision + * calculations to reduce branches and gain a little accuracy. + * + * When |z| is near 1, we subtract 1 and use log1p() and don't + * leave it to log() to subtract 1, since we gain at least 1 bit + * of accuracy in this way. + * + * When |z| is very near 1, subtracting 1 can cancel almost + * 3*MANT_DIG bits. We arrange that subtracting 1 is exact in + * doubled precision, and then do the rest of the calculation + * in sloppy doubled precision. Although large cancellations + * often lose lots of accuracy, here the final result is exact + * in doubled precision if the large calculation occurs (because + * then it is exact in tripled precision and the cancellation + * removes enough bits to fit in doubled precision). Thus the + * result is accurate in sloppy doubled precision, and the only + * significant loss of accuracy is when it is summed and passed + * to log1p(). + */ + sh = ax2h; + sl = ay2h; + _2sumF(sh, sl); + if (sh < 0.5 || sh >= 3) + return (CMPLX(log(ay2l + ax2l + sl + sh) / 2, v)); + sh -= 1; + _2sum(sh, sl); + _2sum(ax2l, ay2l); + /* Briggs-Kahan algorithm (except we discard the final low term): */ + _2sum(sh, ax2l); + _2sum(sl, ay2l); + t = ax2l + sl; + _2sumF(sh, t); + return (CMPLX(log1p(ay2l + t + sh) / 2, v)); +} + +#if (LDBL_MANT_DIG == 53) +__weak_reference(clog, clogl); +#endif Added: head/lib/msun/src/s_clogf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_clogf.c Sun May 13 09:54:34 2018 (r333577) @@ -0,0 +1,151 @@ +/*- + * Copyright (c) 2013 Bruce D. Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +#define MANT_DIG FLT_MANT_DIG +#define MAX_EXP FLT_MAX_EXP +#define MIN_EXP FLT_MIN_EXP + +static const float +ln2f_hi = 6.9314575195e-1, /* 0xb17200.0p-24 */ +ln2f_lo = 1.4286067653e-6; /* 0xbfbe8e.0p-43 */ + +float complex +clogf(float complex z) +{ + float_t ax, ax2h, ax2l, axh, axl, ay, ay2h, ay2l, ayh, ayl, sh, sl, t; + float x, y, v; + uint32_t hax, hay; + int kx, ky; + + x = crealf(z); + y = cimagf(z); + v = atan2f(y, x); + + ax = fabsf(x); + ay = fabsf(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + GET_FLOAT_WORD(hax, ax); + kx = (hax >> 23) - 127; + GET_FLOAT_WORD(hay, ay); + ky = (hay >> 23) - 127; + + /* Handle NaNs and Infs using the general formula. */ + if (kx == MAX_EXP || ky == MAX_EXP) + return (CMPLXF(logf(hypotf(x, y)), v)); + + /* Avoid spurious underflow, and reduce inaccuracies when ax is 1. */ + if (hax == 0x3f800000) { + if (ky < (MIN_EXP - 1) / 2) + return (CMPLXF((ay / 2) * ay, v)); + return (CMPLXF(log1pf(ay * ay) / 2, v)); + } + + /* Avoid underflow when ax is not small. Also handle zero args. */ + if (kx - ky > MANT_DIG || hay == 0) + return (CMPLXF(logf(ax), v)); + + /* Avoid overflow. */ + if (kx >= MAX_EXP - 1) + return (CMPLXF(logf(hypotf(x * 0x1p-126F, y * 0x1p-126F)) + + (MAX_EXP - 2) * ln2f_lo + (MAX_EXP - 2) * ln2f_hi, v)); + if (kx >= (MAX_EXP - 1) / 2) + return (CMPLXF(logf(hypotf(x, y)), v)); + + /* Reduce inaccuracies and avoid underflow when ax is denormal. */ + if (kx <= MIN_EXP - 2) + return (CMPLXF(logf(hypotf(x * 0x1p127F, y * 0x1p127F)) + + (MIN_EXP - 2) * ln2f_lo + (MIN_EXP - 2) * ln2f_hi, v)); + + /* Avoid remaining underflows (when ax is small but not denormal). */ + if (ky < (MIN_EXP - 1) / 2 + MANT_DIG) + return (CMPLXF(logf(hypotf(x, y)), v)); + + /* Calculate ax*ax and ay*ay exactly using Dekker's algorithm. */ + t = (float)(ax * (0x1p12F + 1)); + axh = (float)(ax - t) + t; + axl = ax - axh; + ax2h = ax * ax; + ax2l = axh * axh - ax2h + 2 * axh * axl + axl * axl; + t = (float)(ay * (0x1p12F + 1)); + ayh = (float)(ay - t) + t; + ayl = ay - ayh; + ay2h = ay * ay; + ay2l = ayh * ayh - ay2h + 2 * ayh * ayl + ayl * ayl; + + /* + * When log(|z|) is far from 1, accuracy in calculating the sum + * of the squares is not very important since log() reduces + * inaccuracies. We depended on this to use the general + * formula when log(|z|) is very far from 1. When log(|z|) is + * moderately far from 1, we go through the extra-precision + * calculations to reduce branches and gain a little accuracy. + * + * When |z| is near 1, we subtract 1 and use log1p() and don't + * leave it to log() to subtract 1, since we gain at least 1 bit + * of accuracy in this way. + * + * When |z| is very near 1, subtracting 1 can cancel almost + * 3*MANT_DIG bits. We arrange that subtracting 1 is exact in + * doubled precision, and then do the rest of the calculation + * in sloppy doubled precision. Although large cancellations + * often lose lots of accuracy, here the final result is exact + * in doubled precision if the large calculation occurs (because + * then it is exact in tripled precision and the cancellation + * removes enough bits to fit in doubled precision). Thus the + * result is accurate in sloppy doubled precision, and the only + * significant loss of accuracy is when it is summed and passed + * to log1p(). + */ + sh = ax2h; + sl = ay2h; + _2sumF(sh, sl); + if (sh < 0.5F || sh >= 3) + return (CMPLXF(logf(ay2l + ax2l + sl + sh) / 2, v)); + sh -= 1; + _2sum(sh, sl); + _2sum(ax2l, ay2l); + /* Briggs-Kahan algorithm (except we discard the final low term): */ + _2sum(sh, ax2l); + _2sum(sl, ay2l); + t = ax2l + sl; + _2sumF(sh, t); + return (CMPLXF(log1pf(ay2l + t + sh) / 2, v)); +} Added: head/lib/msun/src/s_clogl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/src/s_clogl.c Sun May 13 09:54:34 2018 (r333577) @@ -0,0 +1,168 @@ +/*- + * Copyright (c) 2013 Bruce D. Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#ifdef __i386__ +#include +#endif + +#include "fpmath.h" +#include "math.h" +#include "math_private.h" + +#define MANT_DIG LDBL_MANT_DIG +#define MAX_EXP LDBL_MAX_EXP +#define MIN_EXP LDBL_MIN_EXP + +static const double +ln2_hi = 6.9314718055829871e-1; /* 0x162e42fefa0000.0p-53 */ + +#if LDBL_MANT_DIG == 64 +#define MULT_REDUX 0x1p32 /* exponent MANT_DIG / 2 rounded up */ +static const double +ln2l_lo = 1.6465949582897082e-12; /* 0x1cf79abc9e3b3a.0p-92 */ +#elif LDBL_MANT_DIG == 113 +#define MULT_REDUX 0x1p57 +static const long double +ln2l_lo = 1.64659495828970812809844307550013433e-12L; /* 0x1cf79abc9e3b39803f2f6af40f343.0p-152L */ +#else +#error "Unsupported long double format" +#endif + +long double complex +clogl(long double complex z) +{ + long double ax, ax2h, ax2l, axh, axl, ay, ay2h, ay2l, ayh, ayl; + long double sh, sl, t; + long double x, y, v; + uint16_t hax, hay; + int kx, ky; + + ENTERIT(long double complex); + + x = creall(z); + y = cimagl(z); + v = atan2l(y, x); + + ax = fabsl(x); + ay = fabsl(y); + if (ax < ay) { + t = ax; + ax = ay; + ay = t; + } + + GET_LDBL_EXPSIGN(hax, ax); + kx = hax - 16383; + GET_LDBL_EXPSIGN(hay, ay); + ky = hay - 16383; + + /* Handle NaNs and Infs using the general formula. */ + if (kx == MAX_EXP || ky == MAX_EXP) + RETURNI(CMPLXL(logl(hypotl(x, y)), v)); + + /* Avoid spurious underflow, and reduce inaccuracies when ax is 1. */ + if (ax == 1) { + if (ky < (MIN_EXP - 1) / 2) + RETURNI(CMPLXL((ay / 2) * ay, v)); + RETURNI(CMPLXL(log1pl(ay * ay) / 2, v)); + } + + /* Avoid underflow when ax is not small. Also handle zero args. */ + if (kx - ky > MANT_DIG || ay == 0) + RETURNI(CMPLXL(logl(ax), v)); + + /* Avoid overflow. */ + if (kx >= MAX_EXP - 1) + RETURNI(CMPLXL(logl(hypotl(x * 0x1p-16382L, y * 0x1p-16382L)) + + (MAX_EXP - 2) * ln2l_lo + (MAX_EXP - 2) * ln2_hi, v)); + if (kx >= (MAX_EXP - 1) / 2) + RETURNI(CMPLXL(logl(hypotl(x, y)), v)); + + /* Reduce inaccuracies and avoid underflow when ax is denormal. */ + if (kx <= MIN_EXP - 2) + RETURNI(CMPLXL(logl(hypotl(x * 0x1p16383L, y * 0x1p16383L)) + + (MIN_EXP - 2) * ln2l_lo + (MIN_EXP - 2) * ln2_hi, v)); + + /* Avoid remaining underflows (when ax is small but not denormal). */ + if (ky < (MIN_EXP - 1) / 2 + MANT_DIG) + RETURNI(CMPLXL(logl(hypotl(x, y)), v)); + + /* Calculate ax*ax and ay*ay exactly using Dekker's algorithm. */ + t = (long double)(ax * (MULT_REDUX + 1)); + axh = (long double)(ax - t) + t; + axl = ax - axh; + ax2h = ax * ax; + ax2l = axh * axh - ax2h + 2 * axh * axl + axl * axl; + t = (long double)(ay * (MULT_REDUX + 1)); + ayh = (long double)(ay - t) + t; + ayl = ay - ayh; + ay2h = ay * ay; + ay2l = ayh * ayh - ay2h + 2 * ayh * ayl + ayl * ayl; + + /* + * When log(|z|) is far from 1, accuracy in calculating the sum + * of the squares is not very important since log() reduces + * inaccuracies. We depended on this to use the general + * formula when log(|z|) is very far from 1. When log(|z|) is + * moderately far from 1, we go through the extra-precision + * calculations to reduce branches and gain a little accuracy. + * + * When |z| is near 1, we subtract 1 and use log1p() and don't + * leave it to log() to subtract 1, since we gain at least 1 bit + * of accuracy in this way. + * + * When |z| is very near 1, subtracting 1 can cancel almost + * 3*MANT_DIG bits. We arrange that subtracting 1 is exact in + * doubled precision, and then do the rest of the calculation + * in sloppy doubled precision. Although large cancellations + * often lose lots of accuracy, here the final result is exact + * in doubled precision if the large calculation occurs (because + * then it is exact in tripled precision and the cancellation + * removes enough bits to fit in doubled precision). Thus the + * result is accurate in sloppy doubled precision, and the only + * significant loss of accuracy is when it is summed and passed + * to log1p(). + */ + sh = ax2h; + sl = ay2h; + _2sumF(sh, sl); + if (sh < 0.5 || sh >= 3) + RETURNI(CMPLXL(logl(ay2l + ax2l + sl + sh) / 2, v)); + sh -= 1; + _2sum(sh, sl); + _2sum(ax2l, ay2l); + /* Briggs-Kahan algorithm (except we discard the final low term): */ + _2sum(sh, ax2l); + _2sum(sl, ay2l); + t = ax2l + sl; + _2sumF(sh, t); + RETURNI(CMPLXL(log1pl(ay2l + t + sh) / 2, v)); +} From owner-svn-src-all@freebsd.org Sun May 13 12:29:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F002EFDA06D; Sun, 13 May 2018 12:29:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 955D86C2EA; Sun, 13 May 2018 12:29: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72720569A; Sun, 13 May 2018 12:29:10 +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 w4DCTAkq060845; Sun, 13 May 2018 12:29:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DCTA4v060844; Sun, 13 May 2018 12:29:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201805131229.w4DCTA4v060844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 13 May 2018 12:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333579 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 333579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 12:29:11 -0000 Author: rmacklem Date: Sun May 13 12:29:09 2018 New Revision: 333579 URL: https://svnweb.freebsd.org/changeset/base/333579 Log: The NFSv4.1 server should return NFSERR_BACKCHANBUSY instead of NFS_OK. When an NFSv4.1 session is busy due to a callback being in progress, nfsrv_freesession() should return NFSERR_BACKCHANBUSY instead of NFS_OK. The only effect this has is that the DestroySession operation will report the failure for this case and this probably has little or no effect on a client. Spotted by inspection and no failures related to this have been reported. MFC after: 2 months Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun May 13 11:31:32 2018 (r333578) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun May 13 12:29:09 2018 (r333579) @@ -5982,7 +5982,7 @@ nfsrv_freesession(struct nfsdsession *sep, uint8_t *se if (sep->sess_refcnt > 0) { NFSUNLOCKSESSION(shp); NFSUNLOCKSTATE(); - return (0); + return (NFSERR_BACKCHANBUSY); } LIST_REMOVE(sep, sess_hash); LIST_REMOVE(sep, sess_list); From owner-svn-src-all@freebsd.org Sun May 13 12:42:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2837FDABC3; Sun, 13 May 2018 12:42:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B1446E00D; Sun, 13 May 2018 12:42:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EC2A59D8; Sun, 13 May 2018 12:42:54 +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 w4DCgs6a070795; Sun, 13 May 2018 12:42:54 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DCgs7b070794; Sun, 13 May 2018 12:42:54 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201805131242.w4DCgs7b070794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 13 May 2018 12:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333580 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 333580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 12:42:55 -0000 Author: rmacklem Date: Sun May 13 12:42:53 2018 New Revision: 333580 URL: https://svnweb.freebsd.org/changeset/base/333580 Log: Fix a slow leak of session structures in the NFSv4.1 server. For a fairly rare case of a client doing an ExchangeID after a hard reboot, the old confirmed clientid still exists, but some clients use a new co_verifier. For this case, the server was not freeing up the sessions on the old confirmed clientid. This patch fixes this case. It also adds two LIST_INIT() macros, which are actually no-ops, since the structure is malloc()d with M_ZERO so the pointer is already set to NULL. It should have minimal impact, since the only way I could exercise this code path was by doing a hard power cycle (pulling the plus) on a machine running Linux with a NFSv4.1 mount on the server. Originally spotted during testing of the ESXi 6.5 client. Tested by: andreas.nagy@frequentis.com MFC after: 2 months Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun May 13 12:29:09 2018 (r333579) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun May 13 12:42:53 2018 (r333580) @@ -180,9 +180,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc nfsquad_t *clientidp, nfsquad_t *confirmp, NFSPROC_T *p) { struct nfsclient *clp = NULL, *new_clp = *new_clpp; - int i, error = 0; + int i, error = 0, ret; struct nfsstate *stp, *tstp; struct sockaddr_in *sad, *rad; + struct nfsdsession *sep, *nsep; int zapit = 0, gotit, hasstate = 0, igotlock; static u_int64_t confirm_index = 0; @@ -352,6 +353,15 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc * can be thrown away once the SETCLIENTID_CONFIRM occurs. */ LIST_REMOVE(clp, lc_hash); + + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { + ret = nfsrv_freesession(sep, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) new_clp->lc_confirm.lval[0] = confirmp->lval[0] = @@ -387,6 +397,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } + LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); nfsstatsv1.srvclients++; @@ -451,6 +462,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsc LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } + LIST_INIT(&new_clp->lc_session); LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, lc_hash); nfsstatsv1.srvclients++; From owner-svn-src-all@freebsd.org Sun May 13 13:01:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC539FDB698; Sun, 13 May 2018 13:00:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2BF46FB29; Sun, 13 May 2018 13:00:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C9085B8B; Sun, 13 May 2018 13:00: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 w4DD0xhG077292; Sun, 13 May 2018 13:00:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DD0xIa077291; Sun, 13 May 2018 13:00:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805131300.w4DD0xIa077291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 13 May 2018 13:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333581 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 333581 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 13:01:00 -0000 Author: markj Date: Sun May 13 13:00:59 2018 New Revision: 333581 URL: https://svnweb.freebsd.org/changeset/base/333581 Log: Get rid of vm_pageout_page_queued(). vm_page_queue(), added in r333256, generalizes vm_pageout_page_queued(), so use it instead. No functional change intended. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D15402 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun May 13 12:42:53 2018 (r333580) +++ head/sys/vm/vm_pageout.c Sun May 13 13:00:59 2018 (r333581) @@ -252,32 +252,16 @@ vm_pageout_end_scan(struct scan_state *ss) } /* - * Ensure that the page has not been dequeued after a pageout batch was - * collected. See vm_page_dequeue_complete(). - */ -static inline bool -vm_pageout_page_queued(vm_page_t m, int queue) -{ - - vm_page_assert_locked(m); - - if ((m->aflags & PGA_DEQUEUE) != 0) - return (false); - atomic_thread_fence_acq(); - return (m->queue == queue); -} - -/* * Add a small number of queued pages to a batch queue for later processing * without the corresponding queue lock held. The caller must have enqueued a * marker page at the desired start point for the scan. Pages will be * physically dequeued if the caller so requests. Otherwise, the returned * batch may contain marker pages, and it is up to the caller to handle them. * - * When processing the batch queue, vm_pageout_page_queued() must be used to - * determine whether the page was logically dequeued by another thread. Once - * this check is performed, the page lock guarantees that the page will not be - * disassociated from the queue. + * When processing the batch queue, vm_page_queue() must be used to + * determine whether the page has been logically dequeued by another thread. + * Once this check is performed, the page lock guarantees that the page will + * not be disassociated from the queue. */ static __always_inline void vm_pageout_collect_batch(struct scan_state *ss, const bool dequeue) @@ -751,7 +735,7 @@ recheck: * The page may have been disassociated from the queue * while locks were dropped. */ - if (!vm_pageout_page_queued(m, queue)) + if (vm_page_queue(m) != queue) continue; /* @@ -1262,7 +1246,7 @@ recheck: * The page may have been disassociated from the queue * while locks were dropped. */ - if (!vm_pageout_page_queued(m, PQ_INACTIVE)) { + if (vm_page_queue(m) != PQ_INACTIVE) { addl_page_shortage++; continue; } @@ -1542,7 +1526,7 @@ act_scan: * The page may have been disassociated from the queue * while locks were dropped. */ - if (!vm_pageout_page_queued(m, PQ_ACTIVE)) + if (vm_page_queue(m) != PQ_ACTIVE) continue; /* From owner-svn-src-all@freebsd.org Sun May 13 17:44:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0671FC77D7; Sun, 13 May 2018 17:44:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BC9B7BD97; Sun, 13 May 2018 17:44:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4906210A78; Sun, 13 May 2018 17:44:27 +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 w4DHiRL0021892; Sun, 13 May 2018 17:44:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DHiRoh021891; Sun, 13 May 2018 17:44:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805131744.w4DHiRoh021891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 13 May 2018 17:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333583 - stable/11/tools/test/popss X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/tools/test/popss X-SVN-Commit-Revision: 333583 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 17:44:27 -0000 Author: kib Date: Sun May 13 17:44:26 2018 New Revision: 333583 URL: https://svnweb.freebsd.org/changeset/base/333583 Log: MFC r333460: Add the test program to examine CPU behaviour for pop ss issue CVE-2018-8897. Approved by: re (marius) Added: stable/11/tools/test/popss/ - copied from r333460, head/tools/test/popss/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Sun May 13 19:19:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1028DFCD6B5; Sun, 13 May 2018 19:19:14 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B18B96E7AE; Sun, 13 May 2018 19:19:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90F4811975; Sun, 13 May 2018 19:19:13 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DJJD7A067173; Sun, 13 May 2018 19:19:13 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DJJAww067157; Sun, 13 May 2018 19:19:10 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201805131919.w4DJJAww067157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 13 May 2018 19:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333584 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 333584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 19:19:14 -0000 Author: fsu Date: Sun May 13 19:19:10 2018 New Revision: 333584 URL: https://svnweb.freebsd.org/changeset/base/333584 Log: Fix EXT2FS_DEBUG definition usage. Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D15394 Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h head/sys/fs/ext2fs/ext2_hash.c head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_alloc.c Sun May 13 19:19:10 2018 (r333584) @@ -1381,8 +1381,8 @@ ext2_vfree(struct vnode *pvp, ino_t ino, int mode) ibp = (char *)bp->b_data; ino = (ino - 1) % fs->e2fs->e2fs_ipg; if (isclr(ibp, ino)) { - printf("ino = %llu, fs = %s\n", - (unsigned long long)ino, fs->e2fs_fsmnt); + printf("ino = %ju, fs = %s\n", + ino, fs->e2fs_fsmnt); if (fs->e2fs_ronly == 0) panic("ext2_vfree: freeing free inode"); } Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_bmap.c Sun May 13 19:19:10 2018 (r333584) @@ -48,8 +48,8 @@ #include #include -#include #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_extents.c Sun May 13 19:19:10 2018 (r333584) @@ -53,7 +53,7 @@ static void ext4_ext_print_extent(struct ext4_extent *ep) { - printf(" ext %p => (blk %u len %u start %lu)\n", + printf(" ext %p => (blk %u len %u start %ju)\n", ep, ep->e_blk, ep->e_len, (uint64_t)ep->e_start_hi << 32 | ep->e_start_lo); } @@ -69,7 +69,7 @@ ext4_ext_print_index(struct inode *ip, struct ext4_ext fs = ip->i_e2fs; - printf(" index %p => (blk %u pblk %lu)\n", + printf(" index %p => (blk %u pblk %ju)\n", ex, ex->ei_blk, (uint64_t)ex->ei_leaf_hi << 32 | ex->ei_leaf_lo); if(!do_walk) @@ -110,9 +110,9 @@ ext4_ext_print_path(struct inode *ip, struct ext4_exte { int k, l; - l = path->ep_depth + l = path->ep_depth; - printf("ip=%d, Path:\n", ip->i_number); + printf("ip=%ju, Path:\n", ip->i_number); for (k = 0; k <= l; k++, path++) { if (path->ep_index) { ext4_ext_print_index(ip, path->ep_index, 0); @@ -123,13 +123,13 @@ ext4_ext_print_path(struct inode *ip, struct ext4_exte } void -ext4_ext_print_extent_tree_status(struct inode * ip) +ext4_ext_print_extent_tree_status(struct inode *ip) { struct ext4_extent_header *ehp; ehp = (struct ext4_extent_header *)(char *)ip->i_db; - printf("Extent status:ip=%d\n", ip->i_number); + printf("Extent status:ip=%ju\n", ip->i_number); if (!(ip->i_flag & IN_E4EXTENTS)) return; Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_extents.h Sun May 13 19:19:10 2018 (r333584) @@ -130,7 +130,7 @@ int ext4_ext_get_blocks(struct inode *ip, int64_t iblo unsigned long max_blocks, struct ucred *cred, struct buf **bpp, int *allocate, daddr_t *); #ifdef EXT2FS_DEBUG -void ext4_ext_print_extent_tree_status(struct inode * ip); +void ext4_ext_print_extent_tree_status(struct inode *ip); #endif #endif /* !_FS_EXT2FS_EXT2_EXTENTS_H_ */ Modified: head/sys/fs/ext2fs/ext2_hash.c ============================================================================== --- head/sys/fs/ext2fs/ext2_hash.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_hash.c Sun May 13 19:19:10 2018 (r333584) @@ -61,6 +61,7 @@ #include #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_htree.c Sun May 13 19:19:10 2018 (r333584) @@ -44,6 +44,7 @@ #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_inode.c Sun May 13 19:19:10 2018 (r333584) @@ -50,6 +50,7 @@ #include #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun May 13 19:19:10 2018 (r333584) @@ -54,17 +54,19 @@ ext2_print_inode(struct inode *in) printf("Inode: %5ju", (uintmax_t)in->i_number); printf( /* "Inode: %5d" */ - " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d acl: 0x%lx\n", + " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d acl: 0x%jx\n", "n/a", in->i_mode, in->i_flags, in->i_gen, in->i_facl); printf("User: %5u Group: %5u Size: %ju\n", in->i_uid, in->i_gid, (uintmax_t)in->i_size); printf("Links: %3d Blockcount: %ju\n", in->i_nlink, (uintmax_t)in->i_blocks); - printf("ctime: 0x%x", in->i_ctime); - printf("atime: 0x%x", in->i_atime); - printf("mtime: 0x%x", in->i_mtime); + printf("ctime: 0x%x ", in->i_ctime); + printf("atime: 0x%x ", in->i_atime); + printf("mtime: 0x%x ", in->i_mtime); if (E2DI_HAS_XTIME(in)) - printf("crtime %#x ", in->i_birthtime); + printf("crtime %#x\n", in->i_birthtime); + else + printf("\n"); if (in->i_flag & IN_E4EXTENTS) { printf("Extents:\n"); ehp = (struct ext4_extent_header *)in->i_db; Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_lookup.c Sun May 13 19:19:10 2018 (r333584) @@ -57,6 +57,7 @@ #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_subr.c Sun May 13 19:19:10 2018 (r333584) @@ -48,6 +48,7 @@ #include #include +#include #include #include #include Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_vfsops.c Sun May 13 19:19:10 2018 (r333584) @@ -58,13 +58,15 @@ #include #include +#include #include #include -#include #include #include #include +#include + static int ext2_flushfiles(struct mount *mp, int flags, struct thread *td); static int ext2_mountfs(struct vnode *, struct mount *); Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun May 13 19:19:10 2018 (r333584) @@ -90,6 +90,7 @@ #include #include #include +#include static int ext2_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static void ext2_itimes_locked(struct vnode *); Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Sun May 13 17:44:26 2018 (r333583) +++ head/sys/fs/ext2fs/fs.h Sun May 13 19:19:10 2018 (r333584) @@ -161,4 +161,9 @@ */ #define NINDIR(fs) (EXT2_ADDR_PER_BLOCK(fs)) +/* + * Use if additional debug logging is required. + */ +/* #define EXT2FS_DEBUG */ + #endif /* !_FS_EXT2FS_FS_H_ */ From owner-svn-src-all@freebsd.org Sun May 13 19:29:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5847AFCE230; Sun, 13 May 2018 19:29:36 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF43C70AE3; Sun, 13 May 2018 19:29:35 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D126D11B28; Sun, 13 May 2018 19:29:35 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DJTZuo072482; Sun, 13 May 2018 19:29:35 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DJTZtZ072481; Sun, 13 May 2018 19:29:35 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201805131929.w4DJTZtZ072481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 13 May 2018 19:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333585 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 333585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 19:29:36 -0000 Author: fsu Date: Sun May 13 19:29:35 2018 New Revision: 333585 URL: https://svnweb.freebsd.org/changeset/base/333585 Log: Fix on-disk inode checksum calculation logic. Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D15395 Modified: head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/ext2fs/ext2_inode_cnv.c Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Sun May 13 19:19:10 2018 (r333584) +++ head/sys/fs/ext2fs/ext2_csum.c Sun May 13 19:29:35 2018 (r333585) @@ -535,29 +535,42 @@ static uint32_t ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *ei) { struct m_ext2fs *fs; - uint16_t old_hi; - uint32_t inum, gen, crc; + uint32_t inode_csum_seed, inum, gen, crc; + uint16_t dummy_csum = 0; + unsigned int offset, csum_size; fs = ip->i_e2fs; - - ei->e2di_chksum_lo = 0; - if ((EXT2_INODE_SIZE(ip->i_e2fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { - old_hi = ei->e2di_chksum_hi; - ei->e2di_chksum_hi = 0; - } - + offset = offsetof(struct ext2fs_dinode, e2di_chksum_lo); + csum_size = sizeof(dummy_csum); inum = ip->i_number; gen = ip->i_gen; + crc = calculate_crc32c(fs->e2fs_csum_seed, + (uint8_t *)&inum, sizeof(inum)); + inode_csum_seed = calculate_crc32c(crc, + (uint8_t *)&gen, sizeof(gen)); - crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); - crc = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); - crc = calculate_crc32c(crc, (uint8_t *)ei, fs->e2fs->e2fs_inode_size); + crc = calculate_crc32c(inode_csum_seed, (uint8_t *)ei, offset); + crc = calculate_crc32c(crc, (uint8_t *)&dummy_csum, csum_size); + offset += csum_size; + crc = calculate_crc32c(crc, (uint8_t *)ei + offset, + E2FS_REV0_INODE_SIZE - offset); - if ((EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE && - ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) - ei->e2di_chksum_hi = old_hi; + if (EXT2_INODE_SIZE(fs) > E2FS_REV0_INODE_SIZE) { + offset = offsetof(struct ext2fs_dinode, e2di_chksum_hi); + crc = calculate_crc32c(crc, (uint8_t *)ei + + E2FS_REV0_INODE_SIZE, offset - E2FS_REV0_INODE_SIZE); + if ((EXT2_INODE_SIZE(ip->i_e2fs) > E2FS_REV0_INODE_SIZE && + ei->e2di_extra_isize >= EXT2_INODE_CSUM_HI_EXTRA_END)) { + crc = calculate_crc32c(crc, (uint8_t *)&dummy_csum, + csum_size); + offset += csum_size; + } + + crc = calculate_crc32c(crc, (uint8_t *)ei + offset, + EXT2_INODE_SIZE(fs) - offset); + } + return (crc); } @@ -573,10 +586,6 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) return (0); - /* Check case, when dinode was not initialized */ - if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) - return (0); - provided = ei->e2di_chksum_lo; calculated = ext2_ei_csum(ip, ei); @@ -587,8 +596,17 @@ ext2_ei_csum_verify(struct inode *ip, struct ext2fs_di } else calculated &= 0xFFFF; - if (provided != calculated) + if (provided != calculated) { + /* + * If it is first time used dinode, + * it is expected that it will be zeroed + * and we will not return checksum error in this case. + */ + if (!memcmp(ei, &ei_zero, sizeof(struct ext2fs_dinode))) + return (0); + return (EIO); + } return (0); } Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun May 13 19:19:10 2018 (r333584) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun May 13 19:29:35 2018 (r333585) @@ -92,10 +92,7 @@ ext2_print_inode(struct inode *in) int ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) { - struct m_ext2fs *fs; - const static struct ext2fs_dinode ei_zero; - fs = ip->i_e2fs; ip->i_nlink = ei->e2di_nlink; /* * Godmar thinks - if the link count is zero, then the inode is @@ -139,11 +136,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) memcpy(ip->i_data, ei->e2di_blocks, sizeof(ei->e2di_blocks)); - if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM) && - memcmp(ei, &ei_zero, EXT2_INODE_SIZE(fs))) - return (ext2_ei_csum_verify(ip, ei)); - - return (0); + return (ext2_ei_csum_verify(ip, ei)); } /* From owner-svn-src-all@freebsd.org Sun May 13 19:48:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07436FCF253; Sun, 13 May 2018 19:48:32 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD91875C60; Sun, 13 May 2018 19:48:31 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FB5E11E63; Sun, 13 May 2018 19:48:31 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DJmVWx082510; Sun, 13 May 2018 19:48:31 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DJmUSq082504; Sun, 13 May 2018 19:48:30 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201805131948.w4DJmUSq082504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sun, 13 May 2018 19:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333586 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 333586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 19:48:32 -0000 Author: fsu Date: Sun May 13 19:48:30 2018 New Revision: 333586 URL: https://svnweb.freebsd.org/changeset/base/333586 Log: Fix directory blocks checksumming. Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D15396 Modified: head/sys/fs/ext2fs/ext2_csum.c head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_htree.c head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_csum.c ============================================================================== --- head/sys/fs/ext2fs/ext2_csum.c Sun May 13 19:29:35 2018 (r333585) +++ head/sys/fs/ext2fs/ext2_csum.c Sun May 13 19:48:30 2018 (r333586) @@ -154,12 +154,37 @@ ext2_extattr_blk_csum_set(struct inode *ip, struct buf header->h_checksum = ext2_extattr_blk_csum(ip, ip->i_facl, header); } -static struct ext2fs_direct_tail * -ext2_get_dirent_tail(struct inode *ip, struct ext2fs_direct_2 *ep) +void +ext2_init_dirent_tail(struct ext2fs_direct_tail *tp) { + memset(tp, 0, sizeof(struct ext2fs_direct_tail)); + tp->e2dt_rec_len = sizeof(struct ext2fs_direct_tail); + tp->e2dt_reserved_ft = EXT2_FT_DIR_CSUM; +} + +struct ext2fs_direct_tail * +ext2_dirent_get_tail(struct inode *ip, struct ext2fs_direct_2 *ep) +{ + struct ext2fs_direct_2 *dep; + void *top; struct ext2fs_direct_tail *tp; + unsigned int rec_len; - tp = EXT2_DIRENT_TAIL(ep, ip->i_e2fs->e2fs_bsize); + dep = ep; + top = EXT2_DIRENT_TAIL(ep, ip->i_e2fs->e2fs_bsize); + rec_len = dep->e2d_reclen; + + while (rec_len && !(rec_len & 0x3)) { + dep = (struct ext2fs_direct_2 *)(((char *)dep) + rec_len); + if ((void *)dep >= top) + break; + rec_len = dep->e2d_reclen; + } + + if (dep != top) + return (NULL); + + tp = (struct ext2fs_direct_tail *)dep; if (tp->e2dt_reserved_zero1 || tp->e2dt_rec_len != sizeof(struct ext2fs_direct_tail) || tp->e2dt_reserved_zero2 || @@ -189,13 +214,13 @@ ext2_dirent_csum(struct inode *ip, struct ext2fs_direc return (crc); } -static int +int ext2_dirent_csum_verify(struct inode *ip, struct ext2fs_direct_2 *ep) { uint32_t calculated; struct ext2fs_direct_tail *tp; - tp = ext2_get_dirent_tail(ip, ep); + tp = ext2_dirent_get_tail(ip, ep); if (tp == NULL) return (0); @@ -263,7 +288,7 @@ ext2_dx_csum(struct inode *ip, struct ext2fs_direct_2 return (crc); } -static int +int ext2_dx_csum_verify(struct inode *ip, struct ext2fs_direct_2 *ep) { uint32_t calculated; @@ -304,7 +329,7 @@ ext2_dir_blk_csum_verify(struct inode *ip, struct buf ep = (struct ext2fs_direct_2 *)bp->b_data; - if (ext2_get_dirent_tail(ip, ep) != NULL) + if (ext2_dirent_get_tail(ip, ep) != NULL) error = ext2_dirent_csum_verify(ip, ep); else if (ext2_get_dx_count(ip, ep, NULL) != NULL) error = ext2_dx_csum_verify(ip, ep); @@ -316,12 +341,18 @@ ext2_dir_blk_csum_verify(struct inode *ip, struct buf return (error); } -static void +void ext2_dirent_csum_set(struct inode *ip, struct ext2fs_direct_2 *ep) { + struct m_ext2fs *fs; struct ext2fs_direct_tail *tp; - tp = ext2_get_dirent_tail(ip, ep); + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + + tp = ext2_dirent_get_tail(ip, ep); if (tp == NULL) return; @@ -329,13 +360,19 @@ ext2_dirent_csum_set(struct inode *ip, struct ext2fs_d ext2_dirent_csum(ip, ep, (char *)tp - (char *)ep); } -static void +void ext2_dx_csum_set(struct inode *ip, struct ext2fs_direct_2 *ep) { + struct m_ext2fs *fs; struct ext2fs_htree_count *cp; struct ext2fs_htree_tail *tp; int count_offset, limit, count; + fs = ip->i_e2fs; + + if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + return; + cp = ext2_get_dx_count(ip, ep, &count_offset); if (cp == NULL) return; @@ -350,35 +387,6 @@ ext2_dx_csum_set(struct inode *ip, struct ext2fs_direc tp->ht_checksum = ext2_dx_csum(ip, ep, count_offset, count, tp); } -void -ext2_dir_blk_csum_set_mem(struct inode *ip, char *buf, int size) -{ - struct m_ext2fs *fs; - struct ext2fs_direct_2 *ep; - - fs = ip->i_e2fs; - - if (!EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) - return; - - ep = (struct ext2fs_direct_2 *)buf; - - if (ext2_htree_has_idx(ip)) { - if (ext2_get_dx_count(ip, ep, NULL) != NULL) - ext2_dx_csum_set(ip, ep); - } else { - if (ext2_get_dirent_tail(ip, ep) != NULL) - ext2_dirent_csum_set(ip, ep); - } -} - -void -ext2_dir_blk_csum_set(struct inode *ip, struct buf *bp) -{ - - ext2_dir_blk_csum_set_mem(ip, bp->b_data, bp->b_bufsize); -} - static uint32_t ext2_extent_blk_csum(struct inode *ip, struct ext4_extent_header *ehp) { @@ -543,9 +551,9 @@ ext2_ei_csum(struct inode *ip, struct ext2fs_dinode *e offset = offsetof(struct ext2fs_dinode, e2di_chksum_lo); csum_size = sizeof(dummy_csum); inum = ip->i_number; - gen = ip->i_gen; crc = calculate_crc32c(fs->e2fs_csum_seed, (uint8_t *)&inum, sizeof(inum)); + gen = ip->i_gen; inode_csum_seed = calculate_crc32c(crc, (uint8_t *)&gen, sizeof(gen)); Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Sun May 13 19:29:35 2018 (r333585) +++ head/sys/fs/ext2fs/ext2_extern.h Sun May 13 19:48:30 2018 (r333586) @@ -43,6 +43,7 @@ struct ext2fs_dinode; struct ext2fs_direct_2; +struct ext2fs_direct_tail; struct ext2fs_searchslot; struct indir; struct inode; @@ -110,10 +111,15 @@ void ext2_sb_csum_set(struct m_ext2fs *); int ext2_extattr_blk_csum_verify(struct inode *, struct buf *); void ext2_extattr_blk_csum_set(struct inode *, struct buf *); int ext2_dir_blk_csum_verify(struct inode *, struct buf *); -void ext2_dir_blk_csum_set(struct inode *, struct buf *); -void ext2_dir_blk_csum_set_mem(struct inode *, char *, int); +struct ext2fs_direct_tail *ext2_dirent_get_tail(struct inode *ip, + struct ext2fs_direct_2 *ep); +void ext2_dirent_csum_set(struct inode *, struct ext2fs_direct_2 *); +int ext2_dirent_csum_verify(struct inode *ip, struct ext2fs_direct_2 *ep); +void ext2_dx_csum_set(struct inode *, struct ext2fs_direct_2 *); +int ext2_dx_csum_verify(struct inode *ip, struct ext2fs_direct_2 *ep); int ext2_extent_blk_csum_verify(struct inode *, void *); void ext2_extent_blk_csum_set(struct inode *, void *); +void ext2_init_dirent_tail(struct ext2fs_direct_tail *); int ext2_gd_i_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *); void ext2_gd_i_bitmap_csum_set(struct m_ext2fs *, int, struct buf *); int ext2_gd_b_bitmap_csum_verify(struct m_ext2fs *, int, struct buf *); @@ -122,7 +128,6 @@ int ext2_ei_csum_verify(struct inode *, struct ext2fs_ void ext2_ei_csum_set(struct inode *, struct ext2fs_dinode *); int ext2_gd_csum_verify(struct m_ext2fs *, struct cdev *); void ext2_gd_csum_set(struct m_ext2fs *); - /* Flags to low-level allocation routines. * The low 16-bits are reserved for IO_ flags from vnode.h. Modified: head/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- head/sys/fs/ext2fs/ext2_htree.c Sun May 13 19:29:35 2018 (r333585) +++ head/sys/fs/ext2fs/ext2_htree.c Sun May 13 19:48:30 2018 (r333586) @@ -56,7 +56,7 @@ static void ext2_append_entry(char *block, uint32_t blksize, struct ext2fs_direct_2 *last_entry, - struct ext2fs_direct_2 *new_entry); + struct ext2fs_direct_2 *new_entry, int csum_size); static int ext2_htree_append_block(struct vnode *vp, char *data, struct componentname *cnp, uint32_t blksize); static int ext2_htree_check_next(struct inode *ip, uint32_t hash, @@ -82,12 +82,14 @@ static void ext2_htree_set_hash(struct ext2fs_htree_en uint32_t hash); static void ext2_htree_set_limit(struct ext2fs_htree_entry *ep, uint16_t limit); -static int ext2_htree_split_dirblock(char *block1, char *block2, - uint32_t blksize, uint32_t *hash_seed, uint8_t hash_version, +static int ext2_htree_split_dirblock(struct inode *ip, + char *block1, char *block2, uint32_t blksize, + uint32_t *hash_seed, uint8_t hash_version, uint32_t *split_hash, struct ext2fs_direct_2 *entry); static void ext2_htree_release(struct ext2fs_htree_lookup_info *info); static uint32_t ext2_htree_root_limit(struct inode *ip, int len); -static int ext2_htree_writebuf(struct ext2fs_htree_lookup_info *info); +static int ext2_htree_writebuf(struct inode *ip, + struct ext2fs_htree_lookup_info *info); int ext2_htree_has_idx(struct inode *ip) @@ -207,10 +209,16 @@ ext2_htree_release(struct ext2fs_htree_lookup_info *in static uint32_t ext2_htree_root_limit(struct inode *ip, int len) { + struct m_ext2fs *fs; uint32_t space; + fs = ip->i_e2fs; space = ip->i_e2fs->e2fs_bsize - EXT2_DIR_REC_LEN(1) - EXT2_DIR_REC_LEN(2) - len; + + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + space -= sizeof(struct ext2fs_htree_tail); + return (space / sizeof(struct ext2fs_htree_entry)); } @@ -223,6 +231,9 @@ ext2_htree_node_limit(struct inode *ip) fs = ip->i_e2fs; space = fs->e2fs_bsize - EXT2_DIR_REC_LEN(0); + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + space -= sizeof(struct ext2fs_htree_tail); + return (space / sizeof(struct ext2fs_htree_entry)); } @@ -417,13 +428,13 @@ ext2_htree_append_block(struct vnode *vp, char *data, } static int -ext2_htree_writebuf(struct ext2fs_htree_lookup_info *info) +ext2_htree_writebuf(struct inode* ip, struct ext2fs_htree_lookup_info *info) { int i, error; for (i = 0; i < info->h_levels_num; i++) { struct buf *bp = info->h_levels[i].h_bp; - + ext2_dx_csum_set(ip, (struct ext2fs_direct_2 *)bp->b_data); error = bwrite(bp); if (error) return (error); @@ -487,14 +498,14 @@ ext2_htree_cmp_sort_entry(const void *e1, const void * static void ext2_append_entry(char *block, uint32_t blksize, struct ext2fs_direct_2 *last_entry, - struct ext2fs_direct_2 *new_entry) + struct ext2fs_direct_2 *new_entry, int csum_size) { uint16_t entry_len; entry_len = EXT2_DIR_REC_LEN(last_entry->e2d_namlen); last_entry->e2d_reclen = entry_len; last_entry = (struct ext2fs_direct_2 *)((char *)last_entry + entry_len); - new_entry->e2d_reclen = block + blksize - (char *)last_entry; + new_entry->e2d_reclen = block + blksize - (char *)last_entry - csum_size; memcpy(last_entry, new_entry, EXT2_DIR_REC_LEN(new_entry->e2d_namlen)); } @@ -502,12 +513,13 @@ ext2_append_entry(char *block, uint32_t blksize, * Move half of entries from the old directory block to the new one. */ static int -ext2_htree_split_dirblock(char *block1, char *block2, uint32_t blksize, - uint32_t *hash_seed, uint8_t hash_version, +ext2_htree_split_dirblock(struct inode *ip, char *block1, char *block2, + uint32_t blksize, uint32_t *hash_seed, uint8_t hash_version, uint32_t *split_hash, struct ext2fs_direct_2 *entry) { + struct m_ext2fs *fs; int entry_cnt = 0; - int size = 0; + int size = 0, csum_size = 0; int i, k; uint32_t offset; uint16_t entry_len = 0; @@ -516,11 +528,15 @@ ext2_htree_split_dirblock(char *block1, char *block2, char *dest; struct ext2fs_htree_sort_entry *sort_info; + fs = ip->i_e2fs; ep = (struct ext2fs_direct_2 *)block1; dest = block2; sort_info = (struct ext2fs_htree_sort_entry *) ((char *)block2 + blksize); + if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) + csum_size = sizeof(struct ext2fs_direct_tail); + /* * Calculate name hash value for the entry which is to be added. */ @@ -530,7 +546,7 @@ ext2_htree_split_dirblock(char *block1, char *block2, /* * Fill in directory entry sort descriptors. */ - while ((char *)ep < block1 + blksize) { + while ((char *)ep < block1 + blksize - csum_size) { if (ep->e2d_ino && ep->e2d_namlen) { entry_cnt++; sort_info--; @@ -585,7 +601,7 @@ ext2_htree_split_dirblock(char *block1, char *block2, /* Shrink directory entries in block 1. */ last = (struct ext2fs_direct_2 *)block1; entry_len = 0; - for (offset = 0; offset < blksize; ) { + for (offset = 0; offset < blksize - csum_size; ) { ep = (struct ext2fs_direct_2 *)(block1 + offset); offset += ep->e2d_reclen; if (ep->e2d_ino) { @@ -600,19 +616,24 @@ ext2_htree_split_dirblock(char *block1, char *block2, if (entry_hash >= *split_hash) { /* Add entry to block 2. */ ext2_append_entry(block2, blksize, - (struct ext2fs_direct_2 *)dest, entry); + (struct ext2fs_direct_2 *)dest, entry, csum_size); /* Adjust length field of last entry of block 1. */ - last->e2d_reclen = block1 + blksize - (char *)last; + last->e2d_reclen = block1 + blksize - (char *)last - csum_size; } else { /* Add entry to block 1. */ - ext2_append_entry(block1, blksize, last, entry); + ext2_append_entry(block1, blksize, last, entry, csum_size); /* Adjust length field of last entry of block 2. */ ((struct ext2fs_direct_2 *)dest)->e2d_reclen = - block2 + blksize - dest; + block2 + blksize - dest - csum_size; } + if (csum_size) { + ext2_init_dirent_tail(EXT2_DIRENT_TAIL(block1, blksize)); + ext2_init_dirent_tail(EXT2_DIRENT_TAIL(block2, blksize)); + } + return (0); } @@ -680,13 +701,14 @@ ext2_htree_create_index(struct vnode *vp, struct compo hash_version = root->h_info.h_hash_version; if (hash_version <= EXT2_HTREE_TEA) hash_version += m_fs->e2fs_uhash; - ext2_htree_split_dirblock(buf1, buf2, blksize, fs->e3fs_hash_seed, + ext2_htree_split_dirblock(dp, buf1, buf2, blksize, fs->e3fs_hash_seed, hash_version, &split_hash, new_entry); ext2_htree_insert_entry(&info, split_hash, 2); /* * Write directory block 0. */ + ext2_dx_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); if (DOINGASYNC(vp)) { bdwrite(bp); error = 0; @@ -700,6 +722,7 @@ ext2_htree_create_index(struct vnode *vp, struct compo /* * Write directory block 1. */ + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf1); error = ext2_htree_append_block(vp, buf1, cnp, blksize); if (error) goto out1; @@ -707,6 +730,7 @@ ext2_htree_create_index(struct vnode *vp, struct compo /* * Write directory block 2. */ + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)buf2); error = ext2_htree_append_block(vp, buf2, cnp, blksize); free(buf1, M_TEMP); @@ -825,6 +849,8 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ split_hash, blknum); /* Write new index node to disk */ + ext2_dx_csum_set(ip, + (struct ext2fs_direct_2 *)dst_bp->b_data); error = bwrite(dst_bp); ip->i_flag |= IN_CHANGE | IN_UPDATE; if (error) @@ -863,7 +889,7 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ /* Split target directory block */ newdirblock = malloc(blksize, M_TEMP, M_WAITOK | M_ZERO); - ext2_htree_split_dirblock((char *)bp->b_data, newdirblock, blksize, + ext2_htree_split_dirblock(ip, (char *)bp->b_data, newdirblock, blksize, fs->e3fs_hash_seed, hash_version, &split_hash, entry); cursize = roundup(ip->i_size, blksize); dirsize = cursize + blksize; @@ -873,11 +899,13 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ ext2_htree_insert_entry(&info, split_hash, blknum); /* Write the new directory block to the end of the directory */ + ext2_dirent_csum_set(ip, (struct ext2fs_direct_2 *)newdirblock); error = ext2_htree_append_block(dvp, newdirblock, cnp, blksize); if (error) goto finish; /* Write the target directory block */ + ext2_dirent_csum_set(ip, (struct ext2fs_direct_2 *)bp->b_data); error = bwrite(bp); ip->i_flag |= IN_CHANGE | IN_UPDATE; if (error) @@ -885,7 +913,7 @@ ext2_htree_add_entry(struct vnode *dvp, struct ext2fs_ write_bp = 1; /* Write the index block */ - error = ext2_htree_writebuf(&info); + error = ext2_htree_writebuf(ip, &info); if (!error) write_info = 1; Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Sun May 13 19:29:35 2018 (r333585) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sun May 13 19:48:30 2018 (r333586) @@ -136,6 +136,7 @@ ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) memcpy(ip->i_data, ei->e2di_blocks, sizeof(ei->e2di_blocks)); + /* Verify inode csum. */ return (ext2_ei_csum_verify(ip, ei)); } @@ -197,7 +198,7 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) memcpy(ei->e2di_blocks, ip->i_data, sizeof(ei->e2di_blocks)); - /* Set inode csum */ + /* Set inode csum. */ ext2_ei_csum_set(ip, ei); return (0); Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sun May 13 19:29:35 2018 (r333585) +++ head/sys/fs/ext2fs/ext2_lookup.c Sun May 13 19:48:30 2018 (r333586) @@ -930,7 +930,7 @@ ext2_direnter(struct inode *ip, struct vnode *dvp, str memcpy(bp->b_data, &newdir, sizeof(struct ext2fs_direct_2)); - ext2_dir_blk_csum_set(dp, bp); + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); error = bwrite(bp); if (error) return (error); @@ -1030,7 +1030,7 @@ ext2_add_entry(struct vnode *dvp, struct ext2fs_direct ep = (struct ext2fs_direct_2 *)((char *)ep + dsize); } bcopy((caddr_t)entry, (caddr_t)ep, (u_int)newentrysize); - ext2_dir_blk_csum_set(dp, bp); + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); if (DOINGASYNC(dvp)) { bdwrite(bp); error = 0; @@ -1088,7 +1088,7 @@ ext2_dirremove(struct vnode *dvp, struct componentname else rep = (struct ext2fs_direct_2 *)((char *)ep + ep->e2d_reclen); ep->e2d_reclen += rep->e2d_reclen; - ext2_dir_blk_csum_set(dp, bp); + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); if (DOINGASYNC(dvp) && dp->i_count != 0) bdwrite(bp); else @@ -1119,7 +1119,7 @@ ext2_dirrewrite(struct inode *dp, struct inode *ip, st ep->e2d_type = DTTOFT(IFTODT(ip->i_mode)); else ep->e2d_type = EXT2_FT_UNKNOWN; - ext2_dir_blk_csum_set(dp, bp); + ext2_dirent_csum_set(dp, (struct ext2fs_direct_2 *)bp->b_data); error = bwrite(bp); dp->i_flag |= IN_CHANGE | IN_UPDATE; return (error); Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun May 13 19:29:35 2018 (r333585) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun May 13 19:48:30 2018 (r333586) @@ -1091,9 +1091,8 @@ abortit: "rename: mangled dir"); } else { dirbuf->dotdot_ino = newparent; - ext2_dir_blk_csum_set_mem(ip, - (char *)dirbuf, - ip->i_e2fs->e2fs_bsize); + ext2_dirent_csum_set(ip, + (struct ext2fs_direct_2 *)dirbuf); (void)vn_rdwr(UIO_WRITE, fvp, (caddr_t)dirbuf, ip->i_e2fs->e2fs_bsize, @@ -1284,14 +1283,6 @@ out: #endif /* UFS_ACL */ -static void -ext2_init_dirent_tail(struct ext2fs_direct_tail *tp) -{ - memset(tp, 0, sizeof(struct ext2fs_direct_tail)); - tp->e2dt_rec_len = sizeof(struct ext2fs_direct_tail); - tp->e2dt_reserved_ft = EXT2_FT_DIR_CSUM; -} - /* * Mkdir system call */ @@ -1400,7 +1391,7 @@ ext2_mkdir(struct vop_mkdir_args *ap) ext2_init_dirent_tail(EXT2_DIRENT_TAIL(buf, DIRBLKSIZ)); } memcpy(buf, &dirtemplate, sizeof(dirtemplate)); - ext2_dir_blk_csum_set_mem(ip, buf, DIRBLKSIZ); + ext2_dirent_csum_set(ip, (struct ext2fs_direct_2 *)buf); error = vn_rdwr(UIO_WRITE, tvp, (caddr_t)buf, DIRBLKSIZ, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_SYNC | IO_NOMACCHECK, cnp->cn_cred, NOCRED, From owner-svn-src-all@freebsd.org Sun May 13 20:10:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFD0BFD026C; Sun, 13 May 2018 20:10:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD827A2C2; Sun, 13 May 2018 20:10:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81220121B1; Sun, 13 May 2018 20:10:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DKA2t9093854; Sun, 13 May 2018 20:10:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DKA2mp093851; Sun, 13 May 2018 20:10:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805132010.w4DKA2mp093851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 13 May 2018 20:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333587 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 333587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 20:10:03 -0000 Author: kib Date: Sun May 13 20:10:02 2018 New Revision: 333587 URL: https://svnweb.freebsd.org/changeset/base/333587 Log: Fix PMC_IN_TRAP_HANDLER() for i386 after the 4/4 split. Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/include/pmc_mdep.h Modified: head/sys/i386/include/pmc_mdep.h ============================================================================== --- head/sys/i386/include/pmc_mdep.h Sun May 13 19:48:30 2018 (r333586) +++ head/sys/i386/include/pmc_mdep.h Sun May 13 20:10:02 2018 (r333587) @@ -145,8 +145,8 @@ struct pmc_mdep; #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) #define PMC_IN_TRAP_HANDLER(PC) \ - ((PC) >= (uintptr_t) start_exceptions && \ - (PC) < (uintptr_t) end_exceptions) + ((PC) >= (uintptr_t)start_exceptions + setidt_disp && \ + (PC) < (uintptr_t) end_exceptions + setidt_disp) #define PMC_AT_FUNCTION_PROLOGUE_PUSH_BP(I) \ (((I) & 0x00ffffff) == 0xe58955) /* pushl %ebp; movl %esp,%ebp */ From owner-svn-src-all@freebsd.org Sun May 13 22:58:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1D79FD8B00; Sun, 13 May 2018 22:58:41 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70D3D807D7; Sun, 13 May 2018 22:58:41 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F55A13D62; Sun, 13 May 2018 22:58:41 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DMwfnV082112; Sun, 13 May 2018 22:58:41 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DMwfbG082111; Sun, 13 May 2018 22:58:41 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201805132258.w4DMwfbG082111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sun, 13 May 2018 22:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333588 - head/tools/build/options X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/tools/build/options X-SVN-Commit-Revision: 333588 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 22:58:41 -0000 Author: sevan (doc committer) Date: Sun May 13 22:58:40 2018 New Revision: 333588 URL: https://svnweb.freebsd.org/changeset/base/333588 Log: Typo Submitted by: jrm@ Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D14836 Modified: head/tools/build/options/WITHOUT_ISCSI Modified: head/tools/build/options/WITHOUT_ISCSI ============================================================================== --- head/tools/build/options/WITHOUT_ISCSI Sun May 13 20:10:02 2018 (r333587) +++ head/tools/build/options/WITHOUT_ISCSI Sun May 13 22:58:40 2018 (r333588) @@ -1,4 +1,4 @@ .\" $FreeBSD$ Set to not build -.Xr iscid 8 +.Xr iscsid 8 and related utilities. From owner-svn-src-all@freebsd.org Sun May 13 23:04:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AFF6FD8FC4; Sun, 13 May 2018 23:04:37 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B287181F47; Sun, 13 May 2018 23:04:36 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8361F13F31; Sun, 13 May 2018 23:04:36 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DN4asK087239; Sun, 13 May 2018 23:04:36 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DN4aik087238; Sun, 13 May 2018 23:04:36 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201805132304.w4DN4aik087238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Sun, 13 May 2018 23:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333589 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 333589 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 23:04:37 -0000 Author: sevan (doc committer) Date: Sun May 13 23:04:35 2018 New Revision: 333589 URL: https://svnweb.freebsd.org/changeset/base/333589 Log: Regen after r333588 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun May 13 22:58:40 2018 (r333588) +++ head/share/man/man5/src.conf.5 Sun May 13 23:04:35 2018 (r333589) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 3, 2018 +.Dd May 14, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -848,7 +848,7 @@ and .Xr tcpmd5 4 . .It Va WITHOUT_ISCSI Set to not build -.Xr iscid 8 +.Xr iscsid 8 and related utilities. .It Va WITHOUT_JAIL Set to not build tools for the support of jails; e.g., From owner-svn-src-all@freebsd.org Sun May 13 23:16:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DBC0FD96D4; Sun, 13 May 2018 23:16:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2047B84C20; Sun, 13 May 2018 23:16:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F140C140C9; Sun, 13 May 2018 23:16:04 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DNG4eo092483; Sun, 13 May 2018 23:16:04 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DNG4oh092482; Sun, 13 May 2018 23:16:04 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805132316.w4DNG4oh092482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 13 May 2018 23:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333590 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 333590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 23:16:05 -0000 Author: mmacy Date: Sun May 13 23:16:04 2018 New Revision: 333590 URL: https://svnweb.freebsd.org/changeset/base/333590 Log: Add epoch(9) man page Reviewed by: gallatin@ Approved by: sbruno@ Added: head/share/man/man9/epoch.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun May 13 23:04:35 2018 (r333589) +++ head/share/man/man9/Makefile Sun May 13 23:16:04 2018 (r333590) @@ -123,6 +123,7 @@ MAN= accept_filter.9 \ drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ + epoch.9 \ EVENTHANDLER.9 \ eventtimers.9 \ extattr.9 \ Added: head/share/man/man9/epoch.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/epoch.9 Sun May 13 23:16:04 2018 (r333590) @@ -0,0 +1,161 @@ +.\" +.\" Copyright (C) 2018 Matthew Macy . +.\" +.\" 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 HOLDER(S) ``AS IS'' AND ANY +.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) 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 13, 2018 +.Dt EPOCH 9 +.Os +.Sh NAME +.Nm epoch , +.Nm epoch_context , +.Nm epoch_alloc , +.Nm epoch_free , +.Nm epoch_enter , +.Nm epoch_exit , +.Nm epoch_wait , +.Nm epoch_call , +.Nm in_epoch , +.Nd kernel epoch based reclaimation +.Sh SYNOPSIS +.In sys/param.h +.In sys/proc.h +.In sys/epoch.h +.Ft epoch_t +.Fn epoch_alloc "void" +.Ft void +.Fn epoch_enter "epoch_t epoch" +.Ft void +.Fn epoch_exit "epoch_t epoch" +.Ft void +.Fn epoch_wait "epoch_t epoch" +.Ft void +.Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)" +.Ft int +.Fn in_epoch "void" +.Sh DESCRIPTION +Epochs are used to guarantee liveness and immutability of data by +deferring reclamation and mutation until a grace period has elapsed. +Epochs do not have any lock ordering issues. Entering and leaving +an epoch section will never block. +.Pp +Epochs are allocated with +.Fn epoch_alloc +and freed with +.Fn epoch_free . +Threads indicate the start of an epoch critical section by calling +.Fn epoch_enter . +The end of a critical section is indicated by calling +.Fn epoch_exit . +A thread can wait until a grace period has elapsed +since any threads have entered +the epoch by calling +.Fn epoch_wait . +If the thread can't sleep or is otherwise in a performance sensitive +path it can ensure that a grace period has elapsed by calling +.Fn epoch_call +with a callback with any work that needs to wait for an epoch to elapse. +Only non-sleepable locks can be acquired during a section protected by +.Fn epoch_enter +and +.Fn epoch_exit . +INVARIANTS can assert that a thread is in an epoch by using +.Fn in_epoch . +.Pp +The epoch API currently does not support sleeping in epoch sections. +A caller cannot do epoch_enter recursively on different epochs. A +caller should never call +.Fn epoch_wait +in the middle of an epoch section as this will lead to a deadlock. +.Pp +Note that epochs are not a straight replacement for read locks. Callers +must use safe list and tailq traversal routines in an epoch (see ck_queue). +When modifying a list referenced from an epoch section safe removal +routines must be used and the caller can no longer modify a list entry +in place. An item to be modified must be handled with copy on write +and frees must be deferred until after a grace period has elapsed. + +.Sh RETURN VALUES +.Fn in_epoch +will return 1 if curthread is in an epoch, 0 otherwise. +.Sh EXAMPLES +Async free example: + +Thread 1: +.Bd -literal +{ + epoch_enter(net_epoch); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + sa = ifa->ifa_addr; + if (sa->sa_family != AF_INET) + continue; + sin = (struct sockaddr_in *)sa; + if (prison_check_ip4(cred, &sin->sin_addr) == 0) { + ia = (struct in_ifaddr *)ifa; + break; + } + } + epoch_exit(net_epoch); +} +.Ed +Thread 2: +.Bd -literal +void +ifa_free(struct ifaddr *ifa) +{ + + if (refcount_release(&ifa->ifa_refcnt)) + epoch_call(net_epoch, &ifa->ifa_epoch_ctx, ifa_destroy); +} + +{ + + IF_ADDR_WLOCK(ifp); + CK_STAILQ_REMOVE(&ifp->if_addrhead, ifa, ifaddr, ifa_link); + /* mark as unlinked */ + ifa->ifa_addr->sa_family = AF_UNSPEC; + IF_ADDR_WUNLOCK(ifp); + ifa_free(ifa); +} +.Ed +.Pp +Thread 1 traverses the ifaddr list in an epoch. Thread 2 unlinks +with the corresponding epoch safe macro, marks as logically free, +and then defers deletion. More general mutation or a synchronous +free would have to follow a a call to +.Fn epoch_wait . +.Sh ERRORS +None. +.El +.Sh SEE ALSO +.Xr locking 9 , +.Xr mtx_pool 9 , +.Xr mutex 9 , +.Xr rwlock 9 , +.Xr sema 9 , +.Xr sleep 9 , +.Xr sx 9 , +.Xr timeout 9 From owner-svn-src-all@freebsd.org Sun May 13 23:24:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BB51FD9C8A; Sun, 13 May 2018 23:24:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98DC8729A; Sun, 13 May 2018 23:24:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA72714271; Sun, 13 May 2018 23:24:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DNOm9P097322; Sun, 13 May 2018 23:24:48 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DNOm3B097320; Sun, 13 May 2018 23:24:48 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805132324.w4DNOm3B097320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sun, 13 May 2018 23:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333591 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 23:24:49 -0000 Author: mmacy Date: Sun May 13 23:24:48 2018 New Revision: 333591 URL: https://svnweb.freebsd.org/changeset/base/333591 Log: epoch(9): cleanups, additional debug checks, and add global_epoch - GC the _nopreempt routines - to really benefit we'd need a separate routine - they're not currently in use - they complicate the API for no benefit at this time - check that we're actually in a epoch section at exit - handle epoch_call() early in boot - Fix copyright declaration language Approved by: sbruno@ Modified: head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sun May 13 23:16:04 2018 (r333590) +++ head/sys/kern/subr_epoch.c Sun May 13 23:24:48 2018 (r333591) @@ -1,27 +1,29 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2018, Matthew Macy * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Neither the name of Matthew Macy nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 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. + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * */ #include @@ -49,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include -MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); +static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); /* arbitrary --- needs benchmarking */ #define MAX_ADAPTIVE_SPIN 5000 @@ -116,6 +118,7 @@ struct epoch { static __read_mostly int domcount[MAXMEMDOM]; static __read_mostly int domoffsets[MAXMEMDOM]; static __read_mostly int inited; +__read_mostly epoch_t global_epoch; static void epoch_call_task(void *context); @@ -136,10 +139,8 @@ epoch_init(void *arg __unused) migrate_count = counter_u64_alloc(M_WAITOK); turnstile_count = counter_u64_alloc(M_WAITOK); switch_count = counter_u64_alloc(M_WAITOK); - if (usedomains == false) { - inited = 1; - return; - } + if (usedomains == false) + goto done; count = domain = 0; domoffsets[0] = 0; for (domain = 0; domain < vm_ndomains; domain++) { @@ -156,9 +157,11 @@ epoch_init(void *arg __unused) break; } } + done: inited = 1; + global_epoch = epoch_alloc(); } -SYSINIT(epoch, SI_SUB_CPU + 1, SI_ORDER_FIRST, epoch_init, NULL); +SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); static void epoch_init_numa(epoch_t epoch) @@ -311,19 +314,6 @@ epoch_enter(epoch_t epoch) } void -epoch_enter_nopreempt(epoch_t epoch) -{ - struct epoch_pcpu_state *eps; - - INIT_CHECK(epoch); - critical_enter(); - eps = epoch->e_pcpu[curcpu]; - curthread->td_epochnest++; - MPASS(curthread->td_epochnest < UCHAR_MAX - 2); - ck_epoch_begin(&eps->eps_record.er_record, NULL); -} - -void epoch_exit(epoch_t epoch) { struct epoch_pcpu_state *eps; @@ -331,6 +321,7 @@ epoch_exit(epoch_t epoch) td = curthread; INIT_CHECK(epoch); + MPASS(td->td_epochnest); critical_enter(); eps = epoch->e_pcpu[curcpu]; sched_unpin(); @@ -342,19 +333,6 @@ epoch_exit(epoch_t epoch) critical_exit(); } -void -epoch_exit_nopreempt(epoch_t epoch) -{ - struct epoch_pcpu_state *eps; - - INIT_CHECK(epoch); - MPASS(curthread->td_critnest); - eps = epoch->e_pcpu[curcpu]; - ck_epoch_end(&eps->eps_record.er_record, NULL); - curthread->td_epochnest--; - critical_exit(); -} - /* * epoch_block_handler is a callback from the ck code when another thread is * currently in an epoch section. @@ -541,12 +519,17 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* cb = (void *)ctx; + MPASS(callback); + /* too early in boot to have epoch set up */ + if (__predict_false(epoch == NULL)) { + callback(ctx); + return; + } MPASS(cb->ec_callback == NULL); MPASS(cb->ec_link.stqe_next == NULL); - MPASS(epoch); - MPASS(callback); cb->ec_callback = callback; counter_u64_add(epoch->e_frees, 1); + critical_enter(); eps = epoch->e_pcpu[curcpu]; STAILQ_INSERT_HEAD(&eps->eps_cblist, cb, ec_link); Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Sun May 13 23:16:04 2018 (r333590) +++ head/sys/sys/epoch.h Sun May 13 23:24:48 2018 (r333591) @@ -1,27 +1,28 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2018, Matthew Macy * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Neither the name of Matthew Macy nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 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. + * 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$ */ @@ -32,6 +33,8 @@ struct epoch; typedef struct epoch *epoch_t; +extern epoch_t global_epoch; + struct epoch_context { void *data[2]; } __aligned(sizeof(void *)); @@ -42,8 +45,6 @@ epoch_t epoch_alloc(void); void epoch_free(epoch_t epoch); void epoch_enter(epoch_t epoch); void epoch_exit(epoch_t epoch); -void epoch_enter_nopreempt(epoch_t epoch); -void epoch_exit_nopreempt(epoch_t epoch); void epoch_wait(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(void); From owner-svn-src-all@freebsd.org Sun May 13 23:38:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84AF2FDA41F; Sun, 13 May 2018 23:38:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38F3C6A53A; Sun, 13 May 2018 23:38:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A43E14409; Sun, 13 May 2018 23:38:02 +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 w4DNc1VD002758; Sun, 13 May 2018 23:38:01 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DNc1Cu002757; Sun, 13 May 2018 23:38:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201805132338.w4DNc1Cu002757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 13 May 2018 23:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333592 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 333592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 23:38:02 -0000 Author: rmacklem Date: Sun May 13 23:38:01 2018 New Revision: 333592 URL: https://svnweb.freebsd.org/changeset/base/333592 Log: Fix the eir_server_scope reply argument for NFSv4.1 ExchangeID. In the reply to an ExchangeID operation, the NFSv4.1 server returns a "scope" value (eir_server_scope). If this value is the same, it indicates that two servers share state, which is never the case for FreeBSD servers. As such, the value needs to be unique and it was without this patch. However, I just found out that it is not supposed to change when the server reboots and without this patch, it did change. This patch fixes eir_server_scope so that it does not change when the server is rebooted. The only affect not having this patch has is that Linux clients don't reclaim opens and locks after a server reboot, which meant they lost any byte range locks held before the server rebooted. It only affects NFSv4.1 mounts and the FreeBSD NFSv4.1 client was not affected by this bug. MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Sun May 13 23:24:48 2018 (r333591) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Sun May 13 23:38:01 2018 (r333592) @@ -3835,9 +3835,9 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused txdr_hyper(owner_minor, tl); /* Minor */ (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */ - NFSM_BUILD(tl, uint32_t *, 3 * NFSX_UNSIGNED); - *tl++ = txdr_unsigned(NFSX_UNSIGNED); - *tl++ = time_uptime; /* Make scope a unique value. */ + (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, + strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */ + NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(1); (void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org")); (void)nfsm_strtom(nd, version, strlen(version)); From owner-svn-src-all@freebsd.org Sun May 13 23:56:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EE70FDB05C; Sun, 13 May 2018 23:56:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C26876FDA9; Sun, 13 May 2018 23:56:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4AFD1475F; Sun, 13 May 2018 23:56:43 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4DNuheE013081; Sun, 13 May 2018 23:56:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4DNuhMG013080; Sun, 13 May 2018 23:56:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201805132356.w4DNuhMG013080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 13 May 2018 23:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333594 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 333594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 13 May 2018 23:56:44 -0000 Author: nwhitehorn Date: Sun May 13 23:56:43 2018 New Revision: 333594 URL: https://svnweb.freebsd.org/changeset/base/333594 Log: Revert changes to hash table alignment in r333273, which booting on all G5 systems, pending further analysis. Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sun May 13 23:55:11 2018 (r333593) +++ head/sys/powerpc/aim/moea64_native.c Sun May 13 23:56:43 2018 (r333594) @@ -448,14 +448,18 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel moea64_part_table = (struct pate *)moea64_bootstrap_alloc(PART_SIZE, PART_SIZE); if (hw_direct_map) - moea64_part_table = - (struct pate *)PHYS_TO_DMAP((vm_offset_t)moea64_part_table); + moea64_part_table = (struct pate *)PHYS_TO_DMAP( + (vm_offset_t)moea64_part_table); } /* * PTEG table must be aligned on a 256k boundary, but can be placed - * anywhere with that alignment. + * anywhere with that alignment. Some of our hash calculations, + * however, assume that the PTEG table is aligned to its own size + * (low-order bits are zero in an OR). As such, make alignment + * bigger than strictly necessary for the time being. */ - moea64_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, 256*1024); + moea64_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, + MAX(256*1024, size)); if (hw_direct_map) moea64_pteg_table = (struct lpte *)PHYS_TO_DMAP((vm_offset_t)moea64_pteg_table); From owner-svn-src-all@freebsd.org Mon May 14 00:14:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE05AFDC00A; Mon, 14 May 2018 00:14:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8488473B2C; Mon, 14 May 2018 00:14:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FCC214AA6; Mon, 14 May 2018 00:14:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E0E1JO023240; Mon, 14 May 2018 00:14:01 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E0E17W023239; Mon, 14 May 2018 00:14:01 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805140014.w4E0E17W023239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 14 May 2018 00:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333595 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 00:14:02 -0000 Author: mmacy Date: Mon May 14 00:14:00 2018 New Revision: 333595 URL: https://svnweb.freebsd.org/changeset/base/333595 Log: epoch(9): allow sx locks to be held across epoch_wait() The INVARIANTS checks in epoch_wait() were intended to prevent the block handler from returning with locks held. What it in fact did was preventing anything except Giant from being held across it. Check that the number of locks held has not changed instead. Approved by: sbruno@ Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sun May 13 23:56:43 2018 (r333594) +++ head/sys/kern/subr_epoch.c Mon May 14 00:14:00 2018 (r333595) @@ -469,7 +469,11 @@ epoch_wait(epoch_t epoch) int old_cpu; int old_pinned; u_char old_prio; +#ifdef INVARIANTS + int locks; + locks = curthread->td_locks; +#endif INIT_CHECK(epoch); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, @@ -506,9 +510,9 @@ epoch_wait(epoch_t epoch) /* restore thread priority */ sched_prio(td, old_prio); thread_unlock(td); - KASSERT(td->td_locks == 0, - ("%d locks held", td->td_locks)); PICKUP_GIANT(); + KASSERT(td->td_locks == locks, + ("%d residual locks held", td->td_locks - locks)); } void From owner-svn-src-all@freebsd.org Mon May 14 00:14:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791AFFDC0BF; Mon, 14 May 2018 00:14:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D113473C79; Mon, 14 May 2018 00:14:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4E0Eebs087838; Sun, 13 May 2018 17:14:40 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4E0EeXt087837; Sun, 13 May 2018 17:14:40 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805140014.w4E0EeXt087837@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333494 - head/share/man/man7 In-Reply-To: To: araujo@freebsd.org Date: Sun, 13 May 2018 17:14:40 -0700 (PDT) CC: "Rodney W. Grimes" , "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 00:14:43 -0000 > On Sat, May 12, 2018, 12:59 AM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Fri, May 11, 2018 at 8:26 AM, Rodney W. Grimes > > > wrote: > > > >> @@ -67,7 +72,8 @@ Changes are first committed to CURRENT and then > > usuall > > > >> to STABLE. > > > >> Every few years the CURRENT branch is renamed to STABLE, and a new > > > >> CURRENT is branched, with an incremented major version number. > > > >> -Releases are then branched off STABLE and numbered with consecutive > > minor numbers. > > > >> +Releases are then branched off STABLE and numbered with consecutive > > minor > > > >> +numbers. > > > > > > > > Proper place to line break long lines is at conjuncatives such > > > > as the "and" above, yeilding: > > > > > > What? Are you just inventing these rules out of blue sky? What > > > possible reason is there to do as you have proposed? > > > > Well known and established man page style rules, documented someplace, > > which I can not seem to locate right now. > > > > Could you please find that if possible and share with us? > Personally I'm about to rewrite some man page and that would be useful in > my case! It did take me some time to track down this "crazy concept you all think I just invented", but it is infact in the GNU groff info documentaton (found on my 5.4 systems in /usr/share/info/groff.info.gz): Here are a few hints for preparing text for input to `gtroff'. * First, keep the input lines short. Short input lines are easier to edit, and `gtroff' packs words onto longer lines anyhow. * In keeping with this, it is helpful to begin a new line after every comma or phrase, since common corrections are to add or delete sentences or phrases. * End each sentence with two spaces - or better, start each sentence on a new line. `gtroff' recognizes characters that usually end a sentence, and inserts sentence space accordingly. * Do not hyphenate words at the end of lines - `gtroff' is smart enough to hyphenate words as needed, but is not smart enough to take hyphens out and join a word back together. Also, words such as "mother-in-law" should not be broken over a line, since then a space can occur where not wanted, such as "mother- in-law". Regards, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 14 00:21:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A13FDC7A6; Mon, 14 May 2018 00:21:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1D767444C; Mon, 14 May 2018 00:21:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8354114AE8; Mon, 14 May 2018 00:21:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E0L5MV023916; Mon, 14 May 2018 00:21:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E0L4UG023910; Mon, 14 May 2018 00:21:04 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805140021.w4E0L4UG023910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 14 May 2018 00:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333596 - in head/sys: dev/hwpmc kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: dev/hwpmc kern sys X-SVN-Commit-Revision: 333596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 00:21:06 -0000 Author: mmacy Date: Mon May 14 00:21:04 2018 New Revision: 333596 URL: https://svnweb.freebsd.org/changeset/base/333596 Log: hwpmc: fix load/unload race and vm map LOR - fix load/unload race by allocating the per-domain list structure at boot - fix long extant vm map LOR by replacing pmc_sx sx_slock with global_epoch to protect the liveness of elements of the pmc_ss_owners list Reported by: pho Approved by: sbruno Modified: head/sys/dev/hwpmc/hwpmc_logging.c head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/kern_pmc.c head/sys/sys/pmc.h head/sys/sys/pmckern.h Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 00:14:00 2018 (r333595) +++ head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 00:21:04 2018 (r333596) @@ -63,20 +63,10 @@ __FBSDID("$FreeBSD$"); #ifdef NUMA #define NDOMAINS vm_ndomains - -static int -getdomain(int cpu) -{ - struct pcpu *pc; - - pc = pcpu_find(cpu); - return (pc->pc_domain); -} #else #define NDOMAINS 1 #define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) #define free_domain(addr, type) free(addr, type) -#define getdomain(cpu) 0 #endif /* @@ -225,16 +215,6 @@ struct pmclog_buffer { uint16_t plb_domain; } __aligned(CACHE_LINE_SIZE); -struct pmc_domain_buffer_header { - struct mtx pdbh_mtx; - TAILQ_HEAD(, pmclog_buffer) pdbh_head; - struct pmclog_buffer *pdbh_plbs; - int pdbh_ncpus; -} __aligned(CACHE_LINE_SIZE); - -struct pmc_domain_buffer_header *pmc_dom_hdrs[MAXMEMDOM]; - - /* * Prototypes */ @@ -280,6 +260,7 @@ pmclog_get_buffer(struct pmc_owner *po) ("[pmclog,%d] po=%p current buffer still valid", __LINE__, po)); domain = PCPU_GET(domain); + MPASS(pmc_dom_hdrs[domain]); mtx_lock_spin(&pmc_dom_hdrs[domain]->pdbh_mtx); if ((plb = TAILQ_FIRST(&pmc_dom_hdrs[domain]->pdbh_head)) != NULL) TAILQ_REMOVE(&pmc_dom_hdrs[domain]->pdbh_head, plb, plb_next); @@ -1165,7 +1146,7 @@ pmclog_process_userlog(struct pmc_owner *po, struct pm void pmclog_initialize() { - int domain, cpu; + int domain; struct pmclog_buffer *plb; if (pmclog_buffer_size <= 0 || pmclog_buffer_size > 16*1024) { @@ -1180,7 +1161,6 @@ pmclog_initialize() "than zero.\n", pmc_nlogbuffers_pcpu); pmc_nlogbuffers_pcpu = PMC_NLOGBUFFERS_PCPU; } - if (pmc_nlogbuffers_pcpu*pmclog_buffer_size > 32*1024) { (void) printf("hwpmc: memory allocated pcpu must be less than 32MB (is %dK).\n", pmc_nlogbuffers_pcpu*pmclog_buffer_size); @@ -1188,17 +1168,6 @@ pmclog_initialize() pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; } for (domain = 0; domain < NDOMAINS; domain++) { - pmc_dom_hdrs[domain] = malloc_domain(sizeof(struct pmc_domain_buffer_header), M_PMC, domain, - M_WAITOK|M_ZERO); - mtx_init(&pmc_dom_hdrs[domain]->pdbh_mtx, "pmc_bufferlist_mtx", "pmc-leaf", MTX_SPIN); - TAILQ_INIT(&pmc_dom_hdrs[domain]->pdbh_head); - } - CPU_FOREACH(cpu) { - domain = getdomain(cpu); - KASSERT(pmc_dom_hdrs[domain] != NULL, ("no mem allocated for domain: %d", domain)); - pmc_dom_hdrs[domain]->pdbh_ncpus++; - } - for (domain = 0; domain < NDOMAINS; domain++) { int ncpus = pmc_dom_hdrs[domain]->pdbh_ncpus; int total = ncpus*pmc_nlogbuffers_pcpu; @@ -1231,12 +1200,10 @@ pmclog_shutdown() mtx_destroy(&pmc_kthread_mtx); for (domain = 0; domain < NDOMAINS; domain++) { - mtx_destroy(&pmc_dom_hdrs[domain]->pdbh_mtx); while ((plb = TAILQ_FIRST(&pmc_dom_hdrs[domain]->pdbh_head)) != NULL) { TAILQ_REMOVE(&pmc_dom_hdrs[domain]->pdbh_head, plb, plb_next); free(plb->plb_base, M_PMC); } free(pmc_dom_hdrs[domain]->pdbh_plbs, M_PMC); - free(pmc_dom_hdrs[domain], M_PMC); } } Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon May 14 00:14:00 2018 (r333595) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon May 14 00:21:04 2018 (r333596) @@ -1564,12 +1564,14 @@ pmc_process_mmap(struct thread *td, struct pmckern_map const struct pmc_process *pp; freepath = fullpath = NULL; + epoch_exit(global_epoch); pmc_getfilename((struct vnode *) pkm->pm_file, &fullpath, &freepath); pid = td->td_proc->p_pid; + epoch_enter(global_epoch); /* Inform owners of all system-wide sampling PMCs. */ - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_in(po, pid, pkm->pm_address, fullpath); @@ -1606,10 +1608,12 @@ pmc_process_munmap(struct thread *td, struct pmckern_m pid = td->td_proc->p_pid; - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + epoch_enter(global_epoch); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_out(po, pid, pkm->pm_address, pkm->pm_address + pkm->pm_size); + epoch_exit(global_epoch); if ((pp = pmc_find_process_descriptor(td->td_proc, 0)) == NULL) return; @@ -1631,7 +1635,7 @@ pmc_log_kernel_mappings(struct pmc *pm) struct pmc_owner *po; struct pmckern_map_in *km, *kmbase; - sx_assert(&pmc_sx, SX_LOCKED); + MPASS(in_epoch() || sx_xlocked(&pmc_sx)); KASSERT(PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)), ("[pmc,%d] non-sampling PMC (%p) desires mapping information", __LINE__, (void *) pm)); @@ -1905,11 +1909,13 @@ pmc_hook_handler(struct thread *td, int function, void pk = (struct pmckern_procexec *) arg; + epoch_enter(global_epoch); /* Inform owners of SS mode PMCs of the exec event. */ - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_procexec(po, PMC_ID_INVALID, p->p_pid, pk->pm_entryaddr, fullpath); + epoch_exit(global_epoch); PROC_LOCK(p); is_using_hwpmcs = p->p_flag & P_HWPMC; @@ -2033,12 +2039,12 @@ pmc_hook_handler(struct thread *td, int function, void break; case PMC_FN_MMAP: - sx_assert(&pmc_sx, SX_LOCKED); + MPASS(in_epoch() || sx_xlocked(&pmc_sx)); pmc_process_mmap(td, (struct pmckern_map_in *) arg); break; case PMC_FN_MUNMAP: - sx_assert(&pmc_sx, SX_LOCKED); + MPASS(in_epoch() || sx_xlocked(&pmc_sx)); pmc_process_munmap(td, (struct pmckern_map_out *) arg); break; @@ -2360,7 +2366,8 @@ pmc_release_pmc_descriptor(struct pmc *pm) po->po_sscount--; if (po->po_sscount == 0) { atomic_subtract_rel_int(&pmc_ss_count, 1); - LIST_REMOVE(po, po_ssnext); + CK_LIST_REMOVE(po, po_ssnext); + epoch_wait(global_epoch); } } @@ -2727,7 +2734,7 @@ pmc_start(struct pmc *pm) if (mode == PMC_MODE_SS) { if (po->po_sscount == 0) { - LIST_INSERT_HEAD(&pmc_ss_owners, po, po_ssnext); + CK_LIST_INSERT_HEAD(&pmc_ss_owners, po, po_ssnext); atomic_add_rel_int(&pmc_ss_count, 1); PMCDBG1(PMC,OPS,1, "po=%p in global list", po); } @@ -2854,7 +2861,8 @@ pmc_stop(struct pmc *pm) po->po_sscount--; if (po->po_sscount == 0) { atomic_subtract_rel_int(&pmc_ss_count, 1); - LIST_REMOVE(po, po_ssnext); + CK_LIST_REMOVE(po, po_ssnext); + epoch_wait(global_epoch); PMCDBG1(PMC,OPS,2,"po=%p removed from global list", po); } } @@ -2900,6 +2908,9 @@ pmc_syscall_handler(struct thread *td, void *syscall_a c = (struct pmc_syscall_args *)syscall_args; op = c->pmop_code; arg = c->pmop_data; + /* PMC isn't set up yet */ + if (pmc_hook == NULL) + return (EINVAL); if (op == PMC_OP_CONFIGURELOG) { /* * We cannot create the logging process inside @@ -2916,7 +2927,6 @@ pmc_syscall_handler(struct thread *td, void *syscall_a PMC_GET_SX_XLOCK(ENOSYS); is_sx_downgraded = 0; - PMCDBG3(MOD,PMS,1, "syscall op=%d \"%s\" arg=%p", op, pmc_op_to_name[op], arg); @@ -4482,9 +4492,11 @@ pmc_process_exit(void *arg __unused, struct proc *p) /* * Log a sysexit event to all SS PMC owners. */ - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + epoch_enter(global_epoch); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_sysexit(po, p->p_pid); + epoch_exit(global_epoch); if (!is_using_hwpmcs) return; @@ -4659,10 +4671,11 @@ pmc_process_fork(void *arg __unused, struct proc *p1, * If there are system-wide sampling PMCs active, we need to * log all fork events to their owner's logs. */ - - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + epoch_enter(global_epoch); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_procfork(po, p1->p_pid, newproc->p_pid); + epoch_exit(global_epoch); if (!is_using_hwpmcs) return; @@ -4728,21 +4741,19 @@ pmc_kld_load(void *arg __unused, linker_file_t lf) { struct pmc_owner *po; - sx_slock(&pmc_sx); - /* * Notify owners of system sampling PMCs about KLD operations. */ - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + epoch_enter(global_epoch); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_in(po, (pid_t) -1, (uintfptr_t) lf->address, lf->filename); + epoch_exit(global_epoch); /* * TODO: Notify owners of (all) process-sampling PMCs too. */ - - sx_sunlock(&pmc_sx); } static void @@ -4751,18 +4762,16 @@ pmc_kld_unload(void *arg __unused, const char *filenam { struct pmc_owner *po; - sx_slock(&pmc_sx); - - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + epoch_enter(global_epoch); + CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_out(po, (pid_t) -1, (uintfptr_t) address, (uintfptr_t) address + size); + epoch_exit(global_epoch); /* * TODO: Notify owners of process-sampling PMCs. */ - - sx_sunlock(&pmc_sx); } /* @@ -5064,6 +5073,7 @@ pmc_initialize(void) /* set hook functions */ pmc_intr = md->pmd_intr; + wmb(); pmc_hook = pmc_hook_handler; if (error == 0) { @@ -5282,6 +5292,3 @@ load (struct module *module __unused, int cmd, void *a return error; } - -/* memory pool */ -MALLOC_DEFINE(M_PMC, "pmc", "Memory space for the PMC module"); Modified: head/sys/kern/kern_pmc.c ============================================================================== --- head/sys/kern/kern_pmc.c Mon May 14 00:14:00 2018 (r333595) +++ head/sys/kern/kern_pmc.c Mon May 14 00:21:04 2018 (r333596) @@ -48,6 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #ifdef HWPMC_HOOKS FEATURE(hwpmc_hooks, "Kernel support for HW PMC"); #define PMC_KERNEL_VERSION PMC_VERSION @@ -58,6 +62,9 @@ FEATURE(hwpmc_hooks, "Kernel support for HW PMC"); MALLOC_DECLARE(M_PMCHOOKS); MALLOC_DEFINE(M_PMCHOOKS, "pmchooks", "Memory space for PMC hooks"); +/* memory pool */ +MALLOC_DEFINE(M_PMC, "pmc", "Memory space for the PMC module"); + const int pmc_kernel_version = PMC_KERNEL_VERSION; /* Hook variable. */ @@ -84,6 +91,7 @@ volatile int pmc_ss_count; * somewhat more expensive than a simple 'if' check and indirect call. */ struct sx pmc_sx; +SX_SYSINIT(pmcsx, &pmc_sx, "pmc-sx"); /* * PMC Soft per cpu trapframe. @@ -91,6 +99,11 @@ struct sx pmc_sx; struct trapframe pmc_tf[MAXCPU]; /* + * Per domain list of buffer headers + */ +__read_mostly struct pmc_domain_buffer_header *pmc_dom_hdrs[MAXMEMDOM]; + +/* * PMC Soft use a global table to store registered events. */ @@ -100,20 +113,12 @@ static int pmc_softevents = 16; SYSCTL_INT(_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_RDTUN, &pmc_softevents, 0, "maximum number of soft events"); -struct mtx pmc_softs_mtx; int pmc_softs_count; struct pmc_soft **pmc_softs; +struct mtx pmc_softs_mtx; MTX_SYSINIT(pmc_soft_mtx, &pmc_softs_mtx, "pmc-softs", MTX_SPIN); -static void -pmc_init_sx(void) -{ - sx_init_flags(&pmc_sx, "pmc-sx", SX_NOWITNESS); -} - -SYSINIT(pmcsx, SI_SUB_LOCK, SI_ORDER_MIDDLE, pmc_init_sx, NULL); - /* * Helper functions. */ @@ -325,12 +330,30 @@ pmc_soft_ev_release(struct pmc_soft *ps) mtx_unlock_spin(&pmc_softs_mtx); } +#ifdef NUMA +#define NDOMAINS vm_ndomains + +static int +getdomain(int cpu) +{ + struct pcpu *pc; + + pc = pcpu_find(cpu); + return (pc->pc_domain); +} +#else +#define NDOMAINS 1 +#define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) +#define getdomain(cpu) 0 +#endif /* * Initialise hwpmc. */ static void init_hwpmc(void *dummy __unused) { + int domain, cpu; + if (pmc_softevents <= 0 || pmc_softevents > PMC_EV_DYN_COUNT) { (void) printf("hwpmc: tunable \"softevents\"=%d out of " @@ -339,6 +362,19 @@ init_hwpmc(void *dummy __unused) } pmc_softs = malloc(pmc_softevents * sizeof(struct pmc_soft *), M_PMCHOOKS, M_NOWAIT|M_ZERO); KASSERT(pmc_softs != NULL, ("cannot allocate soft events table")); + + for (domain = 0; domain < NDOMAINS; domain++) { + pmc_dom_hdrs[domain] = malloc_domain(sizeof(struct pmc_domain_buffer_header), M_PMC, domain, + M_WAITOK|M_ZERO); + mtx_init(&pmc_dom_hdrs[domain]->pdbh_mtx, "pmc_bufferlist_mtx", "pmc-leaf", MTX_SPIN); + TAILQ_INIT(&pmc_dom_hdrs[domain]->pdbh_head); + } + CPU_FOREACH(cpu) { + domain = getdomain(cpu); + KASSERT(pmc_dom_hdrs[domain] != NULL, ("no mem allocated for domain: %d", domain)); + pmc_dom_hdrs[domain]->pdbh_ncpus++; + } + } SYSINIT(hwpmc, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_hwpmc, NULL); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Mon May 14 00:14:00 2018 (r333595) +++ head/sys/sys/pmc.h Mon May 14 00:21:04 2018 (r333596) @@ -40,6 +40,8 @@ #include #include #include +#include +#include #define PMC_MODULE_NAME "hwpmc" #define PMC_NAME_MAX 64 /* HW counter name size */ @@ -826,7 +828,7 @@ struct pmc_process { struct pmc_owner { LIST_ENTRY(pmc_owner) po_next; /* hash chain */ - LIST_ENTRY(pmc_owner) po_ssnext; /* list of SS PMC owners */ + CK_LIST_ENTRY(pmc_owner) po_ssnext; /* list of SS PMC owners */ LIST_HEAD(, pmc) po_pmcs; /* owned PMC list */ TAILQ_HEAD(, pmclog_buffer) po_logbuffers; /* (o) logbuffer list */ struct mtx po_mtx; /* spin lock for (o) */ Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Mon May 14 00:14:00 2018 (r333595) +++ head/sys/sys/pmckern.h Mon May 14 00:21:04 2018 (r333596) @@ -157,6 +157,15 @@ struct pmc_soft { struct pmc_dyn_event_descr ps_ev; }; +struct pmclog_buffer; + +struct pmc_domain_buffer_header { + struct mtx pdbh_mtx; + TAILQ_HEAD(, pmclog_buffer) pdbh_head; + struct pmclog_buffer *pdbh_plbs; + int pdbh_ncpus; +} __aligned(CACHE_LINE_SIZE); + /* hook */ extern int (*pmc_hook)(struct thread *_td, int _function, void *_arg); extern int (*pmc_intr)(int _cpu, struct trapframe *_frame); @@ -176,16 +185,19 @@ extern const int pmc_kernel_version; /* PMC soft per cpu trapframe */ extern struct trapframe pmc_tf[MAXCPU]; +/* per domain buffer header list */ +extern struct pmc_domain_buffer_header *pmc_dom_hdrs[MAXMEMDOM]; + /* Quick check if preparatory work is necessary */ #define PMC_HOOK_INSTALLED(cmd) __predict_false(pmc_hook != NULL) /* Hook invocation; for use within the kernel */ #define PMC_CALL_HOOK(t, cmd, arg) \ do { \ - sx_slock(&pmc_sx); \ + epoch_enter(global_epoch); \ if (pmc_hook != NULL) \ (pmc_hook)((t), (cmd), (arg)); \ - sx_sunlock(&pmc_sx); \ + epoch_exit(global_epoch); \ } while (0) /* Hook invocation that needs an exclusive lock */ From owner-svn-src-all@freebsd.org Mon May 14 00:56:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22529FDE43F; Mon, 14 May 2018 00:56:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C86B57CF68; Mon, 14 May 2018 00:56:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8D721512D; Mon, 14 May 2018 00:56:33 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E0uXYa043720; Mon, 14 May 2018 00:56:33 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E0uXUA043719; Mon, 14 May 2018 00:56:33 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805140056.w4E0uXUA043719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 14 May 2018 00:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333597 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 00:56:34 -0000 Author: mmacy Date: Mon May 14 00:56:33 2018 New Revision: 333597 URL: https://svnweb.freebsd.org/changeset/base/333597 Log: pmc: fix buildworld hid ck_queue.h from user Approved by: sbruno Modified: head/sys/sys/pmc.h Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Mon May 14 00:21:04 2018 (r333596) +++ head/sys/sys/pmc.h Mon May 14 00:56:33 2018 (r333597) @@ -40,8 +40,10 @@ #include #include #include +#ifdef _KERNEL #include #include +#endif #define PMC_MODULE_NAME "hwpmc" #define PMC_NAME_MAX 64 /* HW counter name size */ From owner-svn-src-all@freebsd.org Mon May 14 01:08:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 448A0FDEE5D; Mon, 14 May 2018 01:08:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E915881083; Mon, 14 May 2018 01:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C721C152C3; Mon, 14 May 2018 01:08:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E18lGV048852; Mon, 14 May 2018 01:08:47 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E18lv0048851; Mon, 14 May 2018 01:08:47 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805140108.w4E18lv0048851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 14 May 2018 01:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333598 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 333598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 01:08:48 -0000 Author: mmacy Date: Mon May 14 01:08:47 2018 New Revision: 333598 URL: https://svnweb.freebsd.org/changeset/base/333598 Log: pmc: don't add pmc owner to list until setup is complete Once a pmc owner is added to the pmc_ss_owners list it is visible for all to see. We don't want this to happen until setup is complete. Reported by: mjg Approved by: sbruno Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon May 14 00:56:33 2018 (r333597) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon May 14 01:08:47 2018 (r333598) @@ -2733,13 +2733,6 @@ pmc_start(struct pmc *pm) */ if (mode == PMC_MODE_SS) { - if (po->po_sscount == 0) { - CK_LIST_INSERT_HEAD(&pmc_ss_owners, po, po_ssnext); - atomic_add_rel_int(&pmc_ss_count, 1); - PMCDBG1(PMC,OPS,1, "po=%p in global list", po); - } - po->po_sscount++; - /* * Log mapping information for all existing processes in the * system. Subsequent mappings are logged as they happen; @@ -2748,6 +2741,12 @@ pmc_start(struct pmc *pm) if (po->po_logprocmaps == 0) { pmc_log_all_process_mappings(po); po->po_logprocmaps = 1; + } + po->po_sscount++; + if (po->po_sscount == 1) { + atomic_add_rel_int(&pmc_ss_count, 1); + CK_LIST_INSERT_HEAD(&pmc_ss_owners, po, po_ssnext); + PMCDBG1(PMC,OPS,1, "po=%p in global list", po); } } From owner-svn-src-all@freebsd.org Mon May 14 04:00:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5721AFC3472; Mon, 14 May 2018 04:00:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 092E885E7C; Mon, 14 May 2018 04:00:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE68F16F23; Mon, 14 May 2018 04:00:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E40qXK037421; Mon, 14 May 2018 04:00:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E40qHr037419; Mon, 14 May 2018 04:00:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201805140400.w4E40qHr037419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Mon, 14 May 2018 04:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333599 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 333599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 04:00:53 -0000 Author: nwhitehorn Date: Mon May 14 04:00:52 2018 New Revision: 333599 URL: https://svnweb.freebsd.org/changeset/base/333599 Log: Final fix for alignment issues with the page table first patched with r333273 and partially reverted with r333594. Older CPUs implement addition of offsets into the page table by a bitwise OR rather than actual addition, which only works if the table is aligned at a multiple of its own size (they also require it to be aligned at a multiple of 256KB). Newer ones do not have that requirement, but it hardly matters to enforce it anyway. The original code was failing on newer systems with huge amounts of RAM (> 512 GB), in which the page table was 4 GB in size. Because the bootstrap memory allocator took its alignment parameter as an int, this turned into a 0, removing any alignment constraint at all and making the MMU fail. The first round of this patch (r333273) fixed this case by aligning it at 256 KB, which broke older CPUs. Fix this instead by widening the alignment parameter. Modified: head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/mmu_oea64.h head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon May 14 01:08:47 2018 (r333598) +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 14 04:00:52 2018 (r333599) @@ -2446,7 +2446,7 @@ moea64_remove_all(mmu_t mmu, vm_page_t m) * calculated. */ vm_offset_t -moea64_bootstrap_alloc(vm_size_t size, u_int align) +moea64_bootstrap_alloc(vm_size_t size, vm_size_t align) { vm_offset_t s, e; int i, j; Modified: head/sys/powerpc/aim/mmu_oea64.h ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.h Mon May 14 01:08:47 2018 (r333598) +++ head/sys/powerpc/aim/mmu_oea64.h Mon May 14 04:00:52 2018 (r333599) @@ -39,7 +39,7 @@ extern mmu_def_t oea64_mmu; */ /* Allocate physical memory for use in moea64_bootstrap. */ -vm_offset_t moea64_bootstrap_alloc(vm_size_t, u_int); +vm_offset_t moea64_bootstrap_alloc(vm_size_t size, vm_size_t align); /* Set an LPTE structure to match the contents of a PVO */ void moea64_pte_from_pvo(const struct pvo_entry *pvo, struct lpte *lpte); Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Mon May 14 01:08:47 2018 (r333598) +++ head/sys/powerpc/aim/moea64_native.c Mon May 14 04:00:52 2018 (r333599) @@ -453,10 +453,11 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel } /* * PTEG table must be aligned on a 256k boundary, but can be placed - * anywhere with that alignment. Some of our hash calculations, - * however, assume that the PTEG table is aligned to its own size - * (low-order bits are zero in an OR). As such, make alignment - * bigger than strictly necessary for the time being. + * anywhere with that alignment on POWER ISA 3+ systems. On earlier + * systems, offset addition is done by the CPU with bitwise OR rather + * than addition, so the table must also be aligned on a boundary of + * its own size. Pick the larger of the two, which works on all + * systems. */ moea64_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, MAX(256*1024, size)); From owner-svn-src-all@freebsd.org Mon May 14 05:21:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 185DBFD0C66; Mon, 14 May 2018 05:21:20 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA1D4765AF; Mon, 14 May 2018 05:21:19 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B68217C11; Mon, 14 May 2018 05:21:19 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E5LJfg077913; Mon, 14 May 2018 05:21:19 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E5LIgv077909; Mon, 14 May 2018 05:21:18 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201805140521.w4E5LIgv077909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Mon, 14 May 2018 05:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333600 - in head/contrib/elftoolchain: elfcopy readelf X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head/contrib/elftoolchain: elfcopy readelf X-SVN-Commit-Revision: 333600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 05:21:20 -0000 Author: phil Date: Mon May 14 05:21:18 2018 New Revision: 333600 URL: https://svnweb.freebsd.org/changeset/base/333600 Log: Handle thread-local storage (TLS) segments correctly when copying (objcopy) and displaying (readelf) them. PR: 227552 Submitted by: kaiw (maintainer) Reported by: jachmann@unitix.org Reviewed by: phil MFC after: 1 day Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h head/contrib/elftoolchain/elfcopy/sections.c head/contrib/elftoolchain/elfcopy/segments.c head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.h Mon May 14 04:00:52 2018 (r333599) +++ head/contrib/elftoolchain/elfcopy/elfcopy.h Mon May 14 05:21:18 2018 (r333600) @@ -127,6 +127,7 @@ struct section { uint64_t cap; /* section capacity */ uint64_t align; /* section alignment */ uint64_t type; /* section type */ + uint64_t flags; /* section flags */ uint64_t vma; /* section virtual addr */ uint64_t lma; /* section load addr */ uint64_t pad_sz;/* section padding size */ Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Mon May 14 04:00:52 2018 (r333599) +++ head/contrib/elftoolchain/elfcopy/sections.c Mon May 14 05:21:18 2018 (r333600) @@ -411,6 +411,7 @@ create_scn(struct elfcopy *ecp) s->sz = ish.sh_size; s->align = ish.sh_addralign; s->type = ish.sh_type; + s->flags = ish.sh_flags; s->vma = ish.sh_addr; /* Modified: head/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/segments.c Mon May 14 04:00:52 2018 (r333599) +++ head/contrib/elftoolchain/elfcopy/segments.c Mon May 14 05:21:18 2018 (r333600) @@ -79,6 +79,8 @@ add_to_inseg_list(struct elfcopy *ecp, struct section continue; if (s->vma + s->sz > seg->vaddr + seg->msz) continue; + if (seg->type == PT_TLS && ((s->flags & SHF_TLS) == 0)) + continue; insert_to_inseg_list(seg, s); if (seg->type == PT_LOAD) Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Mon May 14 04:00:52 2018 (r333599) +++ head/contrib/elftoolchain/readelf/readelf.c Mon May 14 05:21:18 2018 (r333600) @@ -2378,11 +2378,22 @@ dump_phdr(struct readelf *re) } printf(" %2.2d ", i); /* skip NULL section. */ - for (j = 1; (size_t)j < re->shnum; j++) - if (re->sl[j].addr >= phdr.p_vaddr && - re->sl[j].addr + re->sl[j].sz <= + for (j = 1; (size_t)j < re->shnum; j++) { + if (re->sl[j].off < phdr.p_offset) + continue; + if (re->sl[j].off + re->sl[j].sz > + phdr.p_offset + phdr.p_filesz && + re->sl[j].type != SHT_NOBITS) + continue; + if (re->sl[j].addr < phdr.p_vaddr || + re->sl[j].addr + re->sl[j].sz > phdr.p_vaddr + phdr.p_memsz) - printf("%s ", re->sl[j].name); + continue; + if (phdr.p_type == PT_TLS && + (re->sl[j].flags & SHF_TLS) == 0) + continue; + printf("%s ", re->sl[j].name); + } printf("\n"); } #undef PH_HDR From owner-svn-src-all@freebsd.org Mon May 14 06:15:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0649FDAE2D; Mon, 14 May 2018 06:15:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C54A77FA87; Mon, 14 May 2018 06:11:25 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7C8C18435; Mon, 14 May 2018 06:11:25 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4E6BPUU003911; Mon, 14 May 2018 06:11:25 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4E6BPtT003910; Mon, 14 May 2018 06:11:25 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805140611.w4E6BPtT003910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 14 May 2018 06:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333601 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 333601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 06:15:01 -0000 Author: mmacy Date: Mon May 14 06:11:25 2018 New Revision: 333601 URL: https://svnweb.freebsd.org/changeset/base/333601 Log: hwpmc: don't reference domain index with no memory backing it On multi-socket the domain will be correctly set for a given CPU regardless of whether or not NUMA is enabled. Approved by: sbruno Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 05:21:18 2018 (r333600) +++ head/sys/dev/hwpmc/hwpmc_logging.c Mon May 14 06:11:25 2018 (r333601) @@ -63,8 +63,10 @@ __FBSDID("$FreeBSD$"); #ifdef NUMA #define NDOMAINS vm_ndomains +#define curdomain PCPU_GET(domain) #else #define NDOMAINS 1 +#define curdomain 0 #define malloc_domain(size, type, domain, flags) malloc((size), (type), (flags)) #define free_domain(addr, type) free(addr, type) #endif @@ -259,7 +261,7 @@ pmclog_get_buffer(struct pmc_owner *po) KASSERT(po->po_curbuf[curcpu] == NULL, ("[pmclog,%d] po=%p current buffer still valid", __LINE__, po)); - domain = PCPU_GET(domain); + domain = curdomain; MPASS(pmc_dom_hdrs[domain]); mtx_lock_spin(&pmc_dom_hdrs[domain]->pdbh_mtx); if ((plb = TAILQ_FIRST(&pmc_dom_hdrs[domain]->pdbh_head)) != NULL) From owner-svn-src-all@freebsd.org Mon May 14 07:08:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD43AFDD355; Mon, 14 May 2018 07:08:27 +0000 (UTC) (envelope-from philip@trouble.is) Received: from weatherwax.trouble.is (weatherwax.trouble.is [176.58.93.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFE76C4C0; Mon, 14 May 2018 07:08:26 +0000 (UTC) (envelope-from philip@trouble.is) Received: from rincewind.trouble.is (rincewind.trouble.is [88.198.44.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 40ksH56Xfhz3C1F; Mon, 14 May 2018 07:08:17 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 40ksH54ZrVz2F2; Mon, 14 May 2018 07:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trouble.is; s=20180304; t=1526281697; bh=zhdrHwahJw+dhPE0S/j0iwW1eBy4w3LuUpgQXhe2BsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=WPsd1YD2fg95Sbu3v7KOTfEfWBd8PzwJgq5GwEqb4aLxv1FOmYiV65Dp44qYFF60T KeXXqaBZhvfgG3vtdBWe60sVlK1C3YgcLoMcAMzlImp6YVDI8oDgMr6RTa6TvGsaj4 sHIdBSpPvSlsEQTlbopp13AyajhzQA475mtq7lNmmhTy1CEYE5RxYWL2WcChCMO7Sq 7w+Ir2I47A/kgnXloBVFYZhnCvUCEwmRpi7SZk0jQUdCogAs6bYTqYynMd83hd1XFq R/9VYDBpEGEfuYZ1vN/yxz+Af14JjHZWE5PFTi4Kytd0vzYdVxsNhdjewFvTnxbli3 CiT0VDlIWNKLA== Date: Mon, 14 May 2018 12:38:17 +0530 From: Philip Paeps To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333551 - in head/contrib/ldns: . compat drill ldns m4 packaging Message-ID: <20180514070817.GJ9283@rincewind.trouble.is> Mail-Followup-To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805121200.w4CC0Ikx020535@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201805121200.w4CC0Ikx020535@repo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Prickle-Prickle, the 61st day of Discord in the YOLD 3184 X-Phase-of-Moon: The Moon is Waning Crescent (2% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 07:08:27 -0000 On 2018-05-12 12:00:18 (+0000), Dag-Erling Smørgrav wrote: >Author: des >Date: Sat May 12 12:00:18 2018 >New Revision: 333551 >URL: https://svnweb.freebsd.org/changeset/base/333551 > >Log: > Upgrade LDNS to 1.7.0. > > I've been holding back on this because 1.7.0 requires OpenSSL 1.1.0 or > newer for full DANE support. But we can't wait forever, and nothing in > base uses DANE anyway, so here we go. Thank you! This lets me get rid of a couple of annoying local patches. :) Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-all@freebsd.org Mon May 14 08:42:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DECE5FE1861; Mon, 14 May 2018 08:42:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59E3484C7D; Mon, 14 May 2018 08:42:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w4E8gTt2042479 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 14 May 2018 11:42:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w4E8gTt2042479 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w4E8gT7o042478; Mon, 14 May 2018 11:42:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 May 2018 11:42:29 +0300 From: Konstantin Belousov To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333597 - head/sys/sys Message-ID: <20180514084229.GD6887@kib.kiev.ua> References: <201805140056.w4E0uXUA043719@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805140056.w4E0uXUA043719@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 08:42:41 -0000 On Mon, May 14, 2018 at 12:56:33AM +0000, Matt Macy wrote: > Author: mmacy > Date: Mon May 14 00:56:33 2018 > New Revision: 333597 > URL: https://svnweb.freebsd.org/changeset/base/333597 > > Log: > pmc: fix buildworld > > hid ck_queue.h from user > > Approved by: sbruno > > Modified: > head/sys/sys/pmc.h > > Modified: head/sys/sys/pmc.h > ============================================================================== > --- head/sys/sys/pmc.h Mon May 14 00:21:04 2018 (r333596) > +++ head/sys/sys/pmc.h Mon May 14 00:56:33 2018 (r333597) > @@ -40,8 +40,10 @@ > #include > #include > #include > +#ifdef _KERNEL > #include > #include Kernel must not use userspace headers. > +#endif > > #define PMC_MODULE_NAME "hwpmc" > #define PMC_NAME_MAX 64 /* HW counter name size */ From owner-svn-src-all@freebsd.org Mon May 14 11:19:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64817FE86DD; Mon, 14 May 2018 11:19:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D267DC79; Mon, 14 May 2018 11:19:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w4EBJPTQ077083 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 14 May 2018 14:19:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w4EBJPTQ077083 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w4EBJPJJ077082; Mon, 14 May 2018 14:19:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 14 May 2018 14:19:25 +0300 From: Konstantin Belousov To: Helge Oldach Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r333162 - in stable/11: lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/kern Message-ID: <20180514111925.GH6887@kib.kiev.ua> References: <201805020757.w427vaQd080376@repo.freebsd.org> <201805140450.w4E4oouZ087259@nuc.oldach.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805140450.w4E4oouZ087259@nuc.oldach.net> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 11:19:36 -0000 On Mon, May 14, 2018 at 06:50:50AM +0200, Helge Oldach wrote: > This MFC adds two files and a subdirectory to the root file system: > > /pdeathsig_helper > /.debug/pdeathsig_helper.debug > > I have filed bug 228233. Try the patch from https://lists.freebsd.org/pipermail/freebsd-stable/2018-May/088877.html From owner-svn-src-all@freebsd.org Mon May 14 13:50:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28850DBB8C6; Mon, 14 May 2018 13:50:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D08CF7E13D; Mon, 14 May 2018 13:50:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 913D81CE44; Mon, 14 May 2018 13:50:17 +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 w4EDoHHG033835; Mon, 14 May 2018 13:50:17 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EDoH6V033834; Mon, 14 May 2018 13:50:17 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201805141350.w4EDoH6V033834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 14 May 2018 13:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333603 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 13:50:18 -0000 Author: tuexen Date: Mon May 14 13:50:17 2018 New Revision: 333603 URL: https://svnweb.freebsd.org/changeset/base/333603 Log: Ensure that the MTU's used are multiple of 4. The length of SCTP packets is always a multiple of 4. Therefore, ensure that the MTUs used are also a multiple of 4. Thanks to Irene Ruengeler for providing an earlier version of this patch. MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon May 14 07:20:34 2018 (r333602) +++ head/sys/netinet/sctputil.c Mon May 14 13:50:17 2018 (r333603) @@ -758,8 +758,8 @@ sctp_stop_timers_for_shutdown(struct sctp_tcb *stcb) } /* - * a list of sizes based on typical mtu's, used only if next hop size not - * returned. + * A list of sizes based on typical mtu's, used only if next hop size not + * returned. These values MUST be multiples of 4 and MUST be ordered. */ static uint32_t sctp_mtu_sizes[] = { 68, @@ -768,29 +768,32 @@ static uint32_t sctp_mtu_sizes[] = { 512, 544, 576, - 1006, + 1004, 1492, 1500, 1536, - 2002, + 2000, 2048, 4352, 4464, 8166, - 17914, + 17912, 32000, - 65535 + 65532 }; /* - * Return the largest MTU smaller than val. If there is no - * entry, just return val. + * Return the largest MTU in sctp_mtu_sizes smaller than val. + * If val is smaller than the minimum, just return the largest + * multiple of 4 smaller or equal to val. + * Ensure that the result is a multiple of 4. */ uint32_t sctp_get_prev_mtu(uint32_t val) { uint32_t i; + val &= 0x00000003; if (val <= sctp_mtu_sizes[0]) { return (val); } @@ -799,12 +802,16 @@ sctp_get_prev_mtu(uint32_t val) break; } } + KASSERT((sctp_mtu_sizes[i - 1] & 0x00000003) == 0, + ("sctp_mtu_sizes[%u] not a multiple of 4", i - 1)); return (sctp_mtu_sizes[i - 1]); } /* - * Return the smallest MTU larger than val. If there is no - * entry, just return val. + * Return the smallest MTU in sctp_mtu_sizes larger than val. + * If val is larger than the maximum, just return the largest multiple of 4 smaller + * or equal to val. + * Ensure that the result is a multiple of 4. */ uint32_t sctp_get_next_mtu(uint32_t val) @@ -812,8 +819,11 @@ sctp_get_next_mtu(uint32_t val) /* select another MTU that is just bigger than this one */ uint32_t i; + val &= 0x00000003; for (i = 0; i < (sizeof(sctp_mtu_sizes) / sizeof(uint32_t)); i++) { if (val < sctp_mtu_sizes[i]) { + KASSERT((sctp_mtu_sizes[i] & 0x00000003) == 0, + ("sctp_mtu_sizes[%u] not a multiple of 4", i)); return (sctp_mtu_sizes[i]); } } From owner-svn-src-all@freebsd.org Mon May 14 15:16:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C77DDF4C1A; Mon, 14 May 2018 15:16:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDB4073990; Mon, 14 May 2018 15:16:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA0141DD0E; Mon, 14 May 2018 15:16:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4EFGpk3079878; Mon, 14 May 2018 15:16:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EFGp1u079877; Mon, 14 May 2018 15:16:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201805141516.w4EFGp1u079877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 14 May 2018 15:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333604 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 15:16:52 -0000 Author: tuexen Date: Mon May 14 15:16:51 2018 New Revision: 333604 URL: https://svnweb.freebsd.org/changeset/base/333604 Log: sctp_get_mbuf_for_msg() should honor the allinone parameter. When it is not required that the buffer is not a chain, return a chain. This is based on a patch provided by Irene Ruengeler. Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Mon May 14 13:50:17 2018 (r333603) +++ head/sys/netinet/sctp_bsd_addr.c Mon May 14 15:16:51 2018 (r333604) @@ -387,10 +387,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int w m_freem(m); return (NULL); } - } - if (SCTP_BUF_NEXT(m)) { - sctp_m_freem(SCTP_BUF_NEXT(m)); - SCTP_BUF_NEXT(m) = NULL; + KASSERT(SCTP_BUF_NEXT(m) == NULL, ("%s: no chain allowed", __FUNCTION__)); } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon May 14 13:50:17 2018 (r333603) +++ head/sys/netinet/sctp_output.c Mon May 14 15:16:51 2018 (r333604) @@ -7450,7 +7450,7 @@ dont_do_it: /* Not enough room for a chunk header, get some */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 0, MT_DATA); + m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* * we're in trouble here. _PREPEND below will free From owner-svn-src-all@freebsd.org Mon May 14 15:35:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0210BDF5C22; Mon, 14 May 2018 15:35:55 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7B297908B; Mon, 14 May 2018 15:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85E941E042; Mon, 14 May 2018 15:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4EFZs5D089908; Mon, 14 May 2018 15:35:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EFZs8b089907; Mon, 14 May 2018 15:35:54 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805141535.w4EFZs8b089907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 May 2018 15:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333605 - stable/11/release/tools X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/release/tools X-SVN-Commit-Revision: 333605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 15:35:55 -0000 Author: trasz Date: Mon May 14 15:35:54 2018 New Revision: 333605 URL: https://svnweb.freebsd.org/changeset/base/333605 Log: MFC r333493: Set kldxref_enable="YES" for ARM images. Without it, the images are missing the /boot/kernel/linker.hints file, which breaks loading some of the modules with dependencies, eg cfiscsi.ko. This is a minimal fix for ARM images, in order to safely MFC it before 11.2-RELEASE. Afterwards, however, I believe we should actually just change the default (as in, etc/defaults/rc.conf). The reason is that it's required for every image that's being cross-built, as kldxref(1) cannot handle files for non-native architectures. For the one that is not - amd64 - having it on by default doesn't change anything - the script is noop if the linker.hints already exists. The long-term solution would be to rewrite kldxref(1) to handle other architectures, and generate linker.hints at build time. Approved by: re (marius@) Sponsored by: DARPA, AFRL Modified: stable/11/release/tools/arm.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/release/tools/arm.subr ============================================================================== --- stable/11/release/tools/arm.subr Mon May 14 15:16:51 2018 (r333604) +++ stable/11/release/tools/arm.subr Mon May 14 15:35:54 2018 (r333605) @@ -122,6 +122,7 @@ arm_install_base() { echo 'sendmail_outbound_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'sendmail_msp_queue_enable="NO"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf + echo 'kldxref_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf sync umount_loop ${CHROOTDIR}/${DESTDIR} From owner-svn-src-all@freebsd.org Mon May 14 17:27:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C44DFC025; Mon, 14 May 2018 17:27:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 924F473B8D; Mon, 14 May 2018 17:27:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 710AC1F30E; Mon, 14 May 2018 17:27:54 +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 w4EHRsV0048397; Mon, 14 May 2018 17:27:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EHRsVl048396; Mon, 14 May 2018 17:27:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201805141727.w4EHRsVl048396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 14 May 2018 17:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333606 - head/sys/amd64/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/include X-SVN-Commit-Revision: 333606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 17:27:55 -0000 Author: jhb Date: Mon May 14 17:27:53 2018 New Revision: 333606 URL: https://svnweb.freebsd.org/changeset/base/333606 Log: Make the common interrupt entry point labels local labels. Kernel debuggers depend on symbol names to find stack frames with a trapframe rather than a normal stack frame. The labels used for the shared interrupt entry point for the PTI and non-PTI cases did not match the existing patterns confusing debuggers. Add the '.L' prefix to mark these symbols as local so they are not visible in the symbol table. Reviewed by: kib MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Mon May 14 15:35:54 2018 (r333605) +++ head/sys/amd64/include/asmacros.h Mon May 14 17:27:53 2018 (r333606) @@ -223,9 +223,9 @@ X\name\()_pti: .type X\vec_name\()_pti,@function X\vec_name\()_pti: testb $SEL_RPL_MASK,PTI_CS-3*8(%rsp) /* err, %rax, %rdx not pushed */ - jz \vec_name\()_u + jz .L\vec_name\()_u PTI_UENTRY has_err=0 - jmp \vec_name\()_u + jmp .L\vec_name\()_u .endm .macro INTR_PUSH_FRAME vec_name @@ -234,9 +234,9 @@ X\vec_name\()_pti: .type X\vec_name,@function X\vec_name: testb $SEL_RPL_MASK,PTI_CS-3*8(%rsp) /* come from kernel? */ - jz \vec_name\()_u /* Yes, dont swapgs again */ + jz .L\vec_name\()_u /* Yes, dont swapgs again */ swapgs -\vec_name\()_u: +.L\vec_name\()_u: subq $TF_RIP,%rsp /* skip dummy tf_err and tf_trapno */ movq %rdi,TF_RDI(%rsp) movq %rsi,TF_RSI(%rsp) From owner-svn-src-all@freebsd.org Mon May 14 17:43:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC029DFCD6F; Mon, 14 May 2018 17:43:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA8378B77; Mon, 14 May 2018 17:43:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F8EE1F64D; Mon, 14 May 2018 17:43:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4EHhhat059190; Mon, 14 May 2018 17:43:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EHhhOg059189; Mon, 14 May 2018 17:43:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805141743.w4EHhhOg059189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 14 May 2018 17:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333607 - stable/11/release X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release X-SVN-Commit-Revision: 333607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 17:43:44 -0000 Author: gjb Date: Mon May 14 17:43:43 2018 New Revision: 333607 URL: https://svnweb.freebsd.org/changeset/base/333607 Log: MFC r333473: Add a special GCE_LICENSE variable to Makefile.gce, which when set, will include license metadata in the resultant GCE image. GCE_LICENSE is unset by default, as it primarily pertains to images produced by the FreeBSD Project, but for downstream FreeBSD consumers, it can be set in the make(1) environment in the format of: --licenses="projects/PROJECT_ID/global/licenses/LICENSE_NAME" The "license" is not a license, per se, but required metadata that is required by the GCE marketplace. For the FreeBSD Project, the license name is simply 'freebsd', with the description of 'FreeBSD'. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/Makefile.gce Directory Properties: stable/11/ (props changed) Modified: stable/11/release/Makefile.gce ============================================================================== --- stable/11/release/Makefile.gce Mon May 14 17:27:53 2018 (r333606) +++ stable/11/release/Makefile.gce Mon May 14 17:43:43 2018 (r333607) @@ -17,6 +17,7 @@ GCE_UPLOAD_TGTS= gce-do-login CLEANFILES+= ${GCE_UPLOAD_TGTS} GCE_BUCKET?= +GCE_LICENSE?= .if !defined(GCE_FAMILY) || empty(GCE_FAMILY) GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} @@ -69,7 +70,7 @@ gce-do-upload: /usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \ gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \ - --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} \ + --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} ${GCE_LICENSE} \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz touch ${.OBJDIR}/${.TARGET} From owner-svn-src-all@freebsd.org Mon May 14 17:44:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19CF6DFCDC6; Mon, 14 May 2018 17:44:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB5A678C81; Mon, 14 May 2018 17:44:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E0201F64E; Mon, 14 May 2018 17:44:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4EHi2U1059271; Mon, 14 May 2018 17:44:02 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EHi2Kh059270; Mon, 14 May 2018 17:44:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805141744.w4EHi2Kh059270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 14 May 2018 17:44: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: r333608 - stable/10/release X-SVN-Group: stable-10 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/10/release X-SVN-Commit-Revision: 333608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 17:44:03 -0000 Author: gjb Date: Mon May 14 17:44:02 2018 New Revision: 333608 URL: https://svnweb.freebsd.org/changeset/base/333608 Log: MFC r333473: Add a special GCE_LICENSE variable to Makefile.gce, which when set, will include license metadata in the resultant GCE image. GCE_LICENSE is unset by default, as it primarily pertains to images produced by the FreeBSD Project, but for downstream FreeBSD consumers, it can be set in the make(1) environment in the format of: --licenses="projects/PROJECT_ID/global/licenses/LICENSE_NAME" The "license" is not a license, per se, but required metadata that is required by the GCE marketplace. For the FreeBSD Project, the license name is simply 'freebsd', with the description of 'FreeBSD'. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.gce Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile.gce ============================================================================== --- stable/10/release/Makefile.gce Mon May 14 17:43:43 2018 (r333607) +++ stable/10/release/Makefile.gce Mon May 14 17:44:02 2018 (r333608) @@ -17,6 +17,7 @@ GCE_UPLOAD_TGTS= gce-do-login CLEANFILES+= ${GCE_UPLOAD_TGTS} GCE_BUCKET?= +GCE_LICENSE?= .if !defined(GCE_FAMILY) || empty(GCE_FAMILY) GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} @@ -69,7 +70,7 @@ gce-do-upload: /usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \ gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \ - --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} \ + --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} ${GCE_LICENSE} \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz touch ${.OBJDIR}/${.TARGET} From owner-svn-src-all@freebsd.org Mon May 14 19:16:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A38D4E68424; Mon, 14 May 2018 19:16:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (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 00DC4706D5; Mon, 14 May 2018 19:16:06 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f65.google.com with SMTP id r2-v6so19683942lff.4; Mon, 14 May 2018 12:16:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=n3GHpHBWAM6//t2UH1NHUehCQzyB42r3mJquW/dLtnw=; b=f/xDmSBW0UZpmanGgsQcbdqK1+Yub/HM2UWouyxUISOEs/ZNPAMgzkvNU3DxrlBbk7 sZpGlMKQ89yNBfarwM898iEk852ubpfHmuyxHu7aAb5QSAvx6o4V0+X/M7Tn7YyhWWdj U7soIUN6StEl6hFO8b8M8Wzn9ozL49WIEhElgG45c+Ls9Hv6a1uJwuEhNhKHPe01qrYu WjjEuOhZa3TaRiKgtc6e2Tpw4bsejt37EsczIoY59kMRZLqSe24PIeDbIAJk1fMdDr6a aKzTOzQ/xpFQSzus2SiTmk9ZufebtLeh3wyUMuAWVb+iioOjJLLKBnxBCZOON6O2TW6j WPcg== X-Gm-Message-State: ALKqPweXXCx63g5BjM5CVhm1QVTfc8ZU81dmUac+XAg7vgj2oCsL7Rtl p5kZqol6/pYvEIVAyppuuS+wUIec X-Google-Smtp-Source: AB8JxZqUlk/766FhPDWL/rmaEAa1voPQqEA9LIzKjyMIf6Y0gbmTJgiiybW7m7PNAI8yf38IIG6vEg== X-Received: by 2002:a2e:1b52:: with SMTP id b79-v6mr5574611ljb.134.1526322068038; Mon, 14 May 2018 11:21:08 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id i20-v6sm2562237lfe.69.2018.05.14.11.21.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 May 2018 11:21:07 -0700 (PDT) Subject: Re: svn commit: r332730 - in head/sys: amd64/amd64 i386/i386 powerpc/powerpc To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201804181544.w3IFisf7045389@repo.freebsd.org> <4861734.o1QKEXXL6r@ralph.baldwin.cx> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABzR5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz7CwZQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryM7BTQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAcLBfAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Mon, 14 May 2018 21:21:05 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <4861734.o1QKEXXL6r@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 19:16:07 -0000 On 05/05/2018 01:55, John Baldwin wrote: > On Wednesday, April 18, 2018 03:44:54 PM Andriy Gapon wrote: >> Author: avg >> Date: Wed Apr 18 15:44:54 2018 >> New Revision: 332730 >> URL: https://svnweb.freebsd.org/changeset/base/332730 >> >> Log: >> don't check for kdb reentry in trap_fatal(), it's impossible >> >> trap() checks for it earlier and calls kdb_reentry(). > > I just noticed today that there are several other kdb_trap() checks in > other architectures that need this fix and the KDB_WHY_TRAP change. Just > grep for debugger_on_panic under sys. For example: > > arm/arm/trap-v4.c: if (debugger_on_panic || kdb_active) > arm/arm/trap-v6.c: if (debugger_on_panic || kdb_active) > arm64/arm64/trap.c: if (debugger_on_panic || kdb_active) > mips/mips/trap.c: if (debugger_on_panic || kdb_active) { This list seems to be exhaustive. Please see https://reviews.freebsd.org/D15431 Thanks! -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon May 14 19:20:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1E77E687D9; Mon, 14 May 2018 19:20:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 863C772FC0; Mon, 14 May 2018 19:20: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68C8A2056B; Mon, 14 May 2018 19:20: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 w4EJKcmP008330; Mon, 14 May 2018 19:20:38 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EJKcHk008329; Mon, 14 May 2018 19:20:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201805141920.w4EJKcHk008329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 14 May 2018 19:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333610 - stable/11/sys/fs/msdosfs X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/fs/msdosfs X-SVN-Commit-Revision: 333610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 19:20:39 -0000 Author: pfg Date: Mon May 14 19:20:37 2018 New Revision: 333610 URL: https://svnweb.freebsd.org/changeset/base/333610 Log: MFC r333239: msdosfs: long names of files are created incorrectly. This fixes a regression that happened in r120492 (2003) where libkiconv was introduced and we went from checking unlen to checking for '\0'. PR: 111843 Patch by: Damjan Jovanovic Approved by: re (gjb) Modified: stable/11/sys/fs/msdosfs/msdosfs_conv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_conv.c Mon May 14 17:49:41 2018 (r333609) +++ stable/11/sys/fs/msdosfs/msdosfs_conv.c Mon May 14 19:20:37 2018 (r333610) @@ -568,7 +568,7 @@ unix2winfn(const u_char *un, size_t unlen, struct wine if (!code) end = WIN_LAST; } - if (*un == '\0') + if (!unlen) end = WIN_LAST; wep->weCnt |= end; return !end; From owner-svn-src-all@freebsd.org Mon May 14 19:21:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CE3CE68C91; Mon, 14 May 2018 19:21:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0CC47352E; Mon, 14 May 2018 19:21: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C38C8206C5; Mon, 14 May 2018 19:21: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 w4EJLvQX010621; Mon, 14 May 2018 19:21:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EJLvS3010620; Mon, 14 May 2018 19:21:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201805141921.w4EJLvS3010620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 14 May 2018 19:21: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: r333611 - stable/10/sys/fs/msdosfs X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/sys/fs/msdosfs X-SVN-Commit-Revision: 333611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 19:21:58 -0000 Author: pfg Date: Mon May 14 19:21:57 2018 New Revision: 333611 URL: https://svnweb.freebsd.org/changeset/base/333611 Log: MFC r333239: msdosfs: long names of files are created incorrectly. This fixes a regression that happened in r120492 (2003) where libkiconv was introduced and we went from checking unlen to checking for '\0'. PR: 111843 Patch by: Damjan Jovanovic Modified: stable/10/sys/fs/msdosfs/msdosfs_conv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_conv.c Mon May 14 19:20:37 2018 (r333610) +++ stable/10/sys/fs/msdosfs/msdosfs_conv.c Mon May 14 19:21:57 2018 (r333611) @@ -581,7 +581,7 @@ unix2winfn(un, unlen, wep, cnt, chksum, pmp) if (!code) end = WIN_LAST; } - if (*un == '\0') + if (!unlen) end = WIN_LAST; wep->weCnt |= end; return !end; From owner-svn-src-all@freebsd.org Mon May 14 20:06:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76DADE74CEB; Mon, 14 May 2018 20:06:50 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AD957C250; Mon, 14 May 2018 20:06:50 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA85020D53; Mon, 14 May 2018 20:06:49 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4EK6nc3033491; Mon, 14 May 2018 20:06:49 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EK6nlJ033489; Mon, 14 May 2018 20:06:49 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201805142006.w4EK6nlJ033489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 14 May 2018 20:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333612 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333612 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 20:06:50 -0000 Author: shurd Date: Mon May 14 20:06:49 2018 New Revision: 333612 URL: https://svnweb.freebsd.org/changeset/base/333612 Log: Replace rmlock with epoch in lagg Use the new epoch based reclamation API. Now the hot paths will not block at all, and the sx lock is used for the softc data. This fixes LORs reported where the rwlock was obtained when the sxlock was held. Submitted by: mmacy Reported by: Harry Schmalzbauer Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15355 Modified: head/sys/net/if_lagg.c head/sys/net/if_lagg.h Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon May 14 19:21:57 2018 (r333611) +++ head/sys/net/if_lagg.c Mon May 14 20:06:49 2018 (r333612) @@ -73,6 +73,18 @@ __FBSDID("$FreeBSD$"); #include #include +#define LAGG_RLOCK() epoch_enter(net_epoch) +#define LAGG_RUNLOCK() epoch_exit(net_epoch) +#define LAGG_RLOCK_ASSERT() MPASS(in_epoch()) +#define LAGG_UNLOCK_ASSERT() MPASS(!in_epoch()) + +#define LAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") +#define LAGG_SX_DESTROY(_sc) sx_destroy(&(_sc)->sc_sx) +#define LAGG_XLOCK(_sc) sx_xlock(&(_sc)->sc_sx) +#define LAGG_XUNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) +#define LAGG_SXLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_LOCKED) +#define LAGG_XLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_XLOCKED) + /* Special flags we should propagate to the lagg ports. */ static struct { int flag; @@ -334,14 +346,11 @@ lagg_proto_detach(struct lagg_softc *sc) lagg_proto pr; LAGG_XLOCK_ASSERT(sc); - LAGG_WLOCK_ASSERT(sc); pr = sc->sc_proto; sc->sc_proto = LAGG_PROTO_NONE; if (lagg_protos[pr].pr_detach != NULL) lagg_protos[pr].pr_detach(sc); - else - LAGG_WUNLOCK(sc); } static int @@ -437,10 +446,10 @@ lagg_register_vlan(void *arg, struct ifnet *ifp, u_int if (ifp->if_softc != arg) /* Not our event */ return; - LAGG_SLOCK(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); } /* @@ -456,10 +465,10 @@ lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_i if (ifp->if_softc != arg) /* Not our event */ return; - LAGG_SLOCK(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); } static int @@ -475,7 +484,6 @@ lagg_clone_create(struct if_clone *ifc, int unit, cadd free(sc, M_DEVBUF); return (ENOSPC); } - LAGG_LOCK_INIT(sc); LAGG_SX_INIT(sc); LAGG_XLOCK(sc); @@ -550,9 +558,7 @@ lagg_clone_destroy(struct ifnet *ifp) lagg_port_destroy(lp, 1); /* Unhook the aggregation protocol */ - LAGG_WLOCK(sc); lagg_proto_detach(sc); - LAGG_UNLOCK_ASSERT(sc); LAGG_XUNLOCK(sc); ifmedia_removeall(&sc->sc_media); @@ -564,7 +570,6 @@ lagg_clone_destroy(struct ifnet *ifp) LAGG_LIST_UNLOCK(); LAGG_SX_DESTROY(sc); - LAGG_LOCK_DESTROY(sc); free(sc, M_DEVBUF); } @@ -580,7 +585,7 @@ lagg_capabilities(struct lagg_softc *sc) /* Get common enabled capabilities for the lagg ports */ ena = ~0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) ena &= lp->lp_ifp->if_capenable; ena = (ena == ~0 ? 0 : ena); @@ -590,7 +595,7 @@ lagg_capabilities(struct lagg_softc *sc) */ do { pena = ena; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { lagg_setcaps(lp, ena); ena &= lp->lp_ifp->if_capenable; } @@ -600,7 +605,7 @@ lagg_capabilities(struct lagg_softc *sc) cap = ~0; hwa = ~(uint64_t)0; memset(&hw_tsomax, 0, sizeof(hw_tsomax)); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { cap &= lp->lp_ifp->if_capabilities; hwa &= lp->lp_ifp->if_hwassist; if_hw_tsomax_common(lp->lp_ifp, &hw_tsomax); @@ -689,17 +694,14 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * bcopy(IF_LLADDR(ifp), lp->lp_lladdr, ETHER_ADDR_LEN); lp->lp_ifcapenable = ifp->if_capenable; if (SLIST_EMPTY(&sc->sc_ports)) { - LAGG_WLOCK(sc); bcopy(IF_LLADDR(ifp), IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); lagg_proto_lladdr(sc); - LAGG_WUNLOCK(sc); EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); } else { if_setlladdr(ifp, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); } lagg_setflags(lp, 1); - LAGG_WLOCK(sc); if (SLIST_EMPTY(&sc->sc_ports)) sc->sc_primary = lp; @@ -723,13 +725,15 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * * is predictable and `ifconfig laggN create ...` command * will lead to the same result each time. */ - SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { + LAGG_RLOCK(); + CK_SLIST_FOREACH(tlp, &sc->sc_ports, lp_entries) { if (tlp->lp_ifp->if_index < ifp->if_index && ( SLIST_NEXT(tlp, lp_entries) == NULL || SLIST_NEXT(tlp, lp_entries)->lp_ifp->if_index > ifp->if_index)) break; } + LAGG_RUNLOCK(); if (tlp != NULL) SLIST_INSERT_AFTER(tlp, lp, lp_entries); else @@ -738,13 +742,10 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * lagg_setmulti(lp); - LAGG_WUNLOCK(sc); if ((error = lagg_proto_addport(sc, lp)) != 0) { /* Remove the port, without calling pr_delport. */ - LAGG_WLOCK(sc); lagg_port_destroy(lp, 0); - LAGG_UNLOCK_ASSERT(sc); return (error); } @@ -764,7 +765,7 @@ lagg_port_checkstacking(struct lagg_softc *sc) int m = 0; LAGG_SXLOCK_ASSERT(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (lp->lp_flags & LAGG_PORT_STACK) { sc_ptr = (struct lagg_softc *)lp->lp_ifp->if_softc; m = MAX(m, lagg_port_checkstacking(sc_ptr)); @@ -775,6 +776,19 @@ lagg_port_checkstacking(struct lagg_softc *sc) } #endif +static void +lagg_port_destroy_cb(epoch_context_t ec) +{ + struct lagg_port *lp; + struct ifnet *ifp; + + lp = __containerof(ec, struct lagg_port, lp_epoch_ctx); + ifp = lp->lp_ifp; + + if_rele(ifp); + free(lp, M_DEVBUF); +} + static int lagg_port_destroy(struct lagg_port *lp, int rundelport) { @@ -786,11 +800,8 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport LAGG_XLOCK_ASSERT(sc); - if (rundelport) { - LAGG_WLOCK(sc); + if (rundelport) lagg_proto_delport(sc, lp); - } else - LAGG_WLOCK_ASSERT(sc); if (lp->lp_detaching == 0) lagg_clrmulti(lp); @@ -809,7 +820,7 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport } /* Finally, remove the port from the lagg */ - SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries); + CK_SLIST_REMOVE(&sc->sc_ports, lp, lagg_port, lp_entries); sc->sc_count--; /* Update the primary interface */ @@ -824,19 +835,16 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport if (sc->sc_destroying == 0) { bcopy(lladdr, IF_LLADDR(sc->sc_ifp), ETHER_ADDR_LEN); lagg_proto_lladdr(sc); - LAGG_WUNLOCK(sc); EVENTHANDLER_INVOKE(iflladdr_event, sc->sc_ifp); - } else - LAGG_WUNLOCK(sc); + } /* * Update lladdr for each port (new primary needs update * as well, to switch from old lladdr to its 'real' one) */ - SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries) + CK_SLIST_FOREACH(lp_ptr, &sc->sc_ports, lp_entries) if_setlladdr(lp_ptr->lp_ifp, lladdr, ETHER_ADDR_LEN); - } else - LAGG_WUNLOCK(sc); + } if (lp->lp_ifflags) if_printf(ifp, "%s: lp_ifflags unclean\n", __func__); @@ -847,9 +855,11 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport if_setlladdr(ifp, lp->lp_lladdr, ETHER_ADDR_LEN); } - if_rele(ifp); - free(lp, M_DEVBUF); - + /* + * free port and release it's ifnet reference after a grace period has + * elapsed. + */ + epoch_call(net_epoch, &lp->lp_epoch_ctx, lagg_port_destroy_cb); /* Update lagg capabilities */ lagg_capabilities(sc); lagg_linkstate(sc); @@ -878,15 +888,15 @@ lagg_port_ioctl(struct ifnet *ifp, u_long cmd, caddr_t break; } - LAGG_SLOCK(sc); + LAGG_RLOCK(); if ((lp = ifp->if_lagg) == NULL || lp->lp_softc != sc) { error = ENOENT; - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); break; } lagg_port2req(lp, rp); - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); break; case SIOCSIFCAP: @@ -942,17 +952,16 @@ lagg_get_counter(struct ifnet *ifp, ift_counter cnt) struct lagg_softc *sc; struct lagg_port *lp; struct ifnet *lpifp; - struct rm_priotracker tracker; uint64_t newval, oldval, vsum; /* Revise this when we've got non-generic counters. */ KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt)); sc = (struct lagg_softc *)ifp->if_softc; - LAGG_RLOCK(sc, &tracker); vsum = 0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { /* Saved attached value */ oldval = lp->port_counters.val[cnt]; /* current value */ @@ -961,6 +970,7 @@ lagg_get_counter(struct ifnet *ifp, ift_counter cnt) /* Calculate diff and save new */ vsum += newval - oldval; } + LAGG_RUNLOCK(); /* * Add counter data which might be added by upper @@ -973,7 +983,6 @@ lagg_get_counter(struct ifnet *ifp, ift_counter cnt) */ vsum += sc->detached_counters.val[cnt]; - LAGG_RUNLOCK(sc, &tracker); return (vsum); } @@ -1079,7 +1088,7 @@ lagg_init(void *xsc) * This might be if_setlladdr() notification * that lladdr has been changed. */ - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (memcmp(IF_LLADDR(ifp), IF_LLADDR(lp->lp_ifp), ETHER_ADDR_LEN) != 0) if_setlladdr(lp->lp_ifp, IF_LLADDR(ifp), ETHER_ADDR_LEN); @@ -1124,7 +1133,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data switch (cmd) { case SIOCGLAGG: - LAGG_SLOCK(sc); + LAGG_XLOCK(sc); buflen = sc->sc_count * sizeof(struct lagg_reqport); outbuf = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); ra->ra_proto = sc->sc_proto; @@ -1132,7 +1141,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data count = 0; buf = outbuf; len = min(ra->ra_size, buflen); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (len < sizeof(rpbuf)) break; @@ -1142,7 +1151,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data buf += sizeof(rpbuf); len -= sizeof(rpbuf); } - LAGG_SUNLOCK(sc); + LAGG_XUNLOCK(sc); ra->ra_ports = count; ra->ra_size = count * sizeof(rpbuf); error = copyout(outbuf, ra->ra_port, ra->ra_size); @@ -1158,14 +1167,13 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data } LAGG_XLOCK(sc); - LAGG_WLOCK(sc); lagg_proto_detach(sc); - LAGG_UNLOCK_ASSERT(sc); + LAGG_UNLOCK_ASSERT(); lagg_proto_attach(sc, ra->ra_proto); LAGG_XUNLOCK(sc); break; case SIOCGLAGGOPTS: - LAGG_SLOCK(sc); + LAGG_XLOCK(sc); ro->ro_opts = sc->sc_opts; if (sc->sc_proto == LAGG_PROTO_LACP) { struct lacp_softc *lsc; @@ -1183,13 +1191,13 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data ro->ro_active = sc->sc_active; } else { ro->ro_active = 0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) ro->ro_active += LAGG_PORTACTIVE(lp); } ro->ro_bkt = sc->sc_bkt; ro->ro_flapping = sc->sc_flapping; ro->ro_flowid_shift = sc->flowid_shift; - LAGG_SUNLOCK(sc); + LAGG_XUNLOCK(sc); break; case SIOCSLAGGOPTS: if (sc->sc_proto == LAGG_PROTO_ROUNDROBIN) { @@ -1296,14 +1304,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; case SIOCGLAGGFLAGS: rf->rf_flags = 0; - LAGG_SLOCK(sc); + LAGG_XLOCK(sc); if (sc->sc_flags & MBUF_HASHFLAG_L2) rf->rf_flags |= LAGG_F_HASHL2; if (sc->sc_flags & MBUF_HASHFLAG_L3) rf->rf_flags |= LAGG_F_HASHL3; if (sc->sc_flags & MBUF_HASHFLAG_L4) rf->rf_flags |= LAGG_F_HASHL4; - LAGG_SUNLOCK(sc); + LAGG_XUNLOCK(sc); break; case SIOCSLAGGHASH: error = priv_check(td, PRIV_NET_LAGG); @@ -1330,17 +1338,17 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; } - LAGG_SLOCK(sc); + LAGG_RLOCK(); if ((lp = (struct lagg_port *)tpif->if_lagg) == NULL || lp->lp_softc != sc) { error = ENOENT; - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); if_rele(tpif); break; } lagg_port2req(lp, rp); - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); if_rele(tpif); break; case SIOCSLAGGPORT: @@ -1405,7 +1413,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case SIOCSIFFLAGS: /* Set flags on ports too */ LAGG_XLOCK(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { lagg_setflags(lp, 1); } @@ -1430,12 +1438,12 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; case SIOCADDMULTI: case SIOCDELMULTI: - LAGG_WLOCK(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + LAGG_XLOCK(sc); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { lagg_clrmulti(lp); lagg_setmulti(lp); } - LAGG_WUNLOCK(sc); + LAGG_XUNLOCK(sc); error = 0; break; case SIOCSIFMEDIA: @@ -1445,7 +1453,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data case SIOCSIFCAP: LAGG_XLOCK(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (lp->lp_ioctl != NULL) (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); } @@ -1523,7 +1531,6 @@ lagg_setmulti(struct lagg_port *lp) struct ifmultiaddr *ifma; int error; - LAGG_WLOCK_ASSERT(sc); IF_ADDR_WLOCK(scifp); TAILQ_FOREACH(ifma, &scifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -1554,7 +1561,7 @@ lagg_clrmulti(struct lagg_port *lp) { struct lagg_mc *mc; - LAGG_WLOCK_ASSERT(lp->lp_softc); + LAGG_XLOCK_ASSERT(lp->lp_softc); while ((mc = SLIST_FIRST(&lp->lp_mc_head)) != NULL) { SLIST_REMOVE(&lp->lp_mc_head, mc, lagg_mc, mc_entries); if (mc->mc_ifma && lp->lp_detaching == 0) @@ -1635,15 +1642,14 @@ lagg_transmit(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; int error, len, mcast; - struct rm_priotracker tracker; len = m->m_pkthdr.len; mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; - LAGG_RLOCK(sc, &tracker); + LAGG_RLOCK(); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - LAGG_RUNLOCK(sc, &tracker); + LAGG_RUNLOCK(); m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENXIO); @@ -1652,7 +1658,7 @@ lagg_transmit(struct ifnet *ifp, struct mbuf *m) ETHER_BPF_MTAP(ifp, m); error = lagg_proto_start(sc, m); - LAGG_RUNLOCK(sc, &tracker); + LAGG_RUNLOCK(); if (error != 0) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); @@ -1674,13 +1680,12 @@ lagg_input(struct ifnet *ifp, struct mbuf *m) struct lagg_port *lp = ifp->if_lagg; struct lagg_softc *sc = lp->lp_softc; struct ifnet *scifp = sc->sc_ifp; - struct rm_priotracker tracker; - LAGG_RLOCK(sc, &tracker); + LAGG_RLOCK(); if ((scifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (lp->lp_flags & LAGG_PORT_DISABLED) || sc->sc_proto == LAGG_PROTO_NONE) { - LAGG_RUNLOCK(sc, &tracker); + LAGG_RUNLOCK(); m_freem(m); return (NULL); } @@ -1700,7 +1705,7 @@ lagg_input(struct ifnet *ifp, struct mbuf *m) } } - LAGG_RUNLOCK(sc, &tracker); + LAGG_RUNLOCK(); return (m); } @@ -1725,12 +1730,12 @@ lagg_media_status(struct ifnet *ifp, struct ifmediareq imr->ifm_status = IFM_AVALID; imr->ifm_active = IFM_ETHER | IFM_AUTO; - LAGG_SLOCK(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (LAGG_PORTACTIVE(lp)) imr->ifm_status |= IFM_ACTIVE; } - LAGG_SUNLOCK(sc); + LAGG_RUNLOCK(); } static void @@ -1743,12 +1748,14 @@ lagg_linkstate(struct lagg_softc *sc) LAGG_XLOCK_ASSERT(sc); /* Our link is considered up if at least one of our ports is active */ - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (lp->lp_ifp->if_link_state == LINK_STATE_UP) { new_link = LINK_STATE_UP; break; } } + LAGG_RUNLOCK(); if_link_state_change(sc->sc_ifp, new_link); /* Update if_baudrate to reflect the max possible speed */ @@ -1761,8 +1768,10 @@ lagg_linkstate(struct lagg_softc *sc) case LAGG_PROTO_LOADBALANCE: case LAGG_PROTO_BROADCAST: speed = 0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) speed += lp->lp_ifp->if_baudrate; + LAGG_RUNLOCK(); sc->sc_ifp->if_baudrate = speed; break; case LAGG_PROTO_LACP: @@ -1809,14 +1818,16 @@ lagg_link_active(struct lagg_softc *sc, struct lagg_po goto found; } -search: - SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { + search: + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (LAGG_PORTACTIVE(lp_next)) { + LAGG_RUNLOCK(); rval = lp_next; goto found; } } - + LAGG_RUNLOCK(); found: return (rval); } @@ -1898,7 +1909,8 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m struct lagg_port *lp, *last = NULL; struct mbuf *m0; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { if (!LAGG_PORTACTIVE(lp)) continue; @@ -1918,6 +1930,8 @@ lagg_bcast_start(struct lagg_softc *sc, struct mbuf *m } last = lp; } + LAGG_RUNLOCK(); + if (last == NULL) { m_freem(m); return (ENOENT); @@ -2001,11 +2015,12 @@ lagg_lb_attach(struct lagg_softc *sc) struct lagg_port *lp; struct lagg_lb *lb; + LAGG_XLOCK_ASSERT(sc); lb = malloc(sizeof(struct lagg_lb), M_DEVBUF, M_WAITOK | M_ZERO); lb->lb_key = m_ether_tcpip_hash_init(); sc->sc_psc = lb; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lagg_lb_port_create(lp); } @@ -2015,7 +2030,6 @@ lagg_lb_detach(struct lagg_softc *sc) struct lagg_lb *lb; lb = (struct lagg_lb *)sc->sc_psc; - LAGG_WUNLOCK(sc); if (lb != NULL) free(lb, M_DEVBUF); } @@ -2028,7 +2042,8 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p int i = 0; bzero(&lb->lb_ports, sizeof(lb->lb_ports)); - SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { + LAGG_RLOCK(); + CK_SLIST_FOREACH(lp_next, &sc->sc_ports, lp_entries) { if (lp_next == lp) continue; if (i >= LAGG_MAX_PORTS) @@ -2038,6 +2053,7 @@ lagg_lb_porttable(struct lagg_softc *sc, struct lagg_p sc->sc_ifname, lp_next->lp_ifp->if_xname, i); lb->lb_ports[i++] = lp_next; } + LAGG_RUNLOCK(); return (0); } @@ -2104,7 +2120,8 @@ lagg_lacp_attach(struct lagg_softc *sc) struct lagg_port *lp; lacp_attach(sc); - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + LAGG_XLOCK_ASSERT(sc); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_create(lp); } @@ -2114,13 +2131,12 @@ lagg_lacp_detach(struct lagg_softc *sc) struct lagg_port *lp; void *psc; - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + LAGG_XLOCK_ASSERT(sc); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_destroy(lp); psc = sc->sc_psc; sc->sc_psc = NULL; - LAGG_WUNLOCK(sc); - lacp_detach(psc); } @@ -2132,11 +2148,11 @@ lagg_lacp_lladdr(struct lagg_softc *sc) LAGG_SXLOCK_ASSERT(sc); /* purge all the lacp ports */ - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_destroy(lp); /* add them back in */ - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) lacp_port_create(lp); } Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Mon May 14 19:21:57 2018 (r333611) +++ head/sys/net/if_lagg.h Mon May 14 20:06:49 2018 (r333612) @@ -253,27 +253,8 @@ struct lagg_port { struct lagg_counters port_counters; /* ifp counters copy */ SLIST_ENTRY(lagg_port) lp_entries; + struct epoch_context lp_epoch_ctx; }; - -#define LAGG_LOCK_INIT(_sc) rm_init(&(_sc)->sc_mtx, "if_lagg rmlock") -#define LAGG_LOCK_DESTROY(_sc) rm_destroy(&(_sc)->sc_mtx) -#define LAGG_RLOCK(_sc, _p) rm_rlock(&(_sc)->sc_mtx, (_p)) -#define LAGG_WLOCK(_sc) rm_wlock(&(_sc)->sc_mtx) -#define LAGG_RUNLOCK(_sc, _p) rm_runlock(&(_sc)->sc_mtx, (_p)) -#define LAGG_WUNLOCK(_sc) rm_wunlock(&(_sc)->sc_mtx) -#define LAGG_RLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_RLOCKED) -#define LAGG_WLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_WLOCKED) -#define LAGG_UNLOCK_ASSERT(_sc) rm_assert(&(_sc)->sc_mtx, RA_UNLOCKED) - -#define LAGG_SX_INIT(_sc) sx_init(&(_sc)->sc_sx, "if_lagg sx") -#define LAGG_SX_DESTROY(_sc) sx_destroy(&(_sc)->sc_sx) -#define LAGG_SLOCK(_sc) sx_slock(&(_sc)->sc_sx) -#define LAGG_XLOCK(_sc) sx_xlock(&(_sc)->sc_sx) -#define LAGG_SUNLOCK(_sc) sx_sunlock(&(_sc)->sc_sx) -#define LAGG_XUNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) -#define LAGG_SXLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_LOCKED) -#define LAGG_SLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_SLOCKED) -#define LAGG_XLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SA_XLOCKED) extern struct mbuf *(*lagg_input_p)(struct ifnet *, struct mbuf *); extern void (*lagg_linkstate_p)(struct ifnet *, int ); From owner-svn-src-all@freebsd.org Mon May 14 21:46:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD78DE79D5E; Mon, 14 May 2018 21:46:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7163D74011; Mon, 14 May 2018 21:46:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E9E321DB4; Mon, 14 May 2018 21:46:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4ELk7X4085785; Mon, 14 May 2018 21:46:07 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4ELk6HE085783; Mon, 14 May 2018 21:46:06 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805142146.w4ELk6HE085783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 14 May 2018 21:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333613 - head/sys/dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/sdhci X-SVN-Commit-Revision: 333613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 21:46:08 -0000 Author: marius Date: Mon May 14 21:46:06 2018 New Revision: 333613 URL: https://svnweb.freebsd.org/changeset/base/333613 Log: The broken DDR52 support of Intel Bay Trail eMMC controllers rumored in the commit log of r321385 has been confirmed via the public VLI54 erratum. Thus, stop advertising DDR52 for these controllers. Note that this change should hardly make a difference in practice as eMMC chips from the same era as these SoCs most likely support HS200 at least, probably even up to HS400ES. Modified: head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Mon May 14 20:06:49 2018 (r333612) +++ head/sys/dev/sdhci/sdhci_acpi.c Mon May 14 21:46:06 2018 (r333613) @@ -60,7 +60,6 @@ static const struct sdhci_acpi_device { { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "80860F14", 3, "Intel Bay Trail/Braswell SDXC Controller", @@ -261,11 +260,16 @@ sdhci_acpi_attach(device_t dev) return (ENOMEM); } - /* Intel Braswell eMMC 4.5.1 controller quirk */ + /* + * Intel Bay Trail and Braswell eMMC controllers share the same IDs, + * but while with these former DDR52 is affected by the VLI54 erratum, + * these latter require the timeout clock to be hardcoded to 1 MHz. + */ if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; sc->quirks &= ~sdhci_quirk_clear; sc->quirks |= sdhci_quirk_set; sc->slot.quirks = sc->quirks; Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Mon May 14 20:06:49 2018 (r333612) +++ head/sys/dev/sdhci/sdhci_pci.c Mon May 14 21:46:06 2018 (r333613) @@ -108,18 +108,18 @@ static const struct sdhci_device { { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + /* DDR52 is supported but affected by the VLI54 erratum */ SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN}, { 0x0f158086, 0xffff, "Intel Bay Trail SDXC Controller", SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + /* DDR52 is supported but affected by the VLI54 erratum */ SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x19db8086, 0xffff, "Intel Denverton eMMC 5.0 Controller", From owner-svn-src-all@freebsd.org Mon May 14 21:57:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C86EE7A607; Mon, 14 May 2018 21:57:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E10B577D8D; Mon, 14 May 2018 21:57:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0D8121F6A; Mon, 14 May 2018 21:57:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4ELvj3K091006; Mon, 14 May 2018 21:57:45 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4ELvjs6091005; Mon, 14 May 2018 21:57:45 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805142157.w4ELvjs6091005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 14 May 2018 21:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333614 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 333614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 21:57:46 -0000 Author: marius Date: Mon May 14 21:57:45 2018 New Revision: 333614 URL: https://svnweb.freebsd.org/changeset/base/333614 Log: Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9). Modified: head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Mon May 14 21:46:06 2018 (r333613) +++ head/sys/dev/mmc/mmcsd.c Mon May 14 21:57:45 2018 (r333614) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -179,7 +180,7 @@ static int mmcsd_bus_bit_width(device_t dev); static daddr_t mmcsd_delete(struct mmcsd_part *part, struct bio *bp); static const char *mmcsd_errmsg(int e); static int mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, - int fflag); + int fflag, struct thread *td); static int mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag); static uintmax_t mmcsd_pretty_size(off_t size, char *unit); @@ -771,22 +772,23 @@ mmcsd_strategy(struct bio *bp) static int mmcsd_ioctl_rpmb(struct cdev *dev, u_long cmd, caddr_t data, - int fflag, struct thread *td __unused) + int fflag, struct thread *td) { - return (mmcsd_ioctl(dev->si_drv1, cmd, data, fflag)); + return (mmcsd_ioctl(dev->si_drv1, cmd, data, fflag, td)); } static int mmcsd_ioctl_disk(struct disk *disk, u_long cmd, void *data, int fflag, - struct thread *td __unused) + struct thread *td) { - return (mmcsd_ioctl(disk->d_drv1, cmd, data, fflag)); + return (mmcsd_ioctl(disk->d_drv1, cmd, data, fflag, td)); } static int -mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag) +mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag, + struct thread *td) { struct mmc_ioc_cmd *mic; struct mmc_ioc_multi_cmd *mimc; @@ -795,6 +797,10 @@ mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void if ((fflag & FREAD) == 0) return (EBADF); + + err = priv_check(td, PRIV_DRIVER); + if (err != 0) + return (err); err = 0; switch (cmd) { From owner-svn-src-all@freebsd.org Mon May 14 22:56:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB178E7DF70; Mon, 14 May 2018 22:56:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 774C287951; Mon, 14 May 2018 22:56:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5564C2292E; Mon, 14 May 2018 22:56:42 +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 w4EMugcN021597; Mon, 14 May 2018 22:56:42 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4EMugIk021596; Mon, 14 May 2018 22:56:42 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805142256.w4EMugIk021596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 14 May 2018 22:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333615 - stable/11/sys/netgraph X-SVN-Group: stable-11 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: stable/11/sys/netgraph X-SVN-Commit-Revision: 333615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 22:56:43 -0000 Author: sbruno Date: Mon May 14 22:56:41 2018 New Revision: 333615 URL: https://svnweb.freebsd.org/changeset/base/333615 Log: MFC r303848 Repair trivial panic in ng_uncallout. Fixes bugzilla #211031 PR: 211031 Approved by: re (gjb) Modified: stable/11/sys/netgraph/ng_base.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/ng_base.c ============================================================================== --- stable/11/sys/netgraph/ng_base.c Mon May 14 21:57:45 2018 (r333614) +++ stable/11/sys/netgraph/ng_base.c Mon May 14 22:56:41 2018 (r333615) @@ -3815,7 +3815,7 @@ ng_uncallout(struct callout *c, node_p node) item = c->c_arg; /* Do an extra check */ if ((rval > 0) && (c->c_func == &ng_callout_trampoline) && - (NGI_NODE(item) == node)) { + (item != NULL) && (NGI_NODE(item) == node)) { /* * We successfully removed it from the queue before it ran * So now we need to unreference everything that was From owner-svn-src-all@freebsd.org Mon May 14 23:12:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C7EE7ED8F; Mon, 14 May 2018 23:12:31 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C849B6B22D; Mon, 14 May 2018 23:12:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9C2B22C5D; Mon, 14 May 2018 23:12:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4ENCUFP031390; Mon, 14 May 2018 23:12:30 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4ENCUSl031387; Mon, 14 May 2018 23:12:30 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201805142312.w4ENCUSl031387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 14 May 2018 23:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333616 - in stable/11: lib/libc/gen share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/11: lib/libc/gen share/man/man9 X-SVN-Commit-Revision: 333616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 14 May 2018 23:12:31 -0000 Author: gonzo Date: Mon May 14 23:12:30 2018 New Revision: 333616 URL: https://svnweb.freebsd.org/changeset/base/333616 Log: MFC r332317, r332439, r332442 Approved by: re r332317: [man] Fix return type of BUS_ADD_CHILD(9) Fix return type of BUS_ADD_CHILD(9) in SYNOPSYS section, it should be device_t, not int PR: 207389 r332439: Fix quotes in the example code in syslog(3) BUGS section mdoc treats verbatim quotes in .Dl as a string delimiter and does not pass them to the rendered output. Use special char \*q to specify double quote PR: 216755 r332442: Bump .Dd value (forgot to do this in r332439) Modified: stable/11/lib/libc/gen/syslog.3 stable/11/share/man/man9/BUS_ADD_CHILD.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/syslog.3 ============================================================================== --- stable/11/lib/libc/gen/syslog.3 Mon May 14 22:56:41 2018 (r333615) +++ stable/11/lib/libc/gen/syslog.3 Mon May 14 23:12:30 2018 (r333616) @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 21, 2015 +.Dd April 12, 2018 .Dt SYSLOG 3 .Os .Sh NAME @@ -292,4 +292,4 @@ for later interpolation by .Pp Always use the proper secure idiom: .Pp -.Dl syslog(priority, "%s", string); +.Dl syslog(priority, \*q%s\*q, string); Modified: stable/11/share/man/man9/BUS_ADD_CHILD.9 ============================================================================== --- stable/11/share/man/man9/BUS_ADD_CHILD.9 Mon May 14 22:56:41 2018 (r333615) +++ stable/11/share/man/man9/BUS_ADD_CHILD.9 Mon May 14 23:12:30 2018 (r333616) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2015 +.Dd April 8, 2018 .Dt BUS_ADD_CHILD 9 .Os .Sh NAME @@ -37,7 +37,7 @@ .Sh SYNOPSIS .In sys/param.h .In sys/bus.h -.Ft int +.Ft device_t .Fn BUS_ADD_CHILD "device_t dev" "int order" "const char *name" "int unit" .Sh DESCRIPTION The From owner-svn-src-all@freebsd.org Tue May 15 00:00:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6113EA8FAA; Tue, 15 May 2018 00:00:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 717AE782CD; Tue, 15 May 2018 00:00:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A48A232E9; Tue, 15 May 2018 00:00:47 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F00lPA051828; Tue, 15 May 2018 00:00:47 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F00imB051812; Tue, 15 May 2018 00:00:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201805150000.w4F00imB051812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 15 May 2018 00:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333617 - in stable/11: . cddl/lib/libdtrace cddl/usr.sbin cddl/usr.sbin/dwatch cddl/usr.sbin/dwatch/libexec etc/mtree share/dtrace X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in stable/11: . cddl/lib/libdtrace cddl/usr.sbin cddl/usr.sbin/dwatch cddl/usr.sbin/dwatch/libexec etc/mtree share/dtrace X-SVN-Commit-Revision: 333617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 00:00:48 -0000 Author: dteske Date: Tue May 15 00:00:44 2018 New Revision: 333617 URL: https://svnweb.freebsd.org/changeset/base/333617 Log: MFC SVN r329188,329334,329353,329914,329995-329996: DTrace Enhancements r329188: Use tabs in io.d, fix alignment issues, remove extra newlines r329334: Add errno definitions to /usr/lib/dtrace/errno.d r329353: Add inline to errno.d for translating int to string r329914: Updates and enhancements to io.d to aid DTrace scripting r329995: Updates and enhancements to signal.d to aid DTrace scripting r329996: Consistent casing for fallback SIGCHLD (s/Unknown/unknown/) MFC SVN r330559-330560,330672,332865-332867,333513-333519: dwatch(1) r330559: Introduce dwatch(1) as a tool for making DTrace more useful r330560: Bump dwatch(1) internal version from 1.0-beta-91 to 1.0 r330672: Fix display of wrong pid from dtrace_sched(4) r332865: Add `-dev' option to aid debugging of profiles r332866: Add profile for send(2)/recv(2) syscalls r332867: Remove the line used to demonstrate `-dev' option r333513: Bugfix, usage displayed with `-1Q' r333514: Separate default values so `-[BK] num' don't affect usage r333515: Simplify info message test r333516: Export ARGV to profiles loaded via load_profile() r333517: Allow `-E code' to override profile EVENT_DETAILS r333518: Expose process for ip/tcp/udp r333519: Refactor sendrecv profile Reviewed by: markj, gnn, bdrewery (head; earlier version) Approved by: re (gjb) Relnotes: yes Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D15418 Added: stable/11/cddl/usr.sbin/dwatch/ - copied from r330559, head/cddl/usr.sbin/dwatch/ stable/11/cddl/usr.sbin/dwatch/libexec/sendrecv (contents, props changed) - copied, changed from r332866, head/cddl/usr.sbin/dwatch/libexec/sendrecv Deleted: stable/11/share/dtrace/watch_execve stable/11/share/dtrace/watch_kill stable/11/share/dtrace/watch_vop_remove Modified: stable/11/ObsoleteFiles.inc stable/11/cddl/lib/libdtrace/errno.d stable/11/cddl/lib/libdtrace/io.d stable/11/cddl/lib/libdtrace/ip.d stable/11/cddl/lib/libdtrace/libproc_compat.h stable/11/cddl/lib/libdtrace/psinfo.d stable/11/cddl/lib/libdtrace/regs_x86.d stable/11/cddl/lib/libdtrace/sched.d stable/11/cddl/lib/libdtrace/signal.d stable/11/cddl/lib/libdtrace/tcp.d stable/11/cddl/lib/libdtrace/udp.d stable/11/cddl/usr.sbin/Makefile stable/11/cddl/usr.sbin/dwatch/dwatch stable/11/cddl/usr.sbin/dwatch/libexec/Makefile stable/11/cddl/usr.sbin/dwatch/libexec/chmod stable/11/cddl/usr.sbin/dwatch/libexec/errno stable/11/cddl/usr.sbin/dwatch/libexec/io stable/11/cddl/usr.sbin/dwatch/libexec/ip stable/11/cddl/usr.sbin/dwatch/libexec/kill stable/11/cddl/usr.sbin/dwatch/libexec/nanosleep stable/11/cddl/usr.sbin/dwatch/libexec/open stable/11/cddl/usr.sbin/dwatch/libexec/proc stable/11/cddl/usr.sbin/dwatch/libexec/rw stable/11/cddl/usr.sbin/dwatch/libexec/sched stable/11/cddl/usr.sbin/dwatch/libexec/tcp stable/11/cddl/usr.sbin/dwatch/libexec/udp stable/11/cddl/usr.sbin/dwatch/libexec/vop_create stable/11/cddl/usr.sbin/dwatch/libexec/vop_readdir stable/11/cddl/usr.sbin/dwatch/libexec/vop_rename stable/11/cddl/usr.sbin/dwatch/libexec/vop_symlink stable/11/etc/mtree/BSD.usr.dist stable/11/share/dtrace/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Mon May 14 23:12:30 2018 (r333616) +++ stable/11/ObsoleteFiles.inc Tue May 15 00:00:44 2018 (r333617) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20180513: remove DTrace scripts made obsolete by dwatch(1) +OLD_FILES+=usr/share/dtrace/watch_execve +OLD_FILES+=usr/share/dtrace/watch_kill +OLD_FILES+=usr/share/dtrace/watch_vop_remove # 20180331: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: stable/11/cddl/lib/libdtrace/errno.d ============================================================================== --- stable/11/cddl/lib/libdtrace/errno.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/errno.d Tue May 15 00:00:44 2018 (r333617) @@ -20,6 +20,7 @@ * CDDL HEADER END * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org + * Portions Copyright 2018 Devin Teske dteske@freebsd.org * * $FreeBSD$ */ @@ -216,7 +217,15 @@ inline int ENOLINK = 91; #pragma D binding "1.0" ENOLINK inline int EPROTO = 92; #pragma D binding "1.0" EPROTO -inline int ELAST = 92; +inline int ENOTCAPABLE = 93; +#pragma D binding "1.13" ENOTCAPABLE +inline int ECAPMODE = 94; +#pragma D binding "1.13" ECAPMODE +inline int ENOTRECOVERABLE = 95; +#pragma D binding "1.13" ENOTRECOVERABLE +inline int EOWNERDEAD = 96; +#pragma D binding "1.13" EOWNERDEAD +inline int ELAST = 96; #pragma D binding "1.0" ELAST inline int ERESTART = -1; #pragma D binding "1.0" ERESTART @@ -226,3 +235,114 @@ inline int ENOIOCTL = -3; #pragma D binding "1.0" ENOIOCTL inline int EDIRIOCTL = -4; #pragma D binding "1.0" EDIRIOCTL +inline int ERELOOKUP = -5; +#pragma D binding "1.13" ERELOOKUP + +/* + * Error strings from + */ +#pragma D binding "1.13" strerror +inline string strerror[int errno] = + errno == 0 ? "Success" : + errno == EPERM ? "Operation not permitted" : + errno == ENOENT ? "No such file or directory" : + errno == ESRCH ? "No such process" : + errno == EINTR ? "Interrupted system call" : + errno == EIO ? "Input/output error" : + errno == ENXIO ? "Device not configured" : + errno == E2BIG ? "Argument list too long" : + errno == ENOEXEC ? "Exec format error" : + errno == EBADF ? "Bad file descriptor" : + errno == ECHILD ? "No child processes" : + errno == EDEADLK ? "Resource deadlock avoided" : + errno == ENOMEM ? "Cannot allocate memory" : + errno == EACCES ? "Permission denied" : + errno == EFAULT ? "Bad address" : + errno == ENOTBLK ? "Block device required" : + errno == EBUSY ? "Device busy" : + errno == EEXIST ? "File exists" : + errno == EXDEV ? "Cross-device link" : + errno == ENODEV ? "Operation not supported by device" : + errno == ENOTDIR ? "Not a directory" : + errno == EISDIR ? "Is a directory" : + errno == EINVAL ? "Invalid argument" : + errno == ENFILE ? "Too many open files in system" : + errno == EMFILE ? "Too many open files" : + errno == ENOTTY ? "Inappropriate ioctl for device" : + errno == ETXTBSY ? "Text file busy" : + errno == EFBIG ? "File too large" : + errno == ENOSPC ? "No space left on device" : + errno == ESPIPE ? "Illegal seek" : + errno == EROFS ? "Read-only filesystem" : + errno == EMLINK ? "Too many links" : + errno == EPIPE ? "Broken pipe" : + errno == EDOM ? "Numerical argument out of domain" : + errno == ERANGE ? "Result too large" : + errno == EAGAIN ? "Resource temporarily unavailable" : + errno == EINPROGRESS ? "Operation now in progress" : + errno == EALREADY ? "Operation already in progress" : + errno == ENOTSOCK ? "Socket operation on non-socket" : + errno == EDESTADDRREQ ? "Destination address required" : + errno == EMSGSIZE ? "Message too long" : + errno == EPROTOTYPE ? "Protocol wrong type for socket" : + errno == ENOPROTOOPT ? "Protocol not available" : + errno == EPROTONOSUPPORT ? "Protocol not supported" : + errno == ESOCKTNOSUPPORT ? "Socket type not supported" : + errno == EOPNOTSUPP ? "Operation not supported" : + errno == EPFNOSUPPORT ? "Protocol family not supported" : + errno == EAFNOSUPPORT ? "Address family not supported by protocol family" : + errno == EADDRINUSE ? "Address already in use" : + errno == EADDRNOTAVAIL ? "Can't assign requested address" : + errno == ENETDOWN ? "Network is down" : + errno == ENETUNREACH ? "Network is unreachable" : + errno == ENETRESET ? "Network dropped connection on reset" : + errno == ECONNABORTED ? "Software caused connection abort" : + errno == ECONNRESET ? "Connection reset by peer" : + errno == ENOBUFS ? "No buffer space available" : + errno == EISCONN ? "Socket is already connected" : + errno == ENOTCONN ? "Socket is not connected" : + errno == ESHUTDOWN ? "Can't send after socket shutdown" : + errno == ETOOMANYREFS ? "Too many references: can't splice" : + errno == ETIMEDOUT ? "Operation timed out" : + errno == ECONNREFUSED ? "Connection refused" : + errno == ELOOP ? "Too many levels of symbolic links" : + errno == ENAMETOOLONG ? "File name too long" : + errno == EHOSTDOWN ? "Host is down" : + errno == EHOSTUNREACH ? "No route to host" : + errno == ENOTEMPTY ? "Directory not empty" : + errno == EPROCLIM ? "Too many processes" : + errno == EUSERS ? "Too many users" : + errno == EDQUOT ? "Disc quota exceeded" : + errno == ESTALE ? "Stale NFS file handle" : + errno == EREMOTE ? "Too many levels of remote in path" : + errno == EBADRPC ? "RPC struct is bad" : + errno == ERPCMISMATCH ? "RPC version wrong" : + errno == EPROGUNAVAIL ? "RPC prog. not avail" : + errno == EPROGMISMATCH ? "Program version wrong" : + errno == EPROCUNAVAIL ? "Bad procedure for program" : + errno == ENOLCK ? "No locks available" : + errno == ENOSYS ? "Function not implemented" : + errno == EFTYPE ? "Inappropriate file type or format" : + errno == EAUTH ? "Authentication error" : + errno == ENEEDAUTH ? "Need authenticator" : + errno == EIDRM ? "Identifier removed" : + errno == ENOMSG ? "No message of desired type" : + errno == EOVERFLOW ? "Value too large to be stored in data type" : + errno == ECANCELED ? "Operation canceled" : + errno == EILSEQ ? "Illegal byte sequence" : + errno == ENOATTR ? "Attribute not found" : + errno == EDOOFUS ? "Programming error" : + errno == EBADMSG ? "Bad message" : + errno == EMULTIHOP ? "Multihop attempted" : + errno == ENOLINK ? "Link has been severed" : + errno == EPROTO ? "Protocol error" : + errno == ENOTCAPABLE ? "Capabilities insufficient" : + errno == ECAPMODE ? "Not permitted in capability mode" : + errno == ENOTRECOVERABLE ? "State not recoverable" : + errno == EOWNERDEAD ? "Previous owner died" : + errno == ERESTART ? "restart syscall" : + errno == EJUSTRETURN ? "don't modify regs, just return" : + errno == ENOIOCTL ? "ioctl not handled by this layer" : + errno == EDIRIOCTL ? "do direct ioctl in GEOM" : + errno == ERELOOKUP ? "retry the directory lookup" : + "Unknown error"; Modified: stable/11/cddl/lib/libdtrace/io.d ============================================================================== --- stable/11/cddl/lib/libdtrace/io.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/io.d Tue May 15 00:00:44 2018 (r333617) @@ -18,6 +18,8 @@ * * CDDL HEADER END * + * Portions Copyright 2018 Devin Teske dteske@freebsd.org + * * $FreeBSD$ */ /* @@ -29,47 +31,51 @@ #pragma D depends_on provider io typedef struct devinfo { - int dev_major; /* major number */ - int dev_minor; /* minor number */ - int dev_instance; /* instance number */ - string dev_name; /* name of device */ - string dev_statname; /* name of device + instance/minor */ - string dev_pathname; /* pathname of device */ + int dev_major; /* major number */ + int dev_minor; /* minor number */ + int dev_instance; /* instance number */ + int dev_type; /* type of device */ + string dev_name; /* name of device */ + string dev_statname; /* name of device + instance/minor */ + string dev_pathname; /* pathname of device */ } devinfo_t; #pragma D binding "1.0" translator translator devinfo_t < struct devstat *D > { - dev_major = D->device_number; - dev_minor = D->unit_number; - dev_instance = 0; - dev_name = stringof(D->device_name); - dev_statname = stringof(D->device_name); - dev_pathname = stringof(D->device_name); + dev_major = D->device_number; + dev_minor = D->unit_number; + dev_instance = 0; + dev_type = D->device_type; + dev_name = stringof(D->device_name); + dev_statname = stringof(D->device_name); + dev_pathname = stringof(D->device_name); }; typedef struct bufinfo { - int b_flags; /* flags */ - long b_bcount; /* number of bytes */ - caddr_t b_addr; /* buffer address */ - uint64_t b_blkno; /* expanded block # on device */ - uint64_t b_lblkno; /* block # on device */ - size_t b_resid; /* # of bytes not transferred */ - size_t b_bufsize; /* size of allocated buffer */ -/* caddr_t b_iodone; I/O completion routine */ - int b_error; /* expanded error field */ -/* dev_t b_edev; extended device */ + int b_cmd; /* I/O operation */ + int b_flags; /* flags */ + long b_bcount; /* number of bytes */ + caddr_t b_addr; /* buffer address */ + uint64_t b_blkno; /* expanded block # on device */ + uint64_t b_lblkno; /* block # on device */ + size_t b_resid; /* # of bytes not transferred */ + size_t b_bufsize; /* size of allocated buffer */ +/* caddr_t b_iodone; I/O completion routine */ + int b_error; /* expanded error field */ +/* dev_t b_edev; extended device */ } bufinfo_t; #pragma D binding "1.0" translator translator bufinfo_t < struct bio *B > { - b_flags = B->bio_flags; - b_bcount = B->bio_bcount; - b_addr = B->bio_data; - b_blkno = 0; - b_lblkno = 0; - b_resid = B->bio_resid; - b_bufsize = 0; /* XXX gnn */ - b_error = B->bio_error; + b_cmd = B->bio_cmd; + b_flags = B->bio_flags; + b_bcount = B->bio_bcount; + b_addr = B->bio_data; + b_blkno = 0; + b_lblkno = 0; + b_resid = B->bio_resid; + b_bufsize = 0; /* XXX gnn */ + b_error = B->bio_error; }; /* @@ -106,4 +112,150 @@ inline int O_SYNC = 0x0080; inline int O_TRUNC = 0x0400; #pragma D binding "1.1" O_TRUNC +/* + * The following inline constants can be used to examine bio_cmd of struct bio + * or a translated bufinfo_t. + */ +inline int BIO_READ = 0x01; +#pragma D binding "1.13" BIO_READ +inline int BIO_WRITE = 0x02; +#pragma D binding "1.13" BIO_WRITE +inline int BIO_DELETE = 0x03; +#pragma D binding "1.13" BIO_DELETE +inline int BIO_GETATTR = 0x04; +#pragma D binding "1.13" BIO_GETATTR +inline int BIO_FLUSH = 0x05; +#pragma D binding "1.13" BIO_FLUSH +inline int BIO_CMD0 = 0x06; +#pragma D binding "1.13" BIO_CMD0 +inline int BIO_CMD1 = 0x07; +#pragma D binding "1.13" BIO_CMD1 +inline int BIO_CMD2 = 0x08; +#pragma D binding "1.13" BIO_CMD2 +inline int BIO_ZONE = 0x09; +#pragma D binding "1.13" BIO_ZONE +/* + * The following inline constants can be used to examine bio_flags of struct + * bio or a translated bufinfo_t. + */ +inline int BIO_ERROR = 0x01; +#pragma D binding "1.13" BIO_ERROR +inline int BIO_DONE = 0x02; +#pragma D binding "1.13" BIO_DONE +inline int BIO_ONQUEUE = 0x04; +#pragma D binding "1.13" BIO_ONQUEUE +inline int BIO_ORDERED = 0x08; +#pragma D binding "1.13" BIO_ORDERED +inline int BIO_UNMAPPED = 0x10; +#pragma D binding "1.13" BIO_UNMAPPED +inline int BIO_TRANSIENT_MAPPING = 0x20; +#pragma D binding "1.13" BIO_TRANSIENT_MAPPING +inline int BIO_VLIST = 0x40; +#pragma D binding "1.13" BIO_VLIST + +/* + * The following inline constants can be used to examine device_type of struct + * devstat or a translated devinfo_t. + */ +inline int DEVSTAT_TYPE_DIRECT = 0x000; +#pragma D binding "1.13" DEVSTAT_TYPE_DIRECT +inline int DEVSTAT_TYPE_SEQUENTIAL = 0x001; +#pragma D binding "1.13" DEVSTAT_TYPE_SEQUENTIAL +inline int DEVSTAT_TYPE_PRINTER = 0x002; +#pragma D binding "1.13" DEVSTAT_TYPE_PRINTER +inline int DEVSTAT_TYPE_PROCESSOR = 0x003; +#pragma D binding "1.13" DEVSTAT_TYPE_PROCESSOR +inline int DEVSTAT_TYPE_WORM = 0x004; +#pragma D binding "1.13" DEVSTAT_TYPE_WORM +inline int DEVSTAT_TYPE_CDROM = 0x005; +#pragma D binding "1.13" DEVSTAT_TYPE_CDROM +inline int DEVSTAT_TYPE_SCANNER = 0x006; +#pragma D binding "1.13" DEVSTAT_TYPE_SCANNER +inline int DEVSTAT_TYPE_OPTICAL = 0x007; +#pragma D binding "1.13" DEVSTAT_TYPE_OPTICAL +inline int DEVSTAT_TYPE_CHANGER = 0x008; +#pragma D binding "1.13" DEVSTAT_TYPE_CHANGER +inline int DEVSTAT_TYPE_COMM = 0x009; +#pragma D binding "1.13" DEVSTAT_TYPE_COMM +inline int DEVSTAT_TYPE_ASC0 = 0x00a; +#pragma D binding "1.13" DEVSTAT_TYPE_ASC0 +inline int DEVSTAT_TYPE_ASC1 = 0x00b; +#pragma D binding "1.13" DEVSTAT_TYPE_ASC1 +inline int DEVSTAT_TYPE_STORARRAY = 0x00c; +#pragma D binding "1.13" DEVSTAT_TYPE_STORARRAY +inline int DEVSTAT_TYPE_ENCLOSURE = 0x00d; +#pragma D binding "1.13" DEVSTAT_TYPE_ENCLOSURE +inline int DEVSTAT_TYPE_FLOPPY = 0x00e; +#pragma D binding "1.13" DEVSTAT_TYPE_FLOPPY +inline int DEVSTAT_TYPE_MASK = 0x00f; +#pragma D binding "1.13" DEVSTAT_TYPE_MASK +inline int DEVSTAT_TYPE_IF_SCSI = 0x010; +#pragma D binding "1.13" DEVSTAT_TYPE_IF_SCSI +inline int DEVSTAT_TYPE_IF_IDE = 0x020; +#pragma D binding "1.13" DEVSTAT_TYPE_IF_IDE +inline int DEVSTAT_TYPE_IF_OTHER = 0x030; +#pragma D binding "1.13" DEVSTAT_TYPE_IF_OTHER +inline int DEVSTAT_TYPE_IF_MASK = 0x0f0; +#pragma D binding "1.13" DEVSTAT_TYPE_IF_MASK +inline int DEVSTAT_TYPE_PASS = 0x100; +#pragma D binding "1.13" DEVSTAT_TYPE_PASS + +#pragma D binding "1.13" device_type_string +inline string device_type_string[int type] = + type == DEVSTAT_TYPE_DIRECT ? "DIRECT" : + type == DEVSTAT_TYPE_SEQUENTIAL ? "SEQUENTIAL" : + type == DEVSTAT_TYPE_PRINTER ? "PRINTER" : + type == DEVSTAT_TYPE_PROCESSOR ? "PROCESSOR" : + type == DEVSTAT_TYPE_WORM ? "WORM" : + type == DEVSTAT_TYPE_CDROM ? "CDROM" : + type == DEVSTAT_TYPE_SCANNER ? "SCANNER" : + type == DEVSTAT_TYPE_OPTICAL ? "OPTICAL" : + type == DEVSTAT_TYPE_CHANGER ? "CHANGER" : + type == DEVSTAT_TYPE_COMM ? "COMM" : + type == DEVSTAT_TYPE_ASC0 ? "ASC0" : + type == DEVSTAT_TYPE_ASC1 ? "ASC1" : + type == DEVSTAT_TYPE_STORARRAY ? "STORARRAY" : + type == DEVSTAT_TYPE_ENCLOSURE ? "ENCLOSURE" : + type == DEVSTAT_TYPE_FLOPPY ? "FLOPPY" : + strjoin("UNKNOWN(", strjoin(lltostr(type), ")")); + +#pragma D binding "1.13" device_type +inline string device_type[int type] = + device_type_string[type & DEVSTAT_TYPE_MASK]; + +#pragma D binding "1.13" device_if_string +inline string device_if_string[int type] = + type == 0 ? "ACCESS" : + type == DEVSTAT_TYPE_IF_SCSI ? "SCSI" : + type == DEVSTAT_TYPE_IF_IDE ? "IDE" : + type == DEVSTAT_TYPE_IF_OTHER ? "OTHER" : + strjoin("UNKNOWN(", strjoin(lltostr(type), ")")); + +#pragma D binding "1.13" device_if +inline string device_if[int type] = + device_if_string[type & DEVSTAT_TYPE_IF_MASK]; + +#pragma D binding "1.13" bio_cmd_string +inline string bio_cmd_string[int cmd] = + cmd == BIO_READ ? "READ" : + cmd == BIO_WRITE ? "WRITE" : + cmd == BIO_DELETE ? "DELETE" : + cmd == BIO_GETATTR ? "GETATTR" : + cmd == BIO_FLUSH ? "FLUSH" : + cmd == BIO_CMD0 ? "CMD0" : + cmd == BIO_CMD1 ? "CMD1" : + cmd == BIO_CMD2 ? "CMD2" : + cmd == BIO_ZONE ? "ZONE" : + strjoin("UNKNOWN(", strjoin(lltostr(cmd), ")")); + +#pragma D binding "1.13" bio_flag_string +inline string bio_flag_string[int flag] = + flag == BIO_ERROR ? "ERROR" : + flag == BIO_DONE ? "DONE" : + flag == BIO_ONQUEUE ? "ONQUEUE" : + flag == BIO_ORDERED ? "ORDERED" : + flag == BIO_UNMAPPED ? "UNMAPPED" : + flag == BIO_TRANSIENT_MAPPING ? "TRANSIENT_MAPPING" : + flag == BIO_VLIST ? "VLIST" : + ""; Modified: stable/11/cddl/lib/libdtrace/ip.d ============================================================================== --- stable/11/cddl/lib/libdtrace/ip.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/ip.d Tue May 15 00:00:44 2018 (r333617) @@ -215,10 +215,10 @@ translator csinfo_t < void *p > { #pragma D binding "1.6.3" translator translator csinfo_t < struct inpcb *p > { - cs_addr = NULL; - cs_cid = (uint64_t)p; - cs_pid = 0; /* XXX */ - cs_zoneid = 0; + cs_addr = NULL; + cs_cid = (uint64_t)p; + cs_pid = 0; /* XXX */ + cs_zoneid = 0; }; #pragma D binding "1.5" translator Modified: stable/11/cddl/lib/libdtrace/libproc_compat.h ============================================================================== --- stable/11/cddl/lib/libdtrace/libproc_compat.h Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/libproc_compat.h Tue May 15 00:00:44 2018 (r333617) @@ -4,7 +4,7 @@ * * This software was developed by Rui Paulo under sponsorship from the * FreeBSD Foundation. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: Modified: stable/11/cddl/lib/libdtrace/psinfo.d ============================================================================== --- stable/11/cddl/lib/libdtrace/psinfo.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/psinfo.d Tue May 15 00:00:44 2018 (r333617) @@ -97,4 +97,3 @@ inline psinfo_t *curpsinfo = xlate (curth inline lwpsinfo_t *curlwpsinfo = xlate (curthread); #pragma D attributes Stable/Stable/Common curlwpsinfo #pragma D binding "1.0" curlwpsinfo - Modified: stable/11/cddl/lib/libdtrace/regs_x86.d ============================================================================== --- stable/11/cddl/lib/libdtrace/regs_x86.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/regs_x86.d Tue May 15 00:00:44 2018 (r333617) @@ -1,4 +1,4 @@ -/* +/* * CDDL HEADER START * * The contents of this file are subject to the terms of the @@ -116,4 +116,3 @@ inline int R_R14 = 18 + 1 + 1; #pragma D binding "1.0" R_R14 inline int R_R15 = 18 + 1 + 0; #pragma D binding "1.0" R_R15 - Modified: stable/11/cddl/lib/libdtrace/sched.d ============================================================================== --- stable/11/cddl/lib/libdtrace/sched.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/sched.d Tue May 15 00:00:44 2018 (r333617) @@ -81,4 +81,3 @@ inline chipid_t chip = curcpu->cpu_chip; inline lgrp_id_t lgrp = curcpu->cpu_lgrp; #pragma D attributes Stable/Stable/Common lgrp #pragma D binding "1.0" lgrp - Modified: stable/11/cddl/lib/libdtrace/signal.d ============================================================================== --- stable/11/cddl/lib/libdtrace/signal.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/signal.d Tue May 15 00:00:44 2018 (r333617) @@ -20,6 +20,7 @@ * CDDL HEADER END * * Portions Copyright 2008 John Birrell jb@freebsd.org + * Portions Copyright 2018 Devin Teske dteske@freebsd.org * * $FreeBSD$ */ @@ -86,7 +87,48 @@ inline int SIGUSR1 = 30; #pragma D binding "1.0" SIGUSR1 inline int SIGUSR2 = 31; #pragma D binding "1.0" SIGUSR2 +inline int SIGTHR = 32; +#pragma D binding "1.13" SIGTHR +inline int SIGLIBRT = 33; +#pragma D binding "1.13" SIGLIBRT +#pragma D binding "1.13" signal_string +inline string signal_string[int signal] = + signal == SIGHUP ? "SIGHUP" : + signal == SIGINT ? "SIGINT" : + signal == SIGQUIT ? "SIGQUIT" : + signal == SIGILL ? "SIGILL": + signal == SIGTRAP ? "SIGTRAP" : + signal == SIGABRT ? "SIGABRT" : + signal == SIGEMT ? "SIGEMT" : + signal == SIGFPE ? "SIGFPE" : + signal == SIGKILL ? "SIGKILL" : + signal == SIGBUS ? "SIGBUS" : + signal == SIGSEGV ? "SIGSEGV" : + signal == SIGSYS ? "SIGSYS" : + signal == SIGPIPE ? "SIGPIPE" : + signal == SIGALRM ? "SIGALRM" : + signal == SIGTERM ? "SIGTERM" : + signal == SIGURG ? "SIGURG" : + signal == SIGSTOP ? "SIGSTOP" : + signal == SIGTSTP ? "SIGTSTP" : + signal == SIGCONT ? "SIGCONT" : + signal == SIGCHLD ? "SIGCHLD" : + signal == SIGTTIN ? "SIGTTIN" : + signal == SIGTTOU ? "SIGTTOU" : + signal == SIGIO ? "SIGIO" : + signal == SIGXCPU ? "SIGXCPU" : + signal == SIGXFSZ ? "SIGXFSZ" : + signal == SIGVTALRM ? "SIGVTALRM" : + signal == SIGPROF ? "SIGPROF" : + signal == SIGWINCH ? "SIGWINCH" : + signal == SIGINFO ? "SIGINFO" : + signal == SIGUSR1 ? "SIGUSR1" : + signal == SIGUSR2 ? "SIGUSR2" : + signal == SIGTHR ? "SIGTHR" : + signal == SIGLIBRT ? "SIGLIBRT" : + "UNKNOWN"; + inline int CLD_EXITED = 1; #pragma D binding "1.0" CLD_EXITED inline int CLD_KILLED = 2; @@ -99,3 +141,13 @@ inline int CLD_STOPPED = 5; #pragma D binding "1.0" CLD_STOPPED inline int CLD_CONTINUED = 6; #pragma D binding "1.0" CLD_CONTINUED + +#pragma D binding "1.13" child_signal_string +inline string child_signal_string[int child_signal] = + child_signal == CLD_EXITED ? "child exited" : + child_signal == CLD_KILLED ? "child terminated abnormally" : + child_signal == CLD_DUMPED ? "child core dumped" : + child_signal == CLD_TRAPPED ? "traced child trapped" : + child_signal == CLD_STOPPED ? "child stopped" : + child_signal == CLD_CONTINUED ? "stopped child continued" : + strjoin("unknown SIGCHLD code (", strjoin(lltostr(child_signal), ")")); Modified: stable/11/cddl/lib/libdtrace/tcp.d ============================================================================== --- stable/11/cddl/lib/libdtrace/tcp.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/tcp.d Tue May 15 00:00:44 2018 (r333617) @@ -118,18 +118,18 @@ typedef struct tcpsinfo { int32_t tcps_rcv_ws; /* receive window scaling */ u_long tcps_cwnd; /* congestion window */ u_long tcps_cwnd_ssthresh; /* threshold for congestion avoidance */ - uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */ + uint32_t tcps_srecover; /* for use in NewReno Fast Recovery */ uint32_t tcps_sack_fack; /* SACK sequence # we have acked */ uint32_t tcps_sack_snxt; /* next SACK seq # for retransmission */ uint32_t tcps_rto; /* round-trip timeout, msec */ uint32_t tcps_mss; /* max segment size */ int tcps_retransmit; /* retransmit send event, boolean */ int tcps_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ - int tcps_debug; /* socket has SO_DEBUG set */ - int tcps_cookie; /* expose the socket's SO_USER_COOKIE */ - int32_t tcps_dupacks; /* consecutive dup acks received */ - uint32_t tcps_rtttime; /* RTT measurement start time */ - uint32_t tcps_rtseq; /* sequence # being timed */ + int tcps_debug; /* socket has SO_DEBUG set */ + int tcps_cookie; /* expose the socket's SO_USER_COOKIE */ + int32_t tcps_dupacks; /* consecutive dup acks received */ + uint32_t tcps_rtttime; /* RTT measurement start time */ + uint32_t tcps_rtseq; /* sequence # being timed */ uint32_t tcps_ts_recent; /* timestamp echo data */ } tcpsinfo_t; @@ -206,31 +206,31 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_snxt = p == NULL ? 0 : p->snd_nxt; tcps_rack = p == NULL ? 0 : p->last_ack_sent; tcps_rnxt = p == NULL ? 0 : p->rcv_nxt; - tcps_swnd = p == NULL ? -1 : p->snd_wnd; - tcps_snd_ws = p == NULL ? -1 : p->snd_scale; - tcps_swl1 = p == NULL ? -1 : p->snd_wl1; - tcps_swl2 = p == NULL ? -1 : p->snd_wl2; - tcps_radv = p == NULL ? -1 : p->rcv_adv; - tcps_rwnd = p == NULL ? -1 : p->rcv_wnd; - tcps_rup = p == NULL ? -1 : p->rcv_up; - tcps_rcv_ws = p == NULL ? -1 : p->rcv_scale; - tcps_cwnd = p == NULL ? -1 : p->snd_cwnd; - tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; - tcps_srecover = p == NULL ? -1 : p->snd_recover; + tcps_swnd = p == NULL ? -1 : p->snd_wnd; + tcps_snd_ws = p == NULL ? -1 : p->snd_scale; + tcps_swl1 = p == NULL ? -1 : p->snd_wl1; + tcps_swl2 = p == NULL ? -1 : p->snd_wl2; + tcps_radv = p == NULL ? -1 : p->rcv_adv; + tcps_rwnd = p == NULL ? -1 : p->rcv_wnd; + tcps_rup = p == NULL ? -1 : p->rcv_up; + tcps_rcv_ws = p == NULL ? -1 : p->rcv_scale; + tcps_cwnd = p == NULL ? -1 : p->snd_cwnd; + tcps_cwnd_ssthresh = p == NULL ? -1 : p->snd_ssthresh; + tcps_srecover = p == NULL ? -1 : p->snd_recover; tcps_sack_fack = p == NULL ? 0 : p->snd_fack; tcps_sack_snxt = p == NULL ? 0 : p->sack_newdata; tcps_rto = p == NULL ? -1 : (p->t_rxtcur * 1000) / `hz; - tcps_mss = p == NULL ? -1 : p->t_maxseg; + tcps_mss = p == NULL ? -1 : p->t_maxseg; tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0; - tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ + tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */ tcps_debug = p == NULL ? 0 : p->t_inpcb->inp_socket->so_options & 1; tcps_cookie = p == NULL ? -1 : p->t_inpcb->inp_socket->so_user_cookie; - tcps_dupacks = p == NULL ? -1 : p->t_dupacks; - tcps_rtttime = p == NULL ? -1 : p->t_rtttime; - tcps_rtseq = p == NULL ? -1 : p->t_rtseq; - tcps_ts_recent = p == NULL ? -1 : p->ts_recent; + tcps_dupacks = p == NULL ? -1 : p->t_dupacks; + tcps_rtttime = p == NULL ? -1 : p->t_rtttime; + tcps_rtseq = p == NULL ? -1 : p->t_rtseq; + tcps_ts_recent = p == NULL ? -1 : p->ts_recent; }; #pragma D binding "1.6.3" translator @@ -319,74 +319,74 @@ inline int PRU_LISTEN = 3; #pragma D binding "1.12.1" PRU_CONNECT inline int PRU_CONNECT = 4; #pragma D binding "1.12.1" PRU_ACCEPT -inline int PRU_ACCEPT = 5 ; +inline int PRU_ACCEPT = 5 ; #pragma D binding "1.12.1" PRU_DISCONNECT -inline int PRU_DISCONNECT= 6; +inline int PRU_DISCONNECT = 6; #pragma D binding "1.12.1" PRU_SHUTDOWN -inline int PRU_SHUTDOWN = 7; +inline int PRU_SHUTDOWN = 7; #pragma D binding "1.12.1" PRU_RCVD -inline int PRU_RCVD = 8; +inline int PRU_RCVD = 8; #pragma D binding "1.12.1" PRU_SEND -inline int PRU_SEND = 9; +inline int PRU_SEND = 9; #pragma D binding "1.12.1" PRU_ABORT -inline int PRU_ABORT = 10; +inline int PRU_ABORT = 10; #pragma D binding "1.12.1" PRU_CONTROL -inline int PRU_CONTROL = 11; +inline int PRU_CONTROL = 11; #pragma D binding "1.12.1" PRU_SENSE -inline int PRU_SENSE = 12; +inline int PRU_SENSE = 12; #pragma D binding "1.12.1" PRU_RCVOOB -inline int PRU_RCVOOB = 13; +inline int PRU_RCVOOB = 13; #pragma D binding "1.12.1" PRU_SENDOOB -inline int PRU_SENDOOB = 14; +inline int PRU_SENDOOB = 14; #pragma D binding "1.12.1" PRU_SOCKADDR -inline int PRU_SOCKADDR = 15; +inline int PRU_SOCKADDR = 15; #pragma D binding "1.12.1" PRU_PEERADDR -inline int PRU_PEERADDR = 16; +inline int PRU_PEERADDR = 16; #pragma D binding "1.12.1" PRU_CONNECT2 -inline int PRU_CONNECT2 = 17; +inline int PRU_CONNECT2 = 17; #pragma D binding "1.12.1" PRU_FASTTIMO -inline int PRU_FASTTIMO = 18; +inline int PRU_FASTTIMO = 18; #pragma D binding "1.12.1" PRU_SLOWTIMO -inline int PRU_SLOWTIMO = 19; +inline int PRU_SLOWTIMO = 19; #pragma D binding "1.12.1" PRU_PROTORCV -inline int PRU_PROTORCV = 20; +inline int PRU_PROTORCV = 20; #pragma D binding "1.12.1" PRU_PROTOSEND -inline int PRU_PROTOSEND = 21; +inline int PRU_PROTOSEND = 21; #pragma D binding "1.12.1" PRU_SEND_EOF -inline int PRU_SEND_EOF = 22; +inline int PRU_SEND_EOF = 22; #pragma D binding "1.12.1" PRU_SOSETLABEL -inline int PRU_SOSETLABEL = 23; +inline int PRU_SOSETLABEL = 23; #pragma D binding "1.12.1" PRU_CLOSE -inline int PRU_CLOSE = 24; +inline int PRU_CLOSE = 24; #pragma D binding "1.12.1" PRU_FLUSH -inline int PRU_FLUSH = 25; +inline int PRU_FLUSH = 25; #pragma D binding "1.12.1" prureq_string inline string prureq_string[uint8_t req] = - req == PRU_ATTACH ? "ATTACH" : - req == PRU_DETACH ? "DETACH" : - req == PRU_BIND ? "BIND" : - req == PRU_LISTEN ? "LISTEN" : - req == PRU_CONNECT ? "CONNECT" : - req == PRU_ACCEPT ? "ACCEPT" : - req == PRU_DISCONNECT ? "DISCONNECT" : - req == PRU_SHUTDOWN ? "SHUTDOWN" : - req == PRU_RCVD ? "RCVD" : - req == PRU_SEND ? "SEND" : - req == PRU_ABORT ? "ABORT" : - req == PRU_CONTROL ? "CONTROL" : - req == PRU_SENSE ? "SENSE" : - req == PRU_RCVOOB ? "RCVOOB" : - req == PRU_SENDOOB ? "SENDOOB" : - req == PRU_SOCKADDR ? "SOCKADDR" : - req == PRU_PEERADDR ? "PEERADDR" : - req == PRU_CONNECT2 ? "CONNECT2" : - req == PRU_FASTTIMO ? "FASTTIMO" : - req == PRU_SLOWTIMO ? "SLOWTIMO" : - req == PRU_PROTORCV ? "PROTORCV" : - req == PRU_PROTOSEND ? "PROTOSEND" : - req == PRU_SEND ? "SEND_EOF" : - req == PRU_SOSETLABEL ? "SOSETLABEL" : - req == PRU_CLOSE ? "CLOSE" : - req == PRU_FLUSH ? "FLUSE" : + req == PRU_ATTACH ? "ATTACH" : + req == PRU_DETACH ? "DETACH" : + req == PRU_BIND ? "BIND" : + req == PRU_LISTEN ? "LISTEN" : + req == PRU_CONNECT ? "CONNECT" : + req == PRU_ACCEPT ? "ACCEPT" : + req == PRU_DISCONNECT ? "DISCONNECT" : + req == PRU_SHUTDOWN ? "SHUTDOWN" : + req == PRU_RCVD ? "RCVD" : + req == PRU_SEND ? "SEND" : + req == PRU_ABORT ? "ABORT" : + req == PRU_CONTROL ? "CONTROL" : + req == PRU_SENSE ? "SENSE" : + req == PRU_RCVOOB ? "RCVOOB" : + req == PRU_SENDOOB ? "SENDOOB" : + req == PRU_SOCKADDR ? "SOCKADDR" : + req == PRU_PEERADDR ? "PEERADDR" : + req == PRU_CONNECT2 ? "CONNECT2" : + req == PRU_FASTTIMO ? "FASTTIMO" : + req == PRU_SLOWTIMO ? "SLOWTIMO" : + req == PRU_PROTORCV ? "PROTORCV" : + req == PRU_PROTOSEND ? "PROTOSEND" : + req == PRU_SEND ? "SEND_EOF" : + req == PRU_SOSETLABEL ? "SOSETLABEL" : + req == PRU_CLOSE ? "CLOSE" : + req == PRU_FLUSH ? "FLUSE" : "unknown" ; Modified: stable/11/cddl/lib/libdtrace/udp.d ============================================================================== --- stable/11/cddl/lib/libdtrace/udp.d Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/lib/libdtrace/udp.d Tue May 15 00:00:44 2018 (r333617) @@ -47,7 +47,7 @@ typedef struct udpinfo { uint16_t udp_sport; /* source port */ uint16_t udp_dport; /* destination port */ uint16_t udp_length; /* total length */ - uint16_t udp_checksum; /* headers + data checksum */ + uint16_t udp_checksum; /* headers + data checksum */ struct udphdr *udp_hdr; /* raw UDP header */ } udpinfo_t; Modified: stable/11/cddl/usr.sbin/Makefile ============================================================================== --- stable/11/cddl/usr.sbin/Makefile Mon May 14 23:12:30 2018 (r333616) +++ stable/11/cddl/usr.sbin/Makefile Tue May 15 00:00:44 2018 (r333617) @@ -3,6 +3,7 @@ .include SUBDIR= ${_dtrace} \ + ${_dwatch} \ ${_lockstat} \ ${_plockstat} \ ${_tests} \ @@ -26,6 +27,7 @@ _zfsd= zfsd .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _dtrace= dtrace +_dwatch= dwatch _lockstat= lockstat _plockstat= plockstat .endif @@ -33,15 +35,18 @@ _plockstat= plockstat .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "riscv" _dtrace= dtrace +_dwatch= dwatch _lockstat= lockstat .endif .if ${MACHINE_CPUARCH} == "mips" _dtrace= dtrace +_dwatch= dwatch .endif .if ${MACHINE_CPUARCH} == "powerpc" _dtrace= dtrace +_dwatch= dwatch _lockstat= lockstat .endif Modified: stable/11/cddl/usr.sbin/dwatch/dwatch ============================================================================== --- head/cddl/usr.sbin/dwatch/dwatch Tue Mar 6 23:44:19 2018 (r330559) +++ stable/11/cddl/usr.sbin/dwatch/dwatch Tue May 15 00:00:44 2018 (r333617) @@ -47,7 +47,7 @@ DTRACE_PRAGMA=" ############################################################ GLOBALS -VERSION='$Version: 1.0-beta-91 $' # -V +VERSION='$Version: 1.2 $' # -V pgm="${0##*/}" # Program basename @@ -57,6 +57,12 @@ pgm="${0##*/}" # Program basename PROBE_ARG= # +# Command-line defaults +# +_MAX_ARGS=64 # -B num +_MAX_DEPTH=64 # -K num + +# # Command-line options # CONSOLE= # -y @@ -67,6 +73,7 @@ CUSTOM_DETAILS= # -E code CUSTOM_TEST= # -t test DEBUG= # -d DESTRUCTIVE_ACTIONS= # -w +DEVELOPER= # -dev EXECNAME= # -k name EXECREGEX= # -z regex EXIT_AFTER_COMPILE= # -e @@ -76,8 +83,8 @@ GROUP= # -g group JID= # -j jail LIST= # -l LIST_PROFILES= # -Q -MAX_ARGS=64 # -B num -MAX_DEPTH=64 # -K num +MAX_ARGS=$_MAX_ARGS # -B num +MAX_DEPTH=$_MAX_DEPTH # -K num ONELINE= # -1 OUTPUT= # -o file OUTPUT_CMD= # -O cmd @@ -143,7 +150,7 @@ usage() printf "$optfmt" "-1" \ "Print one line per process/profile (Default; disables \`-R')." printf "$optfmt" "-B num" \ - "Maximum process arguments to display (Default $MAX_ARGS)." + "Maximum process arguments to display (Default $_MAX_ARGS)." printf "$optfmt" "-d" \ "Debug. Send dtrace(1) script to stdout instead of executing." printf "$optfmt" "-e" \ @@ -161,7 +168,7 @@ usage() printf "$optfmt" "-k name" \ "Only show processes matching name." printf "$optfmt" "-K num" \ - "Maximum directory depth to display (Default $MAX_DEPTH)." + "Maximum directory depth to display (Default $_MAX_DEPTH)." printf "$optfmt" "-l" \ "List available probes on standard output and exit." printf "$optfmt" "-m" \ @@ -489,8 +496,7 @@ list_profiles() function ans(s) { return cons ? "\033[" s "m" : "" } gsub(filter, ans("31;1") "&" ans("39;22")) ' # END-QUOTE - return $SUCCESS - # NOTREACHED + exit $SUCCESS fi [ "$quiet" ] || echo PROFILES: @@ -531,6 +537,11 @@ list_profiles() exit $SUCCESS } +shell_escape() +{ + echo "$*" | awk 'gsub(/'\''/, "&\\\\&&")||1' +} + load_profile() { local profile="$1" @@ -540,7 +551,45 @@ load_profile() local oldIFS="$IFS" local dir found= + local ARGV= + [ $COUNT -gt 0 ] && ARGV="$ARGV -N $COUNT" + [ "$DEBUG" ] && ARGV="$ARGV -d" + [ "$DESTRUCTIVE_ACTIONS" ] && ARGV="$ARGV -w" + [ "$EXIT_AFTER_COMPILE" ] && ARGV="$ARGV -e" + [ "$GROUP" ] && ARGV="$ARGV -g $GROUP" + [ "$JID" ] && ARGV="$ARGV -j $JID" + [ $MAX_ARGS -ne $_MAX_ARGS ] && ARGV="$ARGV -B $MAX_ARGS" + [ $MAX_DEPTH -ne $_MAX_DEPTH ] && ARGV="$ARGV -K $MAX_DEPTH" + [ "$ONELINE" ] && ARGV="$ARGV -1" + [ "$PID" ] && ARGV="$ARGV -p $PID" + [ "$PSTREE" ] && ARGV="$ARGV -R" + [ "$QUIET" ] && ARGV="$ARGV -q" + [ "$TIMEOUT" ] && ARGV="$ARGV -T $TIMEOUT" + [ "$TRACE" ] && ARGV="$ARGV -x" + [ "$USER" ] && ARGV="$ARGV -u $USER" + [ "$VERBOSE" ] && ARGV="$ARGV -v" + + [ "$FILTER" ] && + ARGV="$ARGV -r '$( shell_escape "$FILTER" )'" + [ "$EXECREGEX" ] && + ARGV="$ARGV -z '$( shell_escape "$EXECREGEX" )'" + [ "$CUSTOM_DETAILS" ] && + ARGV="$ARGV -E '$( shell_escape "$EVENT_DETAILS" )'" + [ "$EVENT_TEST" ] && + ARGV="$ARGV -t '$( shell_escape "$EVENT_TEST" )'" + [ "$OUTPUT" ] && + ARGV="$ARGV -o '$( shell_escape "$OUTPUT" )'" + [ "$OUTPUT_CMD" ] && + ARGV="$ARGV -O '$( shell_escape "$OUTPUT_CMD" )'" + + case "$PROBE_TYPE" in + provider) ARGV="$ARGV -P" ;; + module) ARGV="$ARGV -m" ;; + function) ARGV="$ARGV -f" ;; + name) ARGV="$ARGV -n" ;; + esac + IFS=: for dir in $DWATCH_PROFILES_PATH; do [ -d "$dir" ] || continue @@ -835,6 +884,11 @@ if [ "$PROBE_ARG" ]; then fi # +# Developer switch +# +[ "$DEBUG" -a "$EXIT_AFTER_COMPILE" -a "$VERBOSE" ] && DEVELOPER=1 DEBUG= + +# # Set default event details if `-E code' was not given # [ "$CUSTOM_DETAILS" ] || EVENT_DETAILS=$( pproc_dump 0 ) @@ -848,7 +902,7 @@ fi # # Show the user what's being watched # -[ "$DEBUG$QUIET$EXIT_AFTER_COMPILE" ] || info "Watching '$PROBE' ..." +[ "$DEBUG$EXIT_AFTER_COMPILE" ] || info "Watching '$PROBE' ..." # # Header for watched probe entry @@ -966,6 +1020,61 @@ PSARGS_ACTION=$( cat <&9 ) exec 3>&1 console_stdout=3 + # + # Developer debugging aide + # + if [ "$DEVELOPER" ]; then + # + # Run, capture the error line, and focus it + # + # Example error text to capture line number from: + # dtrace: failed to compile script /dev/stdin: line 669: ... + # + errline= + stdin_buf=$( cat ) + stderr_buf=$( echo "$stdin_buf" | + dtrace_cmd -t -es /dev/stdin "$@" 2>&1 > /dev/null ) + status=$? + if [ "$stderr_buf" ]; then + errline=$( echo "$stderr_buf" | awk ' + BEGIN { + ti = "\033[31m" + te = "\033[39m" + } + { line = $0 } + sub(/.*: line /, "") && sub(/:.*/, "") { + print # to errline + sub("line " $0, ti "&" te, line) + } + { print line > "/dev/stderr" } + ' 2>&3 ) + fi + if [ "$errline" ]; then + echo "$stdin_buf" | awk -v line="${errline%%[^0-9]*}" ' + BEGIN { + start = line < 10 ? 1 : line - 10 + end = line + 10 + slen = length(sprintf("%u", start)) + elen = length(sprintf("%u", end)) + N = elen > slen ? elen : slen + for (i = start; i <= end; i++) { + ti[i] = "\033[2m" + te[i] = "\033[22m" + } + ti[line] = "\033[31m" + te[line] = "\033[39m" + fmt = "%s%*u %s%s\n" + } + NR < start { next } + NR == start, NR == end { + printf(fmt, ti[NR], N, NR, $0, te[NR]) + } + NR > end { exit } + ' # END-QUOTE + fi + exit $status + fi + if [ $COUNT -eq 0 -a ! "$EXECREGEX$FILTER$GROUP$OUTPUT_CMD$PID$USER" ] then case "$OUTPUT" in @@ -1285,6 +1394,7 @@ $( pproc_dump -v 3 )} } EOF +# NOTREACHED ################################################################################ # END Modified: stable/11/cddl/usr.sbin/dwatch/libexec/Makefile ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/Makefile Tue Mar 6 23:44:19 2018 (r330559) +++ stable/11/cddl/usr.sbin/dwatch/libexec/Makefile Tue May 15 00:00:44 2018 (r333617) @@ -11,6 +11,7 @@ FILES= chmod \ proc \ rw \ sched \ + sendrecv \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 15 00:50:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03F0DEA8C88; Tue, 15 May 2018 00:50:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A88C7834B0; Tue, 15 May 2018 00:50:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BE6723AE8; Tue, 15 May 2018 00:50:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F0oADE077273; Tue, 15 May 2018 00:50:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F0oAkm077272; Tue, 15 May 2018 00:50:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805150050.w4F0oAkm077272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 May 2018 00:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333618 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 00:50:11 -0000 Author: emaste Date: Tue May 15 00:50:09 2018 New Revision: 333618 URL: https://svnweb.freebsd.org/changeset/base/333618 Log: subr_pidctrl: use standard 2-Clause FreeBSD license and disclaimer Approved by: jeff Modified: head/sys/kern/subr_pidctrl.c Modified: head/sys/kern/subr_pidctrl.c ============================================================================== --- head/sys/kern/subr_pidctrl.c Tue May 15 00:00:44 2018 (r333617) +++ head/sys/kern/subr_pidctrl.c Tue May 15 00:50:09 2018 (r333618) @@ -8,22 +8,22 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include From owner-svn-src-all@freebsd.org Tue May 15 02:26:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9941CEB1428; Tue, 15 May 2018 02:26:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2221C77844; Tue, 15 May 2018 02:26:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF41224CE7; Tue, 15 May 2018 02:26:50 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F2Qo0a027177; Tue, 15 May 2018 02:26:50 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F2QoZe027176; Tue, 15 May 2018 02:26:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201805150226.w4F2QoZe027176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 15 May 2018 02:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333619 - stable/11/sys/arm/xilinx X-SVN-Group: stable-11 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/11/sys/arm/xilinx X-SVN-Commit-Revision: 333619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 02:26:51 -0000 Author: gonzo Date: Tue May 15 02:26:50 2018 New Revision: 333619 URL: https://svnweb.freebsd.org/changeset/base/333619 Log: MFC r331906: Approved by: re (gjb) Fix accidental USB port resets by GPIO on Zynq/Zedboard boards The Zynq/Zedboard GPIO driver attempts to tri-state all GPIO pins on boot up but the order in which I reset the hardware can cause the pins to be briefly held low before being tri-stated. This is a problem on boards that use GPIO pins to reset devices. In particular, the Zybo and ZC-706 boards use a GPIO pin as a USB PHY reset. If U-boot enables the USB port before booting the kernel, the GPIO driver attach causes a glitch on the USB PHY reset and the USB port loses power. My fix is to have the GPIO driver leave the pins in whatever configuration U-boot placed them. PR: 225713 Submitted by: Thomas Skibo Modified: stable/11/sys/arm/xilinx/zy7_gpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/xilinx/zy7_gpio.c ============================================================================== --- stable/11/sys/arm/xilinx/zy7_gpio.c Tue May 15 00:50:09 2018 (r333618) +++ stable/11/sys/arm/xilinx/zy7_gpio.c Tue May 15 02:26:50 2018 (r333619) @@ -297,24 +297,6 @@ zy7_gpio_probe(device_t dev) return (0); } -static void -zy7_gpio_hw_reset(struct zy7_gpio_softc *sc) -{ - int i; - - for (i = 0; i < NUMBANKS; i++) { - WR4(sc, ZY7_GPIO_DATA(i), 0); - WR4(sc, ZY7_GPIO_DIRM(i), 0); - WR4(sc, ZY7_GPIO_OEN(i), 0); - WR4(sc, ZY7_GPIO_INT_DIS(i), 0xffffffff); - WR4(sc, ZY7_GPIO_INT_POLARITY(i), 0); - WR4(sc, ZY7_GPIO_INT_TYPE(i), - i == 1 ? 0x003fffff : 0xffffffff); - WR4(sc, ZY7_GPIO_INT_ANY(i), 0); - WR4(sc, ZY7_GPIO_INT_STAT(i), 0xffffffff); - } -} - static int zy7_gpio_detach(device_t dev); static int @@ -336,9 +318,6 @@ zy7_gpio_attach(device_t dev) zy7_gpio_detach(dev); return (ENOMEM); } - - /* Completely reset. */ - zy7_gpio_hw_reset(sc); sc->busdev = gpiobus_attach_bus(dev); if (sc->busdev == NULL) { From owner-svn-src-all@freebsd.org Tue May 15 04:24:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37637ED9357; Tue, 15 May 2018 04:24:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB29D7360F; Tue, 15 May 2018 04:24:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7F2A26225; Tue, 15 May 2018 04:24:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F4OdiM088554; Tue, 15 May 2018 04:24:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F4OcBV088548; Tue, 15 May 2018 04:24:38 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805150424.w4F4OcBV088548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 15 May 2018 04:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333620 - in head/sys/dev/cxgbe: . common firmware tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common firmware tom X-SVN-Commit-Revision: 333620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 04:24:40 -0000 Author: np Date: Tue May 15 04:24:38 2018 New Revision: 333620 URL: https://svnweb.freebsd.org/changeset/base/333620 Log: cxgbe(4): Filtering related features and fixes. - Driver support for hardware NAT. - Driver support for swapmac action. - Validate a request to create a hashfilter against the filter mask. - Add a hashfilter config file for T5. Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt (contents, props changed) Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/common/t4_regs_values.h head/sys/dev/cxgbe/t4_filter.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/common/common.h Tue May 15 04:24:38 2018 (r333620) @@ -238,6 +238,7 @@ struct tp_params { uint32_t vlan_pri_map; uint32_t ingress_config; + uint64_t hash_filter_mask; __be16 err_vec_mask; int8_t fcoe_shift; Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue May 15 04:24:38 2018 (r333620) @@ -8368,6 +8368,7 @@ int t4_init_sge_params(struct adapter *adapter) static void read_filter_mode_and_ingress_config(struct adapter *adap, bool sleep_ok) { + uint32_t v; struct tp_params *tpp = &adap->params.tp; t4_tp_pio_read(adap, &tpp->vlan_pri_map, 1, A_TP_VLAN_PRI_MAP, @@ -8391,12 +8392,12 @@ static void read_filter_mode_and_ingress_config(struct tpp->matchtype_shift = t4_filter_field_shift(adap, F_MPSHITTYPE); tpp->frag_shift = t4_filter_field_shift(adap, F_FRAGMENTATION); - /* - * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID - * represents the presence of an Outer VLAN instead of a VNIC ID. - */ - if ((tpp->ingress_config & F_VNIC) == 0) - tpp->vnic_shift = -1; + if (chip_id(adap) > CHELSIO_T4) { + v = t4_read_reg(adap, LE_HASH_MASK_GEN_IPV4T5(3)); + adap->params.tp.hash_filter_mask = v; + v = t4_read_reg(adap, LE_HASH_MASK_GEN_IPV4T5(4)); + adap->params.tp.hash_filter_mask |= (u64)v << 32; + } } /** Modified: head/sys/dev/cxgbe/common/t4_regs_values.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_regs_values.h Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/common/t4_regs_values.h Tue May 15 04:24:38 2018 (r333620) @@ -292,6 +292,17 @@ #define W_FT_MPSHITTYPE 3 #define W_FT_FRAGMENTATION 1 +#define M_FT_FCOE ((1ULL << W_FT_FCOE) - 1) +#define M_FT_PORT ((1ULL << W_FT_PORT) - 1) +#define M_FT_VNIC_ID ((1ULL << W_FT_VNIC_ID) - 1) +#define M_FT_VLAN ((1ULL << W_FT_VLAN) - 1) +#define M_FT_TOS ((1ULL << W_FT_TOS) - 1) +#define M_FT_PROTOCOL ((1ULL << W_FT_PROTOCOL) - 1) +#define M_FT_ETHERTYPE ((1ULL << W_FT_ETHERTYPE) - 1) +#define M_FT_MACMATCH ((1ULL << W_FT_MACMATCH) - 1) +#define M_FT_MPSHITTYPE ((1ULL << W_FT_MPSHITTYPE) - 1) +#define M_FT_FRAGMENTATION ((1ULL << W_FT_FRAGMENTATION) - 1) + /* * Some of the Compressed Filter Tuple fields have internal structure. These * bit shifts/masks describe those structures. All shifts are relative to the Added: head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg_hashfilter.txt Tue May 15 04:24:38 2018 (r333620) @@ -0,0 +1,300 @@ +# Firmware configuration file. +# +# Global limits (some are hardware limits, others are due to the firmware). +# nvi = 128 virtual interfaces +# niqflint = 1023 ingress queues with freelists and/or interrupts +# nethctrl = 64K Ethernet or ctrl egress queues +# neq = 64K egress queues of all kinds, including freelists +# nexactf = 512 MPS TCAM entries, can oversubscribe. +# + +[global] + rss_glb_config_mode = basicvirtual + rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp + + # PL_TIMEOUT register + pl_timeout_value = 10000 # the timeout value in units of us + + # SGE_THROTTLE_CONTROL + bar2throttlecount = 500 # bar2throttlecount in us + + sge_timer_value = 1, 5, 10, 50, 100, 200 # SGE_TIMER_VALUE* in usecs + + reg[0x1124] = 0x00000400/0x00000400 # SGE_CONTROL2, enable VFIFO; if + # SGE_VFIFO_SIZE is not set, then + # firmware will set it up in function + # of number of egress queues used + + reg[0x1130] = 0x00d5ffeb # SGE_DBP_FETCH_THRESHOLD, fetch + # threshold set to queue depth + # minus 128-entries for FL and HP + # queues, and 0xfff for LP which + # prompts the firmware to set it up + # in function of egress queues + # used + + reg[0x113c] = 0x0002ffc0 # SGE_VFIFO_SIZE, set to 0x2ffc0 which + # prompts the firmware to set it up in + # function of number of egress queues + # used + + # enable TP_OUT_CONFIG.IPIDSPLITMODE + reg[0x7d04] = 0x00010000/0x00010000 + + # disable TP_PARA_REG3.RxFragEn + reg[0x7d6c] = 0x00000000/0x00007000 + + # enable TP_PARA_REG6.EnableCSnd + reg[0x7d78] = 0x00000400/0x00000000 + + reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT + + filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe + filterMask = port, protocol + + tp_pmrx = 20, 512 + tp_pmrx_pagesize = 16K + + # TP number of RX channels (0 = auto) + tp_nrxch = 0 + + tp_pmtx = 40, 512 + tp_pmtx_pagesize = 64K + + # TP number of TX channels (0 = auto) + tp_ntxch = 0 + + # TP OFLD MTUs + tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 + + # TP_GLOBAL_CONFIG + reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable + + # TP_PC_CONFIG + reg[0x7d48] = 0x00000000/0x00000400 # clear EnableFLMError + + # TP_PC_CONFIG2 + reg[0x7d4c] = 0x00010000/0x00010000 # set DisableNewPshFlag + + # TP_PARA_REG0 + reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6 + + # TP_PARA_REG3 + reg[0x7d6c] = 0x28000000/0x28000000 # set EnableTnlCngHdr + # set RxMacCheck (Note: + # Only for hash filter, + # no tcp offload) + + # TP_PIO_ADDR:TP_RX_LPBK + reg[tp_pio:0x28] = 0x00208208/0x00ffffff # set commit limits to 8 + + # MC configuration + mc_mode_brc[0] = 0 # mc0 - 1: enable BRC, 0: enable RBC + mc_mode_brc[1] = 0 # mc1 - 1: enable BRC, 0: enable RBC + + # ULP_TX_CONFIG + reg[0x8dc0] = 0x00000004/0x00000004 # Enable more error msg for ... + # TPT error. + +# PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by +# these 4 PFs only. +[function "0"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x1 + +[function "1"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x2 + +[function "2"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x4 + +[function "3"] + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x8 + +# PF4 is the resource-rich PF that the bus/nexus driver attaches to. +# It gets 32 MSI/128 MSI-X vectors. +[function "4"] + wx_caps = all + r_caps = all + nvi = 32 + rssnvi = 8 + niqflint = 512 + nethctrl = 1024 + neq = 2048 + nqpcq = 8192 + nexactf = 456 + cmask = all + pmask = all + + # driver will mask off features it won't use + protocol = nic_hashfilter + + tp_l2t = 4096 + + # TCAM has 8K cells; each region must start at a multiple of 128 cell. + # Each entry in these categories takes 4 cells each. nhash will use the + # TCAM iff there is room left (that is, the rest don't add up to 2048). + nroute = 32 + nclip = 32 + nfilter = 1008 + nserver = 512 + nhash = 524288 + +# PF5 is the SCSI Controller PF. It gets 32 MSI/40 MSI-X vectors. +# Not used right now. +[function "5"] + nvi = 1 + rssnvi = 0 + +# PF6 is the FCoE Controller PF. It gets 32 MSI/40 MSI-X vectors. +# Not used right now. +[function "6"] + nvi = 1 + rssnvi = 0 + +# The following function, 1023, is not an actual PCIE function but is used to +# configure and reserve firmware internal resources that come from the global +# resource pool. +[function "1023"] + wx_caps = all + r_caps = all + nvi = 4 + rssnvi = 0 + cmask = all + pmask = all + nexactf = 8 + nfilter = 16 + +# For Virtual functions, we only allow NIC functionality and we only allow +# access to one port (1 << PF). Note that because of limitations in the +# Scatter Gather Engine (SGE) hardware which checks writes to VF KDOORBELL +# and GTS registers, the number of Ingress and Egress Queues must be a power +# of 2. +# +[function "0/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x1 + +[function "1/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x2 + +[function "2/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x4 + +[function "3/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x8 + +# MPS has 192K buffer space for ingress packets from the wire as well as +# loopback path of the L2 switch. +[port "0"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[port "1"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[port "2"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[port "3"] + dcb = none + bg_mem = 25 + lpbk_mem = 25 + hwm = 30 + lwm = 15 + dwm = 30 + +[fini] + version = 0x1 + checksum = 0x380a0a4 +# +# $FreeBSD$ +# Modified: head/sys/dev/cxgbe/t4_filter.c ============================================================================== --- head/sys/dev/cxgbe/t4_filter.c Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/t4_filter.c Tue May 15 04:24:38 2018 (r333620) @@ -64,7 +64,7 @@ struct filter_entry { static void free_filter_resources(struct filter_entry *); static int get_hashfilter(struct adapter *, struct t4_filter *); -static int set_hashfilter(struct adapter *, struct t4_filter *, +static int set_hashfilter(struct adapter *, struct t4_filter *, uint64_t, struct l2t_entry *); static int del_hashfilter(struct adapter *, struct t4_filter *); static int configure_hashfilter_tcb(struct adapter *, struct filter_entry *); @@ -96,50 +96,6 @@ remove_hftid(struct adapter *sc, int tid, int ntids) } static uint32_t -fconf_iconf_to_mode(uint32_t fconf, uint32_t iconf) -{ - uint32_t mode; - - mode = T4_FILTER_IPv4 | T4_FILTER_IPv6 | T4_FILTER_IP_SADDR | - T4_FILTER_IP_DADDR | T4_FILTER_IP_SPORT | T4_FILTER_IP_DPORT; - - if (fconf & F_FRAGMENTATION) - mode |= T4_FILTER_IP_FRAGMENT; - - if (fconf & F_MPSHITTYPE) - mode |= T4_FILTER_MPS_HIT_TYPE; - - if (fconf & F_MACMATCH) - mode |= T4_FILTER_MAC_IDX; - - if (fconf & F_ETHERTYPE) - mode |= T4_FILTER_ETH_TYPE; - - if (fconf & F_PROTOCOL) - mode |= T4_FILTER_IP_PROTO; - - if (fconf & F_TOS) - mode |= T4_FILTER_IP_TOS; - - if (fconf & F_VLAN) - mode |= T4_FILTER_VLAN; - - if (fconf & F_VNIC_ID) { - mode |= T4_FILTER_VNIC; - if (iconf & F_VNIC) - mode |= T4_FILTER_IC_VNIC; - } - - if (fconf & F_PORT) - mode |= T4_FILTER_PORT; - - if (fconf & F_FCOE) - mode |= T4_FILTER_FCoE; - - return (mode); -} - -static uint32_t mode_to_fconf(uint32_t mode) { uint32_t fconf = 0; @@ -186,7 +142,8 @@ mode_to_iconf(uint32_t mode) return (0); } -static int check_fspec_against_fconf_iconf(struct adapter *sc, +static int +check_fspec_against_fconf_iconf(struct adapter *sc, struct t4_filter_specification *fs) { struct tp_params *tpp = &sc->params.tp; @@ -240,15 +197,38 @@ static int check_fspec_against_fconf_iconf(struct adap int get_filter_mode(struct adapter *sc, uint32_t *mode) { - struct tp_params *tpp = &sc->params.tp; + struct tp_params *tp = &sc->params.tp; + uint64_t mask; - /* - * We trust the cached values of the relevant TP registers. This means - * things work reliably only if writes to those registers are always via - * t4_set_filter_mode. - */ - *mode = fconf_iconf_to_mode(tpp->vlan_pri_map, tpp->ingress_config); + /* Non-zero incoming value in mode means "hashfilter mode". */ + mask = *mode ? tp->hash_filter_mask : UINT64_MAX; + /* Always */ + *mode = T4_FILTER_IPv4 | T4_FILTER_IPv6 | T4_FILTER_IP_SADDR | + T4_FILTER_IP_DADDR | T4_FILTER_IP_SPORT | T4_FILTER_IP_DPORT; + +#define CHECK_FIELD(fconf_bit, field_shift, field_mask, mode_bit) do { \ + if (tp->vlan_pri_map & (fconf_bit)) { \ + MPASS(tp->field_shift >= 0); \ + if ((mask >> tp->field_shift & field_mask) == field_mask) \ + *mode |= (mode_bit); \ + } \ +} while (0) + + CHECK_FIELD(F_FRAGMENTATION, frag_shift, M_FT_FRAGMENTATION, T4_FILTER_IP_FRAGMENT); + CHECK_FIELD(F_MPSHITTYPE, matchtype_shift, M_FT_MPSHITTYPE, T4_FILTER_MPS_HIT_TYPE); + CHECK_FIELD(F_MACMATCH, macmatch_shift, M_FT_MACMATCH, T4_FILTER_MAC_IDX); + CHECK_FIELD(F_ETHERTYPE, ethertype_shift, M_FT_ETHERTYPE, T4_FILTER_ETH_TYPE); + CHECK_FIELD(F_PROTOCOL, protocol_shift, M_FT_PROTOCOL, T4_FILTER_IP_PROTO); + CHECK_FIELD(F_TOS, tos_shift, M_FT_TOS, T4_FILTER_IP_TOS); + CHECK_FIELD(F_VLAN, vlan_shift, M_FT_VLAN, T4_FILTER_VLAN); + CHECK_FIELD(F_VNIC_ID, vnic_shift, M_FT_VNIC_ID , T4_FILTER_VNIC); + if (tp->ingress_config & F_VNIC) + *mode |= T4_FILTER_IC_VNIC; + CHECK_FIELD(F_PORT, port_shift, M_FT_PORT , T4_FILTER_PORT); + CHECK_FIELD(F_FCOE, fcoe_shift, M_FT_FCOE , T4_FILTER_FCoE); +#undef CHECK_FIELD + return (0); } @@ -361,7 +341,7 @@ static int set_tcamfilter(struct adapter *sc, struct t4_filter *t, struct l2t_entry *l2te) { struct filter_entry *f; - struct fw_filter_wr *fwr; + struct fw_filter2_wr *fwr; u_int vnic_vld, vnic_vld_mask; struct wrq_cookie cookie; int i, rc, busy, locked; @@ -385,8 +365,13 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t else if (busy > 0) rc = EBUSY; else { - fwr = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*fwr), 16), - &cookie); + int len16; + + if (sc->params.filter2_wr_support) + len16 = howmany(sizeof(struct fw_filter2_wr), 16); + else + len16 = howmany(sizeof(struct fw_filter_wr), 16); + fwr = start_wrq_wr(&sc->sge.mgmtq, len16, &cookie); if (__predict_false(fwr == NULL)) rc = ENOMEM; else { @@ -419,7 +404,10 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t vnic_vld_mask = 0; bzero(fwr, sizeof(*fwr)); - fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); + if (sc->params.filter2_wr_support) + fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER2_WR)); + else + fwr->op_pkd = htobe32(V_FW_WR_OP(FW_FILTER_WR)); fwr->len16_pkd = htobe32(FW_LEN16(*fwr)); fwr->tid_to_iq = htobe32(V_FW_FILTER_WR_TID(f->tid) | @@ -484,6 +472,20 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t /* XXX: need to use SMT idx instead */ bcopy(f->fs.smac, fwr->sma, sizeof (fwr->sma)); } + if (sc->params.filter2_wr_support) { + fwr->filter_type_swapmac = + V_FW_FILTER2_WR_SWAPMAC(f->fs.swapmac); + fwr->natmode_to_ulp_type = + V_FW_FILTER2_WR_ULP_TYPE(f->fs.nat_mode ? + ULP_MODE_TCPDDP : ULP_MODE_NONE) | + V_FW_FILTER2_WR_NATFLAGCHECK(f->fs.nat_flag_chk) | + V_FW_FILTER2_WR_NATMODE(f->fs.nat_mode); + memcpy(fwr->newlip, f->fs.nat_dip, sizeof(fwr->newlip)); + memcpy(fwr->newfip, f->fs.nat_sip, sizeof(fwr->newfip)); + fwr->newlport = htobe16(f->fs.nat_dport); + fwr->newfport = htobe16(f->fs.nat_sport); + fwr->natseqcheck = htobe32(f->fs.nat_seq_chk); + } commit_wrq_wr(&sc->sge.mgmtq, fwr, &cookie); /* Wait for response. */ @@ -502,11 +504,88 @@ set_tcamfilter(struct adapter *sc, struct t4_filter *t return (rc); } +static int +hashfilter_ntuple(struct adapter *sc, const struct t4_filter_specification *fs, + uint64_t *ftuple) +{ + struct tp_params *tp = &sc->params.tp; + uint64_t fmask; + + *ftuple = fmask = 0; + + /* + * Initialize each of the fields which we care about which are present + * in the Compressed Filter Tuple. + */ + if (tp->vlan_shift >= 0 && fs->mask.vlan) { + *ftuple |= (F_FT_VLAN_VLD | fs->val.vlan) << tp->vlan_shift; + fmask |= M_FT_VLAN << tp->vlan_shift; + } + + if (tp->port_shift >= 0 && fs->mask.iport) { + *ftuple |= (uint64_t)fs->val.iport << tp->port_shift; + fmask |= M_FT_PORT << tp->port_shift; + } + + if (tp->protocol_shift >= 0 && fs->mask.proto) { + *ftuple |= (uint64_t)fs->val.proto << tp->protocol_shift; + fmask |= M_FT_PROTOCOL << tp->protocol_shift; + } + + if (tp->tos_shift >= 0 && fs->mask.tos) { + *ftuple |= (uint64_t)(fs->val.tos) << tp->tos_shift; + fmask |= M_FT_TOS << tp->tos_shift; + } + + if (tp->vnic_shift >= 0 && fs->mask.vnic) { + /* F_VNIC in ingress config was already validated. */ + if (tp->ingress_config & F_VNIC) + MPASS(fs->mask.pfvf_vld); + else + MPASS(fs->mask.ovlan_vld); + + *ftuple |= ((1ULL << 16) | fs->val.vnic) << tp->vnic_shift; + fmask |= M_FT_VNIC_ID << tp->vnic_shift; + } + + if (tp->macmatch_shift >= 0 && fs->mask.macidx) { + *ftuple |= (uint64_t)(fs->val.macidx) << tp->macmatch_shift; + fmask |= M_FT_MACMATCH << tp->macmatch_shift; + } + + if (tp->ethertype_shift >= 0 && fs->mask.ethtype) { + *ftuple |= (uint64_t)(fs->val.ethtype) << tp->ethertype_shift; + fmask |= M_FT_ETHERTYPE << tp->ethertype_shift; + } + + if (tp->matchtype_shift >= 0 && fs->mask.matchtype) { + *ftuple |= (uint64_t)(fs->val.matchtype) << tp->matchtype_shift; + fmask |= M_FT_MPSHITTYPE << tp->matchtype_shift; + } + + if (tp->frag_shift >= 0 && fs->mask.frag) { + *ftuple |= (uint64_t)(fs->val.frag) << tp->frag_shift; + fmask |= M_FT_FRAGMENTATION << tp->frag_shift; + } + + if (tp->fcoe_shift >= 0 && fs->mask.fcoe) { + *ftuple |= (uint64_t)(fs->val.fcoe) << tp->fcoe_shift; + fmask |= M_FT_FCOE << tp->fcoe_shift; + } + + /* A hashfilter must conform to the filterMask. */ + if (fmask != tp->hash_filter_mask) + return (EINVAL); + + return (0); +} + int set_filter(struct adapter *sc, struct t4_filter *t) { struct tid_info *ti = &sc->tids; struct l2t_entry *l2te; + uint64_t ftuple; int rc; /* @@ -516,8 +595,15 @@ set_filter(struct adapter *sc, struct t4_filter *t) if (t->fs.hash) { if (!is_hashfilter(sc) || ti->ntids == 0) return (ENOTSUP); + /* Hardware, not user, selects a tid for hashfilters. */ if (t->idx != (uint32_t)-1) - return (EINVAL); /* hw, not user picks the idx */ + return (EINVAL); + /* T5 can't count hashfilter hits. */ + if (is_t5(sc) && t->fs.hitcnts) + return (EINVAL); + rc = hashfilter_ntuple(sc, &t->fs, &ftuple); + if (rc != 0) + return (rc); } else { if (ti->nftids == 0) return (ENOTSUP); @@ -529,9 +615,10 @@ set_filter(struct adapter *sc, struct t4_filter *t) return (EINVAL); } - /* T4 doesn't support removing VLAN Tags for loop back filters. */ + /* T4 doesn't support VLAN tag removal or rewrite, swapmac, and NAT. */ if (is_t4(sc) && t->fs.action == FILTER_SWITCH && - (t->fs.newvlan == VLAN_REMOVE || t->fs.newvlan == VLAN_REWRITE)) + (t->fs.newvlan == VLAN_REMOVE || t->fs.newvlan == VLAN_REWRITE || + t->fs.swapmac || t->fs.nat_mode)) return (ENOTSUP); if (t->fs.action == FILTER_SWITCH && t->fs.eport >= sc->params.nports) @@ -616,7 +703,7 @@ done: } if (t->fs.hash) - return (set_hashfilter(sc, t, l2te)); + return (set_hashfilter(sc, t, ftuple, l2te)); else return (set_tcamfilter(sc, t, l2te)); @@ -924,65 +1011,9 @@ done: return (0); } -static uint64_t -hashfilter_ntuple(struct adapter *sc, const struct t4_filter_specification *fs) -{ - struct tp_params *tp = &sc->params.tp; - uint64_t ntuple = 0; - - /* - * Initialize each of the fields which we care about which are present - * in the Compressed Filter Tuple. - */ - if (tp->vlan_shift >= 0 && fs->mask.vlan) - ntuple |= (F_FT_VLAN_VLD | fs->val.vlan) << tp->vlan_shift; - - if (tp->port_shift >= 0 && fs->mask.iport) - ntuple |= (uint64_t)fs->val.iport << tp->port_shift; - - if (tp->protocol_shift >= 0) { - if (!fs->val.proto) - ntuple |= (uint64_t)IPPROTO_TCP << tp->protocol_shift; - else - ntuple |= (uint64_t)fs->val.proto << tp->protocol_shift; - } - - if (tp->tos_shift >= 0 && fs->mask.tos) - ntuple |= (uint64_t)(fs->val.tos) << tp->tos_shift; - - if (tp->vnic_shift >= 0) { -#ifdef notyet - if (tp->ingress_config & F_VNIC && fs->mask.pfvf_vld) - ntuple |= (uint64_t)((fs->val.pfvf_vld << 16) | - (fs->val.pf << 13) | - (fs->val.vf)) << tp->vnic_shift; - else -#endif - ntuple |= (uint64_t)((fs->val.ovlan_vld << 16) | - (fs->val.vnic)) << tp->vnic_shift; - } - - if (tp->macmatch_shift >= 0 && fs->mask.macidx) - ntuple |= (uint64_t)(fs->val.macidx) << tp->macmatch_shift; - - if (tp->ethertype_shift >= 0 && fs->mask.ethtype) - ntuple |= (uint64_t)(fs->val.ethtype) << tp->ethertype_shift; - - if (tp->matchtype_shift >= 0 && fs->mask.matchtype) - ntuple |= (uint64_t)(fs->val.matchtype) << tp->matchtype_shift; - - if (tp->frag_shift >= 0 && fs->mask.frag) - ntuple |= (uint64_t)(fs->val.frag) << tp->frag_shift; - - if (tp->fcoe_shift >= 0 && fs->mask.fcoe) - ntuple |= (uint64_t)(fs->val.fcoe) << tp->fcoe_shift; - - return (ntuple); -} - static void mk_act_open_req6(struct adapter *sc, struct filter_entry *f, int atid, - struct cpl_act_open_req6 *cpl) + uint64_t ftuple, struct cpl_act_open_req6 *cpl) { struct cpl_t5_act_open_req6 *cpl5 = (void *)cpl; struct cpl_t6_act_open_req6 *cpl6 = (void *)cpl; @@ -1011,18 +1042,22 @@ mk_act_open_req6(struct adapter *sc, struct filter_ent cpl->opt0 = htobe64(V_NAGLE(f->fs.newvlan == VLAN_REMOVE || f->fs.newvlan == VLAN_REWRITE) | V_DELACK(f->fs.hitcnts) | V_L2T_IDX(f->l2te ? f->l2te->idx : 0) | V_TX_CHAN(f->fs.eport) | - V_NO_CONG(f->fs.rpttid) | F_TCAM_BYPASS | F_NON_OFFLOAD); + V_NO_CONG(f->fs.rpttid) | + V_ULP_MODE(f->fs.nat_mode ? ULP_MODE_TCPDDP : ULP_MODE_NONE) | + F_TCAM_BYPASS | F_NON_OFFLOAD); - cpl6->params = htobe64(V_FILTER_TUPLE(hashfilter_ntuple(sc, &f->fs))); + cpl6->params = htobe64(V_FILTER_TUPLE(ftuple)); cpl6->opt2 = htobe32(F_RSS_QUEUE_VALID | V_RSS_QUEUE(f->fs.iq) | - F_T5_OPT_2_VALID | F_RX_CHANNEL | + V_TX_QUEUE(f->fs.nat_mode) | V_WND_SCALE_EN(f->fs.nat_flag_chk) | + V_RX_FC_DISABLE(f->fs.nat_seq_chk ? 1 : 0) | F_T5_OPT_2_VALID | + F_RX_CHANNEL | V_SACK_EN(f->fs.swapmac) | V_CONG_CNTRL((f->fs.action == FILTER_DROP) | (f->fs.dirsteer << 1)) | V_PACE(f->fs.maskhash | (f->fs.dirsteerhash << 1))); } static void mk_act_open_req(struct adapter *sc, struct filter_entry *f, int atid, - struct cpl_act_open_req *cpl) + uint64_t ftuple, struct cpl_act_open_req *cpl) { struct cpl_t5_act_open_req *cpl5 = (void *)cpl; struct cpl_t6_act_open_req *cpl6 = (void *)cpl; @@ -1051,11 +1086,15 @@ mk_act_open_req(struct adapter *sc, struct filter_entr cpl->opt0 = htobe64(V_NAGLE(f->fs.newvlan == VLAN_REMOVE || f->fs.newvlan == VLAN_REWRITE) | V_DELACK(f->fs.hitcnts) | V_L2T_IDX(f->l2te ? f->l2te->idx : 0) | V_TX_CHAN(f->fs.eport) | - V_NO_CONG(f->fs.rpttid) | F_TCAM_BYPASS | F_NON_OFFLOAD); + V_NO_CONG(f->fs.rpttid) | + V_ULP_MODE(f->fs.nat_mode ? ULP_MODE_TCPDDP : ULP_MODE_NONE) | + F_TCAM_BYPASS | F_NON_OFFLOAD); - cpl6->params = htobe64(V_FILTER_TUPLE(hashfilter_ntuple(sc, &f->fs))); + cpl6->params = htobe64(V_FILTER_TUPLE(ftuple)); cpl6->opt2 = htobe32(F_RSS_QUEUE_VALID | V_RSS_QUEUE(f->fs.iq) | - F_T5_OPT_2_VALID | F_RX_CHANNEL | + V_TX_QUEUE(f->fs.nat_mode) | V_WND_SCALE_EN(f->fs.nat_flag_chk) | + V_RX_FC_DISABLE(f->fs.nat_seq_chk ? 1 : 0) | F_T5_OPT_2_VALID | + F_RX_CHANNEL | V_SACK_EN(f->fs.swapmac) | V_CONG_CNTRL((f->fs.action == FILTER_DROP) | (f->fs.dirsteer << 1)) | V_PACE(f->fs.maskhash | (f->fs.dirsteerhash << 1))); } @@ -1086,7 +1125,8 @@ act_open_cpl_len16(struct adapter *sc, int isipv6) } static int -set_hashfilter(struct adapter *sc, struct t4_filter *t, struct l2t_entry *l2te) +set_hashfilter(struct adapter *sc, struct t4_filter *t, uint64_t ftuple, + struct l2t_entry *l2te) { void *wr; struct wrq_cookie cookie; @@ -1137,9 +1177,9 @@ set_hashfilter(struct adapter *sc, struct t4_filter *t goto done; } if (f->fs.type) - mk_act_open_req6(sc, f, atid, wr); + mk_act_open_req6(sc, f, atid, ftuple, wr); else - mk_act_open_req(sc, f, atid, wr); + mk_act_open_req(sc, f, atid, ftuple, wr); f->locked = 1; /* ithread mustn't free f if ioctl is still around. */ f->pending = 1; @@ -1383,13 +1423,82 @@ set_tcb_field(struct adapter *sc, u_int tid, uint16_t /* Set one of the t_flags bits in the TCB. */ static inline int -set_tcb_tflag(struct adapter *sc, int tid, u_int bit_pos, u_int val) +set_tcb_tflag(struct adapter *sc, int tid, u_int bit_pos, u_int val, + u_int no_reply) { return (set_tcb_field(sc, tid, W_TCB_T_FLAGS, 1ULL << bit_pos, - (uint64_t)val << bit_pos, 1)); + (uint64_t)val << bit_pos, no_reply)); } +#define WORD_MASK 0xffffffff +static void +set_nat_params(struct adapter *sc, struct filter_entry *f, const bool dip, + const bool sip, const bool dp, const bool sp) +{ + + if (dip) { + if (f->fs.type) { + set_tcb_field(sc, f->tid, W_TCB_SND_UNA_RAW, WORD_MASK, + f->fs.nat_dip[15] | f->fs.nat_dip[14] << 8 | + f->fs.nat_dip[13] << 16 | f->fs.nat_dip[12] << 24, 1); + + set_tcb_field(sc, f->tid, + W_TCB_SND_UNA_RAW + 1, WORD_MASK, + f->fs.nat_dip[11] | f->fs.nat_dip[10] << 8 | + f->fs.nat_dip[9] << 16 | f->fs.nat_dip[8] << 24, 1); + + set_tcb_field(sc, f->tid, + W_TCB_SND_UNA_RAW + 2, WORD_MASK, + f->fs.nat_dip[7] | f->fs.nat_dip[6] << 8 | + f->fs.nat_dip[5] << 16 | f->fs.nat_dip[4] << 24, 1); + + set_tcb_field(sc, f->tid, + W_TCB_SND_UNA_RAW + 3, WORD_MASK, + f->fs.nat_dip[3] | f->fs.nat_dip[2] << 8 | + f->fs.nat_dip[1] << 16 | f->fs.nat_dip[0] << 24, 1); + } else { + set_tcb_field(sc, f->tid, + W_TCB_RX_FRAG3_LEN_RAW, WORD_MASK, + f->fs.nat_dip[3] | f->fs.nat_dip[2] << 8 | + f->fs.nat_dip[1] << 16 | f->fs.nat_dip[0] << 24, 1); + } + } + + if (sip) { + if (f->fs.type) { + set_tcb_field(sc, f->tid, + W_TCB_RX_FRAG2_PTR_RAW, WORD_MASK, + f->fs.nat_sip[15] | f->fs.nat_sip[14] << 8 | + f->fs.nat_sip[13] << 16 | f->fs.nat_sip[12] << 24, 1); + + set_tcb_field(sc, f->tid, + W_TCB_RX_FRAG2_PTR_RAW + 1, WORD_MASK, + f->fs.nat_sip[11] | f->fs.nat_sip[10] << 8 | + f->fs.nat_sip[9] << 16 | f->fs.nat_sip[8] << 24, 1); + + set_tcb_field(sc, f->tid, + W_TCB_RX_FRAG2_PTR_RAW + 2, WORD_MASK, + f->fs.nat_sip[7] | f->fs.nat_sip[6] << 8 | + f->fs.nat_sip[5] << 16 | f->fs.nat_sip[4] << 24, 1); + + set_tcb_field(sc, f->tid, + W_TCB_RX_FRAG2_PTR_RAW + 3, WORD_MASK, + f->fs.nat_sip[3] | f->fs.nat_sip[2] << 8 | + f->fs.nat_sip[1] << 16 | f->fs.nat_sip[0] << 24, 1); + + } else { + set_tcb_field(sc, f->tid, + W_TCB_RX_FRAG3_START_IDX_OFFSET_RAW, WORD_MASK, + f->fs.nat_sip[3] | f->fs.nat_sip[2] << 8 | + f->fs.nat_sip[1] << 16 | f->fs.nat_sip[0] << 24, 1); + } + } + + set_tcb_field(sc, f->tid, W_TCB_PDU_HDR_LEN, WORD_MASK, + (dp ? f->fs.nat_dport : 0) | (sp ? f->fs.nat_sport << 16 : 0), 1); +} + /* * Returns EINPROGRESS to indicate that at least one TCB update was sent and the * last of the series of updates requested a reply. The reply informs the @@ -1406,12 +1515,83 @@ configure_hashfilter_tcb(struct adapter *sc, struct fi MPASS(f->valid == 0); if (f->fs.newdmac) { - set_tcb_tflag(sc, f->tid, S_TF_CCTRL_ECE, 1); + set_tcb_tflag(sc, f->tid, S_TF_CCTRL_ECE, 1, 1); updated++; } if (f->fs.newvlan == VLAN_INSERT || f->fs.newvlan == VLAN_REWRITE) { - set_tcb_tflag(sc, f->tid, S_TF_CCTRL_RFR, 1); + set_tcb_tflag(sc, f->tid, S_TF_CCTRL_RFR, 1, 1); + updated++; + } + + if (f->fs.newsmac) { + set_tcb_tflag(sc, f->tid, S_TF_CCTRL_CWR, 1, 1); + set_tcb_field(sc, f->tid, W_TCB_SMAC_SEL, + V_TCB_SMAC_SEL(M_TCB_SMAC_SEL), V_TCB_SMAC_SEL(f->smtidx), + 1); + updated++; + } + + switch(f->fs.nat_mode) { + case NAT_MODE_NONE: + break; + case NAT_MODE_DIP: + set_nat_params(sc, f, true, false, false, false); + updated++; + break; + case NAT_MODE_DIP_DP: + set_nat_params(sc, f, true, false, true, false); + updated++; + break; + case NAT_MODE_DIP_DP_SIP: + set_nat_params(sc, f, true, true, true, false); + updated++; + break; + case NAT_MODE_DIP_DP_SP: + set_nat_params(sc, f, true, false, true, true); + updated++; + break; + case NAT_MODE_SIP_SP: + set_nat_params(sc, f, false, true, false, true); + updated++; + break; + case NAT_MODE_DIP_SIP_SP: + set_nat_params(sc, f, true, true, false, true); + updated++; + break; + case NAT_MODE_ALL: + set_nat_params(sc, f, true, true, true, true); + updated++; + break; + default: + MPASS(0); /* should have been validated earlier */ + break; + + } + + if (f->fs.nat_seq_chk) { + set_tcb_field(sc, f->tid, W_TCB_RCV_NXT, + V_TCB_RCV_NXT(M_TCB_RCV_NXT), + V_TCB_RCV_NXT(f->fs.nat_seq_chk), 1); + updated++; + } + + if (is_t5(sc) && f->fs.action == FILTER_DROP) { + /* + * Migrating = 1, Non-offload = 0 to get a T5 hashfilter to drop. + */ + set_tcb_field(sc, f->tid, W_TCB_T_FLAGS, V_TF_NON_OFFLOAD(1) | + V_TF_MIGRATING(1), V_TF_MIGRATING(1), 1); + updated++; + } + + /* + * Enable switching after all secondary resources (L2T entry, SMT entry, + * etc.) are setup so that any switched packet will use correct + * values. + */ + if (f->fs.action == FILTER_SWITCH) { + set_tcb_tflag(sc, f->tid, S_TF_CCTRL_ECN, 1, 1); updated++; } Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Tue May 15 02:26:50 2018 (r333619) +++ head/sys/dev/cxgbe/tom/t4_tom.c Tue May 15 04:24:38 2018 (r333620) @@ -656,7 +656,7 @@ select_ntuple(struct vi_info *vi, struct l2t_entry *e) if (tp->protocol_shift >= 0) ntuple |= (uint64_t)IPPROTO_TCP << tp->protocol_shift; - if (tp->vnic_shift >= 0) { + if (tp->vnic_shift >= 0 && tp->ingress_config & F_VNIC) { uint32_t vf = G_FW_VIID_VIN(viid); uint32_t pf = G_FW_VIID_PFN(viid); uint32_t vld = G_FW_VIID_VIVLD(viid); From owner-svn-src-all@freebsd.org Tue May 15 04:31:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D80ED99F2; Tue, 15 May 2018 04:31:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E6717603E; Tue, 15 May 2018 04:31:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66F3726266; Tue, 15 May 2018 04:31:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4F4VCYR088849; Tue, 15 May 2018 04:31:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F4VC11088847; Tue, 15 May 2018 04:31:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805150431.w4F4VC11088847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 15 May 2018 04:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333621 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 333621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 04:31:13 -0000 Author: np Date: Tue May 15 04:31:11 2018 New Revision: 333621 URL: https://svnweb.freebsd.org/changeset/base/333621 Log: cxgbetool(8): Provide user interface for hashfilters, hardware NAT, and other filtering related features that were recently added to the driver. Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.8 head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.8 ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.8 Tue May 15 04:24:38 2018 (r333620) +++ head/usr.sbin/cxgbetool/cxgbetool.8 Tue May 15 04:31:11 2018 (r333621) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2015, Chelsio Inc +.\" Copyright (c) 2015, 2018 Chelsio Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 13, 2018 +.Dd May 14, 2018 .Dt CXGBETOOL 8 .Os .Sh NAME @@ -48,10 +48,20 @@ .It .Nm Ar nexus Cm context Bro Cm ingress | egress | fl | cong Brc Ar cntxt_id .It -.Nm Ar nexus Cm filter mode Op Ar match-criteria ... +.Nm Ar nexus Cm hashfilter mode .It -.Nm Ar nexus Cm filter Ar idx Bro Ar filter-specification | Cm delete Brc +.Nm Ar nexus Cm hashfilter Ar filter-specification .It +.Nm Ar nexus Cm hashfilter Ar idx Cm delete +.It +.Nm Ar nexus Cm hashfilter list +.It +.Nm Ar nexus Cm filter mode +.It +.Nm Ar nexus Cm filter Ar idx Ar filter-specification +.It +.Nm Ar nexus Cm filter Ar idx Cm delete +.It .Nm Ar nexus Cm filter list .It .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len @@ -141,44 +151,51 @@ context id of a freelist manager. The FLM context id is displayed in the egress context dump of a freelist as FLMcontextID. .El -.It Cm filter mode Op Ar match-criteria ... -Display or set the nexus's filter mode. -.Ar match-criteria -is a whitespace separated list of criteria from the table below. -Each criteria has an associated budget which is also listed in the table. -The total budget allowed is 36 and attempts to set a filter mode that -exceeds this will be rejected. -Every filter must conform to the filter mode -- multiple match criteria -per filter are allowed but only from among those in the current setting -of the filter mode. -The filter mode can only be changed when there are no existing filters. -Its default value is -.Cm ipv4 ipv6 sip dip sport dport matchtype proto vlan iport fcoe .Pp +.Bl -item -compact +.It +.Cm hashfilter mode +.It +.Cm filter mode +.El +Display a list of match-criteria available for use in filter rules. +A full list of match-criteria known to the chip is in the table below but not +all can be used together and the firmware sets up the available parameters based +on "filterMode" in the configuration file. +Every filter must conform to the filter mode -- multiple match criteria per +filter are allowed but only from among those in the current setting of the +filter mode. +The filter mode for hash filters is a subset of that for normal TCAM filters and +depends on the "filterMask" setting in the firmware configuration file. +Hash filters do not support masked matches and an exact value for every +parameter in the output of "hashfilter mode" (except ipv4/ipv6) must be provided +when creating a hash filter. +.Pp (Note that .Ar mask defaults to all 1s when not provided explicitly. +Hash filters do not support masked matches. Also note that many of the items being matched are discrete numeric values rather than bit fields and should be masked with caution.) .TS center expand; -cb cb cb cbw(40m) -cb c l l. -Criteria Budget Usage Matches if ... +cb cb cbw(40m) +cb l l. +Criteria Usage Matches if ... _ -ipv4 0 T{ +ipv4 T{ .Cm type ipv4 T} T{ incoming packet is an IPv4 datagram. T} _ -ipv6 0 T{ +ipv6 T{ .Cm type ipv6 T} T{ incoming packet is an IPv6 datagram. T} _ -sip 0 T{ +sip T{ .Cm sip Ar addr Ns Op / Ns Ar mask T} T{ bitwise and of the source address in an incoming IP datagram with @@ -189,7 +206,7 @@ equals can be an IPv4 or IPv6 address. T} _ -dip 0 T{ +dip T{ .Cm dip Ar addr Ns Op / Ns Ar mask T} T{ bitwise and of the destination address in an incoming IP datagram with @@ -200,7 +217,7 @@ equals can be an IPv4 or IPv6 address. T} _ -sport 0 T{ +sport T{ .Cm sport Ar port Ns Op : Ns Ar mask T} T{ bitwise and of the source port in an incoming TCP or UDP datagram with @@ -209,7 +226,7 @@ equals .Ar port Ns . T} _ -dport 0 T{ +dport T{ .Cm dport Ar port Ns Op : Ns Ar mask T} T{ bitwise and of the destination port in an incoming TCP or UDP datagram with @@ -218,13 +235,13 @@ equals .Ar port Ns . T} _ -fcoe 1 T{ +fcoe T{ .Cm fcoe Brq 0 | 1 T} T{ incoming frame is Fibre Channel over Ethernet(1) or not(0). T} _ -iport 3 T{ +iport T{ .Cm iport Ar val Ns Op : Ns Ar mask T} T{ bitwise and of the ingress port with @@ -239,7 +256,7 @@ Note that ingress port is not a bit field so it is not to match an arbitrary subset of ingress ports with a single filter rule. T} _ -ovlan 17 T{ +ovlan T{ .Cm ovlan Ar tag Ns Op : Ns Ar mask T} T{ bitwise and of the 16-bit outer VLAN tag of an incoming frame with @@ -248,7 +265,7 @@ equals .Ar tag Ns . T} _ -vlan 17 T{ +vlan T{ .Cm vlan Ar tag Ns Op : Ns Ar mask T} T{ bitwise and of the 16-bit VLAN tag of an incoming QinQ frame with @@ -258,7 +275,7 @@ equals The inner VLAN tag is used if the incoming frame is QinQ. T} _ -tos 8 T{ +tos T{ .Cm tos Ar val Ns Op : Ns Ar mask T} T{ bitwise and of the 8-bit IP Type of Service/IPv6 Traffic Class in an @@ -268,7 +285,7 @@ equals .Ar val Ns . T} _ -proto 8 T{ +proto T{ .Cm proto Ar ipproto Ns Op : Ns Ar mask T} T{ bitwise and of the 8-bit IP protocol in an incoming packet with @@ -277,7 +294,7 @@ equals .Ar ipproto Ns . T} _ -ethtype 16 T{ +ethtype T{ .Cm ethtype Ar type Ns Op : Ns Ar mask T} T{ bitwise and of the 16-bit Ethernet type field of an incoming frame with @@ -286,7 +303,7 @@ equals .Ar type Ns . T} _ -macidx 9 T{ +macidx T{ .Cm macidx Ar idx Ns Op : Ns Ar mask T} T{ bitwise and of the MAC Address Match Index of an incoming frame with @@ -299,7 +316,7 @@ MPS hash. See for more information. T} _ -matchtype 3 T{ +matchtype T{ .Cm matchtype Ar type Ns Op : Ns Ar mask T} T{ bitwise and of the Match Type of an incoming frame with @@ -345,19 +362,138 @@ Not documented. Do not use. .El T} _ -frag 1 T{ +frag T{ .Cm frag Brq 0 | 1 T} T{ incoming frame is part of a fragmented IP datagram(1) or not(0). T} .TE -.It Cm filter Ar idx Ar filter-specification -Program a filter at the index specified by -.Ar idx Ns . +.Pp +.Bl -item -compact +.It +.Cm hashfilter Ar filter-specification +.It +.Cm filter Ar idx Ar filter-specification +.El +Program a filter. +.Pp +TCAM filters: The number of available filters is in +dev...nfilters. +.Ar idx +must be an unused index between 0 and nfilters - 1. +IPv6 filters consume 4 consecutive entries on T4/T5 and and 2 on T6 and +.Ar idx +must be aligned to 4 or 2 in this case. +.Pp +Hash filters: These reside in the card's memory instead of its TCAM and are +enabled with a special configuration file that is selected with +.Cm hw.cxgbe.config_file="hashfilter" +in loader.conf. +There are at least half a million filters available with the sample config +shipped with the driver. +Note that the hardware selects the index for a hashfilter and this index is +displayed when the filter is created. +Hash and TCAM filters can be used together. +.Pp .Ar filter-specification -consists of one or more matches to try against an incoming frame and an -action to perform when all matches succeed. -.It Cm filter Ar idx Cm delete +consists of one or more matches (see Usage in the table above) to try against an +incoming frame, an action to perform when all matches succeed, and some +additional operational parameters. +Hashfilters require an exact value for the 5-tuple (sip, dip, sport, dport, +proto) and for any other match-criteria listed in "hashfilter mode". +Possible filter actions are +.Cm drop Ns , +.Cm pass Ns , or +.Cm switch Ns . +.Pp +.Bl -tag -width nat_dport -offset indent -compact +Operational parameters that can be used with all filters: +.It Cm hitcnts +Count filter hits: 0 or 1 (default). +.It Cm prio +Filter has priority over active and server regions of TCAM: 0 (default) or 1. +.El +.Pp +.Bl -tag -width nat_dport -offset indent -compact +Operational parameters that can be used with filters with +.Cm action pass Ns : +.It Cm queue +Rx queue index to which to deliver the packet. By default, packets that hit a +filter with action pass are delivered based on their RSS hash as usual. Use +this to steer them to a particular queue. +.It Cm rpttid +Report the filter tid instead of the RSS hash in the rx descriptor. +0 (default) or 1. +.It Cm tcbhash +Select TCB hash information in rx descriptor. +0 (default) or 1 +.El +.Pp +.Bl -tag -width nat_dport -offset indent -compact +Operational parameters that can be used with filters with +.Cm action switch Ns : +.It Cm eport +Egress port number on which to send the packet matching the filter. +0 to dev...nports - 1. +.It Cm dmac +Replace packet destination MAC address with the one provided before switching +it out of eport. +.It Cm smac +Replace packet source MAC address with the one provided before switching it +out of eport. +.It Cm swapmac +Swap packet source and destination MAC addresses before switching it out of +eport. +.It Cm vlan +Insert, remove, or rewrite the VLAN tag before switching the packet out of +eport. +.Cm vlan=none +removes the tag, +.Cm vlan= Ns Ar tag +replaces the existing tag with the one provided, and +.Cm vlan=+ Ns Ar tag +inserts the given tag into the frame. +.It Cm nat +Specify the desired NAT mode. Valid NAT modes values are: +.Bl -tag -width dip-dp-sip -compact +.It Cm dip +Perform NAT on destination IP. +.It Cm dip-dp +Perform NAT on destination IP, destination port. +.It Cm dip-dp-sip +Perform NAT on destination IP, destination port, source IP. +.It Cm dip-dp-sp +Perform NAT on destination IP, destination port, source port. +.It Cm sip-sp +Perform NAT on source IP, source port. +.It Cm dip-sip-sp +Perform NAT on destination IP, source IP, source port. +.It Cm all +Perform NAT on all 4-tuple fields. +.El +.It Cm natflag +Perform NAT only on segments which do not have TCP FIN or RST set. +.It Cm natseq +Perform NAT only if incoming segment's sequence number + payload length is less +than this supplied value. +.It Cm nat_dip +Perform NAT using this destination IP. +.It Cm nat_sip +Perform NAT using this source IP. +.It Cm nat_dport +Perform NAT using this destination port. +.It Cm nat_sport +Perform NAT using this source port. +Perform NAT only if incoming segment's sequence number + payload length is less +than this supplied value. +.El +.Pp +.Bl -item -compact +.It +.Cm hashfilter Ar idx Cm delete +.It +.Cm filter Ar idx Cm delete +.El Delete filter that is at the given index. .It Cm filter Cm list List all filters programmed into the hardware. Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Tue May 15 04:24:38 2018 (r333620) +++ head/usr.sbin/cxgbetool/cxgbetool.c Tue May 15 04:31:11 2018 (r333621) @@ -97,6 +97,10 @@ usage(FILE *fp) "\tfilter delete|clear delete a filter\n" "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" + "\thashfilter [ ] ... set a hashfilter\n" + "\thashfilter delete|clear delete a hashfilter\n" + "\thashfilter list list all hashfilters\n" + "\thashfilter mode get global hashfilter mode\n" "\ti2c [] read from i2c device\n" "\tloadboot [pf|offset ] install boot image\n" "\tloadboot clear [pf|offset ] remove boot image\n" @@ -600,7 +604,7 @@ do_show_info_header(uint32_t mode) */ static int parse_val_mask(const char *param, const char *args[], uint32_t *val, - uint32_t *mask) + uint32_t *mask, int hashfilter) { char *p; @@ -615,9 +619,18 @@ parse_val_mask(const char *param, const char *args[], } if (p[0] == ':' && p[1] != 0) { + if (hashfilter) { + warnx("param %s: mask not allowed for " + "hashfilter or nat params", param); + return (EINVAL); + } *mask = strtoul(p+1, &p, 0); if (p[0] == 0) return (0); + } else { + warnx("param %s: mask not allowed for hashfilter", + param); + return (EINVAL); } } @@ -651,7 +664,7 @@ parse_val_mask(const char *param, const char *args[], */ static int parse_ipaddr(const char *param, const char *args[], int *afp, uint8_t addr[], - uint8_t mask[]) + uint8_t mask[], int maskless) { const char *colon, *afn; char *slash; @@ -708,6 +721,11 @@ parse_ipaddr(const char *param, const char *args[], in char *p; unsigned int prefix = strtoul(slash + 1, &p, 10); + if (maskless) { + warnx("mask cannot be provided for maskless specification"); + return (EINVAL); + } + if (p == slash + 1) { warnx("missing address prefix for %s", param); return (EINVAL); @@ -725,13 +743,15 @@ parse_ipaddr(const char *param, const char *args[], in masksize = prefix; } - /* - * Fill in mask. - */ - for (m = mask; masksize >= 8; m++, masksize -= 8) - *m = ~0; - if (masksize) - *m = ~0 << (8 - masksize); + if (mask != NULL) { + /* + * Fill in mask. + */ + for (m = mask; masksize >= 8; m++, masksize -= 8) + *m = ~0; + if (masksize) + *m = ~0 << (8 - masksize); + } return (0); } @@ -917,7 +937,7 @@ do_show_one_filter_info(struct t4_filter *t, uint32_t } static int -show_filters(void) +show_filters(int hash) { uint32_t mode = 0, header = 0; struct t4_filter t; @@ -929,6 +949,7 @@ show_filters(void) return (rc); t.idx = 0; + t.fs.hash = hash; for (t.idx = 0; ; t.idx++) { rc = doit(CHELSIO_T4_GET_FILTER, &t); if (rc != 0 || t.idx == 0xffffffff) @@ -945,9 +966,9 @@ show_filters(void) } static int -get_filter_mode(void) +get_filter_mode(int hashfilter) { - uint32_t mode = 0; + uint32_t mode = hashfilter; int rc; rc = doit(CHELSIO_T4_GET_FILTER_MODE, &mode); @@ -1066,19 +1087,20 @@ set_filter_mode(int argc, const char *argv[]) } static int -del_filter(uint32_t idx) +del_filter(uint32_t idx, int hashfilter) { struct t4_filter t; + t.fs.hash = hashfilter; t.idx = idx; return doit(CHELSIO_T4_DEL_FILTER, &t); } static int -set_filter(uint32_t idx, int argc, const char *argv[]) +set_filter(uint32_t idx, int argc, const char *argv[], int hash) { - int af = AF_UNSPEC, start_arg = 0; + int rc, af = AF_UNSPEC, start_arg = 0; struct t4_filter t; if (argc < 2) { @@ -1088,6 +1110,7 @@ set_filter(uint32_t idx, int argc, const char *argv[]) bzero(&t, sizeof (t)); t.idx = idx; t.fs.hitcnts = 1; + t.fs.hash = hash; for (start_arg = 0; start_arg + 2 <= argc; start_arg += 2) { const char **args = &argv[start_arg]; @@ -1111,66 +1134,74 @@ set_filter(uint32_t idx, int argc, const char *argv[]) return (EINVAL); } af = newaf; - } else if (!parse_val_mask("fcoe", args, &val, &mask)) { + } else if (!parse_val_mask("fcoe", args, &val, &mask, hash)) { t.fs.val.fcoe = val; t.fs.mask.fcoe = mask; - } else if (!parse_val_mask("iport", args, &val, &mask)) { + } else if (!parse_val_mask("iport", args, &val, &mask, hash)) { t.fs.val.iport = val; t.fs.mask.iport = mask; - } else if (!parse_val_mask("ovlan", args, &val, &mask)) { + } else if (!parse_val_mask("ovlan", args, &val, &mask, hash)) { t.fs.val.vnic = val; t.fs.mask.vnic = mask; t.fs.val.ovlan_vld = 1; t.fs.mask.ovlan_vld = 1; - } else if (!parse_val_mask("ivlan", args, &val, &mask)) { + } else if (!parse_val_mask("ivlan", args, &val, &mask, hash)) { t.fs.val.vlan = val; t.fs.mask.vlan = mask; t.fs.val.vlan_vld = 1; t.fs.mask.vlan_vld = 1; - } else if (!parse_val_mask("pf", args, &val, &mask)) { + } else if (!parse_val_mask("pf", args, &val, &mask, hash)) { t.fs.val.vnic &= 0x1fff; t.fs.val.vnic |= (val & 0x7) << 13; t.fs.mask.vnic &= 0x1fff; t.fs.mask.vnic |= (mask & 0x7) << 13; t.fs.val.pfvf_vld = 1; t.fs.mask.pfvf_vld = 1; - } else if (!parse_val_mask("vf", args, &val, &mask)) { + } else if (!parse_val_mask("vf", args, &val, &mask, hash)) { t.fs.val.vnic &= 0xe000; t.fs.val.vnic |= val & 0x1fff; t.fs.mask.vnic &= 0xe000; t.fs.mask.vnic |= mask & 0x1fff; t.fs.val.pfvf_vld = 1; t.fs.mask.pfvf_vld = 1; - } else if (!parse_val_mask("tos", args, &val, &mask)) { + } else if (!parse_val_mask("tos", args, &val, &mask, hash)) { t.fs.val.tos = val; t.fs.mask.tos = mask; - } else if (!parse_val_mask("proto", args, &val, &mask)) { + } else if (!parse_val_mask("proto", args, &val, &mask, hash)) { t.fs.val.proto = val; t.fs.mask.proto = mask; - } else if (!parse_val_mask("ethtype", args, &val, &mask)) { + } else if (!parse_val_mask("ethtype", args, &val, &mask, hash)) { t.fs.val.ethtype = val; t.fs.mask.ethtype = mask; - } else if (!parse_val_mask("macidx", args, &val, &mask)) { + } else if (!parse_val_mask("macidx", args, &val, &mask, hash)) { t.fs.val.macidx = val; t.fs.mask.macidx = mask; - } else if (!parse_val_mask("matchtype", args, &val, &mask)) { + } else if (!parse_val_mask("matchtype", args, &val, &mask, hash)) { t.fs.val.matchtype = val; t.fs.mask.matchtype = mask; - } else if (!parse_val_mask("frag", args, &val, &mask)) { + } else if (!parse_val_mask("frag", args, &val, &mask, hash)) { t.fs.val.frag = val; t.fs.mask.frag = mask; - } else if (!parse_val_mask("dport", args, &val, &mask)) { + } else if (!parse_val_mask("dport", args, &val, &mask, hash)) { t.fs.val.dport = val; t.fs.mask.dport = mask; - } else if (!parse_val_mask("sport", args, &val, &mask)) { + } else if (!parse_val_mask("sport", args, &val, &mask, hash)) { t.fs.val.sport = val; t.fs.mask.sport = mask; } else if (!parse_ipaddr("dip", args, &af, t.fs.val.dip, - t.fs.mask.dip)) { + t.fs.mask.dip, hash)) { /* nada */; } else if (!parse_ipaddr("sip", args, &af, t.fs.val.sip, - t.fs.mask.sip)) { + t.fs.mask.sip, hash)) { /* nada */; + } else if (!parse_ipaddr("nat_dip", args, &af, t.fs.nat_dip, NULL, 1)) { + /*nada*/; + } else if (!parse_ipaddr("nat_sip", args, &af, t.fs.nat_sip, NULL, 1)) { + /*nada*/ + } else if (!parse_val_mask("nat_dport", args, &val, &mask, 1)) { + t.fs.nat_dport = val; + } else if (!parse_val_mask("nat_sport", args, &val, &mask, 1)) { + t.fs.nat_sport = val; } else if (!strcmp(argv[start_arg], "action")) { if (!strcmp(argv[start_arg + 1], "pass")) t.fs.action = FILTER_PASS; @@ -1198,6 +1229,33 @@ set_filter(uint32_t idx, int argc, const char *argv[]) t.fs.dirsteerhash = 1; } else if (!parse_val("eport", args, &val)) { t.fs.eport = val; + } else if (!parse_val("swapmac", args, &val)) { + t.fs.swapmac = 1; + } else if (!strcmp(argv[start_arg], "nat")) { + if (!strcmp(argv[start_arg + 1], "dip")) + t.fs.nat_mode = NAT_MODE_DIP; + else if (!strcmp(argv[start_arg + 1], "dip-dp")) + t.fs.nat_mode = NAT_MODE_DIP_DP; + else if (!strcmp(argv[start_arg + 1], "dip-dp-sip")) + t.fs.nat_mode = NAT_MODE_DIP_DP_SIP; + else if (!strcmp(argv[start_arg + 1], "dip-dp-sp")) + t.fs.nat_mode = NAT_MODE_DIP_DP_SP; + else if (!strcmp(argv[start_arg + 1], "sip-sp")) + t.fs.nat_mode = NAT_MODE_SIP_SP; + else if (!strcmp(argv[start_arg + 1], "dip-sip-sp")) + t.fs.nat_mode = NAT_MODE_DIP_SIP_SP; + else if (!strcmp(argv[start_arg + 1], "all")) + t.fs.nat_mode = NAT_MODE_ALL; + else { + warnx("unknown nat type \"%s\"; known types are dip, " + "dip-dp, dip-dp-sip, dip-dp-sp, sip-sp, " + "dip-sip-sp, and all", argv[start_arg + 1]); + return (EINVAL); + } + } else if (!parse_val("natseq", args, &val)) { + t.fs.nat_seq_chk = val; + } else if (!parse_val("natflag", args, &val)) { + t.fs.nat_flag_chk = 1; } else if (!strcmp(argv[start_arg], "dmac")) { struct ether_addr *daddr; @@ -1229,7 +1287,7 @@ set_filter(uint32_t idx, int argc, const char *argv[]) } else if (argv[start_arg + 1][0] == '+') { t.fs.newvlan = VLAN_INSERT; } else if (isdigit(argv[start_arg + 1][0]) && - !parse_val_mask("vlan", args, &val, &mask)) { + !parse_val_mask("vlan", args, &val, &mask, hash)) { t.fs.val.vlan = val; t.fs.mask.vlan = mask; t.fs.val.vlan_vld = 1; @@ -1265,11 +1323,17 @@ set_filter(uint32_t idx, int argc, const char *argv[]) * Check basic sanity of option combinations. */ if (t.fs.action != FILTER_SWITCH && - (t.fs.eport || t.fs.newdmac || t.fs.newsmac || t.fs.newvlan)) { - warnx("prio, port dmac, smac and vlan only make sense with" + (t.fs.eport || t.fs.newdmac || t.fs.newsmac || t.fs.newvlan || + t.fs.swapmac || t.fs.nat_mode)) { + warnx("port, dmac, smac, vlan, and nat only make sense with" " \"action switch\""); return (EINVAL); } + if (!t.fs.nat_mode && (t.fs.nat_seq_chk || t.fs.nat_flag_chk || + *t.fs.nat_dip || *t.fs.nat_sip || t.fs.nat_dport || t.fs.nat_sport)) { + warnx("nat params only make sense with valid nat mode"); + return (EINVAL); + } if (t.fs.action != FILTER_PASS && (t.fs.rpttid || t.fs.dirsteer || t.fs.maskhash)) { warnx("rpttid, queue and tcbhash don't make sense with" @@ -1282,18 +1346,21 @@ set_filter(uint32_t idx, int argc, const char *argv[]) } t.fs.type = (af == AF_INET6 ? 1 : 0); /* default IPv4 */ - return doit(CHELSIO_T4_SET_FILTER, &t); + rc = doit(CHELSIO_T4_SET_FILTER, &t); + if (hash && rc == 0) + printf("%d\n", t.idx); + return (rc); } static int -filter_cmd(int argc, const char *argv[]) +filter_cmd(int argc, const char *argv[], int hashfilter) { long long val; uint32_t idx; char *s; if (argc == 0) { - warnx("filter: no arguments."); + warnx("%sfilter: no arguments.", hashfilter ? "hash" : ""); return (EINVAL); }; @@ -1302,20 +1369,29 @@ filter_cmd(int argc, const char *argv[]) if (argc != 1) warnx("trailing arguments after \"list\" ignored."); - return show_filters(); + return show_filters(hashfilter); } /* mode */ if (argc == 1 && strcmp(argv[0], "mode") == 0) - return get_filter_mode(); + return get_filter_mode(hashfilter); /* mode */ - if (strcmp(argv[0], "mode") == 0) + if (!hashfilter && strcmp(argv[0], "mode") == 0) return set_filter_mode(argc - 1, argv + 1); /* ... */ s = str_to_number(argv[0], NULL, &val); - if (*s || val > 0xffffffffU) { + if (*s || val < 0 || val > 0xffffffffU) { + if (hashfilter) { + /* + * No numeric index means this must be a request to + * create a new hashfilter and we are already at the + * paramter/value list. + */ + idx = (uint32_t) -1; + goto setf; + } warnx("\"%s\" is neither an index nor a filter subcommand.", argv[0]); return (EINVAL); @@ -1325,11 +1401,16 @@ filter_cmd(int argc, const char *argv[]) /* delete|clear */ if (argc == 2 && (strcmp(argv[1], "delete") == 0 || strcmp(argv[1], "clear") == 0)) { - return del_filter(idx); + return del_filter(idx, hashfilter); } - /* [ ] ... */ - return set_filter(idx, argc - 1, argv + 1); + /* skip */ + argc--; + argv++; + +setf: + /* [ ] ... */ + return set_filter(idx, argc, argv, hashfilter); } /* @@ -3356,7 +3437,7 @@ run_cmd(int argc, const char *argv[]) else if (!strcmp(cmd, "regdump")) rc = dump_regs(argc, argv); else if (!strcmp(cmd, "filter")) - rc = filter_cmd(argc, argv); + rc = filter_cmd(argc, argv, 0); else if (!strcmp(cmd, "context")) rc = get_sge_context(argc, argv); else if (!strcmp(cmd, "loadfw")) @@ -3387,6 +3468,8 @@ run_cmd(int argc, const char *argv[]) rc = dumpstate(argc, argv); else if (!strcmp(cmd, "policy")) rc = load_offload_policy(argc, argv); + else if (!strcmp(cmd, "hashfilter")) + rc = filter_cmd(argc, argv, 1); else { rc = EINVAL; warnx("invalid command \"%s\"", cmd); From owner-svn-src-all@freebsd.org Tue May 15 05:55:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED01EDF555; Tue, 15 May 2018 05:55:30 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20FEE876E2; Tue, 15 May 2018 05:55:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 023E1270F7; Tue, 15 May 2018 05:55:30 +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 w4F5tTqr033571; Tue, 15 May 2018 05:55:29 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F5tTaU033570; Tue, 15 May 2018 05:55:29 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201805150555.w4F5tTaU033570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 15 May 2018 05:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333622 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 333622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 05:55:30 -0000 Author: araujo Date: Tue May 15 05:55:29 2018 New Revision: 333622 URL: https://svnweb.freebsd.org/changeset/base/333622 Log: vq_getchain() can return -1 if some descriptor(s) are invalid and prints a diagnostic message. So we do a sanity checking on the return value of vq_getchain(). Spotted by: gcc49 Reviewed by: avg MFC after: 4 weeks Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15388 Modified: head/usr.sbin/bhyve/pci_virtio_console.c Modified: head/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_console.c Tue May 15 04:31:11 2018 (r333621) +++ head/usr.sbin/bhyve/pci_virtio_console.c Tue May 15 05:55:29 2018 (r333622) @@ -579,6 +579,7 @@ pci_vtcon_notify_tx(void *vsc, struct vqueue_info *vq) while (vq_has_descs(vq)) { n = vq_getchain(vq, &idx, iov, 1, flags); + assert(n >= 1); if (port != NULL) port->vsp_cb(port, port->vsp_arg, iov, 1); From owner-svn-src-all@freebsd.org Tue May 15 07:46:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9435EE6224; Tue, 15 May 2018 07:46:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 780197F377; Tue, 15 May 2018 07:46:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC2B424; Tue, 15 May 2018 07:46:25 +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 w4F7kPYs088995; Tue, 15 May 2018 07:46:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F7kPOp088994; Tue, 15 May 2018 07:46:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201805150746.w4F7kPOp088994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 May 2018 07:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333623 - head/sys/contrib/rdma/krping X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/contrib/rdma/krping X-SVN-Commit-Revision: 333623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 07:46:26 -0000 Author: hselasky Date: Tue May 15 07:46:24 2018 New Revision: 333623 URL: https://svnweb.freebsd.org/changeset/base/333623 Log: Add support for setting type of service, TOS, for outgoing RDMA connections in the krping kernel test utility. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue May 15 05:55:29 2018 (r333622) +++ head/sys/contrib/rdma/krping/krping.c Tue May 15 07:46:24 2018 (r333623) @@ -96,6 +96,7 @@ static const struct krping_option krping_opts[] = { {"rlat", OPT_NOPARAM, 'L'}, {"bw", OPT_NOPARAM, 'B'}, {"duplex", OPT_NOPARAM, 'd'}, + {"tos", OPT_INT, 't'}, {"txdepth", OPT_INT, 'T'}, {"poll", OPT_NOPARAM, 'P'}, {"local_dma_lkey", OPT_NOPARAM, 'Z'}, @@ -234,6 +235,7 @@ struct krping_cb { int txdepth; /* SQ depth */ int local_dma_lkey; /* use 0 for lkey */ int frtest; /* reg test */ + int tos; /* type of service */ /* CM stuff */ struct rdma_cm_id *cm_id; /* connection on client side,*/ @@ -1918,6 +1920,10 @@ static void krping_run_client(struct krping_cb *cb) struct ib_recv_wr *bad_wr; int ret; + /* set type of service, if any */ + if (cb->tos != 0) + rdma_set_service_type(cb->cm_id, cb->tos); + ret = krping_bind_client(cb); if (ret) return; @@ -2096,6 +2102,10 @@ int krping_doit(char *cmd) break; case 'I': cb->server_invalidate = 1; + break; + case 't': + cb->tos = optint; + DEBUG_LOG("type of service, tos=%d\n", (int) cb->tos); break; case 'T': cb->txdepth = optint; From owner-svn-src-all@freebsd.org Tue May 15 09:40:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09A79EA8C15; Tue, 15 May 2018 09:40:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3A2D78635; Tue, 15 May 2018 09:40:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 949F616A7; Tue, 15 May 2018 09:40:52 +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 w4F9eqoe045321; Tue, 15 May 2018 09:40:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4F9eqHV045320; Tue, 15 May 2018 09:40:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201805150940.w4F9eqHV045320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 May 2018 09:40:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333624 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 333624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 09:40:53 -0000 Author: hselasky Date: Tue May 15 09:40:52 2018 New Revision: 333624 URL: https://svnweb.freebsd.org/changeset/base/333624 Log: MFC r333362: Fix for missing network interface address event when adding the default IPv6 based link-local address. The default link local address for IPv6 is added as part of bringing the network interface up. Move the call to "EVENTHANDLER_INVOKE(ifaddr_event,)" from the SIOCAIFADDR_IN6 ioctl(2) handler to in6_notify_ifa() which should catch all the cases of adding IPv6 based addresses to a network interface. Add a witness warning in case the event handler is not allowed to sleep. Approved by: re (marius) Reviewed by: network (ae), kib Differential Revision: https://reviews.freebsd.org/D13407 Sponsored by: Mellanox Technologies Modified: stable/11/sys/netinet6/in6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/in6.c ============================================================================== --- stable/11/sys/netinet6/in6.c Tue May 15 07:46:24 2018 (r333623) +++ stable/11/sys/netinet6/in6.c Tue May 15 09:40:52 2018 (r333624) @@ -677,7 +677,6 @@ aifaddr_out: * The failure means address duplication was detected. */ } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); break; } @@ -1364,7 +1363,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i if (ifacount <= 1 && ifp->if_ioctl) { error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia); if (error) - return (error); + goto done; } /* @@ -1404,7 +1403,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i ia->ia_flags |= IFA_RTSELF; error = rtinit(&ia->ia_ifa, RTM_ADD, ia->ia_flags | rtflags); if (error) - return (error); + goto done; ia->ia_flags |= IFA_ROUTE; } @@ -1417,6 +1416,11 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i if (error == 0) ia->ia_flags |= IFA_RTSELF; } +done: + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "Invoking IPv6 network device address event may sleep"); + + EVENTHANDLER_INVOKE(ifaddr_event, ifp); return (error); } From owner-svn-src-all@freebsd.org Tue May 15 10:10:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 090B6EAAAF9; Tue, 15 May 2018 10:10:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACA977E5AF; Tue, 15 May 2018 10:10:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 888831B7A; Tue, 15 May 2018 10:10:15 +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 w4FAAFMV060400; Tue, 15 May 2018 10:10:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FAAFNC060399; Tue, 15 May 2018 10:10:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805151010.w4FAAFNC060399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 May 2018 10:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333625 - stable/11/tests/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/tests/sys/kern X-SVN-Commit-Revision: 333625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 10:10:16 -0000 Author: kib Date: Tue May 15 10:10:14 2018 New Revision: 333625 URL: https://svnweb.freebsd.org/changeset/base/333625 Log: Handle the difference between HEAD and stable/11 tests build. This is a direct commit to stable/11. PR: 228018, 228233 Tested by: Helge Oldach Sponsored by: The FreeBSD Foundation Approved by: re (marius) Modified: stable/11/tests/sys/kern/Makefile Modified: stable/11/tests/sys/kern/Makefile ============================================================================== --- stable/11/tests/sys/kern/Makefile Tue May 15 09:40:52 2018 (r333624) +++ stable/11/tests/sys/kern/Makefile Tue May 15 10:10:14 2018 (r333625) @@ -4,6 +4,7 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel .PATH: ${SRCTOP}/sys/kern TESTSDIR= ${TESTSBASE}/sys/kern +BINDIR= ${TESTSDIR} ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test From owner-svn-src-all@freebsd.org Tue May 15 11:25:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CE57EAF10F; Tue, 15 May 2018 11:25:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4B06FD1E; Tue, 15 May 2018 11:25:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 301A72832; Tue, 15 May 2018 11:25:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FBPBHr000795; Tue, 15 May 2018 11:25:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FBPBpO000793; Tue, 15 May 2018 11:25:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805151125.w4FBPBpO000793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 May 2018 11:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333626 - stable/11/sys/i386/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/i386/include X-SVN-Commit-Revision: 333626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 11:25:11 -0000 Author: kib Date: Tue May 15 11:25:10 2018 New Revision: 333626 URL: https://svnweb.freebsd.org/changeset/base/333626 Log: MFC r333504: Remove dead declaration. Approved by: re (marius) Modified: stable/11/sys/i386/include/pcb_ext.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/include/pcb_ext.h ============================================================================== --- stable/11/sys/i386/include/pcb_ext.h Tue May 15 10:10:14 2018 (r333625) +++ stable/11/sys/i386/include/pcb_ext.h Tue May 15 11:25:10 2018 (r333626) @@ -44,10 +44,7 @@ struct pcb_ext { }; #ifdef _KERNEL -extern int private_tss; - int i386_extend_pcb(struct thread *); - #endif #endif /* _I386_PCB_EXT_H_ */ From owner-svn-src-all@freebsd.org Tue May 15 11:43:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E95C7EB0185; Tue, 15 May 2018 11:43:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2BA73F69; Tue, 15 May 2018 11:43:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AE7D2B6F; Tue, 15 May 2018 11:43:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FBh5EH010372; Tue, 15 May 2018 11:43:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FBh5eU010371; Tue, 15 May 2018 11:43:05 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201805151143.w4FBh5eU010371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 15 May 2018 11:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333627 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 333627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 11:43:06 -0000 Author: ae Date: Tue May 15 11:43:05 2018 New Revision: 333627 URL: https://svnweb.freebsd.org/changeset/base/333627 Log: MFC r333244: Immediately propagate EACCES error code to application from tcp_output. In r309610 and r315514 the behavior of handling EACCES was changed, and tcp_output() now returns zero when EACCES happens. The reason of this change was a hesitation that applications that use TCP-MD5 will be affected by changes in project/ipsec. TCP-MD5 code returns EACCES when security assocition for given connection is not configured. But the same error code can return pfil(9), and this change has affected connections blocked by pfil(9). E.g. application doesn't return immediately when SYN segment is blocked, instead it waits when several tries will be failed. Actually, for TCP-MD5 application it doesn't matter will it get EACCES after first SYN, or after several tries. Security associtions must be configured before initiating TCP connection. I left the EACCES in the switch() to show that it has special handling. Reported by: Andreas Longwitz Approved by: re (marius) Modified: stable/11/sys/netinet/tcp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_output.c ============================================================================== --- stable/11/sys/netinet/tcp_output.c Tue May 15 11:25:10 2018 (r333626) +++ stable/11/sys/netinet/tcp_output.c Tue May 15 11:43:05 2018 (r333627) @@ -1579,8 +1579,6 @@ timer: SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ switch (error) { case EACCES: - tp->t_softerror = error; - return (0); case EPERM: tp->t_softerror = error; return (error); From owner-svn-src-all@freebsd.org Tue May 15 12:11:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE19FEB4631; Tue, 15 May 2018 12:11:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6FEFD7A65C; Tue, 15 May 2018 12:11:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5100F3015; Tue, 15 May 2018 12:11:53 +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 w4FCBrOQ024971; Tue, 15 May 2018 12:11:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FCBrL3024970; Tue, 15 May 2018 12:11:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805151211.w4FCBrL3024970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 May 2018 12:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333628 - stable/11/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/sys X-SVN-Commit-Revision: 333628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 12:11:53 -0000 Author: kib Date: Tue May 15 12:11:52 2018 New Revision: 333628 URL: https://svnweb.freebsd.org/changeset/base/333628 Log: MFC r333521: PROC_PDEATHSIG_CTL will appear first in 11.2. Approved by: re (marius) Modified: stable/11/lib/libc/sys/procctl.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/procctl.2 ============================================================================== --- stable/11/lib/libc/sys/procctl.2 Tue May 15 11:43:05 2018 (r333627) +++ stable/11/lib/libc/sys/procctl.2 Tue May 15 12:11:52 2018 (r333628) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2018 +.Dd May 12, 2018 .Dt PROCCTL 2 .Os .Sh NAME @@ -550,4 +550,4 @@ The .Dv PROC_PDEATHSIG_CTL facility is based on the prctl(PR_SET_PDEATHSIG, ...) feature of Linux, and first appeared in -.Fx 12.0 . +.Fx 11.2 . From owner-svn-src-all@freebsd.org Tue May 15 13:19:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CD1EED93BE; Tue, 15 May 2018 13:19:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14B4C68037; Tue, 15 May 2018 13:19:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA04F3E16; Tue, 15 May 2018 13:19:00 +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 w4FDJ06x055856; Tue, 15 May 2018 13:19:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FDJ0kW055855; Tue, 15 May 2018 13:19:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805151319.w4FDJ0kW055855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 15 May 2018 13:19: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: r333629 - stable/10/sys/netgraph X-SVN-Group: stable-10 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: stable/10/sys/netgraph X-SVN-Commit-Revision: 333629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 13:19:01 -0000 Author: sbruno Date: Tue May 15 13:19:00 2018 New Revision: 333629 URL: https://svnweb.freebsd.org/changeset/base/333629 Log: MFC r303848 Repair trivial panic in ng_uncallout. Fixes bugzilla #211031 PR: 211031 Modified: stable/10/sys/netgraph/ng_base.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/ng_base.c ============================================================================== --- stable/10/sys/netgraph/ng_base.c Tue May 15 12:11:52 2018 (r333628) +++ stable/10/sys/netgraph/ng_base.c Tue May 15 13:19:00 2018 (r333629) @@ -3813,7 +3813,7 @@ ng_uncallout(struct callout *c, node_p node) item = c->c_arg; /* Do an extra check */ if ((rval > 0) && (c->c_func == &ng_callout_trampoline) && - (NGI_NODE(item) == node)) { + (item != NULL) && (NGI_NODE(item) == node)) { /* * We successfully removed it from the queue before it ran * So now we need to unreference everything that was From owner-svn-src-all@freebsd.org Tue May 15 13:27:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A512CED9B9A; Tue, 15 May 2018 13:27:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5359E69143; Tue, 15 May 2018 13:27:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F90F3FEC; Tue, 15 May 2018 13:27:30 +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 w4FDRU2v060901; Tue, 15 May 2018 13:27:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FDRT9s060900; Tue, 15 May 2018 13:27:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201805151327.w4FDRT9s060900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 15 May 2018 13:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333630 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 333630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 13:27:30 -0000 Author: avg Date: Tue May 15 13:27:29 2018 New Revision: 333630 URL: https://svnweb.freebsd.org/changeset/base/333630 Log: Fix 'zpool create -t ' Creating a pool with a temporary name fails when we also specify custom dataset properties: this is because we mistakenly call zfs_set_prop_nvlist() on the "real" pool name which, as expected, cannot be found because the SPA is present in the namespace with the temporary name. Fix this by specifying the correct pool name when setting the dataset properties. Author: loli10K Reviewed-by: Prakash Surya Reviewed-by: Brian Behlendorf Obtained from: ZFS on Linux, zfsonlinux/zfs@4ceb8dd6fdfdde MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue May 15 13:19:00 2018 (r333629) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue May 15 13:27:29 2018 (r333630) @@ -1556,6 +1556,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) nvlist_t *config, *props = NULL; nvlist_t *rootprops = NULL; nvlist_t *zplprops = NULL; + char *spa_name = zc->zc_name; if (error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, zc->zc_iflags, &config)) @@ -1571,6 +1572,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) if (props) { nvlist_t *nvl = NULL; uint64_t version = SPA_VERSION; + char *tname; (void) nvlist_lookup_uint64(props, zpool_prop_to_name(ZPOOL_PROP_VERSION), &version); @@ -1593,6 +1595,10 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) zplprops, NULL); if (error != 0) goto pool_props_bad; + + if (nvlist_lookup_string(props, + zpool_prop_to_name(ZPOOL_PROP_TNAME), &tname) == 0) + spa_name = tname; } error = spa_create(zc->zc_name, config, props, zplprops); @@ -1600,9 +1606,9 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) /* * Set the remaining root properties */ - if (!error && (error = zfs_set_prop_nvlist(zc->zc_name, + if (!error && (error = zfs_set_prop_nvlist(spa_name, ZPROP_SRC_LOCAL, rootprops, NULL)) != 0) - (void) spa_destroy(zc->zc_name); + (void) spa_destroy(spa_name); pool_props_bad: nvlist_free(rootprops); From owner-svn-src-all@freebsd.org Tue May 15 13:31:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC346ED9DD9; Tue, 15 May 2018 13:31:00 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AC366AF4D; Tue, 15 May 2018 13:31:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5AC304010; Tue, 15 May 2018 13:31:00 +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 w4FDV0Bv061090; Tue, 15 May 2018 13:31:00 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FDV0Eb061089; Tue, 15 May 2018 13:31:00 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805151331.w4FDV0Eb061089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 15 May 2018 13:31:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333631 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 333631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 13:31:01 -0000 Author: sbruno Date: Tue May 15 13:30:59 2018 New Revision: 333631 URL: https://svnweb.freebsd.org/changeset/base/333631 Log: igb(4): I210 restore functionality if pxeboot rom is enabled on this device. r333345 attempted to determine if this code was needed or it was some kind of work around for a problem. Turns out, its definitely a work around for hardware locking and synchronization that manifests itself if the option Rom is enabled and is selected as a boot device (there was a PXE attempt). Reviewed by: mmacy Differential Revision: https://reviews.freebsd.org/D15439 Modified: head/sys/dev/e1000/e1000_mac.c Modified: head/sys/dev/e1000/e1000_mac.c ============================================================================== --- head/sys/dev/e1000/e1000_mac.c Tue May 15 13:27:29 2018 (r333630) +++ head/sys/dev/e1000/e1000_mac.c Tue May 15 13:30:59 2018 (r333631) @@ -2192,11 +2192,12 @@ s32 e1000_write_8bit_ctrl_reg_generic(struct e1000_hw s32 e1000_get_hw_semaphore(struct e1000_hw *hw) { u32 swsm; - s32 timeout = hw->nvm.word_size + 1; + s32 fw_timeout = hw->nvm.word_size + 1; + s32 sw_timeout = hw->nvm.word_size + 1; s32 i = 0; DEBUGFUNC("e1000_get_hw_semaphore"); -#ifdef notyet + /* _82571 */ /* If we have timedout 3 times on trying to acquire * the inter-port SMBI semaphore, there is old code @@ -2208,9 +2209,9 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw) if (hw->dev_spec._82571.smb_counter > 2) sw_timeout = 1; -#endif + /* Get the SW semaphore */ - while (i < timeout) { + while (i < sw_timeout) { swsm = E1000_READ_REG(hw, E1000_SWSM); if (!(swsm & E1000_SWSM_SMBI)) break; @@ -2219,34 +2220,28 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw) i++; } - if (i == timeout) { -#ifdef notyet - /* - * XXX This sounds more like a driver bug whereby we either - * recursed accidentally or missed clearing it previously - */ - /* In rare circumstances, the SW semaphore may already be held - * unintentionally. Clear the semaphore once before giving up. - */ - if (hw->dev_spec._82575.clear_semaphore_once) { - hw->dev_spec._82575.clear_semaphore_once = FALSE; - e1000_put_hw_semaphore_generic(hw); - for (i = 0; i < timeout; i++) { - swsm = E1000_READ_REG(hw, E1000_SWSM); - if (!(swsm & E1000_SWSM_SMBI)) - break; - - usec_delay(50); - } - } -#endif - + if (i == sw_timeout) { DEBUGOUT("Driver can't access device - SMBI bit is set.\n"); - return -E1000_ERR_NVM; + hw->dev_spec._82571.smb_counter++; } + /* In rare circumstances, the SW semaphore may already be held + * unintentionally. Clear the semaphore once before giving up. + */ + if (hw->dev_spec._82575.clear_semaphore_once) { + hw->dev_spec._82575.clear_semaphore_once = FALSE; + e1000_put_hw_semaphore(hw); + for (i = 0; i < fw_timeout; i++) { + swsm = E1000_READ_REG(hw, E1000_SWSM); + if (!(swsm & E1000_SWSM_SMBI)) + break; + + usec_delay(50); + } + } + /* Get the FW semaphore. */ - for (i = 0; i < timeout; i++) { + for (i = 0; i < fw_timeout; i++) { swsm = E1000_READ_REG(hw, E1000_SWSM); E1000_WRITE_REG(hw, E1000_SWSM, swsm | E1000_SWSM_SWESMBI); @@ -2257,7 +2252,7 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw) usec_delay(50); } - if (i == timeout) { + if (i == fw_timeout) { /* Release semaphores */ e1000_put_hw_semaphore(hw); DEBUGOUT("Driver can't access the NVM\n"); From owner-svn-src-all@freebsd.org Tue May 15 14:17:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BC45EDCBDC; Tue, 15 May 2018 14:17:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::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 29A2F75153; Tue, 15 May 2018 14:17:25 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qt0-x231.google.com with SMTP id m9-v6so427898qtb.5; Tue, 15 May 2018 07:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=uxxbfJ3WIehH/121M3qvJl9L2OxuRlhzCDTI+nZARqs=; b=n4WkYi55Mo6EepSiWGcIQlcg4ym/skWUzqjVkZ0PsyPyzJUKzw3oIjcJrCKav0ysoS Zhto3ubhVtea/JbVJ3dVgGRJScecX0NBmTqrP7eyjEkdwQNOKZ92Ho0g3F7Cf9ksnfCk 10Ezz2oPfZ71drxqAuNnJUGH7t/sRfU+8kndnLHqFtEaJh24BKnbfxKfiSyiEYbu7Xcy Tt8rwsAt++Ye3f5aWU15G90KCxnH2VYw044LyPdBFRWmjnoIBfcQJtF/rNIBvPvzQ00E b+SIOJsXn63REJxx7Tzhsd/NP3iToaCdSMzUTpANDLysJtDASMvpYvMftcwwGv6pvsV7 U26w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uxxbfJ3WIehH/121M3qvJl9L2OxuRlhzCDTI+nZARqs=; b=ED5Md1g2geKFe5bxfkqU90y9xHJA4TgNb83MEpRA2H/LOIHwywO76r6pM1XPavQPDo yGacTKi0BJZYL15WDECjOMNxVTHt+uq6G1IbRhZjwvljRFbAOV6EXxBR9jiXccilD7QN nn6E42A6+gFm8O7B0/J2n4q77GmOMgSQvpAo5BqSKs1xqlFrV+OdnGBFfgCTAazhkX3N zBN92uZj+0eyfduOg2bIamN0zQ5euYZ5qm7mxZieyqjLEdbxP/oyFjtpP8zYgDyNw9Jo yBcAcCJm6hUurNZ+wYuqWQA/lBlugzYnX2g1NZRTKOQNDAKxNrumA7CbSv/iJk2PL12J ZrlQ== X-Gm-Message-State: ALKqPwcy/4PzYQqGtkJ1oZo4/Sd0LQ/qNCOmxnLfTL8rTmRkglk9tMV3 f0Pcro9oK2FqISWRN2rDaGcfraju X-Google-Smtp-Source: AB8JxZrIsm6UieETBA9uaHcREVbOiBKJJG6PYmznfCz2c5rM0Js7i1yGnr9JKv5KiBY1XaKgaOBbxw== X-Received: by 2002:ac8:528a:: with SMTP id s10-v6mr13740392qtn.29.1526393844364; Tue, 15 May 2018 07:17:24 -0700 (PDT) Received: from mbp-eth.home (201-77-127-155.static.desktop.com.br. [201.77.127.155]) by smtp.gmail.com with ESMTPSA id f21-v6sm99249qta.79.2018.05.15.07.17.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 07:17:23 -0700 (PDT) Subject: Re: svn commit: r333612 - head/sys/net To: Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805142006.w4EK6nlJ033489@repo.freebsd.org> From: Renato Botelho Message-ID: Date: Tue, 15 May 2018 11:17:20 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201805142006.w4EK6nlJ033489@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 14:17:25 -0000 On 14/05/18 17:06, Stephen Hurd wrote: > Author: shurd > Date: Mon May 14 20:06:49 2018 > New Revision: 333612 > URL: https://svnweb.freebsd.org/changeset/base/333612 > > Log: > Replace rmlock with epoch in lagg > > Use the new epoch based reclamation API. Now the hot paths will not > block at all, and the sx lock is used for the softc data. This fixes LORs > reported where the rwlock was obtained when the sxlock was held. > > Submitted by: mmacy > Reported by: Harry Schmalzbauer > Reviewed by: sbruno > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15355 Thanks! This fixed my (wlan0+em0) failover lagg interface. -- Renato Botelho From owner-svn-src-all@freebsd.org Tue May 15 14:34:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00A1BEDDEFD for ; Tue, 15 May 2018 14:34:44 +0000 (UTC) (envelope-from globaltradez4@globaltradez.us) Received: from semf04.mfg.siteprotect.com (semf04.mfg.siteprotect.com [64.26.60.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9240F79929 for ; Tue, 15 May 2018 14:34:43 +0000 (UTC) (envelope-from globaltradez4@globaltradez.us) Received: from smtpauth02.mfg.siteprotect.com ([64.26.60.151]) by semf04.mfg.siteprotect.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fIZj8-0001KL-Lt for svn-src-all@freebsd.org; Tue, 15 May 2018 09:10:51 -0400 Received: from NESS08PC (unknown [106.51.27.19]) (Authenticated sender: globaltradez4@globaltradez.us) by smtpauth02.mfg.siteprotect.com (Postfix) with ESMTPSA id 40ldGw6HZKz2YQR6g for ; Tue, 15 May 2018 09:10:47 -0400 (EDT) From: "Elsa Jean" To: References: In-Reply-To: Subject: RE: Display Week 2018. Date: Tue, 15 May 2018 09:09:14 -0400 Message-ID: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdPm9qqI1btCk7vaSWegZV7eb1euGAAA7lWAAABfulAAACXVUAAAABMQAAAABjAAAAAGMAAAAAYAAAAABgAAAAAFAAAAAAbAAAAABsAAAAAGwAAAAAbAAAAABrAAAAAGsAAAAAawAAAABrAAAAAGsAAAAAbgAAAABuAAAAAHEAAAAAZAAAAAB3AAAAAHoAAAAAYAAVMw06A= Content-Language: en-in Authentication-Results: mfg.siteprotect.com; auth=pass smtp.auth=globaltradez4@globaltradez.us smtp.mailfrom= X-Originating-IP: 64.26.60.151 X-SpamExperts-Domain: mfg.outbound X-SpamExperts-Username: 64.26.60.150/31 Authentication-Results: mfg.siteprotect.com; auth=pass smtp.auth=64.26.60.150/31@mfg.outbound X-SpamExperts-Outgoing-Class: unsure X-SpamExperts-Outgoing-Evidence: Combined (0.60) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5n34qyroxDuZFM2yMbZZuJF602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO+nAQbkmdvEF+ozOXgLzNbjAZxalSlNXXUOuKKBq5Gfvvpf3JjS9poTbC9IODXxixti8 9Kd+vejUP2oPzfQdihZy0vKNdJMHZ2K0qgciRU0qhtiIS2+zjPkm5Can4bFNzXqMxuCyXn4R6TLE Pny2at99SgL1DYNt5n1o3lr1GBBg7KNuqYnO1kk+wziobWmUqlsgdA1T3sG0n4XCvnpAzoO0pIf7 GSLcmrXJ/w7h27VGOcuiZgCAGPEu7cIluC/6/dbcPN8/qLq8mpB22MMhUaj/usej0Ui1obZJrpUO 2b0C9KoSg+IspmOIIua8zl/ssj/8U8jGWZSIp3MkcCdYxtmQ925D5y2rV05l1KzUZfXwguC9naOa bPQ3DzaRcGcWbzMaIL48SHdwBur7C9FrSAUB4NfL+2ImR0XsWtvN/LlmxxIFeBwctNa7tcu4kuCT Y2Gm+V69KgijJv/RSMoKe4Roh9VoIekQHpwUfpYnEThm5XdSPTnIKa5PE1CI44eM3LoPVecW8yfa nnM7l6FE655C/W135feiosxaEaJwz/Id9ySkes1+/3Szjengfchxce5FP3Wy8CbvQfZmCJ4wCAYq bKAYh4PrtyBPhN1aDP7r6rGRBrUQK81gFLWT7hSbmTMcspBD7YK5QezFKiM4yu1Up49o+lS2LC3n CyMMHg3rGffKeAntHODy29+5Lb+dnuduPwBIU4XP5nDPu5Ea152WEICfHrn+jIckuGWsknXxUGYZ QrIYXfxTvaTcDvxsQFz1pRXWhjh9fdbl44I0Df2UI76cWe1D2JpUjlT3bLuJnVmORVCLxAeoGXKO lRFtTGohtW3T1XUX46BrhYH2jHGpuSMj5GClrnAFwFRqfsSKdQal0xgMz+LgKo4HLHu6ptr4PKCw UPGsfdfow4OUKWxOXUm6fHiZBWRVzgH4c26PuT68Kbi5de883nNDQ3Lphk7dtUqGjwPynkopb8XK RhbHUD7TiXyBkI2ToDF7gH4d X-Report-Abuse-To: spam@semfq01.mfg.siteprotect.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 14:34:44 -0000 Hi, I hope you're doing good. Did you get a chance to review the below email.? Regards, Elsa Jean| Trade show specialist From: Elsa Jean [mailto:globaltradez4@globaltradez.us] Sent: 08 May 2018 14:44 To: 'svn-src-all@freebsd.org' Subject: Display Week 2018. Hi, Would you be interested to getting access to Attendees Email list of Display Week Expo 2018.? List includes: Name, Phone number, Email address and other fields on excel sheet. If you are interested please get back to me so that I will assist you further with counts and pricing details. Could you please let me know your thoughts? so that I can update my CRM accordingly. Looking forward for your email. Regards, Elsa Jean| Trade show specialist Note: If you do not wish to receive further email please reply us with "Exclude" in the subject line. From owner-svn-src-all@freebsd.org Tue May 15 15:11:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF231EE09D6; Tue, 15 May 2018 15:11:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72791830F7; Tue, 15 May 2018 15:11:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5502450A6; Tue, 15 May 2018 15:11:53 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FFBrB4016601; Tue, 15 May 2018 15:11:53 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FFBrPp016600; Tue, 15 May 2018 15:11:53 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805151511.w4FFBrPp016600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 15 May 2018 15:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333632 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 333632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 15:11:53 -0000 Author: trasz Date: Tue May 15 15:11:52 2018 New Revision: 333632 URL: https://svnweb.freebsd.org/changeset/base/333632 Log: Fix sysctl description. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Tue May 15 13:30:59 2018 (r333631) +++ head/sys/dev/usb/template/usb_template_serialnet.c Tue May 15 15:11:52 2018 (r333632) @@ -405,7 +405,7 @@ serialnet_init(void *arg __unused) parent = SYSCTL_ADD_NODE(&serialnet_ctx_list, SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO, parent_name, CTLFLAG_RW, - 0, "USB Mass Storage device side template"); + 0, "USB CDC Serial/Ethernet device side template"); SYSCTL_ADD_U16(&serialnet_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, "vendor_id", CTLFLAG_RWTUN, &usb_template_serialnet.idVendor, 1, "Vendor identifier"); From owner-svn-src-all@freebsd.org Tue May 15 15:36:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D30EE25E0; Tue, 15 May 2018 15:36:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 063DD87267; Tue, 15 May 2018 15:36:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC72F5530; Tue, 15 May 2018 15:36:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FFaZKL027634; Tue, 15 May 2018 15:36:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FFaYWh027628; Tue, 15 May 2018 15:36:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201805151536.w4FFaYWh027628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 May 2018 15:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333633 - in head/sys: conf dev/usb/input modules/usb modules/usb/uhid_snes X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/usb/input modules/usb modules/usb/uhid_snes X-SVN-Commit-Revision: 333633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 15:36:36 -0000 Author: hselasky Date: Tue May 15 15:36:34 2018 New Revision: 333633 URL: https://svnweb.freebsd.org/changeset/base/333633 Log: Add new USB HID driver for Super Nintendo gamepads. Differential Revision: https://reviews.freebsd.org/D15385 Submitted by: johalun@gmail.com (Johannes Lundberg) Sponsored by: Mellanox Technologies Added: head/sys/dev/usb/input/uhid_snes.c (contents, props changed) head/sys/modules/usb/uhid_snes/ head/sys/modules/usb/uhid_snes/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/dev/usb/input/usb_rdesc.h head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue May 15 15:11:52 2018 (r333632) +++ head/sys/conf/files Tue May 15 15:36:34 2018 (r333633) @@ -3387,6 +3387,7 @@ dev/usb/misc/uled.c optional uled dev/usb/input/atp.c optional atp dev/usb/input/uep.c optional uep dev/usb/input/uhid.c optional uhid +dev/usb/input/uhid_snes.c optional uhid_snes dev/usb/input/ukbd.c optional ukbd dev/usb/input/ums.c optional ums dev/usb/input/wmt.c optional wmt Added: head/sys/dev/usb/input/uhid_snes.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/input/uhid_snes.c Tue May 15 15:36:34 2018 (r333633) @@ -0,0 +1,644 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2013, Michael Terrell + * Copyright 2018, Johannes Lundberg + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "usb_rdesc.h" + +#define UHID_SNES_IFQ_MAX_LEN 8 + +#define UREQ_GET_PORT_STATUS 0x01 +#define UREQ_SOFT_RESET 0x02 + +#define UP 0x7f00 +#define DOWN 0x7fff +#define LEFT 0x00ff +#define RIGHT 0xff7f +#define X 0x1f +#define Y 0x8f +#define A 0x2f +#define B 0x4f +#define SELECT 0x10 +#define START 0x20 +#define LEFT_T 0x01 +#define RIGHT_T 0x02 + +static const uint8_t uhid_snes_report_descr[] = { UHID_SNES_REPORT_DESCR() }; + +#define SNES_DEV(v,p,i) { USB_VPI(v,p,i) } + +static const STRUCT_USB_HOST_ID snes_devs[] = { + SNES_DEV(0x0810, 0xe501, 0), /* GeeekPi K-0161 */ + SNES_DEV(0x0079, 0x0011, 0) /* Dragonrise */ +}; + +enum { + UHID_SNES_INTR_DT_RD, + UHID_SNES_STATUS_DT_RD, + UHID_SNES_N_TRANSFER +}; + +struct uhid_snes_softc { + device_t sc_dev; + struct usb_device *sc_usb_device; + struct mtx sc_mutex; + struct usb_callout sc_watchdog; + uint8_t sc_iface_num; + struct usb_xfer *sc_transfer[UHID_SNES_N_TRANSFER]; + struct usb_fifo_sc sc_fifo; + struct usb_fifo_sc sc_fifo_no_reset; + int sc_fflags; + struct usb_fifo *sc_fifo_open[2]; + uint8_t sc_zero_length_packets; + uint8_t sc_previous_status; + uint8_t sc_iid; + uint8_t sc_oid; + uint8_t sc_fid; + uint8_t sc_iface_index; + + uint32_t sc_isize; + uint32_t sc_osize; + uint32_t sc_fsize; + + void *sc_repdesc_ptr; + + uint16_t sc_repdesc_size; + + struct usb_device *sc_udev; +#define UHID_FLAG_IMMED 0x01 /* set if read should be immediate */ + +}; + +static device_probe_t uhid_snes_probe; +static device_attach_t uhid_snes_attach; +static device_detach_t uhid_snes_detach; + +static usb_fifo_open_t uhid_snes_open; +static usb_fifo_close_t uhid_snes_close; +static usb_fifo_ioctl_t uhid_snes_ioctl; +static usb_fifo_cmd_t uhid_snes_start_read; +static usb_fifo_cmd_t uhid_snes_stop_read; + +static void uhid_snes_reset(struct uhid_snes_softc *); +static void uhid_snes_watchdog(void *); + +static usb_callback_t uhid_snes_read_callback; +static usb_callback_t uhid_snes_status_callback; + +static struct usb_fifo_methods uhid_snes_fifo_methods = { + .f_open = &uhid_snes_open, + .f_close = &uhid_snes_close, + .f_ioctl = &uhid_snes_ioctl, + .f_start_read = &uhid_snes_start_read, + .f_stop_read = &uhid_snes_stop_read, + .basename[0] = "uhid_snes" +}; + +static const struct usb_config uhid_snes_config[UHID_SNES_N_TRANSFER] = { + [UHID_SNES_INTR_DT_RD] = { + .callback = &uhid_snes_read_callback, + .bufsize = sizeof(struct usb_device_request) +1, + .flags = {.short_xfer_ok = 1, .short_frames_ok = 1, + .pipe_bof =1, .proxy_buffer =1}, + .type = UE_INTERRUPT, + .endpoint = 0x81, + .direction = UE_DIR_IN + }, + [UHID_SNES_STATUS_DT_RD] = { + .callback = &uhid_snes_status_callback, + .bufsize = sizeof(struct usb_device_request) + 1, + .timeout = 1000, + .type = UE_CONTROL, + .endpoint = 0x00, + .direction = UE_DIR_ANY + } +}; + +static int +uhid_get_report(struct uhid_snes_softc *sc, uint8_t type, + uint8_t id, void *kern_data, void *user_data, uint16_t len) +{ + int err; + uint8_t free_data = 0; + + if (kern_data == NULL) { + kern_data = malloc(len, M_USBDEV, M_WAITOK); + if (kern_data == NULL) { + err = ENOMEM; + goto done; + } + free_data = 1; + } + err = usbd_req_get_report(sc->sc_udev, NULL, kern_data, + len, sc->sc_iface_index, type, id); + if (err) { + err = ENXIO; + goto done; + } + if (user_data) { + /* dummy buffer */ + err = copyout(kern_data, user_data, len); + if (err) { + goto done; + } + } +done: + if (free_data) { + free(kern_data, M_USBDEV); + } + return (err); +} + +static int +uhid_set_report(struct uhid_snes_softc *sc, uint8_t type, + uint8_t id, void *kern_data, void *user_data, uint16_t len) +{ + int err; + uint8_t free_data = 0; + + if (kern_data == NULL) { + kern_data = malloc(len, M_USBDEV, M_WAITOK); + if (kern_data == NULL) { + err = ENOMEM; + goto done; + } + free_data = 1; + err = copyin(user_data, kern_data, len); + if (err) { + goto done; + } + } + err = usbd_req_set_report(sc->sc_udev, NULL, kern_data, + len, sc->sc_iface_index, type, id); + if (err) { + err = ENXIO; + goto done; + } +done: + if (free_data) { + free(kern_data, M_USBDEV); + } + return (err); +} + +static int +uhid_snes_open(struct usb_fifo *fifo, int fflags) +{ + struct uhid_snes_softc *sc = usb_fifo_softc(fifo); + int error; + + if (sc->sc_fflags & fflags) { + uhid_snes_reset(sc); + return (EBUSY); + } + + mtx_lock(&sc->sc_mutex); + usbd_xfer_set_stall(sc->sc_transfer[UHID_SNES_INTR_DT_RD]); + mtx_unlock(&sc->sc_mutex); + + error = usb_fifo_alloc_buffer(fifo, + usbd_xfer_max_len(sc->sc_transfer[UHID_SNES_INTR_DT_RD]), + UHID_SNES_IFQ_MAX_LEN); + if (error) + return (ENOMEM); + + sc->sc_fifo_open[USB_FIFO_RX] = fifo; + + return (0); +} + +static void +uhid_snes_reset(struct uhid_snes_softc *sc) +{ + struct usb_device_request req; + int error; + + req.bRequest = UREQ_SOFT_RESET; + USETW(req.wValue, 0); + USETW(req.wIndex, sc->sc_iface_num); + USETW(req.wLength, 0); + + mtx_lock(&sc->sc_mutex); + + error = usbd_do_request_flags(sc->sc_usb_device, &sc->sc_mutex, + &req, NULL, 0, NULL, 2 * USB_MS_HZ); + + if (error) { + usbd_do_request_flags(sc->sc_usb_device, &sc->sc_mutex, + &req, NULL, 0, NULL, 2 * USB_MS_HZ); + } + + mtx_unlock(&sc->sc_mutex); +} + +static void +uhid_snes_close(struct usb_fifo *fifo, int fflags) +{ + struct uhid_snes_softc *sc = usb_fifo_softc(fifo); + + sc->sc_fflags &= ~(fflags & FREAD); + usb_fifo_free_buffer(fifo); +} + +static int +uhid_snes_ioctl(struct usb_fifo *fifo, u_long cmd, void *data, int fflags) +{ + struct uhid_snes_softc *sc = usb_fifo_softc(fifo); + struct usb_gen_descriptor *ugd; + uint32_t size; + int error = 0; + uint8_t id; + + switch (cmd) { + case USB_GET_REPORT_DESC: + ugd = data; + if (sc->sc_repdesc_size > ugd->ugd_maxlen) { + size = ugd->ugd_maxlen; + } else { + size = sc->sc_repdesc_size; + } + + ugd->ugd_actlen = size; + if (ugd->ugd_data == NULL) + break; /*desciptor length only*/ + error = copyout(sc->sc_repdesc_ptr, ugd->ugd_data, size); + break; + + case USB_SET_IMMED: + if (!(fflags & FREAD)) { + error = EPERM; + break; + } + + if (*(int *)data) { + /* do a test read */ + error = uhid_get_report(sc, UHID_INPUT_REPORT, + sc->sc_iid, NULL, NULL, sc->sc_isize); + if (error) { + break; + } + mtx_lock(&sc->sc_mutex); + sc->sc_fflags |= UHID_FLAG_IMMED; + mtx_unlock(&sc->sc_mutex); + } else { + mtx_lock(&sc->sc_mutex); + sc->sc_fflags &= ~UHID_FLAG_IMMED; + mtx_unlock(&sc->sc_mutex); + } + break; + + case USB_GET_REPORT: + if (!(fflags & FREAD)) { + error = EPERM; + break; + } + ugd = data; + switch (ugd->ugd_report_type) { + case UHID_INPUT_REPORT: + size = sc->sc_isize; + id = sc->sc_iid; + break; + case UHID_OUTPUT_REPORT: + size = sc->sc_osize; + id = sc->sc_oid; + break; + case UHID_FEATURE_REPORT: + size = sc->sc_fsize; + id = sc->sc_fid; + break; + default: + return (EINVAL); + } + if (id != 0) + copyin(ugd->ugd_data, &id, 1); + error = uhid_get_report(sc, ugd->ugd_report_type, id, + NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); + break; + + case USB_SET_REPORT: + if (!(fflags & FWRITE)) { + error = EPERM; + break; + } + ugd = data; + switch (ugd->ugd_report_type) { + case UHID_INPUT_REPORT: + size = sc->sc_isize; + id = sc->sc_iid; + break; + case UHID_OUTPUT_REPORT: + size = sc->sc_osize; + id = sc->sc_oid; + break; + case UHID_FEATURE_REPORT: + size = sc->sc_fsize; + id = sc->sc_fid; + break; + default: + return (EINVAL); + } + if (id != 0) + copyin(ugd->ugd_data, &id, 1); + error = uhid_set_report(sc, ugd->ugd_report_type, id, + NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size)); + break; + + case USB_GET_REPORT_ID: + /* XXX: we only support reportid 0? */ + *(int *)data = 0; + break; + + default: + error = EINVAL; + break; + } + return (error); +} + +static void +uhid_snes_watchdog(void *arg) +{ + struct uhid_snes_softc *sc = arg; + + mtx_assert(&sc->sc_mutex, MA_OWNED); + + if (sc->sc_fflags == 0) + usbd_transfer_start(sc->sc_transfer[UHID_SNES_STATUS_DT_RD]); + + usb_callout_reset(&sc->sc_watchdog, hz, &uhid_snes_watchdog, sc); +} + +static void +uhid_snes_start_read(struct usb_fifo *fifo) +{ + struct uhid_snes_softc *sc = usb_fifo_softc(fifo); + + usbd_transfer_start(sc->sc_transfer[UHID_SNES_INTR_DT_RD]); +} + +static void +uhid_snes_stop_read(struct usb_fifo *fifo) +{ + struct uhid_snes_softc *sc = usb_fifo_softc(fifo); + + usbd_transfer_stop(sc->sc_transfer[UHID_SNES_INTR_DT_RD]); +} + +static void +uhid_snes_read_callback(struct usb_xfer *transfer, usb_error_t error) +{ + struct uhid_snes_softc *sc = usbd_xfer_softc(transfer); + struct usb_fifo *fifo = sc->sc_fifo_open[USB_FIFO_RX]; + struct usb_page_cache *pc; + int actual, max; + + usbd_xfer_status(transfer, &actual, NULL, NULL, NULL); + if (fifo == NULL) + return; + + switch (USB_GET_STATE(transfer)) { + case USB_ST_TRANSFERRED: + if (actual == 0) { + if (sc->sc_zero_length_packets == 4) + /* Throttle transfers. */ + usbd_xfer_set_interval(transfer, 500); + else + sc->sc_zero_length_packets++; + + } else { + /* disable throttling. */ + usbd_xfer_set_interval(transfer, 0); + sc->sc_zero_length_packets = 0; + } + pc = usbd_xfer_get_frame(transfer, 0); + usb_fifo_put_data(fifo, pc, 0, actual, 1); + /* Fall through */ + setup: + case USB_ST_SETUP: + if (usb_fifo_put_bytes_max(fifo) != 0) { + max = usbd_xfer_max_len(transfer); + usbd_xfer_set_frame_len(transfer, 0, max); + usbd_transfer_submit(transfer); + } + break; + + default: + /*disable throttling. */ + usbd_xfer_set_interval(transfer, 0); + sc->sc_zero_length_packets = 0; + + if (error != USB_ERR_CANCELLED) { + /* Issue a clear-stall request. */ + usbd_xfer_set_stall(transfer); + goto setup; + } + break; + } +} + +static void +uhid_snes_status_callback(struct usb_xfer *transfer, usb_error_t error) +{ + struct uhid_snes_softc *sc = usbd_xfer_softc(transfer); + struct usb_device_request req; + struct usb_page_cache *pc; + uint8_t current_status, new_status; + + switch (USB_GET_STATE(transfer)) { + case USB_ST_SETUP: + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UREQ_GET_PORT_STATUS; + USETW(req.wValue, 0); + req.wIndex[0] = sc->sc_iface_num; + req.wIndex[1] = 0; + USETW(req.wLength, 1); + + pc = usbd_xfer_get_frame(transfer, 0); + usbd_copy_in(pc, 0, &req, sizeof(req)); + usbd_xfer_set_frame_len(transfer, 0, sizeof(req)); + usbd_xfer_set_frame_len(transfer, 1, 1); + usbd_xfer_set_frames(transfer, 2); + usbd_transfer_submit(transfer); + break; + + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(transfer, 1); + usbd_copy_out(pc, 0, ¤t_status, 1); + new_status = current_status & ~sc->sc_previous_status; + sc->sc_previous_status = current_status; + break; + + default: + break; + } + +} + +static int +uhid_snes_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(snes_devs, sizeof(snes_devs), uaa)); +} + +static int +uhid_snes_attach(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + struct uhid_snes_softc *sc = device_get_softc(dev); + struct usb_interface_descriptor *idesc; + struct usb_config_descriptor *cdesc; + uint8_t alt_index, iface_index = uaa->info.bIfaceIndex; + int error,unit = device_get_unit(dev); + + sc->sc_dev = dev; + sc->sc_usb_device = uaa->device; + device_set_usb_desc(dev); + mtx_init(&sc->sc_mutex, "uhid_snes", NULL, MTX_DEF | MTX_RECURSE); + usb_callout_init_mtx(&sc->sc_watchdog, &sc->sc_mutex, 0); + + idesc = usbd_get_interface_descriptor(uaa->iface); + alt_index = -1; + for(;;) { + if (idesc == NULL) + break; + + if ((idesc->bDescriptorType == UDESC_INTERFACE) && + (idesc->bLength >= sizeof(*idesc))) { + if (idesc->bInterfaceNumber != uaa->info.bIfaceNum) { + break; + } else { + alt_index++; + if (idesc->bInterfaceClass == UICLASS_HID) + goto found; + } + } + + cdesc = usbd_get_config_descriptor(uaa->device); + idesc = (void *)usb_desc_foreach(cdesc, (void *)idesc); + goto found; + } + goto detach; + +found: + if (alt_index) { + error = usbd_set_alt_interface_index(uaa->device, iface_index, alt_index); + if (error) + goto detach; + } + + sc->sc_iface_num = idesc->bInterfaceNumber; + + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_transfer, uhid_snes_config, UHID_SNES_N_TRANSFER, sc, + &sc->sc_mutex); + + if (error) + goto detach; + + error = usb_fifo_attach(uaa->device, sc, &sc->sc_mutex, + &uhid_snes_fifo_methods, &sc->sc_fifo, unit, -1, + iface_index, UID_ROOT, GID_OPERATOR, 0644); + sc->sc_repdesc_size = sizeof(uhid_snes_report_descr); + sc->sc_repdesc_ptr = __DECONST(void*, &uhid_snes_report_descr); + + + if (error) + goto detach; + + mtx_lock(&sc->sc_mutex); + uhid_snes_watchdog(sc); + mtx_unlock(&sc->sc_mutex); + return (0); + +detach: + uhid_snes_detach(dev); + return (ENOMEM); +} + +static int +uhid_snes_detach(device_t dev) +{ + struct uhid_snes_softc *sc = device_get_softc(dev); + + usb_fifo_detach(&sc->sc_fifo); + usb_fifo_detach(&sc->sc_fifo_no_reset); + + mtx_lock(&sc->sc_mutex); + usb_callout_stop(&sc->sc_watchdog); + mtx_unlock(&sc->sc_mutex); + + usbd_transfer_unsetup(sc->sc_transfer, UHID_SNES_N_TRANSFER); + usb_callout_drain(&sc->sc_watchdog); + mtx_destroy(&sc->sc_mutex); + + return (0); +} + +static device_method_t uhid_snes_methods[] = { + DEVMETHOD(device_probe, uhid_snes_probe), + DEVMETHOD(device_attach, uhid_snes_attach), + DEVMETHOD(device_detach, uhid_snes_detach), + DEVMETHOD_END +}; + +static driver_t uhid_snes_driver = { + "uhid_snes", + uhid_snes_methods, + sizeof(struct uhid_snes_softc) +}; + +static devclass_t uhid_snes_devclass; + +DRIVER_MODULE(uhid_snes, uhub, uhid_snes_driver, uhid_snes_devclass, NULL, 0); +MODULE_DEPEND(uhid_snes, usb, 1, 1, 1); +USB_PNP_HOST_INFO(snes_devs); Modified: head/sys/dev/usb/input/usb_rdesc.h ============================================================================== --- head/sys/dev/usb/input/usb_rdesc.h Tue May 15 15:11:52 2018 (r333632) +++ head/sys/dev/usb/input/usb_rdesc.h Tue May 15 15:36:34 2018 (r333633) @@ -276,3 +276,31 @@ 0x81, 0x01, /* INPUT (Constant) */\ 0xc0 /* END COLLECTION */\ +/* Fixed report descriptor for Super Nintendo gamepads */ +#define UHID_SNES_REPORT_DESCR(...) \ + 0x05, 0x01, /* Usage Page (Desktop), */\ + 0x09, 0x04, /* Usage (Joystik), */\ + 0xA1, 0x01, /* Collection (Application), */\ + 0xA1, 0x02, /* Collection (Logical), */\ + 0x14, /* Logical Minimum (0), */\ + 0x75, 0x08, /* Report Size (8), */\ + 0x95, 0x03, /* Report Count (3), */\ + 0x81, 0x01, /* Input (Constant), */\ + 0x26, 0xFF, 0x00, /* Logical Maximum (255), */\ + 0x95, 0x02, /* Report Count (2), */\ + 0x09, 0x30, /* Usage (X), */\ + 0x09, 0x31, /* Usage (Y), */\ + 0x81, 0x02, /* Input (Variable), */\ + 0x75, 0x01, /* Report Size (1), */\ + 0x95, 0x04, /* Report Count (4), */\ + 0x81, 0x01, /* Input (Constant), */\ + 0x25, 0x01, /* Logical Maximum (1), */\ + 0x95, 0x0A, /* Report Count (10), */\ + 0x05, 0x09, /* Usage Page (Button), */\ + 0x19, 0x01, /* Usage Minimum (01h), */\ + 0x29, 0x0A, /* Usage Maximum (0Ah), */\ + 0x81, 0x02, /* Input (Variable), */\ + 0x95, 0x0A, /* Report Count (10), */\ + 0x81, 0x01, /* Input (Constant), */\ + 0xC0, /* End Collection, */\ + 0xC0 /* End Collection */\ Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Tue May 15 15:11:52 2018 (r333632) +++ head/sys/modules/usb/Makefile Tue May 15 15:36:34 2018 (r333633) @@ -47,7 +47,7 @@ SUBDIR = usb SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} ${_at91dci} \ ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg} SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} -SUBDIR += atp cfumass uhid ukbd ums udbp ufm uep wmt wsp ugold uled +SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp ufm uep wmt wsp ugold uled SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umcs umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += udl Added: head/sys/modules/usb/uhid_snes/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/uhid_snes/Makefile Tue May 15 15:36:34 2018 (r333633) @@ -0,0 +1,36 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2018 Johannes Lundberg. 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. +# + +S= ${SRCTOP}/sys + +.PATH: $S/dev/usb/input + +KMOD= uhid_snes +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h vnode_if.h usbdevs.h \ + uhid_snes.c + +.include From owner-svn-src-all@freebsd.org Tue May 15 15:51:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4242CEE360C; Tue, 15 May 2018 15:51:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2B7E6C6A5; Tue, 15 May 2018 15:51:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id IcEOfXJErSzNNIcEQfXYp0; Tue, 15 May 2018 09:51:19 -0600 X-Authority-Analysis: v=2.3 cv=KuxjJ1eN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=VUJBJC2UJ8kA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=y49WmGJsTEuJB25HqrQA:9 a=RiW8mVJUvqHRhG7r:21 a=Pao8E0vQZZHY_ffZ:21 a=QEXdDO2ut3YA:10 a=wtgsnBrPw8_UhtZQ:21 a=Uti-vC0gznxRXehN:21 a=hINhXtAT44Y2n1Jw:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from [25.170.45.77] (unknown [72.143.234.187]) by spqr.komquats.com (Postfix) with ESMTPSA id 35F24A00; Tue, 15 May 2018 08:51:16 -0700 (PDT) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r333612 - head/sys/net Date: Tue, 15 May 2018 08:51:19 -0700 To: Renato Botelho , Stephen Hurd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <20180515155116.35F24A00@spqr.komquats.com> X-CMAE-Envelope: MS4wfErii+CwJsRi915i/IXlR26cJMNkl0VDQDPSld+rE2cnd1beNvi0qXBUgaxHYDQdYBb4pSoYU9O2M9V3Fhj6j2ICgEG0NpHSxFWoT8exZZsnsrXOFqfp smtQlmeJLd4kuaRrGEH2zHXuJHnEP9RJuyURLiS/PWV7P1Ca8foSVviPIEKx45874n38f6nLoKoZ4D7vsp39dU9Q3oJhoLB3i/SLgkxJ+gP2Tg2nyP8hv5fT QM13x7lGU828gs1hhHpve3qtI28KP+xB1DEd0iGMng86PiZUAJUcZaQHLdEc+9M8Nr+XDxj+S7rePT0Ruc2IAw== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 15:51:22 -0000 Indeed, thank you. It replaced a patch I used to address a panic, due to a = missing lock, when restarting my WiFi connection here at Vancouver Island T= ech Park. I failover bge0 to wlan0. --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Also, this old phone only supports top post. Apologies. Cy Schubert or The need of the many outweighs the greed of the few. --- -----Original Message----- From: Renato Botelho Sent: 15/05/2018 07:17 To: Stephen Hurd; src-committers@freebsd.org; svn-src-all@freebsd.org; svn-= src-head@freebsd.org Subject: Re: svn commit: r333612 - head/sys/net On 14/05/18 17:06, Stephen Hurd wrote: > Author: shurd > Date: Mon May 14 20:06:49 2018 > New Revision: 333612 > URL: https://svnweb.freebsd.org/changeset/base/333612 >=20 > Log: > Replace rmlock with epoch in lagg > =20 > Use the new epoch based reclamation API. Now the hot paths will not > block at all, and the sx lock is used for the softc data. This fixes L= ORs > reported where the rwlock was obtained when the sxlock was held. > =20 > Submitted by: mmacy > Reported by: Harry Schmalzbauer > Reviewed by: sbruno > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15355 Thanks! This fixed my (wlan0+em0) failover lagg interface. --=20 Renato Botelho From owner-svn-src-all@freebsd.org Tue May 15 16:18:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34CE8EE57C2; Tue, 15 May 2018 16:18:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::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 ABB5672A5D; Tue, 15 May 2018 16:18:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id q22-v6so286115pff.11; Tue, 15 May 2018 09:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G7U86/reqWVMFcOBEetvLaXT/sZYDuu0nwx45Z+ca6A=; b=dWt8ExNDne4j72mNhTabVqi5n6nU3/nDsJ43P7Re4wMkjHlt379AyULjrOlLfeGwcM oemW0eRRodHEh+nDMOYD0N/2jj6DdBu2SVnwaPruKjEIQnTbu6ZIWtrePnlfu7vqepUQ bP4rf27KbECyN1Chi6wlUsQVxusFSsFI4YCyncZo4FZp4179FGHJxngnXLTPWk3MXmry YcKHEIFjf5G1zCwsgugrRp9+Tx7jpWVot+MQhWOCF+7Xej53oiy0qOi2m9B5QHdry0Sd w9Cp7pT3WYuKVCb1VPFIATKY/uLWJ+wWqaBjwRGf7ayEcB7mshtMfpSNk2HLTiCa8Sz6 gbKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=G7U86/reqWVMFcOBEetvLaXT/sZYDuu0nwx45Z+ca6A=; b=WiuN0+kjsO6vw30lRScZ5xWuirGWhUYReagk6bzoUkMJP5KRa1zPuVjiulZXRfC33e i9QqILxuSJuUJ6ydYEJxpG/1SqyL1z8sTXBqx3I0ZwzsLZmlBpJZ1rqelJ0fvgj4H/mH id1Bux+P/SlaBu+KE/7APKbRvuWnniq8NAL5DFkbOBkCVfyiGHz2fC2/ky186xROU7nW tZphO9IgqtghbF6BuAiytnbHNsk3G/lTyS4mNbLEkCDDkOKwJ4Kn1N8wydE+cXxCQSlw tORVdpOLOTjf8s9zzRXT/cCfrckXyZHJ5VNsWG7uusFyZZNMahAURchkcOGxVEYRa6ft qSvQ== X-Gm-Message-State: ALKqPwe9fHWjX0c26WHR+Z3hA8CkU3a2lTyroWgg6uGoA+zOgJWsceES fH6sL3fD8/0rPEw+n01Xy+Y7XA== X-Google-Smtp-Source: AB8JxZoltKQPu7w1j8wtIW4GRuQU08bZGDYsyKijWPmSgesh/+E6iHaSQTlKHrejly88Ivxbb6AtkQ== X-Received: by 2002:a65:4443:: with SMTP id e3-v6mr12923745pgq.348.1526401130318; Tue, 15 May 2018 09:18:50 -0700 (PDT) Received: from raichu (toroon0560w-lp140-04-70-29-84-206.dsl.bell.ca. [70.29.84.206]) by smtp.gmail.com with ESMTPSA id 184-v6sm579102pfg.89.2018.05.15.09.18.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 09:18:49 -0700 (PDT) Sender: Mark Johnston Date: Tue, 15 May 2018 12:18:43 -0400 From: Mark Johnston To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333345 - head/sys/dev/e1000 Message-ID: <20180515161843.GA63058@raichu> References: <201805080139.w481djMX062724@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805080139.w481djMX062724@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 16:18:52 -0000 On Tue, May 08, 2018 at 01:39:45AM +0000, Matt Macy wrote: > Author: mmacy > Date: Tue May 8 01:39:45 2018 > New Revision: 333345 > URL: https://svnweb.freebsd.org/changeset/base/333345 > > Log: > Sleep rather than spin in e1000 when doing long running config operations. > > With r333218 it is now possible for drivers to use an sx lock and thus sleep while > waiting on long running operations rather than DELAY(). > > Reported by: gallatin > Reviewed by: sbruno > Approved by: sbruno > MFC after: 1 month > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D14984 This commit causes igb to fail to attach to one of the ports on an I210: igb0@pci0:5:0:0: class=0x020000 card=0x153315d9 chip=0x15338086 rev=0x03 hdr=0x00 vendor = 'Intel Corporation' device = 'I210 Gigabit Network Connection' class = network subclass = ethernet igb1@pci0:6:0:0: class=0x020000 card=0x153315d9 chip=0x15338086 rev=0x03 hdr=0x00 vendor = 'Intel Corporation' device = 'I210 Gigabit Network Connection' class = network subclass = ethernet In the dmesg I see: igb0: port 0xd000-0xd01f mem 0xf8300000-0xf837ffff,0xf8380000-0xf8383fff irq 18 at device 0.0 numa-domain 0 on pci6 igb0: attach_pre capping queues at 4 igb0: Setup of Shared code failed, error -2 igb0: IFDI_ATTACH_PRE failed 6 device_attach: igb0 attach returned 6 pcib7: irq 19 at device 28.3 numa-domain 0 on pci1 pci7: numa-domain 0 on pcib7 igb0: port 0xc000-0xc01f mem 0xf8200000-0xf827ffff,0xf8280000-0xf8283fff irq 19 at device 0.0 numa-domain 0 on pci7 igb0: attach_pre capping queues at 4 igb0: using 1024 tx descriptors and 1024 rx descriptors igb0: msix_init qsets capped at 4 igb0: pxm cpus: 8 queue msgs: 4 admincnt: 1 igb0: using 4 rx queues 4 tx queues igb0: Using MSIX interrupts with 5 vectors igb0: allocated for 4 tx_queues igb0: allocated for 4 rx_queues From owner-svn-src-all@freebsd.org Tue May 15 16:24:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5940EE5EC4; Tue, 15 May 2018 16:24:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C12573116; Tue, 15 May 2018 16:24:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D2B05D99; Tue, 15 May 2018 16:24:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FGOwpL052737; Tue, 15 May 2018 16:24:58 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FGOw5K052736; Tue, 15 May 2018 16:24:58 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201805151624.w4FGOw5K052736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 15 May 2018 16:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333635 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 333635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 16:24:59 -0000 Author: brooks Date: Tue May 15 16:24:58 2018 New Revision: 333635 URL: https://svnweb.freebsd.org/changeset/base/333635 Log: Allow freebsd32 __sysctl(2) to return ENOMEM. This is required by programs like sockstat that read variably sized sysctls such as kern.file. The normal path has no such restriction and the restriction was added without comment along with initial support for freebsd32 in 2002 (r100384). Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15438 Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue May 15 15:56:52 2018 (r333634) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue May 15 16:24:58 2018 (r333635) @@ -2263,7 +2263,7 @@ freebsd32_sysctl(struct thread *td, struct freebsd32_s error = userland_sysctl(td, name, uap->namelen, uap->old, &oldlen, 1, uap->new, uap->newlen, &j, SCTL_MASK32); - if (error && error != ENOMEM) + if (error) return (error); if (uap->oldlenp) suword32(uap->oldlenp, j); From owner-svn-src-all@freebsd.org Tue May 15 16:32:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C545FEE6600; Tue, 15 May 2018 16:32:15 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77D2475DD9; Tue, 15 May 2018 16:32:15 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 3DF242117E; Tue, 15 May 2018 16:32:15 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f53.google.com with SMTP id n202-v6so3053501ita.1; Tue, 15 May 2018 09:32:15 -0700 (PDT) X-Gm-Message-State: ALKqPwfKE3DuJP3Hef5/5M20AOC2uw0tlAxSzONA8ABRsMyPeM98bUNG SLKd53lXIUhKQOXsd0u6O/CCcX76v1Jxh1Awwhs= X-Google-Smtp-Source: AB8JxZr37vpLgQBVsZVucc50bSgmJZmui5D058GrkaAo0A031tfmFec4xYgZFyZ+OJjs8kVhlcbduagR809sePrOi4w= X-Received: by 2002:a6b:3b42:: with SMTP id i63-v6mr16500324ioa.133.1526401934664; Tue, 15 May 2018 09:32:14 -0700 (PDT) MIME-Version: 1.0 References: <201805080139.w481djMX062724@repo.freebsd.org> <20180515161843.GA63058@raichu> In-Reply-To: <20180515161843.GA63058@raichu> From: Matthew Macy Date: Tue, 15 May 2018 09:32:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333345 - head/sys/dev/e1000 To: Mark Johnston 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.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 16:32:16 -0000 See r333631 On Tue, May 15, 2018 at 09:18 Mark Johnston wrote: > On Tue, May 08, 2018 at 01:39:45AM +0000, Matt Macy wrote: > > Author: mmacy > > Date: Tue May 8 01:39:45 2018 > > New Revision: 333345 > > URL: https://svnweb.freebsd.org/changeset/base/333345 > > > > Log: > > Sleep rather than spin in e1000 when doing long running config > operations. > > > > With r333218 it is now possible for drivers to use an sx lock and thus > sleep while > > waiting on long running operations rather than DELAY(). > > > > Reported by: gallatin > > Reviewed by: sbruno > > Approved by: sbruno > > MFC after: 1 month > > Sponsored by: Limelight Networks > > Differential Revision: https://reviews.freebsd.org/D14984 > > This commit causes igb to fail to attach to one of the ports on an I210: > > igb0@pci0:5:0:0: class=0x020000 card=0x153315d9 chip=0x15338086 > rev=0x03 hdr=0x00 > vendor = 'Intel Corporation' > device = 'I210 Gigabit Network Connection' > class = network > subclass = ethernet > igb1@pci0:6:0:0: class=0x020000 card=0x153315d9 chip=0x15338086 > rev=0x03 hdr=0x00 > vendor = 'Intel Corporation' > device = 'I210 Gigabit Network Connection' > class = network > subclass = ethernet > > In the dmesg I see: > > igb0: port 0xd000-0xd01f > mem 0xf8300000-0xf837ffff,0xf8380000-0xf8383fff irq 18 at device 0.0 > numa-domain 0 on pci6 > igb0: attach_pre capping queues at 4 > igb0: Setup of Shared code failed, error -2 > igb0: IFDI_ATTACH_PRE failed 6 > device_attach: igb0 attach returned 6 > pcib7: irq 19 at device 28.3 numa-domain 0 on pci1 > pci7: numa-domain 0 on pcib7 > igb0: port 0xc000-0xc01f > mem 0xf8200000-0xf827ffff,0xf8280000-0xf8283fff irq 19 at device 0.0 > numa-domain 0 on pci7 > igb0: attach_pre capping queues at 4 > igb0: using 1024 tx descriptors and 1024 rx descriptors > igb0: msix_init qsets capped at 4 > igb0: pxm cpus: 8 queue msgs: 4 admincnt: 1 > igb0: using 4 rx queues 4 tx queues > igb0: Using MSIX interrupts with 5 vectors > igb0: allocated for 4 tx_queues > igb0: allocated for 4 rx_queues > From owner-svn-src-all@freebsd.org Tue May 15 16:44:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CF67EE72CE; Tue, 15 May 2018 16:44:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF9278544; Tue, 15 May 2018 16:44:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00D666119; Tue, 15 May 2018 16:44:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FGiZ94062941; Tue, 15 May 2018 16:44:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FGiZYb062940; Tue, 15 May 2018 16:44:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201805151644.w4FGiZYb062940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 15 May 2018 16:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333636 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 333636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 16:44:36 -0000 Author: andrew Date: Tue May 15 16:44:35 2018 New Revision: 333636 URL: https://svnweb.freebsd.org/changeset/base/333636 Log: Increase the number of pages we allocate in the arm64 early boot. We are already close to the limit so increasing the kernel size may cause it to fail to boot when it runs past the end of allocated memory. Reported by: manu Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Tue May 15 16:24:58 2018 (r333635) +++ head/sys/arm64/arm64/locore.S Tue May 15 16:44:35 2018 (r333636) @@ -354,8 +354,8 @@ create_pagetables: mov x6, #(KERNBASE) /* Find modulep - begin */ sub x8, x0, x6 - /* Add a 2MiB page for the module data and round up */ - ldr x7, =(2 * L2_SIZE - 1) + /* Add two 2MiB pages for the module data and round up */ + ldr x7, =(3 * L2_SIZE - 1) add x8, x8, x7 /* Get the number of l2 pages to allocate, rounded down */ lsr x10, x8, #(L2_SHIFT) From owner-svn-src-all@freebsd.org Tue May 15 16:54:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51CF7EE7DBD; Tue, 15 May 2018 16:54:42 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 024ED7AB7E; Tue, 15 May 2018 16:54:42 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D755662D4; Tue, 15 May 2018 16:54:41 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FGsfSQ067830; Tue, 15 May 2018 16:54:41 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FGsfEi067829; Tue, 15 May 2018 16:54:41 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201805151654.w4FGsfEi067829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 15 May 2018 16:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333637 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 16:54:42 -0000 Author: shurd Date: Tue May 15 16:54:41 2018 New Revision: 333637 URL: https://svnweb.freebsd.org/changeset/base/333637 Log: Check that ifma_protospec != NULL in inm_lookup If ifma_protospec is NULL when inm_lookup() is called, there is a dereference in a NULL struct pointer. This ensures that struct is not NULL before comparing the address. Reported by: dumbbell Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15440 Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue May 15 16:44:35 2018 (r333636) +++ head/sys/netinet/in_mcast.c Tue May 15 16:54:41 2018 (r333637) @@ -344,12 +344,13 @@ inm_lookup_locked(struct ifnet *ifp, const struct in_a inm = NULL; TAILQ_FOREACH(ifma, &((ifp)->if_multiaddrs), ifma_link) { - if (ifma->ifma_addr->sa_family == AF_INET) { - inm = (struct in_multi *)ifma->ifma_protospec; - if (inm->inm_addr.s_addr == ina.s_addr) - break; - inm = NULL; - } + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) + continue; + inm = (struct in_multi *)ifma->ifma_protospec; + if (inm->inm_addr.s_addr == ina.s_addr) + break; + inm = NULL; } return (inm); } From owner-svn-src-all@freebsd.org Tue May 15 16:56:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A22BEE7F8B; Tue, 15 May 2018 16:56:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0B2B7AE21; Tue, 15 May 2018 16:56:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A36B662E2; Tue, 15 May 2018 16:56:30 +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 w4FGuUaK068486; Tue, 15 May 2018 16:56:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FGuUc4068485; Tue, 15 May 2018 16:56:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201805151656.w4FGuUc4068485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 15 May 2018 16:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333638 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 16:56:31 -0000 Author: avg Date: Tue May 15 16:56:30 2018 New Revision: 333638 URL: https://svnweb.freebsd.org/changeset/base/333638 Log: calibrate lapic timer in native_lapic_setup The idea is to calibrate the LAPIC timer just once and only on boot, given that [at present] the timer constants are global and shared between all processors. My primary motivation is to fix a panic that can happen when dynamically switching to lapic timer. The panic is caused by a recursion on et_hw_mtx when printing the calibration results to console. See the review for the details of the panic. Also, the code should become slightly simpler and easier to read. The previous code was racy too. Multiple processors could start calibrating the global constants concurrently, although that seems to have been benign. Reviewed by: kib, mav, jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D15422 Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Tue May 15 16:54:41 2018 (r333637) +++ head/sys/x86/x86/local_apic.c Tue May 15 16:56:30 2018 (r333638) @@ -206,6 +206,9 @@ SYSCTL_INT(_hw_apic, OID_AUTO, eoi_suppression, CTLFLA SYSCTL_INT(_hw_apic, OID_AUTO, timer_tsc_deadline, CTLFLAG_RD, &lapic_timer_tsc_deadline, 0, ""); +static void lapic_calibrate_initcount(struct lapic *la); +static void lapic_calibrate_deadline(struct lapic *la); + static uint32_t lapic_read32(enum LAPIC_REGISTERS reg) { @@ -787,6 +790,13 @@ native_lapic_setup(int boot) intrcnt_add(buf, &la->la_timer_count); } + /* Calibrate the timer parameters using BSP. */ + if (boot && IS_BSP()) { + lapic_calibrate_initcount(la); + if (lapic_timer_tsc_deadline) + lapic_calibrate_deadline(la); + } + /* Setup the timer if configured. */ if (la->la_timer_mode != LAT_MODE_UNDEF) { KASSERT(la->la_timer_period != 0, ("lapic%u: zero divisor", @@ -921,7 +931,7 @@ native_lapic_disable_pmc(void) } static void -lapic_calibrate_initcount(struct eventtimer *et, struct lapic *la) +lapic_calibrate_initcount(struct lapic *la) { u_long value; @@ -947,7 +957,7 @@ lapic_calibrate_initcount(struct eventtimer *et, struc } static void -lapic_calibrate_deadline(struct eventtimer *et, struct lapic *la __unused) +lapic_calibrate_deadline(struct lapic *la __unused) { if (bootverbose) { @@ -989,11 +999,6 @@ lapic_et_start(struct eventtimer *et, sbintime_t first struct lapic *la; la = &lapics[PCPU_GET(apic_id)]; - if (et->et_frequency == 0) { - lapic_calibrate_initcount(et, la); - if (lapic_timer_tsc_deadline) - lapic_calibrate_deadline(et, la); - } if (period != 0) { lapic_change_mode(et, la, LAT_MODE_PERIODIC); la->la_timer_period = ((uint32_t)et->et_frequency * period) >> From owner-svn-src-all@freebsd.org Tue May 15 17:21:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4843CEE998A; Tue, 15 May 2018 17:21:00 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E943B7F596; Tue, 15 May 2018 17:20:59 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC1936697; Tue, 15 May 2018 17:20:59 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FHKxeE080597; Tue, 15 May 2018 17:20:59 GMT (envelope-from antoine@FreeBSD.org) Received: (from antoine@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FHKxvS080594; Tue, 15 May 2018 17:20:59 GMT (envelope-from antoine@FreeBSD.org) Message-Id: <201805151720.w4FHKxvS080594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: antoine set sender to antoine@FreeBSD.org using -f From: Antoine Brodin Date: Tue, 15 May 2018 17:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333639 - in head/sys/amd64: include vmm X-SVN-Group: head X-SVN-Commit-Author: antoine X-SVN-Commit-Paths: in head/sys/amd64: include vmm X-SVN-Commit-Revision: 333639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 17:21:00 -0000 Author: antoine Date: Tue May 15 17:20:58 2018 New Revision: 333639 URL: https://svnweb.freebsd.org/changeset/base/333639 Log: vmmdev: return EFAULT when trying to read beyond VM system memory max address Currently, when using dd(1) to take a VM memory image, the capture never ends, reading zeroes when it's beyond VM system memory max address. Return EFAULT when trying to read beyond VM system memory max address. Reviewed by: imp, grehan, anish Approved by: grehan Differential Revision: https://reviews.freebsd.org/D15156 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Tue May 15 16:56:30 2018 (r333638) +++ head/sys/amd64/include/vmm.h Tue May 15 17:20:58 2018 (r333639) @@ -212,6 +212,7 @@ int vm_mmap_getnext(struct vm *vm, vm_paddr_t *gpa, in vm_ooffset_t *segoff, size_t *len, int *prot, int *flags); int vm_get_memseg(struct vm *vm, int ident, size_t *len, bool *sysmem, struct vm_object **objptr); +vm_paddr_t vmm_sysmem_maxaddr(struct vm *vm); void *vm_gpa_hold(struct vm *, int vcpuid, vm_paddr_t gpa, size_t len, int prot, void **cookie); void vm_gpa_release(void *cookie); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue May 15 16:56:30 2018 (r333638) +++ head/sys/amd64/vmm/vmm.c Tue May 15 17:20:58 2018 (r333639) @@ -821,8 +821,8 @@ sysmem_mapping(struct vm *vm, struct mem_map *mm) return (false); } -static vm_paddr_t -sysmem_maxaddr(struct vm *vm) +vm_paddr_t +vmm_sysmem_maxaddr(struct vm *vm) { struct mem_map *mm; vm_paddr_t maxaddr; @@ -931,7 +931,7 @@ vm_assign_pptdev(struct vm *vm, int bus, int slot, int if (ppt_assigned_devices(vm) == 0) { KASSERT(vm->iommu == NULL, ("vm_assign_pptdev: iommu must be NULL")); - maxaddr = sysmem_maxaddr(vm); + maxaddr = vmm_sysmem_maxaddr(vm); vm->iommu = iommu_create_domain(maxaddr); if (vm->iommu == NULL) return (ENXIO); Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Tue May 15 16:56:30 2018 (r333638) +++ head/sys/amd64/vmm/vmm_dev.c Tue May 15 17:20:58 2018 (r333639) @@ -173,7 +173,7 @@ static int vmmdev_rw(struct cdev *cdev, struct uio *uio, int flags) { int error, off, c, prot; - vm_paddr_t gpa; + vm_paddr_t gpa, maxaddr; void *hpa, *cookie; struct vmmdev_softc *sc; @@ -189,6 +189,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag return (error); prot = (uio->uio_rw == UIO_WRITE ? VM_PROT_WRITE : VM_PROT_READ); + maxaddr = vmm_sysmem_maxaddr(sc->vm); while (uio->uio_resid > 0 && error == 0) { gpa = uio->uio_offset; off = gpa & PAGE_MASK; @@ -204,7 +205,7 @@ vmmdev_rw(struct cdev *cdev, struct uio *uio, int flag */ hpa = vm_gpa_hold(sc->vm, VM_MAXCPU - 1, gpa, c, prot, &cookie); if (hpa == NULL) { - if (uio->uio_rw == UIO_READ) + if (uio->uio_rw == UIO_READ && gpa < maxaddr) error = uiomove(__DECONST(void *, zero_region), c, uio); else From owner-svn-src-all@freebsd.org Tue May 15 17:21:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 248BCEE9A02; Tue, 15 May 2018 17:21:19 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 88E0D7F854; Tue, 15 May 2018 17:21:18 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-x22a.google.com with SMTP id y15-v6so940168wrg.11; Tue, 15 May 2018 10:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tTj8+zYvr7t9cIfz5N4WN36Y1mw6nUy2VZe0etDsrf4=; b=Luekv4tIPGqCxCEsBbxeVbvmYTtGQlS4HOghEbPoDt43wPU6bDxBk41DwmCHh46LeL H5kFRRi6Djmm2NB8/H+4OMWEoZ/njyC4L7Wr5UG53pV4lEis0NCGLA/alZ6DjE8xSadB qCK/moUrb95IWq6/TwMVDJHgNneoJe05A7e34nMUf8VMl+Gta6fTw+JSHEFqOcfR2W1Q +b5Y3nF+eE9p3Ygd2jlvxSqC26PrYgDHP+ULbAUW1c2zQX0yHWxdWVgpm91NomAlGpwW S9QHg9IO7xf45jl9P0lsfSqEUK2eNq6Yc2Rh0dYvlKnJnhpV3M/HUVGjxd1AsHrRCxAz RLaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tTj8+zYvr7t9cIfz5N4WN36Y1mw6nUy2VZe0etDsrf4=; b=CF4IpWT3nlzL/8bVRLxBcFomI5NaOcKDcoaD5K5vzLcGO6WqcIu2lOfUisRCIVMtIU sihUaofBjd99gO5SHXwnT//m9FNl3yxOZrz/YoGf6Ho6uFO7yHM08NRDjiIfry5ihX2Y soBeyfRaUam64bBS0Apka649EtEd6uu2IO/gDMqtZ1qK2zdFXEHLJVICHEF2q0S2Sx4R 3pOr3rVsGhAyQbg6oNwYygdNmcPI/+5u26lm//CWiWuMgbDVwOBj0kuAJQO0MRdIUQuN HL0FemHj2UEKyxx6YWNWcCBwxytUgeTekWUbSX5UwvP2aew7BmAxu3KwwLrFbdF86heV j5cA== X-Gm-Message-State: ALKqPwemI1UFnL758xy4rGF7PgcCXKC822cZE3rKDAQ0qA+kfsOlktOw Fy0otqCCXYpBrF3TXo1iqRkkrGKsgd/x+O7WrP73wzWP X-Google-Smtp-Source: AB8JxZqKrKse0GQZPh78pnOtOkIPVd+6cXVktunBO22QB+put07Ms2oeYW91By5V2AN3MI+jA4LGfUR2uwtdE85NjDo= X-Received: by 2002:adf:b583:: with SMTP id c3-v6mr11838767wre.228.1526404877298; Tue, 15 May 2018 10:21:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.197.74 with HTTP; Tue, 15 May 2018 10:21:16 -0700 (PDT) In-Reply-To: <201805140014.w4E0EeXt087837@pdx.rh.CN85.dnsmgr.net> References: <201805140014.w4E0EeXt087837@pdx.rh.CN85.dnsmgr.net> From: Jonathan Looney Date: Tue, 15 May 2018 13:21:16 -0400 Message-ID: Subject: Re: svn commit: r333494 - head/share/man/man7 To: rgrimes@freebsd.org Cc: araujo@freebsd.org, "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 17:21:19 -0000 On Sun, May 13, 2018 at 8:14 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > It did take me some time to track down this "crazy concept you all > think I just invented", but it is infact in the GNU groff info > documentaton (found on my 5.4 systems in /usr/share/info/groff.info.gz): Just to be clear, I don't think these rules apply to FreeBSD. We use mandoc. See mandoc(1) for the rules that apply to us. And, again, just to be clear, I am also pretty sure the following rule doesn't apply: > * In keeping with this, it is helpful to begin a new line after every > comma or phrase, since common corrections are to add or delete > sentences or phrases. OTOH, I believe we do have a rule about beginning each sentence on a new line. (Again, see mandoc(1).) And, it is easy to figure out whether your page complies with the style using mandoc's checkers. For example: $ mandoc -W all,stop /usr/share/man/man9/tcp_functions.9.gz mandoc: /usr/share/man/man9/tcp_functions.9.gz:284:16: WARNING: new sentence, new line Jonathan PS: I'm happy to be corrected by one of the man page experts, which I most certainly am not. From owner-svn-src-all@freebsd.org Tue May 15 17:57:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1F0FEEC0D9; Tue, 15 May 2018 17:57:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93CF3696AA; Tue, 15 May 2018 17:57:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75EDB6D32; Tue, 15 May 2018 17:57:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FHvkrQ099574; Tue, 15 May 2018 17:57:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FHvkxo099573; Tue, 15 May 2018 17:57:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201805151757.w4FHvkxo099573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 15 May 2018 17:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333640 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 333640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 17:57:47 -0000 Author: brooks Date: Tue May 15 17:57:46 2018 New Revision: 333640 URL: https://svnweb.freebsd.org/changeset/base/333640 Log: Remove stray tabs in in6_lltable_dump_entry(). NFC. Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue May 15 17:20:58 2018 (r333639) +++ head/sys/netinet6/in6.c Tue May 15 17:57:46 2018 (r333640) @@ -2350,62 +2350,62 @@ in6_lltable_dump_entry(struct lltable *llt, struct lle int error; bzero(&ndpc, sizeof(ndpc)); - /* skip deleted entries */ - if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) - return (0); - /* Skip if jailed and not a valid IP of the prison. */ - lltable_fill_sa_entry(lle, - (struct sockaddr *)&ndpc.sin6); - if (prison_if(wr->td->td_ucred, - (struct sockaddr *)&ndpc.sin6) != 0) - return (0); - /* - * produce a msg made of: - * struct rt_msghdr; - * struct sockaddr_in6 (IPv6) - * struct sockaddr_dl; - */ - ndpc.rtm.rtm_msglen = sizeof(ndpc); - ndpc.rtm.rtm_version = RTM_VERSION; - ndpc.rtm.rtm_type = RTM_GET; - ndpc.rtm.rtm_flags = RTF_UP; - ndpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; - if (V_deembed_scopeid) - sa6_recoverscope(&ndpc.sin6); + /* skip deleted entries */ + if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) + return (0); + /* Skip if jailed and not a valid IP of the prison. */ + lltable_fill_sa_entry(lle, + (struct sockaddr *)&ndpc.sin6); + if (prison_if(wr->td->td_ucred, + (struct sockaddr *)&ndpc.sin6) != 0) + return (0); + /* + * produce a msg made of: + * struct rt_msghdr; + * struct sockaddr_in6 (IPv6) + * struct sockaddr_dl; + */ + ndpc.rtm.rtm_msglen = sizeof(ndpc); + ndpc.rtm.rtm_version = RTM_VERSION; + ndpc.rtm.rtm_type = RTM_GET; + ndpc.rtm.rtm_flags = RTF_UP; + ndpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; + if (V_deembed_scopeid) + sa6_recoverscope(&ndpc.sin6); - /* publish */ - if (lle->la_flags & LLE_PUB) - ndpc.rtm.rtm_flags |= RTF_ANNOUNCE; + /* publish */ + if (lle->la_flags & LLE_PUB) + ndpc.rtm.rtm_flags |= RTF_ANNOUNCE; - sdl = &ndpc.sdl; - sdl->sdl_family = AF_LINK; - sdl->sdl_len = sizeof(*sdl); - sdl->sdl_index = ifp->if_index; - sdl->sdl_type = ifp->if_type; - if ((lle->la_flags & LLE_VALID) == LLE_VALID) { - sdl->sdl_alen = ifp->if_addrlen; - bcopy(lle->ll_addr, LLADDR(sdl), - ifp->if_addrlen); - } else { - sdl->sdl_alen = 0; - bzero(LLADDR(sdl), ifp->if_addrlen); - } - if (lle->la_expire != 0) - ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + - lle->lle_remtime / hz + - time_second - time_uptime; - ndpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); - if (lle->la_flags & LLE_STATIC) - ndpc.rtm.rtm_flags |= RTF_STATIC; - if (lle->la_flags & LLE_IFADDR) - ndpc.rtm.rtm_flags |= RTF_PINNED; - if (lle->ln_router != 0) - ndpc.rtm.rtm_flags |= RTF_GATEWAY; - ndpc.rtm.rtm_rmx.rmx_pksent = lle->la_asked; - /* Store state in rmx_weight value */ - ndpc.rtm.rtm_rmx.rmx_state = lle->ln_state; - ndpc.rtm.rtm_index = ifp->if_index; - error = SYSCTL_OUT(wr, &ndpc, sizeof(ndpc)); + sdl = &ndpc.sdl; + sdl->sdl_family = AF_LINK; + sdl->sdl_len = sizeof(*sdl); + sdl->sdl_index = ifp->if_index; + sdl->sdl_type = ifp->if_type; + if ((lle->la_flags & LLE_VALID) == LLE_VALID) { + sdl->sdl_alen = ifp->if_addrlen; + bcopy(lle->ll_addr, LLADDR(sdl), + ifp->if_addrlen); + } else { + sdl->sdl_alen = 0; + bzero(LLADDR(sdl), ifp->if_addrlen); + } + if (lle->la_expire != 0) + ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + + lle->lle_remtime / hz + + time_second - time_uptime; + ndpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); + if (lle->la_flags & LLE_STATIC) + ndpc.rtm.rtm_flags |= RTF_STATIC; + if (lle->la_flags & LLE_IFADDR) + ndpc.rtm.rtm_flags |= RTF_PINNED; + if (lle->ln_router != 0) + ndpc.rtm.rtm_flags |= RTF_GATEWAY; + ndpc.rtm.rtm_rmx.rmx_pksent = lle->la_asked; + /* Store state in rmx_weight value */ + ndpc.rtm.rtm_rmx.rmx_state = lle->ln_state; + ndpc.rtm.rtm_index = ifp->if_index; + error = SYSCTL_OUT(wr, &ndpc, sizeof(ndpc)); return (error); } From owner-svn-src-all@freebsd.org Tue May 15 17:59:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83717EEC2C4; Tue, 15 May 2018 17:59:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 387E36AA09; Tue, 15 May 2018 17:59:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19D746D3F; Tue, 15 May 2018 17:59:47 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FHxkti099690; Tue, 15 May 2018 17:59:46 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FHxkP7099689; Tue, 15 May 2018 17:59:46 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201805151759.w4FHxkP7099689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 15 May 2018 17:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333641 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 333641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 17:59:47 -0000 Author: brooks Date: Tue May 15 17:59:46 2018 New Revision: 333641 URL: https://svnweb.freebsd.org/changeset/base/333641 Log: Unwrap some not-so-long lines now that extra tabs been removed. Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue May 15 17:57:46 2018 (r333640) +++ head/sys/netinet6/in6.c Tue May 15 17:59:46 2018 (r333641) @@ -2354,10 +2354,8 @@ in6_lltable_dump_entry(struct lltable *llt, struct lle if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) return (0); /* Skip if jailed and not a valid IP of the prison. */ - lltable_fill_sa_entry(lle, - (struct sockaddr *)&ndpc.sin6); - if (prison_if(wr->td->td_ucred, - (struct sockaddr *)&ndpc.sin6) != 0) + lltable_fill_sa_entry(lle, (struct sockaddr *)&ndpc.sin6); + if (prison_if(wr->td->td_ucred, (struct sockaddr *)&ndpc.sin6) != 0) return (0); /* * produce a msg made of: @@ -2384,16 +2382,14 @@ in6_lltable_dump_entry(struct lltable *llt, struct lle sdl->sdl_type = ifp->if_type; if ((lle->la_flags & LLE_VALID) == LLE_VALID) { sdl->sdl_alen = ifp->if_addrlen; - bcopy(lle->ll_addr, LLADDR(sdl), - ifp->if_addrlen); + bcopy(lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); } else { sdl->sdl_alen = 0; bzero(LLADDR(sdl), ifp->if_addrlen); } if (lle->la_expire != 0) ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + - lle->lle_remtime / hz + - time_second - time_uptime; + lle->lle_remtime / hz + time_second - time_uptime; ndpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); if (lle->la_flags & LLE_STATIC) ndpc.rtm.rtm_flags |= RTF_STATIC; From owner-svn-src-all@freebsd.org Tue May 15 18:01:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17E3CEEC543; Tue, 15 May 2018 18:01:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6636D6B62E; Tue, 15 May 2018 18:01:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4FI1S0v096721; Tue, 15 May 2018 11:01:28 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4FI1S4w096720; Tue, 15 May 2018 11:01:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805151801.w4FI1S4w096720@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333494 - head/share/man/man7 In-Reply-To: To: Jonathan Looney Date: Tue, 15 May 2018 11:01:28 -0700 (PDT) CC: rgrimes@freebsd.org, araujo@freebsd.org, "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 18:01:33 -0000 > On Sun, May 13, 2018 at 8:14 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > It did take me some time to track down this "crazy concept you all > > think I just invented", but it is infact in the GNU groff info > > documentaton (found on my 5.4 systems in /usr/share/info/groff.info.gz): > > Just to be clear, I don't think these rules apply to FreeBSD. We use > mandoc. See mandoc(1) for the rules that apply to us. That is a rather fine line. mandoc is a replacement set for groff -man, which is a replacement for troff/nroff man. What I found are helpful guidelines for anyone writting groff type input, they still apply to mandoc. > > And, again, just to be clear, I am also pretty sure the following rule > doesn't apply: > > > * In keeping with this, it is helpful to begin a new line after every ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Again, these are helpful things that have been around for a very decades, and for someone who has worked on a good deal of *roff input, it is truely helpful in many ways to do this. As one sample of helpful it makes it usually easier to find things in the *roff sources when trying to edit a manpage, Another is it minimizes diffs when making changes. > > comma or phrase, since common corrections are to add or delete > > sentences or phrases. > > OTOH, I believe we do have a rule about beginning each sentence on a new > line. (Again, see mandoc(1).) Yes > > And, it is easy to figure out whether your page complies with the style > using mandoc's checkers. Comply with and being of good style and design are not one and the same. > For example: > > $ mandoc -W all,stop /usr/share/man/man9/tcp_functions.9.gz > mandoc: /usr/share/man/man9/tcp_functions.9.gz:284:16: WARNING: new > sentence, new line > > Jonathan > > PS: I'm happy to be corrected by one of the man page experts, which I most > certainly am not. I would encoruage the man page expects to adopt this set of helpful guidelines, not necessarily making them hard rules, but at least suggesting one knows about them. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue May 15 18:41:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCB2CEEEF40; Tue, 15 May 2018 18:41:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87DCA73BB0; Tue, 15 May 2018 18:41:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A30F740B; Tue, 15 May 2018 18:41:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FIf25K020967; Tue, 15 May 2018 18:41:02 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FIf1ln020963; Tue, 15 May 2018 18:41:01 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805151841.w4FIf1ln020963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 15 May 2018 18:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333642 - in stable/11/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Commit-Revision: 333642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 18:41:03 -0000 Author: np Date: Tue May 15 18:41:01 2018 New Revision: 333642 URL: https://svnweb.freebsd.org/changeset/base/333642 Log: MFC r331340, r331342, r331472, r332050, r333276, r333448: r331340: cxgbe(4): Tunnel congestion drops on a port should be cleared when the stats for that port are cleared. r331342: cxgbe(4): Do not read MFG diags information from custom boards. r331472: cxgbe(4): Always initialize requested_speed to a valid value. This fixes an avoidable EINVAL when the user tries to disable AN after the port is initialized but l1cfg doesn't have a valid speed to use. r332050: cxgbe(4): Always display an error message if SIOCSIFFLAGS will leave IFF_UP and IFF_DRV_RUNNING out of sync. ifhwioctl in the kernel pays no attention to the return code from the driver ioctl during SIOCSIFFLAGS so these messages are the only indication that the ioctl was called but failed. r333276: cxgbe(4): Update all firmwares to 1.19.1.0. r333448: cxgbe(4): Disable write-combined doorbells by default. This had been the default behavior but was changed accidentally as part of the recent iw_cxgbe+OFED overhaul. Fix another bug in that change while here: the global knob affects all the adapters in the system and should be left alone by per-adapter code. Approved by: re@ (marius@) Sponsored by: Chelsio Communications Added: stable/11/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu - copied unchanged from r333276, head/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu - copied unchanged from r333276, head/sys/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu - copied unchanged from r333276, head/sys/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu Deleted: stable/11/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu Modified: stable/11/sys/conf/files stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/modules/cxgbe/t4_firmware/Makefile stable/11/sys/modules/cxgbe/t5_firmware/Makefile stable/11/sys/modules/cxgbe/t6_firmware/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Tue May 15 17:59:46 2018 (r333641) +++ stable/11/sys/conf/files Tue May 15 18:41:01 2018 (r333642) @@ -1381,7 +1381,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1415,7 +1415,7 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.19.1.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" @@ -1449,7 +1449,7 @@ t6fw.fwo optional cxgbe \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.19.1.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Tue May 15 17:59:46 2018 (r333641) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Tue May 15 18:41:01 2018 (r333642) @@ -2958,7 +2958,7 @@ static int get_vpd_keyword_val(const u8 *vpd, const ch * Reads card parameters stored in VPD EEPROM. */ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p, - u32 *buf) + uint16_t device_id, u32 *buf) { int i, ret, addr; int ec, sn, pn, na, md; @@ -3026,12 +3026,16 @@ static int get_vpd_params(struct adapter *adapter, str memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); + if (device_id & 0x80) + return 0; /* Custom card */ + md = get_vpd_keyword_val(vpd, "VF", 1); if (md < 0) { snprintf(p->md, sizeof(p->md), "unknown"); } else { i = vpd[md - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->md, vpd + md, min(i, MD_LEN)); + strstrip((char *)p->md); } return 0; @@ -3716,8 +3720,6 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m fec = FW_PORT_CAP_FEC_RS; else if (lc->requested_fec & FEC_BASER_RS) fec = FW_PORT_CAP_FEC_BASER_RS; - else if (lc->requested_fec & FEC_RESERVED) - fec = FW_PORT_CAP_FEC_RESERVED; if (!(lc->supported & FW_PORT_CAP_ANEG) || lc->requested_aneg == AUTONEG_DISABLE) { @@ -7714,8 +7716,6 @@ static void handle_port_info(struct port_info *pi, con fec |= FEC_RS; if (lc->advertising & FW_PORT_CAP_FEC_BASER_RS) fec |= FEC_BASER_RS; - if (lc->advertising & FW_PORT_CAP_FEC_RESERVED) - fec |= FEC_RESERVED; lc->fec = fec; } @@ -8051,10 +8051,6 @@ int t4_prep_adapter(struct adapter *adapter, u32 *buf) if (ret < 0) return ret; - ret = get_vpd_params(adapter, &adapter->params.vpd, buf); - if (ret < 0) - return ret; - /* Cards with real ASICs have the chipid in the PCIe device id */ t4_os_pci_read_cfg2(adapter, PCI_DEVICE_ID, &device_id); if (device_id >> 12 == chip_id(adapter)) @@ -8064,6 +8060,10 @@ int t4_prep_adapter(struct adapter *adapter, u32 *buf) adapter->params.fpga = 1; adapter->params.cim_la_size = 2 * CIMLA_SIZE; } + + ret = get_vpd_params(adapter, &adapter->params.vpd, device_id, buf); + if (ret < 0) + return ret; init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd); Copied: stable/11/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu (from r333276, head/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu Tue May 15 18:41:01 2018 (r333642, copy of r333276, head/sys/dev/cxgbe/firmware/t4fw-1.19.1.0.bin.uu) @@ -0,0 +1,9747 @@ +/*- + * Copyright (c) 2018 Chelsio Communications, Inc. + * 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. + */ +begin-base64 644 t4fw +AAAEOgETAQAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABB0ELAQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFR1ZSBBcHIgMTAgMDU6 +MDY6MzIgUERUIDIwMTggb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZSksIFZlcnNpb24gVDR4eCAwMS4xMy4wMS4wMAAAAAAAAAAAAAAAAPpruZRg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//0o4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//jhAAAAAA +H/+OFAAAAAAf/44YAAAAAB//jhwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+FsOMACfgf/4WwH/+FsOMAD6gf +/4WwH/+FsOMAD6gf/4WwH/+HQOMAD6gf/4dAH/+OBOMAETgf/44QH/+yMOMAGAgf/7IwH/+yMOMA +PCgf/8AAH//+FeMAPCggAAAAIAABauMAekAgAAF4IAABfOMAe6wgAAF8IAABheMAe7AgAAGYIAAB +nOMAe7wgAAGcIAABpeMAe8AgAAG4IAABvOMAe8wgAAG8IAABxeMAe9AgAAHYIAAB2OMAe9wgAAHc +IAAB4uMAe9wgAAH4IAAB+OMAe+QgAAH8IAAB/OMAe+QgAAIYIAACGOMAe+QgAAIcIAACHOMAe+Qg +AAI4IAACOOMAe+QgAAI8IAACPOMAe+QgAAJYIAACWOMAe+QgAAJcIAACYuMAe+QgAAJ4IAACeOMA +e+wgAAJ8IAACguMAe+wgAAKYIAIPE+MAe/QgAwAAIAMXYOMCiHAgAxdgIAMXYOMCn9AgAxdgIAcH +5OMCn9AgBwfwIAcLYOMGkGAgCAAAIAgS8OMGk9AgCBLwIAksXuMGpsAgCSxgIAktLOMHwDAgCwAA +IAsAAOMHwPwgCwAAIAsAAOMHwPwgCwAAIAt3GOMHwPwAAAAAAAAAAAAAAAAgABQWIAAUCCAAF/Ig +ABQIIAAXbSAAFAggABS6IAAXBSAAFoogABQIIAAWOSAAFfIgABWFIAAT9SAAFS8gABQIIAAUCCAA +FAggABTaAAAAAP///////w/8///w////APz///////8P/P//8P///wD8IADIliAAyh4gAMpOIADK +FCAAyb8gAMm1IADJhCAAyXogAMlwIADJHyAAykwgAMkVIADI5SAAyk4gAMjbIADIyQEQGAEABAAA +AAAAIAAAAEAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7OwAAAAAAAAAg +BRoMIAHEHCAAPbAgAZAYIAG++CABuWggAXYAIARFiB//6dQgALEoIADLAB//3LAgAHaQIABoqAAA +AAAAAAAAIAGR0CAAnRwgAJZgAAAAAB//1TQf/8U8H//CWB//wDAgAFuIIABO5CAATBAgALy4H//j +iCAG3ZAAAAAAAAAAACAAUpggAF7EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIADFKCABqRggANVY +IADUfB//8LAf/8/YH//LkCAAk9ggBZpQIAFBOCABKaggAQ44IAEFkCAA+rQgAO0sIADYSCAFHgAg +AyggIAE2nCADVFggAfUEIAB2UAAAAAAgANW8IAYQHCAAyAggAZu0IAACmCAAtngAAAAAAAAAAB// +89AgANV0IAMq0AAAAAAAAAAAIAOsuCAAKjQgA6sAIAAotAAAAAAgADToIAAzHCAAMWQAAAAAIAA9 +VCABOmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgBBF4IAUZrAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAA6yCADtYAgADeYAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAACAAPbAgAK6kAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsA +AAAgAxS0CAAAACADFMAIAAAAIAMUzAoAAAAgAxTYDAAAACADFOQSAAAAIAMU9A0AAAAgAxUIDgAA +ACADFRgTAAAAIAMVKAoAAAAgAxU8DgAAACADFUgYAAAAIAMVWA0AAAAgAxV0DgAAACADFYQQAAAA +IAMVlBIAAAAgAxWoDgAAACADFbwQAAAAIAMVzBEAAAAgAxXgCgAAACADFfQLAAAAIAMWAA0AAAAg +AxYMFAAAACADFhwKAAAAIAMWNA8AAAAgAxZABgAAACADFlAGAAAAIAMWWAYAAAAgAxZgBgAAACAD +FmgGAAAAIAMWcAkAAAAgAxZ4BgAAACADFoQEAAAAIAMWjAYAAAAgAxaUCwAAACADFpwLAAAAIAMW +qAQAAAAgAxaMBAAAACADFrQJAAAAIAMWvAkAAAAgAxbIAAAAAAAAAAANAAAAIAMW1AoAAAAgAxbk +BgAAACADFvACAAAAIAMW+AMAAAAgAxCMAQAAACADFvwAAAAAAAAAANdqpHjox7dWJCBw28G9zu71 +fA+vR4fGKqgwRhP9RpUBaYCY2ItE96///1uxiVzXvmuQESL9mHGTpnlDjkm0CCH2HiViwECzQCZe +WlHptseq1i8QXQJEFFPYoeaB59P7yCHhzebDNwfW9NUNh0VaFO2p4+kF/O+j+GdvAtmNKkyK//o5 +Qodx9oFtnWEi/eU4DKS+6kRL3s+p9rtLYL6/vHAom37G6qEn+tTvMIUEiB0F2dTQOebbmeUfonz4 +xKxWZfQpIkRDKv+Xq5Qjp/yToDllW1nDjwzMkv/v9H2FhF3Rb6h+T/4s5uCjAUMUTggRofdTfoK9 +OvI1KtfSu+uG05EHDBEWBwwRFgcMERYHDBEWBQkOFAUJDhQFCQ4UBQkOFAQLEBcECxAXBAsQFwQL +EBcGCg8VBgoPFQYKDxUGCg8VH//AAAAEACAgBwtgIAcQ0B/83gAf/6gEIAcLsB//qSQf/6ygA4AA +AIEAAAAA//gAAQAAAAAQAACBBAEAgQQAAAEEAAABBAEAgAAAAAAF//8GAAAABAEACB//gMAqAAAA +H//PNAIAAACAEAAAQUAAAEFAAQCDAAAB//+//7////8f/5RYBAAACCADDqiBgAAADAAAAB//jqD/ +/wAA//8A/wABAAAAAP//H/+vkB//pFwP///////QdB//Yhwf/ODoIAcJPP//vwwf/2KcH/+p3B// +mmQf/OIAAAAIyOD//gDhAZIAH/+UxAD///8f/5kMH/+qAARBAAilAAAAwAAAAMAEAAAwAAAAH/+q +kAAAHdAAAP+AIAcH8CALR0DhAC4AH/+qhB//pjwf/6swH/+moB//qoDgAACg4QAwuOAAAAAAAIAA +4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+x8B//segf/OAIH/+x7B//sggf +/7IAH/+yBB//siAf/7IYH/+yHB//qAQf/6+QIAcLsB/83gAf/6kkH/+ooB//qcAf/5kcH/+vDB// +pcQgCwBgH/+rXAAA/4AAAB6wH/+OoB//q2gf/6tkH/+ryB//rJAqAAAAIAsEYCALBJAEAAAIBQAA +AIP/AACBAAAAABAAACALBNAgCwQwIAAJ+CADDbgf/4TwH/+AwB//rKBnRSMB782riZi63P4QMlR2 +H/+AAAAAPyggAxCMz////yALBfAQAAAAP////wIAAABAAAAAGgAAAB/84HQgoAAAH/+nuCAAHeAg +AB98gAAAAAAAgAD//v//AAAQAABAAAAgADn8IAAjCCAAAAAgACNwIAsIwP//f///+///D/aAACAL +CPAgCwkgAAEAAAAEAAAf/6goIAtTYCALCbAgADToIAA2OCAAMxwgCwtQIAsKECALCqAgADFkIAsK +8FMAAAAA////UgAAAFEAAAAgAf5YH/+p2CAAOWAgBA1gH/+p0CALC3Af/5kUH/+ppCALDZAUAAAA +gAAAAnxQAACAAAAQgAAABoAAsAAAAAoAAP80kv//8A+AALEA4QGaAAACAAAgCw0gH/+WiAAAfkAg +Cw1gH/+p1AD/wAABAAAAKAAAAOAAAAAmAAAAAAD//x//j3AGAAAABYAAAB//pYgrAAAAIABWACAL +VkAf/6dUA4AAAAf///8EAQAINQAAAAMAAAAAP///gEAAAAgP//8f////QUAAAEFAAQAABf//AQQB +AAEEAAAAAMAAH/+puD0AAAAf/5UABwAAAIEEAQCBBAAAH/+pkAAAOpjDAAAAAAAP/wBDAAAf/6cY +AAAIAAQAAAAgC1agH/+xZB//r7Af/5RYAAYAAOEAegAf/5TAH/+pxB//qgAf/5kkH/+ZECALVtAA +AweAIAtXQAgAAAAf/5bwACAAAAAACQAAADAC//z4f8AAAACj/7sAo/+6AA0AAADgAwAAg/+2AA// +//8P//gA/wAAACALV4AgCw7QIAsPACALWBAADwAAAAoAAP//AA8D/8AAg//AACALWJAgC1kAH/+q +SB//sCD/YPAAH/+wAB//jiAEgAAIH/+AUABEAAABgMIAAACBAB//jmAf/4Bg/x///wDAAADwAAAA +gYAAAP9///8f/6Rc/7//////AAAAgAAAAACG3R//mlwf/OIAH/+PYO4AAAAAAAnMH/ziDA8AAAAg +Cw9AAAAIzB//q1Qf/5pkIAsRMCADCDDg//4AIAtM0B//muAf/5T8H/+AcCAHCZAAADAAAAAnEB// +3CAgC2OQIAtjYB//qrQf/5T0AAD//h//mQTerb7vNAAAAD8AAAAAAIkGAJkAAB//rygQAAcCAcCA +AB//rwSZAAAAH/+v5ACIAAiCgAABH/+veP//8AADFQAAAxEAAAAPA/8gAQHsIAEF2CkAAAAAAIkU +IAEKrCADC3QAAEAAIAMOoAwAAAAgARWwH/+wQAAAIaAgAwuEH/+qGB//rkgf/6nc/wD/APDw8PCq +qqqqzMzMzB//pcgAA///AAAn/yADC8ggC2PgIAEmCAAPQkAgA1t4H/+qeAAJAAAAAEgAggAAACAB +Omgf/6osOwAACA4AAADQAAAAH/+AsAAAIooAAAhQAAAfQB//qeQgCyKwIAsi0CALIvD/3///AAkA +CB//r3QwAAAAfwAAAB//qBQgCyYQAAAP/iALJUAgCyWgIAsl4AAA4AD///f/IAsmoCADYqwAAIP/ +IAcPmBWgAAAgBxCQH/+vOAAACAYAAIjMH/+WoAAEA/8KAAAAIAcMKCAHDcggBwxwH/+ZoIP/twCD +/7YgIAsm0OEAAAAzAAAAH/+vQB//sDQD/+AAf///AAA/9pAAACKYA//wACALSiAgC0ngIAtKQB// +sUAf/688AA///x//qeAgC2ZAH/+ZRCAAerggBwkYIAAFiB//pKAf/5YcH/+UjB//qRQgCydQwAQA +AB//p9Af/6fEH/+n3B//rfAf/61kIAPm4CALJ5AgAw9QH/+l3CAAe5jgAQAAH/+aYCALZwAgCyfQ +IADBkB//mlggAL6QH/+QqCALZoAgC2bQH/+WwCALKeAf/480H/+Q7CALPkAgCz5wSAAAACAB0Bgf +/6dkIAHSHB//lUgf/6Y8H/+lJB//pOwAABhQAAAWTB//qDQgBwukH/+lfB//lMThAC4AH/+oQOEA +XgDhAg4A//+//+EADgDhAY4A//++/x//pgwgAddgIAHjdOAFAAAD/wAAH/+lRCADDqgf/L//PAAA +AB//gLiDAAAAH/+lLA88AAAgC0mggoAAACACBVQgAggIH/+qxCACC8AAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAACBgAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAgYAAAAAAAAD/////////////////////H//8AB///AAf//vIH//7 +yB//+8gf//vIH//1SB//+Hgf//bQH//20B//9tAgBt+AAAAAAAAAAAAAAAAAAAAAACAG4sggBuLI +AAAAAAAAAAAAAAAAAAAAACAG34AgBt+AH//5dB//+XQf//l0H//5dB//+XQf//l0AAAAACAB2HgA +AAAAAAAAAAAAAAAAAAAAAgEAAAAAAAAAAAAAAAAAAAEDEREICBAJAwEAAAAAAAAEAAAAAAAAAIGA +AAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAACAKABHxaxPxa9MPA+YxAQIAFvFpF/Fqd2sGkGC0Zndj+FQPEFXRwg8UAGP/+QAA +AGwQCCggBZQVJCAH9mCkFaAZRQD5AA2NYUQBAIgiGvFdF/Fc7fFdHAsOAAAMSRGnmSuSnsDp/2AM ++6AMpQApkp0KSworssMLmQHpFgQkjJmAAInY9yAM+JIAnQAvcq5k8UEf8U4qcq0v8n/vqwEEw/0A +AP9ACX5iAJ0AmNj/QAmGYgCdAIoVKSAUqpkJCUcpJBT1IAu10gCdABvxQS8iFi0hKYkUGPFAr92Y +kPpDyBWgDiUA7pYCLu/CgAD9IGYV4AxlAO3xOR1WAoAADKoCjBSakesAFQTIQQAA+IJoHeBKBQCd +xurGByZIgQAA6+MFDNAEgAAKAmEKAmEKAmEKAmHApOpqNgHAQQAAbakFCACGCQJhKCEpH/El+EUE +FeAMFQD5ACAVoA0FAPogiBXviAEACYgu+kPIFa+IAQD4RSQdoAYFAPYgBhWgHuUA5hYCLEVCgADo +FgEl2YEAAFiJ8P6AABc3xQEA98AAR3ANlQDt5p0oBAqAAPmABMFSAJ0AwCDRDwAAAAAA6iQACdgE +gADsEgUq6ASAAFiLu9Kg0Q8AAAAAwLAMnzTv1ggt9sYAAPpAaB2gG8UA/AACHaANFQBYkixj/8EA +AOokAArYBIAAWI1o0qDRDwD/+bQNoAkFAOokAAJYYQAA/AACHaANlQBYkiBj/5HAoFnMEh3w54nY ++T/yuJAMpQBj/6TaIFgLfGP+hYonjRXAwOqsIC7YBIAAWIVT0qDRD2wQBi4iECQWAeUhGirQBIAA +JiAH9kEoFeAfxQDqFgAqx8KAAP8CUg3hZgEABwlC8SBwDeKFAQBkge3U8CkgBfxASBWgG4UA/p4A +DbAaRQD7IA9tIgCdAOXwxB4L1gAA5/DDG08CgAD0wAwKEgCdAKWZLZKe96ARw1IAnQApkp0Hagoq +osMKmQHulAAEjiGAAIwpiyoMBz4Muwz3YAkD4gCdACogTi0gTLGo+6ANxCALFQAoJE4qMAEpIhjz +QA3OkgCdACsgBy0hJPhgJBWgDFUA/UAEBTC7EQDgqhEN2oKAAAuqAhvwqQqIAiohBywhCQvdAvsG +AAx6qgEA6/CkHVMCgAAKzAIqISKY4IggnOOd5AuqApri/QAAFDAKZQAKiAKY4S0iEJ3lLCA4G/CZ ++AAiHaBNFQD5wSYVoMwZAAzYOR3wlJToDL05+aYADrALBQCb5xjwiZ3m7fCKFOAFAAAsJhib65nq +6AAVB0jBAAAJAIrt5g4hyEEAAO/mDyd5AQAACSCGDwJjCQCGDwJhDG4Rpe7q5p0jgKmAAIgpLyA4 +p4iYKfPgB/eSAJ0AiRAJCUf5IAbhUgCdAMAg0Q8AnhLqJAAL2ASAAFiOSI4S/00QDeAfxQDsEgEp +UASAAO0SACnYBIAAWIse0qDRDx7wYYro90AGGJIAnQAMaRGlmSuSnvdgBmtSAJ0AKZKdB2sKK7LD +C5kBZJC7sKyc6O6UAAzzhgAAYAAoAPPf8HBSAJ0ACVQM9J0AFa/4FgAAAAAAAOsSAClQBIAAWIzA +0qDRDwDqJAADWGEAAPwAIh2gDWUAWJF6Y/9ujSLA5A7dAvxARhXv/ZIAAAAA+EOoFaTZAQAA0QQA +vBoMiAL4Q6YVr/jaAIonjRHAwOqsIC7YBIAAWISq0qDRD9ogWIq1Y/79AAD/91ANoAkFAMCgWctY +HvAsiuj5X/mYkB/FAP/9OA2gCQUAwJDAugurNPvBBhXv/P4AAAAAbBAOlRsoIhAuIgknITUpIAcj +Fg0qMgL+YIgV4A0VAPxgaB2ntQEA4yEaJdv5AAAL2zn6IYYV4ZkBAOf/Ngm3woAA/sJSDeOqAQAO +DkLxwHAN4tMBAGTUGyYgBcHo+f4ADzAXRQD2wCHdYgCdAIciix304XwN4A6FACuwAZ8R82Ae5xIA +nQCZEJkZmhMY7/7t7/4SKA0AAOUWCiyvAoAA6FUIDN+CgACtu+sWCCJwBQAAiRmeF40a9SAGqhIA +nQArUp6GGP1gCiPiAJ0AL1KdJmLDBv8BZPPxGe/tiZj3IAmgkgCdACqCrmShURrv6SOCrSqifx3v +5go7AesWBCTb/QAA+mAJ3iIAnQCb2PpgHSYiAJ0AhymGKgwDPgdmDPLACaPiAJ0AKRoA8yIyDeD6 +9QArIBacEvtgCeUiAJ0AixGGwyogOPfg5hWgBgUA9+EmFaBHBQD74QYV4KoZAAp2ORfv1pYVLSIX +Fu/TnfotIhud+4nECnY5lhb5YA/K4gCdAIscnh7sFgIljVmAAGABHBnvv4mYapEuixoqUp6PGHuj +Sy1SnS/yww/dAZ0UhhTr77cU0/0AAO9kAAMB6YAAmrhl/xNgAwKeHvwgRhWgCgUAWcrZGe+uiZgY +76qMEu4SDiSO2wAA//9cDaAPBQDAoPoghhWv/uYAHe+lwLoLmzT7oQYV7/72AAAAAAD/+xQNoA8F +AACeHp8f/CBGFaAKBQBZysUZ75qMEo8fiZiOHhjvlfk/9XiSAJ0AYAJ2wKCaFIsUFu+SwNoNnTTt +Zggt9i4AAGACXZ4enx+cEuokAAnYBIAAWI1ojBKPH+4SDiV1uYAAYAIVKiAHnh6fH/ogAAUwDAUA +WI1AZKNuKiAHKyAW/GBoHaGqAQBYjRGMEo8f/iHIFa/6agAAAAAAAIsSiBOMEYYVjhas3QhmAvfG +AA8/iAUAKCQ7DJYMlrQtJhvtIhApUASAAFiL5o4ejBIY72kqVp2KKSkgOKOq6iYJJPmWgAAmITWP +xCshGikiEOb/Ng3vwoAAf9sKCgpCyKQLDUJk0FP+ICYV4B2FAPn+AA7wChUA+iGGFaAGNQD2IWYV +r/YGAIonnx+LHeqsICpgBIAAWIhqjx+aEi0iG/lAiBXv/XYA2iBYidEY70qMEo4e+kEoFa/+PgBx +nqgKvwz//QAV7/6KAIsTihUtIhAZ708LqgIb708KaAKGHBrvRgmIAunvRRsKfgAAIxYQJRYRJiAH +hcAjIQf2QSQV4GYRAOtVAQsygoAA9qYACrozAQDmISIpmwKAAAN3AgpVAiMhJAlmApXwhSCX85by +/eCmFeOYAQDo9gYsygKAAAk5AuMSECJT+QAA6fYEKq4CgADl5QIGQIEAAOX2ASfIwQAA5RIRIhQ1 +AABtqQUIAIYJAmEmIBSkZgYGRyYkFPTAB3XSAJ0AiRcpVp0oIhexiOgmFyGAqYAAiykqIDiju5sp +80AHn5IAnQCMHGXAz8Ag0Q8tIE5k3CEOeAL4QEYVoACGAAAAAAAA8x/fAFIAnQAOPwz//QAV7+9W +AAAAAAAA6xINKVAEgADtEgsqYASAAFiJt9Kg0Q8A6xILKVAEgABYi27SoNEPAPpAaB2gG8UA/AAi +HaANFQBYkChj/8GLEPpAaB2gDBUA7RIKJdhhAABYkCJj/6kAACYgO2RgYeokAA5YBIAA/CAoFa+J +BQDpJDsscASAAFiLW/og5hWgCwUAKyYb+kdmHe/8LgAAAAAA6xIEKVAEgABYCXNj/weKJ+tEAApo +BIAA+0QAFaAMBQBYg0nSoNEPANogWIlVY/8IIxYQh8AjIAcmISL64AQD8DMRAOMhBynagoAAC3cC +CncCiycqIQn4xgALejMBAOmxFSmbAoAAA6oCIyEkl/CHIJrzmPbt9gUl2IEAAPfgRhWvzQUA/WAE +BfNoAQDrnQgLMgKAAAYzAuP2BCu+AoAAB+cC5/YBJmCBAADjEhAm6QEAAO3LQn5ABIAALEz+DMYR +pobm0zp3yMEAAPSf8akSAJ0AbckFCACGCQJhY/4kixD6QGgdoAwVAPtiQBXgDQUAWI/WY/55AAD5 +jwAMf/76AAjcDAxNFG3ZBQgghgkCY+/JCAXBAQAA7UwMBMjBAAD1n+8BEgCdACrM/m2pBQhAhgkC +ZWP9zAAAbBAGKCAFwZQPAgD5ABeNZ6UBACoWA/VADxESAJ0AiiLm7oQdFiYAACwgc402KiId+4AE +ANAMFQDnIAcuWAqAAPtABAVwCIUA+40ADTAOBQD5QGgd4A81APuNAAywC1UA+W0AD/F3AQDpjjkL +3wKAAKa7Ge5wLLKer+4f7m//gBR7ogCdACuynQl8CizCwwy7AeQWAiWSMYAAJSBzLRYB/EOoFaAE +FQDgUQQCwAUAAPyAAQJf9fUA9JcACnSIAQAoJHMV7l8EzAHsJh0tyASAAOTuXhUDSYAA7hYALdAE +gAD6QAgV4AwVAFgkdY4QH+5SLSEJLCAHKCEiKSEk+9y6BeDMEQDkiAIOYoKAAAyZAowRC5kCmaCJ +IJii/UBmFeALJQDspgUszgKAAAuZApmh5QAVBUhhAAAJAIoprCAqIAcb7k0KKkAKqhALqgKakC0i +APphABWgGIUA9SBGFaADNQDolgMu7gKAAOPdAgSYQQAA7ZYBJMihAAAKQIgDCIoKIIgDBIoKAIgD +AIoFAIkJAIoMexEGuwgutp2J+PcgB8CSAJ0ALGKuZMFtHO4kK2KtLMJ/DLsB47QABYsxgACwne32 +CCWHQYAALiAUs+4ODkcuJBT1wArN0gCdAI8T+eAG6VIAnQDAQMw5KCAUbosEiSJkkUPSQNEPAAAA +ACsgTooisLsLC0frJE4lcBiAAMm08V/wZ1IAnQAsIEwPAgD9f+/yogCdAI0nx+MOrgHuJgIm0MEA +AFiOi+buEBUBEYAAKKAABogKiIzsoActWASAAPpAaB2gDUUAC4AAZa/hiSdknboqmRTKpoqZZK2w +KKAABogKiIzsoActWASAAPpAaB2gDTUAC4AAZa/hY/2PAAD//1gNoAoFAMCgWckSH+3mifj5P/fw +kgCdAMAwKiAUiROzqiokFPU/+VkSAJ0AiieNEiwKAOqsIC7YBIAAWIJQ9UBoHa/8TgAAAACLImSw +o+QSAid1sYAA6iQACdgEgADtVAAKYASAAFiIi9Kg0Q8A6iQACtgEgABYikLSoNEPAP/19A2gCwUA +//poDaALBQDAygycNOz2CC30/gAAY/972iBYCFtj/qKKJ/IAIh3gCwUA+0QAFaAMFQBYhZwZ7cuZ +oC4iAPoDgh3gDBUA+duQBaANFQDopgIvdgKAAOPuAg14BIAA7vYBKVAEgABYjuXSQNEPK3wY6iQA +D2gEgAD8IAYV4AwVAFiO344Q/9tOBe/9AgBsEAQoIBTTD++LHWoYBIAAiif6YGgd4AwFAOqsICno +BIAAWIIS0qDRD4sic75LFO2ZikhqoUgb7ZUssq7Kxx3tliyyrS3Sfw3LAX3AG7Cunkh9wCEvIBTv +JBQv2tQAANogWAgmY/+owLDAigioNOhGCC3/FgAAiSLJkMAg0Q8AwKBZyK+KSGuhrGP/6fpAaB2g +G8UA/AAiHaANFQBYjrTAINEPAGwQCCwiDy8gByghNCcyB/5DRBWn1QEA+b/AFeALFQDpuTkJsASA +AOsiCSpQBIAA+CCGFeAEFQDodzYPT8KAAPciUg3h/wEACwlC8SBwDeKOAQBkgnLBtOx7Hw6UfAAA +LCBP0w/pIE0mYAUAAAwMRywkT/0gFROiAJ0ALCAF+4ATbWIAnQCNIvogBhWv+zUA/WAOSOIAnQAo +IhmOMvnAFQUiAJ0AiTgY7VQc7VDkkitv34KAAJoQmBGsu+jtSxVIDQAAmRPrFgIvpwKAAKhE9eAN +EhIAnQCLEypCnvtAG0viAJ0AihIpQp0qosMKmQHulAAEkrGAAIwpiyoMBT7TDwy7DPVgCdviAJ0A +LRoA9aHyDeD49QArIBb5YBmlIgCdACwhIhntRighByohJCshCfxA8BXqiAEA6aoCDEMCgAAIuwIZ +7T8Y7TANLUDpzAIO6oKAAAjdAp3giSCc4prk+8BmFeAKVQDr7TcczgKAAAqZApnhiC+Y5SwgOPfB +BhXgDQUA/cDmFeAKJQD92l4F4EklAPjAiBWgzBkADJo5mOkM2zmNZZ3qHe0p/MDIFaAJBQDs5gsj +h+GAAAqcEA3MApzsjBGJaJfvme6IaSjmEI1qLeYR7AAVB0khAAAJAIqIZ/jgC+OiAJ0AH+0OCr0C +D90CnebAxfyTphWhCQUA9SHyDeD49QArIBb5YBPFIgCdACwiGYopKyBPKSA45aoIBmAFAADsJhkl +2/0AACskT5op8yAPx5IAnQCLFGWx9sAg0Q+fFZ8WnhfqJAAK2ASAAFiKx44X7xIFJXWRgACMFGXP +24on2zDsEgAlUMEAAFiF3MAg0Q8a7N+KqPdAEMCSAJ0AjBMrQp79YBF7ogCdAIsSKUKdK7LDHezW +C5kB5JIbZWP9AACc2O6UAAzyZgAAYACWKCA58R/4DhIAnQD/++QNoAkVAAAAAADzn+xIUgCdAAnn +DPb9gBXv9foAiTdkndPwANgNoAoVAAAAAAAAAMGze8kULCA6mhD+IMYV4A31AP2AEL1iAJ0A6iQA +CtgEgABYiS7SoNEPAMGtjDcrIQmNOI4y668RDd0CgAAPuwLkuwIJUASAAFiJFMAg0Q8AAAD//1gN +oBqFAOokAAfYYQAA/CBoFeAMFQBYjdxj/v0AAAq4ApjmwNX8k6YV4QwFAHXLDSsgFikK//lgDjVi +AJ0AihRkoV2LaoxnimmrewfMDJxn92DSDeAOBQCxqoxlm2qLZppprOqre3e7AbGqjimbZpplLSA4 +pe6eKfOgCjeSAJ0AiScomRTKgYuZyb0Z7JgosACfFZ8WCYgKiIwssAf6QGgdoA01AAuAAI8ViyLH +o/tf8kjiAJ0AKCE0h2cuIRqKL4sp6Hc2D2fCgAB3ywoLCULIlA4LQmSwtcHU+v4ADrAMFQD8IIYV +r/KaANogWIb0Y/4DiifqrDArWASAAFiM1tKg0Q8AAAD/8ogNoAkFAJ8VKiAHnxaeF/ogAAUwDAUA +WIoijhfvEgUtZbYAAOokAAfYSQAA/AAiHaANBQBYjZNj/dcqIAf8oGgdoaoBAFiJ7WP9ep8V/iDG +FeAKBQBZx38a7FOKqI8V+V/uoJIAnQD/98QNoAkFAMCQHOxNwLoLqzT7gQYV7/d+AAAAAAAA81/6 +MFIAnQAJ5wz2/YAV7/zuAIonnxXvFgYp2ASAAOwSACVQwQAAWIU61qD+IKgV7/oWAJ8V7xYGKVAE +gABYhrz+IKgV7/q2AAAAwVP6QGgdoAsFAPwAAh2gDTUAWH9FKyAFjxaKEPV/2lViAJ0AY/0ZKiAH +nxWfFvygaB2hqgEAWIm8/iCoFe/4ogBsEA6ILycgBS4hNCkgB5Uc8iFmFeAGFQDygGgd50UBAO0S +CyJ7+QAAD285nx0vIRqM1JwT7dABLqgEgAD/gQAOMZkBAO4iCS+3woAA/MJSDaCtMQAODkLxwHAN +4m8BAGRkacH0CM+N/uAlzWIAnQCOIg8CAPXGzA3gD4UALBYB86AhlxIAnQCZEJkZmhLm7AARwA0A +AJga6Ov9HP+CgACm/+8WCCznAoAAqMzsFg4h6AUAAIYZnReKHvTABiISAJ0Aixoqop6GGC8SDvtA +CWviAJ0AJmLDL/KdBv8BZPRqGevtiZj3IAjgkgCdACqCruTr6hUJsYAALoKtJEJ/F+vlBOsB6xYE +JLP9AAD1wAj2IgCdAJZ49cAg3iIAnQCKKYkqDAQ+CpkM9SAIu6IAnQArGgD1YfINoPz1ACsgFv1g +CQUiAJ0AjhEqIDj8CAIdoAcFAPfg5hXhCQUA9qCIFaCqGQDqlzkL2ASAAArLOZsVlxb3wBISogCd +AIsdZLHZYAEBGevEiZhqkTKKHosajBgqop4swsN7o0aLHiuynQy7AZsUjhTq67wUs/0AAO/kAAcB +yYAAlqhl/yVgA438IeYV4AoFAFnG3hnrs4mYGOuw7RIPJI7bAAD//2wNoA8FAMCg+iCGFa/+9gAc +66rAugubNPuBBhXv/wYAAAAA//twDaAPBQCdH/4iBhXgCgUAWcbMGeugLxIQiZiNHxjrnPk/9lCS +AJ0AYAMKwKCaFIsUHuuZwMoMnDTs5ggt9xYAAGAC8Z0fLxYQ6iQAClgEgABYiXAvEhDtEg8ldrGA +AGACfgAqIAedHy8WEPogAAUwDAUAWIlHLxIQ7RIPLXZWAABgBAwAnR/8ICgVr4kFAOkkOyK4QQAA +5wMeB7CBAAAGAmGOV5z4hlSJVq7ODGYMllR86wftFg8kyAUAAJ5XhhaOFZlWBu4CFuuIjBHtIg8p +UASAAObuAgrYBIAAWIfnjR8Y62uJHvszphWhBwUAdHsNKyAWKgr/+2AELSIAnQCKKSsgOKSq6iYJ +KAQKgADzYAQ/kgCdAC8hNIxULiEaiS/vzDYPX8KAAHy7CgoKQsikDgZCZGB0/CAmFaAfRQD5ngAP +8AsVAPohphXgCjUA+iGGFa/1jgAAAAAAnR+KJy8WEIsb6qwgKeAEgABYhGLvEhAtKASAAPwh6BXv +/C4AAAAqIAf8gGgdoaoBAFiI1xjrQPwh6BXv/aoA2iBYhcIY6zyNH/pBKBWv/b4AcZ6HCuwM/Z2A +Fa/+BgAc6z4Y60KLEo4V+gAiHaAJBQALqTgH7gIa6zf31ooF4AYFAAmGOQbuAoYdG+s56fwgIsBB +AADn7gILC54AACYgB4VQBiZA61UBCzKCgAAGVQIKVQIqIQcrISInIQn2QegVqqoBAOy7Ag1TAoAA +CncCKiEklfCFIJfzm/L34KYVo74BAO72Bi3aAoAAC6oC6vYEKq4CgADl1QIB0/0AAOX2ASGMNQAA +bakFCACGCQJhiB4nEgf3E6YV4QYFAPTB8g2g+fUAKyAW+WAKpWIAnQAqIBSjqgoKRyokFPVACH3S +AJ0AyE+MKSsgOKTMnCnzYAknkgCdAI0dZdEAwCDRDyYgTmRryw/oAvhARhWgAIoAAAAAAAAA8x/c +kFIAnQAO/Az9nYAVr+4eAIQcBARHaEIVhhOIVMCRBpY5CGYo9qCGFaACBQDRD4onixvqrCAp4ASA +AFiD+osTjKTA0QvbOQy7KPtAhhXgAgUA0Q8AAOsSDClQBIAAWIdQ0qDRDwD6QGgdoBvFAPwAIh2g +DRUAWIwKY/+UixD6QGgdoAwVAO0SCiXYYQAAWIwEY/98AAAmIDsPAgAPAgBkYHj8ICgVr4oFACok +OwgghgkCY+z2CCrYBIAA7SIPKVAEgABYhzn6IOYVoAsFAPpHZh3v+xoA6xIEKVAEgABYBVNj/uaK +J+s0AAnoBIAA+0QAFaAMBQBYfynSoNEPANogWIU1Y/7XAAAqIAf8gGgdoaoBAFiIQWP+ngAAIxYS +JyEHg1AlIAf2QSQVqncBAOszAQu7AoAA+kDoFeBVEQDnZgIKqoKAAAUzAgozAiohIocvJbEVDKoC +LCEkk/CDIJryl/WW8+72BimeAoAA86YACfPeAQDj9gEu6gKAAO3MAgXYgQAA/eCGFa/MBQAMuwGr +XeMSEibpAQAA7YtBfGAEgACwOAyGEabGdtM69H/vSJIAnQBtiQUMQIYJAmVj/dgAAIsQ+kBoHaAM +FQD7YkAV4A0FAFiLs2P+NwAAAAAA9Q8ADn/+/gAM3QwNSBRtiQUMYIYJAmfv3ggFyQEAAOg8DAdA +gQAA9Z/seJIAnQCwz235BQmAhggCaWP9fAAAAGwQBiggBSMgByQKA/0PQERRMwEAKCAiZIBvAioC +WHzm/UzAgNANFQAsICEY6l0PAgDsMxEGfVaAAKgzKTKeDwIAbpNFKzKdZLA/+kAIFaD+5QAOzgH9 +xgAO8A8FAPxEJh3gCQUA+CAGFeAMBQD4ICYV4A6VAPggRhXgDQUAWIMs9HOmFaACBQDRD8Ag0Q8A +AGwQCiogBfhA8BXgDBUA+GBoHae1AQDoFgAl2/kAAOvLOQoYBIAA6xYFLCAEgAD9QcAEUZkBAMHD +/UAf5SIAnQCNIu/qNB6b5gAA6+oxEbARAADmFgQs94KAAK/u7hYDLNcCgACrquoWByzABIAAhxf1 +AAQiEgCdAIoUJ3KehhOPF/rgB1uiAJ0AJmLDL/KdBv8B7xYGJ5nRgAAlIRuKQocphioFpTb1TwAO +cQsFAHyzAdWgmBoHZgz0wAXj4gCdACoaAPVCMg3g/PUAKyAWmBr9YAX1IgCdAIpC+qAOUqIAnQAb +6iWHQwt3AYsV6BYKJYkJgABgALgAGuoIiqjoFgolDN+AAIsXjBSGEyuyno8XJmLDfLNDL/KdHOn/ +Bv8B5PA5ZVv9AACbyO8WBi/7bgAAYAKbAAAAAPghZhXgCgUAWcUgGun1iqiJG+gSCiUO3wAA//9M +DaAPBQDA8Bzp78C6C6s0+4EGFe//BgAAAAAA//x4DaAPBQCZG+okAArYBIAAWIfEiRvoEgoleamA +AGACLyogB5kb+iAABTAMBQBYh52JG+gSCi15hgAAYAMQAPDgBEBSAJ0ALSEajCmXGPghRhWi7QEA +6RYLLwPOAACXGPghRhWi7AEA6RYLJwM5gACYGukWCy7/woAAdftVDtUM+dPEBaC36QDmQgMt3IKA +AAt5ApkYCGYB9oBmFaAA3gCKJ5kbixDqrCAp4ASAAFiC1okb+CFIFaALJQDrpAItIASAAOqiAiOG +AoAAjCmXGJgamRuOGI8W5a0MClgEgADlzAgJUASAAO1GAiroBIAA7CYJKeAEgABYgvKIGokbjxf7 +86YVoQ4FAHXrCCsgFiYK/3a5CsCh+iCmFa/3jgAAKiAH/KBoHaGqAQBYhzSJG/ghSBWv/4YAjykY +6bWJFqX/nymMQ4tAjRXnxAAEyIEAAPwOAAU36wEA7hYBLojOAAAnIAcHB0EIdwoncqHurRANU8KA +AO2qAgJAQQAA6ncBAdP9AADnxwIBjD0AAG2pBQgAhgkCYYtAwICYEhnpoRrpny8hGoYWHumcJCEH +GOmZ/CAoFaHXMQD/oABGukQBAO3QgConAoAA7MwPJnBBAAD4hgAKNMwdAORmACZgBQAADDwMFOl1 +DV0M6CIAL/oCgACfZpdnnmOdZQykOQmJAulmBCxGAoAA5GYCIdAFAAAIqAKYYSYgFONmCA0gBIAA +5iQUKAQKgADzYAQCkgCdAIgX9ROmFaEHBQD04fIN4Pn1ACsgFvlgBNViAJ0AiBLSgNEPihVkoJ7A +INEPAAAAAADqJAAE2GEAAPwgiBXgDBUAWIqEY//biif8ISYVp9tBAOqsICgECoAA9aAEYdIAnQCM +FisKAezMICnoBIAAWH24mhL6gAgV7/vaAACLFuxNEQlQBIAA/WAARfAMFQBYe4z0gGAVr/2uAGW8 +BPlf4AjSAJ0ALyAg8f/ft5IAnQBj/3UAKiAH/KBoHaGqAQBYhsOIEtKA0Q+KJ9ww6xIAJVCBAABY +gkHAsvtARh3gAgUA0Q8AAAAAAAAA6zQADjgEgAD8YGgd4AwFAFh9ldtA7DQACugEgADqFgIr8ASA +AO8SBilQBIAAWIJf+oAIFe/7IgDqJAAE2EkAAPwAIh2gDQUAWIpIY/7rAABsEAiSFJMVGekeiED4 +IEYVr8sFAOsqAQJwIQAA+iBmFaeIQQDkgcBiUBEAAI8TLSEFqYwswACv3wTMC+/8QC5YBIAA/4AN +iuIAnQD6ICYVoGgBAP4AIh3gDQUABv04C98L690KB9ghAACCFZ4Q+QAARXAMJQDyQQAV4A8FAPJA +gBWgAg4AjRQOVQz/4CAVoAMFAO/kAARABQAA8Q5gDeB+AQCGEyKgAC3RBQQiC+bWCAlYBIAA4hYG +IzEBAAD2QAZ6ogCdAAgGQPIAIh2gDQUABi04C9IL690KAVghAAD3IBAVoAIVAAcjOIcVB2YLF+jz +pzcncKAGMgoGMwvsfAgBmCEAAI7QCwCJBe42LiYAAwCLItIA6qwBJMgFAAD0X/sj4gCdAAUpDA4q +DPugBhWgBxUA9WAoFeAGBQAJdjgIaAgisgAF5QgltgF+WwIiLAHitgAmfRKAABbo2osSHujZ5rYB +B5AFAAAGIgKGFe67AQxuAoAADbsCkmD6gAYV4SwdANEPixD8ICgV7/1SAAAA/E8ADf/8xgCFFRno +qwXFC/gAChXgAgUAsSLlgx4JD+gAAB3ow4YSGujD7W0BB9gFAAANuwKNFepmAQxOAoAACWYC69YA +JhAFAAD2gAYVoSIdANEPAAAAAOoWAS1oBIAA+8BoHe/51gD9jwAN//k+AGwQDPhASBWgCgUA6yAH +KcgEgADygGgd58UBAP2fwBWgBBUA7Ew5DLgEgAD8ISYVobsBAPMbXA3gDAUAmhacFZkTmxSbGx3o +oS4gFhXofBjonugWCC3/goAApf8V6HcY6HjvFgotpwKAAPSAAEJw//UAf+ETAioCWDKIGOhxHeiT +6hYIJSoRgABgABcAAGZjy/jAHyiQ+vUAKSAW+yAZTSIAnQCJiPcgBhCSAJ0AK1KuHOhlZLDRLMJ/ +K1KtDLsBZLDHsJmZiBzogmSzSyzAgCzMN/4haBWkzB0ArDzrFgImYB0AAPXABYISAJ0ALkKe/cAI +K6IAnQCMGitCnSzCwwy7AesWACWZUYAAKnEMiXeZEf1ADpxiAJ0ALHAQ63IDJglBgAD5n/so0gCd +AC5yA2Tg0I8WZfGuhhGPGI0U7hIAKVAEgADm/zYL2ASAAO8WASngBIAAWDA6GOg6Hehc568ubTAE +gABgAvIAAMCgWcNfGOg0iYgd6FX5P/mIkgCdAP/9CA2gCwUAwLDAqgqZNPkBBhXv/M4AAGqRJCtC +nnyzQYwaK0KdLMLDDLsB5LA1ZPP9AAD/AQYVr/0qAAAAAAD8IaYVoAoFAFnDSBjoHYmIHeg/7BIN +JI8TAAD//IwNoAsFAMCwwPoPnzT/AQYV7/xSAAAAAAAAAP/8GA2gCwUAAAAAihjAsZsW+V/5KuIA +nQDA4J4W+V/4yuIAnQDrdAAJUASAAO0SCSngBIAAWDB2/gAiHeAHFQDnFgktOASAAP9AZhXv+7oA +ZLBJjxX+ACIdoAwFAA/sOGTAiogRhhjqJAAL2ASAAO0SBCngBIAA6GY2CPAEgADmFgEg+BEAAFgx +Bujn7x0wBIAA/dAgBe/3/gAAAACLGA8CAPlhVg3gDAUAeaMCLAoB+AAiHeAOBQAMnjjsFgUnfKGA +AOt0AAlQBIAA7RIJKeAEgABYMaX3QGgd4AsVAPohJhXgChUA+uBmFa/9pgCLEBXn8yohB4lwHOfv +/8+uBeqqAQD/QAAVOJkBAOyqAgTAPQAA/CEoFaSIHQDqtgAkQAkAAAg4DI4gmbPoXzkBs/0AAO+2 +Ai92AoAA7m4CBahBAADutgEuDvYAACgSA+iMICGUVQAA6jz+KsgEgABtqQUIAIYJAmErPP4MuxGr +W5sQKCAULCAEo4j1gAihEgCdAAgJRykkFPUgCjZSAJ0AiHIoJhwpcgHoFgctqASAAPMgCjBSAJ0A +8TX4DeAHBQCnZiZGnSogFisK/3uhCusSASlQBIAAWDUQjBllwOPAINEP6xIBKVAEgABYNQsuIBYY +55r9z3gF4P/1AP/f5RxiAJ0AY/yHiBllj9IqcBDbcPxgaB2gCRUA+1/gFaANBQDqnTgJUASAAFgv +LMAg0Q8AAAD6QGgdoBvFAPwAIh2gDRUAWIi8Y/+9AAAd56gt0IDrEgQm6N0AAPpAaB2k3R0A/GAA +RvAMFQDt3Acl2GEAAFiIsWP/jy4gFi8K///f+vRiAJ0A6xIBKVAEgABYNOPAINEPixAMbBGsu/og +BhXv+5IAKCQUjXDxv/i6kgCdAPpAaB2gDAUAWHm69sBgFa/8EgCKJ+s0AAnoBIAA+0QAFaAMBQBY +e9fSoNEPAAAAAAAAAOsSAilQBIAAWAH1+iAIFe/6vgAAAAAAAOokAAxgBIAAWANuiBeJcZoc56QA +DV8CgADrVQgE9U2AAOtUAAlQBIAA/QBoHeAMBQBYAzP3QABD//o6AIon/KBoHaALJQDqrCAp6ASA +AFgvHitwEPl/8TDSAJ0AKXAVCQhFZI4YK3EJHOdhKnEML3ARjicMqgyr/w+ICf3CpBWvzQUA7uwg +JHiJAADt7gEEQEkAAAr4Oah9rs7u7EAm6IEAAO7bWn7QBIAADuowG+dRLaEB/UAEFaH5MQAL/wor +Ihfv8qEuZAKAAAzdAgvuDA/uLK7dqF79wCQd792BAP3ABB3v9nIAixT6QGgdoAwVAPtiQBXgDQUA +WIhQY/4NAAD9rwANP/6aAGwQBCMgACQK7XQxBiIhA7wi0Q+EIYYg8kBoFaAIJQD3ZAACsJRxAPkP +AAxzNgEA9GAAQfNmgQDl5y4cAQqAAABmGvZgAQG9RAEA5SIBAag5AADlIgwBmGkAAAQkLAQzKKMi +0Q9sEAiKIicgB4kwlRX4QtAVoXcBAPFdTA3omQEA+CAmFeD89QB8gR0FC0f7f8AV4AkVAOubOQlQ +BIAAWDSJ81MwDeD89QAa5uuIqBbm6PcADZiSAJ0ALmKuGeboZOHbKZJ/JWKtCVUBZFHRKIz/KKYI +6VQAAo2BgAAb5wMlsIDt5twSqN0AAPggBhXkVR0A5UUIC88CgADmmQgCqA0AAPTgCJISAJ0AKJKe +9QATO+IAnQAlkp0NeAoogsMIVQFkUYgpIBb9IyYNoOvVACowEPtAElRiAJ0AKzELvLvaIFg0NSgg +FCwgBKSI9YAMQReYAQApJBT1IA4uUgCdAIoVHubajREoIQcc5r8Z5tb/oeAV6ogBAP8AABQ0/x0A +6YgCB/gFAAAPTwyYUIsgD+w5/KBmFeeqAQDsVgIt3gKAAOtLAgLIQQAA61YBIcBBAAD5QAlxUgCd +AOhBDWJT/QAAbakFCACGCQJhwICYFOkgBCJb/QAADLsRq1v1IAkJEgCdAIgyKCYc6TIBJdhBAACb +EygWAvMgCbhQBQUAZpFQpUyIFAx9Eabd7NadLBAEgADRDwAAAAAA9wAOkJIAnQAMeRGmmS6SnvXA +DvviAJ0AJZKdDXsKK7LDC1UBZFHNsI2dqGVe3WAAYwAAAAAAAADqJAAJ2ASAAO0SBSpgBIAAWIE5 +0qDRDwDAoFnBphrmeoio+R/yGJD89QD/+VgNoAUFAAAAAAAAAPpAaB2gG8UA/AAiHaANFQBYh6Zj +/7HAUMDqDog0+UEGFa/4rgAd5o4t0IAt3Df64wAV5N0dAO1NCAlQBIAA/aBgFeAMFQBYh5lj/3sA +AAAA+EKGHa/6DgAAAACKJ/0gaB2gCxUA6qwgKmgEgABYes76IIYVr/tKAIsw82AIopIAnQDiEgQr +5wKAAKbMJMad0Q8AAAAAAAAA6xIAKVAEgABYAOVj/jAAAOokAAxgBIAAWAJgiTGLE4gS7KwRDSgE +gADsuwgE9Z2AANog/QBoHeAMBQBYAieIFKWlpUwMfRGm3ezWnSwQBIAA0Q8AAAAAAP/2lA2gBQUA +jTWMNB7mW/pg6BXgCSUA/HAAB7CtcQD7LwAMu4whAPsgBADTzAEA6MwID/gKgAD/gAEGfd0BAO67 +AQZwOQAA7rsMBmBpAAANvSwNzCj9YABFv/W6AAAAAOokAAPYSQAA/AAiHaANBQBYh1Jj/mHAoFnB +RBrmGYioHeYX+R/xCJD89QD/+PANoAUFAMBQwLoLizT7QQYV7/i2ALBLDLsR61sICVAEgAD7YgAV +4AwFAFh4XLNM4hIEK+8CgACm3SzWndEPAGwQBIk3F+YqKzAW+cxCBaMqBQAKKigLtgnoqAgLNwKA +AKhm52cICQEKgAD0+GgVoAwVAODNGgMzUwAA7nLEIzIBAADmQRZ0wCEAAIsymOCek5aSDbsCKHbE +mzLRDx/mFa+vKfLBALEE7fLFLnAKgAAOmQL5+CYV7/71AA7dAw2ZAR7mDeVyxClvAoAArt2Z0I8y +mFDmhgApAQqAAOWGAS4gCoAABP8CKHbEnzLRDwAAbBAKGeYCCSkKKJJ/4hYIKVAEgAD7AAQA0AYV +AOYWCisoCoAA+CCGFeBVTQDi5fkRY7kAABvl6/nLkgWjLQUA7aooDT8CgAApkn+cFRzl8qh36HK5 +JMv9AAD9QABCM5kBAJkZ5EKhJmIRAACsrJwXq6r6IMYVoGMFAPiABAIwAGoAihrAsP3/4h2gYwUA +7FUDBQMJgACbGi1yuAReAQ7dAZ0QAQCHAzZgaD7VihiLF40V+CDIFa//9QDjOQkB8oEAAO4WCSzP +AoAA6YgIDwEKgADiiAgEYwsAAOiCoStICoAAD5kD6UQBBmIBAAALgABj/6SKGYsUsaoKCkMqtn/R +D2wQBBvlxSoiAA8CACuyfx7lw/tPAA1zLwUAD68oDv4IKeLDKOLC/ct8Be/79QALmQPpiwENZwKA +AP2AAEZ/9PUA/YAIFaADFQD5DuAd4A0FABnltBjlo/kAAEZ/LAEA7PwIBf1EgADLKQjqMCnCwy/i +xAmIDOj7E36BCoAAL+LCADgaBIgDCP8BL+bC/aAgFeG7HQDksCxmYMEAAH+3FGP/xAAACeow+Zhm +Fe//hgAAAAAAAP2gIBXhux0A5b/cZmDBAABYNOLAINEPAGwQBCYhCfhCkBXv+AUAJyAV6JgBCzYC +gADomQwLuQKAAAdmAvhChh3gBwUAJzQA+GBmHaAEFQAEZgKWMRXlVSRWrdEPAAAAAGwQBBblhBXl +XtMPpiIFNQIlJoAkIoBnQAttCAUoIoBngAJj//PRDwBsEAQT5XsiNopj//wAAAAAbBAEKCAFJSAH +ijX1/6IdoAMlAP0BIBHRVQEAwCDRDwCIKRnlcJor+wAHrCIAnQAJWQkpnQIqkQgpkQT7IARLogCd +AIoicK5/2iBYd6SLIg8CAAO6AWSvwoonBLsB6yYCJVDBAABYhbfj5TwVARGAACigAAOICoiM7KAH +LVgEgAD6QGgdoA1FAAuAAGWv4YknZJ+HKpkUyqaKmWSvfSigAAOICoiM7KAHLVgEgAD6QGgdoA01 +AAuAAGWv4WP/XAAA//9YDaAKBQDaIFh3lysgIuq7DAlQBIAAWHjh2lD6ACId4AwFAFh6mosiA7oB +83/7JmIAnQAsIAcEvQGdIvV/+NChzAEA68wfKVAEgAD8AAId4AwVAFiGN8Ag0Q8AAAAA6yAiKVAE +gABYeM0qIAXB436hDGioKYsi82AEBX/8ZgAvIDrAj3j56vpAaB2gCwUA/AACHaANJQBYeARj/9cA +APpAaB2gCwUA/AACHaANJQBYd31j/78AAGwQCogrHeUMLiAhizf8YMgVoP/lAA/uAS4kIQ3MAQy7 +DOuJCHjIBIAAwCDRDwMAhgkCYZsVKCAFJSAHx034IQYV4AMlAP0cAEHRVQEAiimbK/tAB9xiAJ0A +G+UEC1sJK70CLLEIK7EE/WAEY6IAnQCMIg8CAHDOf9ogWHc6iyIPAgADugFkr6CKJwS7AesmAiVQ +wQAAWIVN4+TSFQERgAAooAADiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ2SfZSqZFMqmiplk +r1sooAADiAqIjOygBy1YBIAA+kBoHaANNQALgABlr+Fj/zoAAP//WA2gCgUA2iBYdy0rICLquwwJ +UASAAFh4d9pQ+gAiHeAMBQBYejCLIgO6AfN/+yZiAJ0ALCAHBL0BnSL1f/fAocwBAOvMHylQBIAA +/AACHeAMFQBYhc3AINEPAAAAAOsgIilQBIAAWHhjKiAFweN+oQxoqCmLIvNgBAV//GYALyA6wI94 ++er6QGgdoAsFAPwAAh2gDSUAWHeaY//XAAD6QGgdoAsFAPwAAh2gDSUAWHcTY/+/AABsEAQc5LEr +MgQpMBb9YAQFtZkdAPUgCACSAJ0A6uSsFIiBgAD/yVYFr/3lAOTkgxSktQAALKF+aZUdfLMKKswE ++2AIo6IAnQArIAawuwsLR+skBiWCwYAAwCDRDwAsoX7sswx2eBEAAP9gB+PiAJ0AKCAGsIgICEfo +JAYsfuYAAIkniyIqmRQNuwGbIouZZKC2KLAABIgKiIzaIP1g8BWgDTUAC4AAwCDRDwAAiyKKJw27 +AesmAiVQwQAAWITayawooAAEiAqIjOygBy1YBIAA+kBoHaANRQALgABlr+GJJ9MPZJ9yKpkUZKBk +iplkr2cooAAEiAqIjOygBy1YBIAA+kBoHaANNQALgABlr+Fj/0YAAAAAAAAA6iQACdgEgADsRAAK +6ASAAFh4IcAg0Q8A6iQACdgEgADsRAAK6ASAAFv/RcAg0Q8A//0UDaALBQD//mQNoAoFAIg3IuJ/ +CYgR+EAAQT/7kgCINyLifwmIEfhAAEE/+/IAbBAEGuQ+KKLfZIALCeowK6LgC5kMZ5AB0Q9YekXR +DwBsEAQd5E4nIAcc5CT+QQQV4OcRAA7cOZwwiCD7yCoF4AolAPpgRhXgGQUA6TYDLEYCgAAKiQL4 +YCYV4XcBAOYgeSu8AoAA9+YAD3ANBQD8BAIdoAs1AOnkOhMCOYAAnTWcMwuKAhbkN5oxGuQ3Bu4C +JiEJnjSaNgRmAiIgB505lTv4xgALcSIBAOY2CikUAoAAAv8CCf8C7zYILZAEgADRDywhCCshCZ01 +lTcHzAIEuwIJuwIJzAKcNOs2Bi0QBIAA0Q8AbBAEGOQKHuQcLCAHHePzGeQe+kEEFeD8EQD/zQAO +8cwBAO02AC5kAoAADLsCCbsC44CAKbAEgAAd4938QAgVoA4FAJ5l7WYCIbjdAAD6wIYV5HcdAOp8 +/y5mAoAA7HwCDVcCgADsZgElU+EAAJpjAgSJmWaTZwYgi+UhCSRD9wAA9MFmFaQzHQDlZgorkASA +AOgABQMowQAAbTkCBQJh0Q8AAABsEAYd4/kLKxGtsyoyfxnj9xfj2IigwED44ABE8AYVAOm5CAQB +qYAALDJ4LzJ7+YAFnGIAnQBl8RgsNnwrMnkrNnvdQA3kFgECAJSgDeQWwMn8QAX8IgCdAC8ye8HA +7ePkF4OxgAAiMnwqIQSOIPPh/g2mugEAJDZ89G9mFaAAHgAuNnztrwEFw/0AAAj/Au8lBCWMYQAA +IjJ8sMzvMnshAQGAAMnIY/+/AADaIFh6XWWgxCohBP9BIAwWmgEAyJnRDwDaIFh6UNEPANogWHoS +0Q8AAAAAAAD6QGgdoAsFAFh64dEPLiz46tKILwEKgAD8wAEF3/z1AAy7AwuqASrWiFnEAiQ2fCQ2 +e/pv6BWv/NIAAAAV43kvUFhk8GpZuf9Yecooct/TD8iBWHmfKVBYZJ8lWHmZyK4V468sUmuwzOxW +ayYCyYAAWHkhY/8KAAAAABzjqf5viBWgClUA/G9IFeALRQDtFgAha+UAAFnBFfpv6BWv+yIALjJ7 +4jZ8L3oOAAAiNnvRDx/jnS/yrnH2i/arBh2v/iIAAAAAAFm5xvqtZhWv/pIAbBAEFOOVGeOP6ONw +GV7CgACktCNCf6mI6LgIAYIhgAAqMgB4qQIqQnsc44crMQQqRn8MugHqNQQp0ASAAFh6D86pKTEE +/yEADBbZAQDI19EP2jBYegPRD9owWHnF0Q8A+kBoHaALBQBYepXRDyNGf9EPAABsEATwYPAN7/n1 +AIgiCTkDCYgBKCYCiicPAgAPAgAqrDBYg7nj4z4VARGAACigAAOICoiM7KAHLVgEgAD6QGgdoA1F +AAuAAGWv4Ykn0w/LkiqZFMqlipnJrCigAAOICoiM7KAHLVgEgAD6QGgdoA01AAuAAGWv4dEPAAAA +//9cDaAKBQDRDwAAbBAIHeMzG+NXFuNV9cYgBaAYxQDjLOgl04EAAPhADcwnMwEADDURpFXoUp4p +ZsKAAKbEKUB/+QAQU+IAnQAoUp1kgf+bEeoLHg1IBIAAmRAKIIYLAmULAmMNAIcJAmEJAmHtxwgJ +AQqAAP/GfgXgDhUA4+MIH3AKgACeE6/P/iCGFe//9QD/1wAPcAZFAP4gRhWgAMIAAAAAAIqZyawo +oAADiAqIjOygBy1YBIAA+kBoHaANNQALgABlr+EpQiBkkO8tQHwsQH0e4ykN2wkHuwru3ggF2GMA +AIqyLuCAZKE4/cf+DaAIFQAvCgANjzgP/wkH/wov/Rgv/Jwv8hssCgEM3APx4SAN58wBAAzLCQe7 +CuxEfCXYYwAAwND8j6Yd4AwFAI2w71KeJvP/AAAu4P//4AR7ogCdAC9Snfbf4BWg+PUA8efADedm +AQB4YXTqEgQmQAUAAOhEfSbj4QAAWHmSiRPSoOsSAiSAaYAAKqICC6oBKiYCiicqrDBYg0DJrCig +AAOICoiM7KAHLVgEgAD6QGgdoA1FAAuAAGWv4YknZJ8XKpkUZa7v//u4DaAKBQCMEYsQDICGDGCG +CwJpCwJn0Q+PEY0QLkR/D8CGD6CGDQJtDQJr0Q+bEeoHHg1ABIAAmBAKAIYLAmMLAmEN4IcIAm/o +7AAJ0ASAAFm5J2Svr+3isxmvAoAA5FUICWbCgAD3gABCP/kyAMCx+7cADfAMBQD8j6Ydp7sBACtE +fAu7CfdgAQXwDAUA+2MAJe/7mgAAAAtghgtAhgoCZwoCZdEPAABsEAQY4n0CA0cMMxGoMysyhBni +iyiwAIqxCYgKCiGMAgo+iIwDAj78QGgdoA0lAAuAACI2hNEPAGwQBBTibwIDRwwzEaQzJDKEikEm +QAAoQAj6mGgdoKklAAIFPgMCPnmBJRjidwhoCoiM6lQAClgEgAD8QGgdoA0lAAuAACI2hNEPAAAA +AAAA6yQAClAEgABYeVnzQGgdr/8uAABsEARZvKYS4lUT4nUMAgApIoIJGo4DqAqIhAuAAGP/6wAA +AABsEAQT4oQjMX6iMtEPAAAAEuKTA+gwBO4wBbEwkyCUIZUiEuKPE+JShCAEMwKTIBLijcA6hCAE +MwKTIBLii8AwKDdAKDdEKDdIKDdMIz0BcjPtEuKGwDCTIMcvE+KFAyMDEuKEhCAENAGUIBLig4Qg +BDQBlCAS4oGEIAQ0AZQgEuKAhCAENAGUIMcvwDEDIwMS4n2EIAQ0AZQgY//8AAAAEuJ6gyADExQP +MxGTIBLid8AwIyYAV//WEOJ2kQCSAZMClAMR4nSCEAHqMKIRAfAxwEAE5BYAAgAR4nCCECMaAAMi +ApIQEeJtwCGSEATkMYQDgwKCAYEAANIwASMAAAAAEOJokQCSAZMClAMR4maCEAHqMKIRAfExwEAE +5BYAAgAR4l6CECMqAAMiApIQEeJewCGSEATkMYQDgwKCAYEAANMwATMAAAAAEOJZkQCSAZMClAMR +4leCEAHqMKIRAfIxwEAE5BYAAgAR4kyCECNKAAMiApIQEeJPwCGSEATkMYQDgwKCAYEAANQwAUMA +AAAAAFyUAV2UAl6UA1+UAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAABckAFdkAJekANfkABTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAnJQAHZABnZQCnpQDn5QECJQFCZQGCpQHC5QAQwAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyQAZ2QAp6QBx2QA5+QBHiQBXmQBnqQB3uQAFMAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADclAAdkAHdlALelAPflAQElAUFlAYGlAcH +lAgIlAkJlAoKlAsLlABDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3JAB3ZAC3pALHZAD35AEtJAF +tZAGtpAHt5AIuJAJuZAKupALu5AAUwAAAB///UAA0jEQ//4KAAAAAAAf//2IANMxEP/+CgAAAAAA +H//90ADUMRD//goAAAAAAAD0MAoAAAAAAPQwCgAAAAAA9DAKAAAAAGwQCCcgB4giFuEr+8JOBeF3 +AQDlgPFr1wKAABjhJC6AgOaqCAdw3QAA/VPIFaTuHQCuTu3hHxdwCQAA/4AIS6AJpQAqop0LfAos +wsMMqgHqFgIlB/mAAIjY9wAI8JIAnQAvYq7s4RUXhcGAACpirSzCf+yrAQRz/QAA/UAFJiIAnQCe +2P1ABS4iAJ0ALyAUpP8PD0cvJBT14AeuUgCdAPggSBXnhQEA+QAHcVIAnQDoPBAiDD0AALBKbakF +CACGCQJhwFCIEo0y7SYcIkv9AADrMgEszwKAAKmImBPzYApAUAoFAOoWAC2LSgAAixDrSwgL5wKA +AObMCAXb/QAA68adKpAEgADRD+okAAnYBIAA7EQACugEgABYe0HSoNEPAMCwCYw07NYILfseAACN +ImXf1fpAaB2gG8UA/AAiHaANFQBYgbJj/7///AwNoAoFAAAAjiJl77AtgIAt3Df64wAV5N0dAO1N +CAlQBIAA/aBAFeAMFQBYgaVj/4zAoFm7lx3gzIjY+R/2wJAJpQBj/5zaIFv7AWP/BgCOJ54RiOn7 +wqQV78kFAOXpFCdggQAACckB6b0IClcCgADqVQwEQEEAAJjpCFUy5eUUJukBAAD9AAg64gCdAGir +PairK7zw+6AE0+IAnQDvEgIiDHUAALBObekFCACGDwJhK8IBC6sI5ckEJdvBAAD9YAbMYgCdAOvG +AS3ABIAAZFCp9QBoHe/6lgAAAAAAAOokAA7gBIAA7BYELFgEgABb/FaLMYgTjRTqFgAtZwKAAOyI +CAX0/YAA2iD7AGgd4AwFAFv8HY0Q7a0ICpAEgADtTQgL9wKAAObuCAbr/QAALead0Q8I3Qz6IEgV +5P0dANMPbfkFCCCGCwJjKxIC708MBMEBAADtuwgHjEEAAC78/23pBQhAhgsCZS/JBA2oDKiYKIww +6MYBL/rWAAAqnECawfuABhWgCAUA+YCEHa/9FgALiAz5wSYVr/vaACicQPmAJhWv/LIAbBAEHeBy +GuBzHOBxLdK4KqF/LMKPo93qOgwO7kKAAP2AAEZwCwUAK8QEK8QFWRXQ+kBoHaALBQBb/MrRDwAA +AGwQBBjgZSmCfyowBy2RAi6RBP0gpBWgDwUA65IAJokRgADu7P8mk/0AAOKVAi93AoAA7rsIDmcC +gAD9bwANsADGACuRBS2RBLG7/7/gFa+7AQDrlQUvdwKAAP1gBrxiAJ0AjJDuzAgN3wKAAAvLDAsA +hw/fYOsABwbzJ4AAHuBHKZEFK+J/CZkRqdnt4n0lhhGAAIzRi9CbwIvQnLGf0J/RK+J/sLsr5n/1 +oAYcH7kBAIzZ+aMAFa/JBQD5AAQEfxIFAKLSKyY6/6IEHeVJBQDp1REkIQEAAOTWBy0vAoAA5NYG +KlgEgAD1gATkIgCdACXVEOhYCAR4GwAA7IxAJ/oBAAD94ARjogCdAMky6UQABQCBgABtqQUDAIYJ +AmErIkKrWP8ABYxiAJ0A6CZCJpPhAADRDy+VBf/8mA2gCwUAwKX9wC4FoDslAFm9YMAg0Q8t4oCM +0YvQm8CL0Jyxn9Cf0SvigrC7+9BGFe/8+gAAwMD7D+gVoA0VAFhznMAg0Q8AAAAAAAAA79YJJpPh +AADRDwDLMPpgaB3gbEUA7Kw2CnAEgABtyQULIIYOAmP4YABF8F5FAH6hDS+srNMPbfkFC0CGBAJl +KY376SZCJpPhAADRDwAAAADkJkImk+EAANEPAABsEASCIwICQdEPAABsEASFI4MgFN/r+ECEFaFV +AQDq3+karsKAAORUCAGAuYAA+wAEBDaYOQAJiAIoJQQiQn/RDx3f4BPf4R/f4SZCfishBC5Cf5Jg +liGj//1gBAX2yzkADLsCr1/vJgAnKAUAACVGfyJGfuslBCqQBIAA0Q8AAGwQBIogZaBQHd/S6iID +KfbCgACu3f2v6BXgDBUA/IBABjGqAQAGqgINyCwI3SgnJQXtzAwEWAUAAP1tAAw/+8UA66oBDE5C +gAAJWQIDqgKaIwmIAiglBNEPjyMb374PD0EL/hGr6y2yfxnfuCyyfnLZGdnA8yPeDaAMBQDAwCy2 +fyy2fvpACBWgAEYA2MDzDEYNoAwFAHLRHI0hmtCOICmyfZ3hnCDsJgEky/0AAPlvphXv/VoAGd+k +GN+kqYio6HihIOq2fy+BLgAAza0qsn1qohgtsnv9b+YV4ABKAAAAAAAAAOy2fyf/KYAA+kAIFa/+ +pgAc35WIIayZqen5DwAM8AwFAAnIOPlvxhWv/ioAbBAE9b8iBeAGFQD0QGgdoAI1APaAQAMwAB4A +ALAiKFJ/6GP3cquBAADRDwBsEAT0Q6gVoyMBAPJaAAk4Ux0ABCIKhCaCIQVEKApEEaQi0Q9sEASI +JxvfffUCghXvxwUA4oIJKTAEgADpgRUkIIEAAOdEAQKpAQAA5YUUIRMBAADihgkiIQEAAPRBUg2g +CkUAApIIIoYJCwCH7d9tGSgEgABtqgIFAmGdIIxgwNTjJgIuZgKAAA3MApwh0Q9sEAouIgIqIhgP +AgDx3YwN5zUBABzfYS4iAP1ACBXgOwUA/0CwFeAKVQBZvJwqIhIkIAf6PgAEMAc1APUADFiRRAEA +CshR9QAMcJIAnQAc31P+TTAVoAsVAPh/wBXhakEA/MBoHeAKVQDpuTkPRwKAAPjGAAswOwUA6RYA +K3gEgABZvIYc3zHq3zMaSASAAPSAB2oSAJ0ADEsRqrstsp73oAvp0gCdACuynQxNCi3Sww27AekW +CCWKSYAALCEHHd84DAxK7984HmcCgAANzAKcsBzfNf5ACBWjPQUA/WDmFeAJBQCZuOm2BitXAoAA +mrn9YKYVoBqFAJqzGd8s7+4CD0YCgACetCm2AgeIAii2ASgSCBnfEO/fJhxHAoAACYgIJ4adLiIS +KiIQD+4C7iYSKVgEgABY5Lb0YARREgCdAIonDwIADwIAjaz7RgAVoAsFAOreDAbrIQAADts5WH8G +/b4qBaA7BQDtJAANGASAAP5gaB2gClUAWbxI0jDRDwAe3vSN6OQWCCgECoAA96AEuJIAnQAMmxGq +uy+ynvfgBUnSAJ0AK7KdDJ8KL/LDD7sB5LCXZsP9AACY6OkWCC335gAAYAA5wCDRDykaAAmqAvpC +RhWv+b4AKyoAC6oC+kJGFa/5sgAAAPoAoh2gOwUA7N7yGWgEgABZvChgABQAAOokAAJYYQAA/AAC +HaANNQBYf6ZoMkLAINEPAAAAAAAA//o8DaALBQDAoFm5lB7eyBreyY3oHN7EiRj5v/q4kgCdAP/9 +1A2gCwUAwLDAygzcNP3BBhWv/ZoAH97OnxSOINog/b2sBeAMFQDtFgYvdgKAAOzuAgDYQQAA7hYF +KugEgABYfqDAINEPAAAAbBAYkhCOIBXey4kjiyGKIioWIisWJPgkZhXgBBUA9CDmFaAIBQD4IKYV +oAxFAPwhRhWgDTUAnRn0IMYV4A8lAJ8Y9b16BeAPpQD+IgYV4A21APwiJhXgDMUA/CJGFaAIhQD4 +IcYVoASVAPQh5hWgCXUA+CGmFeALVQD6IWYV4AplAPohhhWgC9UA+iJmFeAK5QAqFhT1vVIFoAn1 +APgiphXgCEUAmBSGFisSJIkVJ2F+LBIiImF/B5koL1CAqSn4nYgVo5kBAAOZCu6SAC9QBIAAJmI+ +LRIjqO4LYACOFywSJC0SIgfuKC9Qga4u+J2oFaPuAQAD7gqO4CoWFuoSIy1YBIAAqO4LYACOGCwS +Fi0SJAfuKC9Qgq4u+J3IFaPuAQAD7gqO4CoWF+oSIi1YBIAACO4IC2AAjhksEhctEhYH7igvUIOu +Lvid6BWj7gEAA+4KjuAqFhjqEiQtWASAAKjuC2AAjhosEhgtEhcH7igvUISuLvieCBWj7gEAA+4K +juAqFhnqEhYtWASAAKjuC2AAjhssEhktEhgH7igvUIWuLvieKBWj7gEAA+4KjuAqFhrqEhctWASA +AAjuCAtgAI4cLBIaLRIZB+4oL1CGri74nkgVo+4BAAPuCo7gKhYb6hIYLVgEgACo7gtgAI4dLBIb +LRIaB+4oL1CHri74nmgVo+4BAAPuCo7gKhYc6hIZLVgEgACo7gtgAI4eLBIcLRIbB+4oL1CIri74 +nogVo+4BAAPuCi7iACoWHeoSGi1YBIAAqO4LYACOHywSHS0SHAfuKC9Qia4u+J6oFaPuAQAD7gou +4gAqFh7qEhstWASAAKjuC2AALhIQLBIeLRIdB+4oL1CKri74nsgVo+4BAAPuCi7iACoWH+oSHC1Y +BIAACO4IC2AALhIRLBIfLRIeB+4oL1CLri74nugVo+4BAAPuCi7iACoWIOoSHS1YBIAACO4IC2AA +LhISLBIgLRIfB+4oL1CMri74nwgVo+4BAAPuCo7gKhYh6hIeLVgEgACo7gtgACwSIS4SEy0SIC9Q +jQfuKChC+a4u+iBmFaPuAQAD7gqO4OoSHy1YBIAAmxGo7gtgAIwRLhIULRIhL1COB+4oKEL6ri76 +IEYVo+4BAAPuCo7g6hIgLVgEgAArFiOo7gtgAC4SFSwSI40TB+4oL1CPri74n2gVo+4BAAPuCo7g +6hIhLTgEgAAnFiLo7ggL2ASAAAtgAI4RKhYkKRISLRIVjxUrEhMsEhToEhEn+EEAAO8WBSXYQQAA +6xYTJmBBAADsFhQkQEEAAOgWESboQQAA7RYVJMhBAAApFhKNH4kciBuMHosd7xIQJEBBAADoFgsm +YEEAAOwWDiXYQQAA6xYNJ/hBAADvFhAkyEEAAOkWDCboQQAAnR+JFo0ZjxrrEgciIQEAAOwSCCbo +QQAA7RYJJ/hBAADvFgoiqEEAAO8SBCZgQQAA7BYIJdhBAADrFgckyCEAAOkWBif7/QAA7xYEL+Im +AACJEI8TixKOkIiTjJKNkauIp8yq3a/unpCdkZySmJPRDwBsEAQpIhX4oAAE8Dh1AOmMDAEgQQAA +8yAART+LBQDrpBAlUEUAAPkABdNiAJ0AKwoAWbVPLCIVKyIU7c0RCUAEgAD8QkYV7oA9AP1rAA2w +CTUA+kJmFeAKJQBtqgyOhA4Oju6GBCRAEQAADwIA0w/TD22aIemCBCRAQQAAioGLgoyDCQmOCgqO +CwuODAyOmYCagZuCnIPrRAAJUASAAFv+toogiCKJIY8jCAiOCQmODw+OCgqOmiCfIykmAegmAilA +BIAAGd19AgCGAwJh+AAKFeAJtQBtmgIIAIrRDwAAAAAAAAD9gQAVoAsFAFm1IPhAaB2gCUUA0w9t +miHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD6iQAClgEgABb/pTaQP/7/A2gPIUA +AGwQBikiFfhCiBWgRgUA0w/4gABFdZkBAAlmDHSrAbGIKiYVBioM6CYUJVFBAAD2gAezogCdAOs0 +AAtgBIAAWbT0+EBoHaAJRQDTD9MPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kc +gyUsEOokAArYBIAAW/5xBkcM9uAFjtIAnQDmNAgK0ASAAPbgaB2gAwUA5BYAKkAEgAD4yGgdoAlF +AAoCZwhAhgoCZQgghgoCYwgAhuoMAAlABIAAbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6Z +gJqBm4Kcg+okAArYBIAAW/5U6lQAAZgFAADmbMAiIQEAAO9tmmpABIAAixAKPBELywjsfAwK0ASA +AFm0vNEPAAAAAAAA6zQACmAEgABZtLfRDwAAAPZgAEYwAwUA/CAGFa//JgBsEAQY3REZ3Q8a3Q0T +3RCTI5gimSH6QAYVoAsFACsmFSsmFNEPAAAAbBAG3iDk4hAqYASAAOdCByvQBIAA+7n8BeAYNQDj +QhUpkASAAOdyDiL76QAAePsnGNz+CPgKiICaE5wS7hYBLAAigAAAkxAqsp3sVAAJWASAAFm2jWSl +x/KCphXgAgUA0Q8AAAAAK+ISC5tS7hYBJf9BgAAa3OfjFgApWASAAOqivyrgBIAAWbaAZKV6Gtzg +2yDqosEq4ASAAFm2eyN9BeSmz2GaAQAAGtza2yDqosMq4ASAAFm2dPdH4A3jhgUAGtzU2yDqosUq +4ASAAFm2bmSmxBrcz9sg6qLHKuAEgABZtmn7QEKIEgCdACsw5cFY9WAr4GIAnQBptyElNOWLEPqC +phXgAgUA0Q+TECqylexUAAlYBIAAWbZcZKcCixD6gqYV4AIFANEPAJMQKrKj7FQACVgEgABZtlRl +rxr6IGgdoAu1AFjhMPoAIh3gAwUA6rM4BQDhgADqEgIrWASAAFm0wMipHNyxjREMrDYs1hdlMyWN +EPyCphXgAgUA0Q8uQG5k7tKTECqyuexUAAlYBIAAWbY9Za6/+iBoHaAbZQBY4Rn6ACId4AIFAOqy +OAUAqYAA6hICK1gEgABZtKosfQMqxShlItGNEPyCphXgAgUA0Q8AAJMQKrKr7FQACVgEgABZtilk +orca3IrbINMP6qKXKuAEgABZtiRlrlr6IGgdoAtVAFjhAPoAIh3gAgUA6rI4BSfpgADqEgIrWASA +AFm0kCxAb/GAJz7SAJ0AZKTfihP6AKId4AzVAFjg3dKg0Q+TECqysexUAAlYBIAAWbYOZa7H+iBo +HaAbJQBY4OpkojUrQG5kt2/qEgIrWASAAFm0fCxCFgrMNixGFosQ+oKmFeACBQDRD5MQKrKv7FQA +CVgEgABZtfxkojMa3F3bIOqiqSrgBIAAWbX3Za5t+iBoHaAL5QBY4NRkodvqEgIrWASAAFm0Zyt9 +Aiq1FIsQ+oKmFeACBQDRD5MQKrKh7FQACVgEgABZtehkoioa3EjbIOqirSrgBIAAWbXjZKOHGtxE +2yDTD+qimyrgBIAAWbXeZa4H+iBoHaALdQBY4LpkoXUrQG5ktuMa3DmLEuqi5ytgBIAAWbXUZaZG +K0BvwMgMuwIrRG+LEPqCphXgAgUA0Q8AAJMQKrK37FQACVgEgABZtclkoe8a3CrbINMP6qKZKuAE +gABZtcRlrZ/6IGgdoAtlAFjgoGShDStAbmS2ahrcH4sS6qLnK2AEgABZtbpkpnkrQG8sCv0MuwEr +RG+LEPqCphXgAgUA0Q8AkxAqsp/sVAAJWASAAFm1r2ShtxrcENsg0w/qopMq4ASAAFm1qmSi2hrc +Ctsg6qKzKuAEgABZtaVkrF8a3AbbIOqiuyrgBIAAWbWgZaxMGtwBixLqotUrYASAAFm1m2WkUosR +K7ISC5lSyJlokgf5IA9h0gCdAIwRK8YS8oKmFeACBQDRD5MQKrKP7FQACVgEgABZtY5koXoa2+7b +IOqikSrgBIAAWbWJZay0+iBoHaALJQBY4GXKohrb5osS6qLnK2AEgABZtYFlrJSKE/oAQh3gDNUA +WOBH0qDRD8Ag0Q8AAAD6IGgdoAv1AFjgV2Sv6uoSAitYBIAAWbPr6xIAI+ALAAAqxRX6gqYV4AIF +ANEPAAD6IGgdoBsVAFjgS2Svui1AbmTVBilAb/E/4ZeSAJ0A8T/hV9IAnQDqEgIrWASAAFmz2S5C +FwruNi5GF4sQ+oKmFeACBQDRDwD6IGgdoAulAFjgOWSvci9AbtMPZPR26hICK1gEgABZs8soQTT7 +AA8CogCdAIoT+gFCHeAM1QBY4BjSoNEPAAAA+iBoHaAbVQBY4ClkrzLqEgEqWASAAOwSAitoBIAA +WN+IixD6gqYV4AIFANEPAAAA+iBoHaALlQBY4B1krwIpQG5klBka252LEuqi5ytgBIAAWbU3ZaJc +K0BvjRD8gqYV4AwVAAy7AvqN5h3gAgUA0Q8AAAAAAAAA+iBoHaALFQBY4Atkrroa24yLEtMP6qLn +K2AEgABZtSZlqymKE/oAIh3gDNUAWN/s0qDRDwAAAADqEgIrWASAAFmzlPVAFfKSAJ0Axy/RDwD6 +IGgdoAuFAFjf9/oAIh3gAgUA6rI4BQFJgAAsQG4PAgBkw4Ma23vrEgIrYASAAFm1DmWibi1Ab8Do +Dt0CLURvZS41jxD+gqYV4AIFANEPAOoSASpYBIAAWN/tZa+cKzDlY/pzAAAAAPogaB2gGwUAWN/d +ZK4CKEBu0w9kgvXqEgIrWASAAFmzbylCGIsQK0YVCpk2+IMGFeACBQDRDwAA+iBoHaALNQBY389k +rcoa21CLEtMP6qLNK2AEgABZtOrj21UdBy4AAIsRK7ISC8lRyJlokgf5P/kR0gCdAI4RjBADvQEt +5hL8gqYVoAIFANEPZS2EjxD+gqYV4AIFANEP6hICK1gEgABZs04qRTSCEPKCphWgAgUA0Q8lfQT0 +sAAV4AsFAPqgaB2gjAUAWbLf6hICKtgEgABY3+srMOXAxAy7Avp8Jh2nuwEA+nymHe/l/gAtMOX6 +IEgVoA4lAA7dAu005StYBIAAWbM2KzDl+nyGHa/lbgAAihJZpkkvMOJ/qRSKElmmRtyg6hICI9gT +AABZtLVkobfAov22PgWgOwUAWbhIxy/RDxrbEYsS6qLPK2AEgABZtKxlrj6LESuyEgvJUWiRCmiS +B/k/8WnSAJ0AHtsSA70BDt0CjhGMEC3mEvyCphWgAgUA0Q+KE/oBIh3gDNUAWN9m0qDRDwAAAPog +aB2gC0UAWN93ZKxqGtr4ixLTD+qizStgBIAAWbSS49sAHQVmAACLESuyEgvpUciZaJIH+T/uEdIA +nQCOEYwQA70BLeYS/IKmFaACBQDRDxra54sS6qLXK2AEgABZtIJlrZaLESuyEguZUmiRCmiSB/k/ +7CnSAJ0AH9rqghHvvwID6BcAAO8mEibqAQAALNDlwOEOzAIs1OXygqYV4AIFANEPihP6AQId4AzV +AFjfONKg0Q8jfQUjPIArMOXAwQy7AgsLR/p8ph3v4BIAAAAa2siLEuqizytgBIAAWbRiZa0XixEr +shIL6VFokQpokgf5P+gx0gCdAB3aywO8AQ3MAo0RLNYSixD6gqYV4AIFANEPAAAAAAD24ABDMAsF +APrAaB2gjAUAWbJgwVDqEgIrWASAAFjfbCsw5QW7Avp8Jh2nuwEA+nymHe/eEgAAACsw5cDIDLsC +CwtH+nymHe/dvgCKE/oA4h3gDNUAWN8I0qDRD4oT+gICHeAMxQBY3wTSoNEPihP6AUId4AzFAFjf +ANKg0Q+KE/oBIh3gDMUAWN770qDRDwCKE/oBAh3gDMUAWN730qDRD4oT+gJCHeAMxQBY3vPSoNEP +AIoT+gIiHeAMxQBY3u7SoNEPihP6AMId4AzFAFje6tKg0Q+KE/oA4h3gDMUAWN7m0qDRD4oT+gDC +HeAM1QBY3uHSoNEPAGwQCCMgB9og8iAAAfALhQDtFAAJ4ASAAFh72O3agBUGyYAAjCANzAKcoBva +fYon6BIAKc8CgAALmQjolgAlAJGAAC6iDC+sMP/ABOViAJ0A8UXADeADBQAjpRT7RAAV78wFAAy7 +AeiiDCXZAQAAm6nrpgglSMEAAHmJXxzaQv200gXv/vUAnqCTJ+rTenVYIQAALcJ9Gdpkm9GZoyjC +fSimAi/Cf+vGfSf4BQAAL8Z/IyQEIyQFkyIjJCAjJCEjJCIjJCOTKZMqkyuTLCMlGvJDZB3gAgUA +0Q8AANogWPNV+kDoFa/+XgDaIFjzUtogWPNGiidj/1gAjiJk4FMFD0do8mjAINEPAC7CgOvmASZo +CwAAnaMpwoCZoijCguvGgCRABQAAKMaCIyQEIyQFkyIjJCAjJCEjJCIjJCOTKZMqkyuTLCMlGvJD +ZB3gAgUA0Q8rIAfaIPogAAXwDAUA+2MAFeANBQBYetdj/5Af2hCfFI4g2iD9tFoF4AwVAO0WBi92 +AoAA7O4CANhBAADuFgUq6ASAAFh54cAg0Q9sEASIImWAnyYgBxfZ8QYGQeoyBStHAoAAp4grgp4k +rB/5s9AF5EQdAHSzfyiCnQlrCiuywwuIAe2EAAQDwYAAHNnzDACHbUkCCAJhiDQe2fOe0CkiABzZ +9OrWAybYQQAA7NYCLM4CgADpSQIB4IEAAOnWASlQBIAAC4AADGgR9wAARHf1AQDkhp0nlHUAAIon ++gFCHeAMBQD7RAAVoA2lAFht4NKg0Q/AINEP//4gDaAIBQDqJAAKaASAAPrDABXgDAUAWHqYwCDR +DwBsEASHJyp5FB/ZzvjipBXvzQUA6HIIJVAHAADscgslUoEAAOqTd3PYgQAADbsBq5nowXR0yQEA +AC6NAep1FCdSgQAA6pNxfDAEgAB5oX2aeO8ABQs4BIAABwJhBwJhBwJhBwJhBwJhBwJhBwJhBwJh +BwJhBwJhF9mzl2CFIJNllGTzs6IFoAelAOJmAiquAoAAB1UC5WYBKxAEgADRD8Ag0Q8AAAAAAAD3 +gGgdoAgFAPjhZhWv/nIACJoMCroMKq0BKqzg+uEGFa/+IgAsvED84QYVr/32AABsEATHjwhYAwg4 +AghIA6ho6CIIC4EKgAACIhiiMtEPAGwQBAQ4AwhYA6ho6CIIC4EKgAACIhiiMtEPAABsEAQEOAMI +WAEISAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBAVIAwg4AQhYA6ho6CIIC4EKgAACIhiiMtEPAAAA +bBAEE9mdAyIC0Q8AbBAOIyIQKDAFKQqSeYkbKSIS/yKgAxCGBQDl2ZUU4DaAAHCXCiowbmihGcAg +0Q8A69mRFL3YgAALmwH6QkYV4AIFANEPIyIYHtmMjTqMIiQKAf+mAA6wvVEA7TYKJgbRgAACKgJY +8oEY2YUvMhEI/wIvNhGJImSQyRjZWpgUjiDaIO/ZfxDYQQAA7xYGL3YCgAD1xgAPMAwVAP4gphWg +DSUAWHkswCDRDwCOPoQ3G9lv5EIOJ3AFAADr6wIA4MEAAP5hxhWv/fUA/CGmFeibHQDpxAIpUASA +APuAZh3omR0A+YAmHeiZHQDpxAAg2IEAAFjw8SgiEg8CAAWIAuaIAgnQBIAA6CYSIlgLAABY/Fv8 +JAAVoA01AP4AAh2gDwUA6dlZHVgEgADpFgApUASAAFm3PMAg0Q8A2iBY25hlrzNj/ucrIAfaIPog +AAXwDAUA+2MAFeANBQBYeehj/xoAAGwQBCUxDdMP0w8MVRHqJAAK2ASAAFg78+ukAAUCOYAAGNkY +KjENCACH6LQABQBpgABtqQIIAmEqMQ1tqQUEAIYLAmHaIPygaB2gCwUAWDuqKSISKvp/CpkB+EJG +FeACBQDRD8cv0Q8AbBAIIyIYGdkuKDIRCYgC6DYRKVAEgABY8mskIAfaIPQgAAIwC4UA7RQACmAE +gABYem/spAAFChGAABnZFIgg6YgCCdAEgAD5gAYVoBulAFm3mB3ZD4w+6hIAKl8CgACtu+q2ACYA +eYAA6zIQKVAEgAALwACKJ+SgDmV4wQAAjqz/wActYgCdAPFGYA3gBAUAJKUU+0QAFe/MBQAMuwHo +ogwl2QEAAJup66YIJUjBAAD5AAVFYgCdABzYz/2x7AXv/vUAnqDkJgclWCEAAPugBiOiAJ0ALcJ9 +Gdjwm9GZoyjCfZiiL8J/68Z9J/gFAAAvxn+ULpQvJCYQJCYRJCYSJCYTJCYUJCYVJCYWJCYXJCYY +JCYZJCYaJCYcJCYdJCYeJCYfJCQEJCQFlCIkJCAkJCEkJCIkJCOUKZQqlCuULCQlGiQlG/pgaB2g +CwUA/AACHaANJQBY9Z3AINEP2iBY8dH6QOgVr/1OANogWPHO2iBY8cGKJ2P/DxjYyy8yEY4iCP8C +7zYRJwGZgAAFCUdokkPAINEPKMKA64YBJngLAACfoy7CgJ6iLcKC68aAJugFAAD9kEYV7/zyACsg +B9og+iAABfAMBQD7YwAV4A0FAFh5WWP/tR/YkZ8UjiDaIP2xcgXgDBUA7RYGL3YCgADs7gIA2EEA +AO4WBSroBIAAWHhjwCDRDwAAAGwQBhnYhJkQiCD8gGgd4AwVAOMWAixGAoAA7IgCCVAEgADoFgEo +2ASAAFh4VtEPAGwQDCsiGCuyByuyDioiECiwIi2wISywIC6wHCOwHe+wHi5mAoAA7cwCD3YCgAAD +7gItsADjsB8vdgKAAA/uAu+wIy5mAoAA6MwCD3YCgADj7gIOZgKAAA/MAv+PAAw13QEA/QRAIFAz +9QAvohJ+8QgP6AxmgAIuphIuohN84QgOyQxmkAIsphP9rMAGUCo1APugDKwgLEUA/aAOBCAuZQD/ +oA9sID8lAP+gEWxiAJ0Ac9EQwKL9sOwFoDsFAFm1i8cv0Q8osBgpsBnqsBosRgKAAAmIAumwGyxG +AoAACogCCIgRCYgCsYj4QsYVoAIFANEPIyIQZDBxKbAQKrARLbAa7LASLM4CgAAKmQLqsBMszgKA +AAyZAuywGSzOAoAACpkC6rAYJIUpAAAIqhEMqgLssBstVgKAAA2qAgiqEQyqArGq6iYWJISlAAAp +IhLr2FEUwCiAAAubASsmEiwwBS0Klf2ACxRiAJ0AwCDRDwAALLAULbAV7rAWLmYCgAANzALtsBcu +ZgKAAA7MAgjMEQ3MAv2WoABQhQUALSIShDfkQg4m4x6AAPwkgBXo7B0A/6BGHa//9QDvFggpUASA +AP2gZh2ozh0A/aAmHajMHQDs1AAlyCEAAOkGAADAYQAA6IMeANhBAABY77QoIhLliAICWAsAAOgm +EilQBIAAWPsf/CIAFaANNQD+AAIdoA8FAOnYHR1YBIAA6RYAKVAEgABZtgBj/zUAAAAqsBgssBnt +sBotVgKAAAyqAuywGy1WAoAADaoCCKoRDKoCsarqJhYpUASAAFjf6MAg0Q8ssBgtsBnusBouZgKA +AA3MAu2wGy5mAoAADswCCMwRDcwCsczsJhYpUASAAFjfecAg0Q8AAC2wGC6wGe+wGi7uAoAADt0C +7rAbLu4CgAAP3QII3REO3QKx3e0mFilQBIAAWN+fwCDRDwAAAAD6YGgdoAtlAFj7FcAg0Q8AAC6w +GC+wGeiwGi92AoAAD+4C77AbL3YCgAAI7gII7hEP7gKx7u4mFilQBIAAWN8WwCDRD2wQCCggBCQi +GPevsAWgGYUAeYEDwCDRD4pK/17ADNCL5QAvQHh78essIAUY19ju19gWfxGAACUiEikiEysxCwhV +ASUmEo05q5l96DcuIhEpJhPyoAXeUgCdAGTg5orsfKexiOv7wGgdoAsFAPwAAh2gDSUAC4AAwJDp +JhEskASAANEPAP2viAWgCiUA/kAIFaA7BQBZtNIpIhApkAUqCpX7P/uEIgCdAIpK81/7NNIAnQAj +IhiNOowiwEH3pgAOsL1RAO02CiYEiYAA2iBY8KQf16guMhEP7gIuNhGIImSAgh3XfZ0UiSDaIOzX +ohDYQQAA7BYGLM4CgAD1JgAMsA0lAPggphXgDBUAWHdPwCDRDxzXoY3g/8CwFaAKVQD0IAYV4DsF +AFm0ri4iEsCQ+EImFe+/9QAP7gHuJhIskASAANEPANogW/7rZa9KwJDpJhEskASAANEP2iBY2c1l +r3tj/rAAKyAH2iD6IAAF8AwFAPtjABXgDQUAWHgdY/9hAGwQCiggBCoiGCkKGOmBCH04BIAAwCDR +D4uq/37ADNCN5QAsoHh9westIAUe13zv13wW/xGAACsiEpoYDrsCKyYS82Amo1IAnQCOLIg2JTAg ++mFEFa/0xQD/AAsNJWUBAAoKTiqs2/VABAUwhLUA9YAUVCIAnQAPuwL7wABEsDwVAPhBhhXgJCUA ++kJGFeAqFQD6wkYNoC9VAH9hCnxhB/TAKw0iAJ0ALjAwKDAxKSBo6jAyL3YCgAAI7gLoMDMvdgKA +AAruAujuEQTIGQAA6O4CDIIKgAD0RkQVoZ6dAPUgI1dQDAUA/TAAFDWuAQAIqgIZ10ydGZsWiZMb +10rlFgcqbkKAAASZLOiy3iSDcYAAlxUlsvsrsvWqiOVSFCxGQoAA+WAARbAPFQBtmUwpUQSHUP8g +ABS1ih0A6XcIDEeCgAAIdwwnff/25+gV5JoBAACRBAD4Guh3AQyCCoAA/YAgFaF3nQDqSggDgHGA +AIi6cokEib5+kXur2/2uVgWgCiUA/EAIFeA7BQBZtDUqIAUrIhibFZoZHNcljxWIGYkgjvDv8Hgr +aASAAPggBhXgCiUA+CAmFaA7BQBZtCkoIhAogAUpCpX5H/JUYgCdAIkYiZrzP/H00gCdAPpAaB2g +CwUA/AACHaANJQBYA3fAINEPAAAA7xIIJfz5gAAv8HgtsAX6QiYV4Iq1APvgGkUgmKUA+aAaBCCZ +tQD5oBnEYgCdACoKlvugGWwiAJ0ALAqZ/aAglSIAnQDC0fzACARgDoUAwvX+wAe0YgCdACgwQSww +QC0wPCkwPe8wPi5mAoAA6MwCDu4CgAAJ3QIoMD/pMEIu7gKAAA/dAu8wQy5mAoAA6cwCDu4CgADo +3QIOZgKAAA/MAg3IDOoiECQEi4AAL6ISffEID9gMZoACLaYSLaITfNEIDckMZpACLKYTjLwOzAL9 +YYYVoCpVAPrABHQiAJ0Aw9H8wAn0YgCdAMLh/sAQFCIAnQDC8v7AHURiAJ0AKBAQZI0dYAMVAAAA ++ABiHePL4QD9P+t2IgCdACkwJCwwJegwJizOAoAADJkC7DAnLM4CgAAImQIImRHsmQIFQBEAAPkN +AA1/9P4AAAAALTAjwPEN/TkttEEssEH8IgYdoCpVAPrf96UiAJ0AKDAh8R/7f9IAnQAoMEEsMEAt +MDwpMD3vMD4uZgKAAOjMAg7uAoAACd0CKDA/6TBCLu4CgAAP3QLvMEMuZgKAAOnMAg7uAoAA6N0C +DmYCgAAPzAINyQzqIhAkhIuAAC+iEn3xCA/YDGaAAi2mEi2iE3zRCA3JDGaQAiymEy0wOC8wOYy8 +6DA6Lu4CgAAP3QLvMDsu7gKAAAjdAurWjh7uAoAAD90C7swCBugFAAAtJhacvPthZhWv+3oALjAk +LzAlLDAh6DAmL3YCgAAP7gLvMCcvdgKAAAjuAgjuEQ/uAvGAFUYSAJ0ALzBMKDBN6TBOL/4CgAAI +/wLoME8v/gKAAAn/Agj/Eej/Ag8THgAAKiIQ6qIYJ5LxgAD/QBKz4gCdAC+2Ei0wSCgwSekwSi7u +AoAACN0C6DBLLu4CgAAJ3QLu1mYe7gKAAAjdAi22FCgwNiwwNCowNfxm8BXgCQUA6bYVLmYCgAAK +zALpthMuZgKAAAjMAu62Cy5mAoAADcwC/WGmFa/4QgAvMDgoMDnpMDov/gKAAAj/AugwOy/+AoAA +Cf8CCP8RCP8C7tZMF/gFAAAvJhb/YWYVr/duACoiEdMPZKFFiqcroR4oCpD5YAfqogCdAC0KYP96 +ABWgCiUA/ayABaA7BQBZs0Zj/HIAAP/uhA2v+vUAAAAc1jrpEgYu8ASAAP1gCBXgClUA+CAGFeA7 +BQBZszstIhL6QggVoE4FAA7dAi0mEi4wQSswQCwwPC8wPe0wPi3eAoAA7rsCDmYCgAAPzAIuMD/v +MEIuZgKAAA3MAu0wQy3eAoAA77sCDmYCgADuzAIN3gKAAA27Agy9DPe/0gASAJ0ALaISfNEIDc8M +ZvACLKYSLKIT+5/RNGIAnQAMuAxmihv7QmYV4AIFANEPAAD6IQgV4AkFACkmESqyByk8IPtByBWg +DDUAbcoFCQCGCgJhwCDRD4mu0w/5JgAV4AxlACo8IG3JBQoghgkCY8Ag0Q8c1f/oEgcveASAAP9g +CBWgCiUA+CAGFaA7BQBZsv9j+1WKGCwxC4qnv8z7Q8QV68whAAzNESncMPl/9ZPiAJ0Aia7lz6pk +yMEAAGP5gAAsMDgtMDnuMDouZgKAAA3MAu0wOy5mAoAADswCCMwRDcwC6tXkFmAFAAAsJhb7YWYV +r/0qACoiECqiGMOw+iAGFafcHQD9q7gFoAolAFmy32P61S8wTCgwTSoiEOkwTi/+AoAACP8C6DBP +L/4CgAAJ/wLqohgv/gKAAPnmAA+//vYAAABsEASJJyuZFOqSCSWASYAAyKFY91bRDwBsEASIIiMg +B/EAoA3hMwEAwCDRDwAAiScomRT3IcgVp6UBAOSSCSQJ6YAAFdVvF9Vr+UAJ0VIAnQD0YAY6EgCd +AAw5EaWZK5KeBzwKLMLD92AJilIAnQArkp0MuwFksNYpIED1IAgokIolAPUgBGkSAJ0A9aAEKpAK +BQDdQP6BBBXgDBUA+kBoHafqAQBYdgsk+pcm+mjuIhIpnwKAAPRgAEHwD0UA7zadIRkhAADzx0YN +4AUFACoiEqarLLInJLR9LrImnsAtsiac0SW2JuW2JyVTgQAAWbPCKSISwIHzLwAM8A8FAAmPOGT/ +yeQkBSlQBIAAWbO6wCDRDwD6wFAVr/3uABzVOIrIaqF/DDkRpZkrkp4HPQrt0sMoBAqAAPdgBBpS +AJ0AK5KdDbsBZLB3sK6eyGW/KIhA6zwYKVAEgAD/qu4F54jBAPhIBh2gDBUA/oAGFeANRQBYdfnA +INEPAAAAAP/7DA2gBAUAY/8LKSBACJkQ+IAGFe/7AgAAAAAAAAAA//tUDaALBQDAoFmv4BzVFIrI ++V/7kJIAnQD//kgNoAsFAMCwwNoNrTT9gQYV7/4OAAAAAGwQBogiLCAH8QCADeHMAQDAINEPiSct +mRQFDkfmkgkmhKGAAPnABmlSAJ0ALyBBFNUA69T8HhgEgADx7GwN4AVFAPYAAh3gDQUA7MoRBiW5 +AACkqiiingvOCi7iw/UACVviAJ0AKqKdDqoB26DsFgAlBoGAAC8gQWXw8gcOR+9hCCtoBIAA+kBo +HaAMFQBYdZ0MORGkmfUzphXvmHUA6CQFKVAEgABZs2DAINEPAAAAAAAAAP/9sA2gBgUAH9Tcjvj3 +wAZ4kgCdAAw6EaSqKKKe9QAHQ+IAnQAqop0LOAoogsMIqgHkoNZnS/0AAPnhBhXv/eoAKiBACKoQ ++sAGFa/8tgAAj54t8AQn8AUe1Rjl8AYu7gKAAAfdAu/wBy7uAoAABd0CCN0RD90CDt0BJdxn9I4A +CvCHlQD0oIAV7/w2AI1gixDs1QoZUASAAPtjABXn3cEA7SRAKugEgAD8wAYVoAwVAFh1iMAg0Q8A +ACzcSOvcZylwBIAA/sBoHeS7HQBZslr7QGgd7/vOAP/7bA2gCgUAnRH8IAYVoAoFAFmvbh/UoowQ +jviNERvUnvnf+MCSAJ0A//rIDaAKBQDAoMCKCOg0+eEGFa/6jgBsEASIIiMgB/EAgA3hMwEAwCDR +D4knKJkU5pIJJAcZgAD1qSAFp5UBAPkgBtlSAJ0A5dSJEaWZAAAMORGkmSqSnvdABtpSAJ0AK5Kd +BTwKLMLDDLsBZLB9LSBB8aucDeAKBQDdYP7BBBXn6gEA+kBoHaAMFQBYdTAMOBH1AABEMA9FAP8T +phXvnnUA7iQFKVAEgABZsvLAINEPABfUcYp490AEIJIAnQAMORGkmSuSngU8CuzCwygECoAA92AE +ClIAnQArkp0MuwHksHVla/0AAJ14Zb+Bj2DrPBgpUASAAP+pZAWn/8EA/kgGHeAMFQD+wAYVoA1F +AFh1MMAg0Q8A//x0DaAGBQAoIEAIiBD4wAYVr/x+AAAA+hEiHa/9HgD//MQNoAsFAMCgWa8Yinj5 +X/uokgCdAP/+YA2gCwUAAMCwwJoJqTT44QYV7/4iAABsEASKKiiiGCiABSkKc3mBJoknK5kU7JIJ +JYCxgADbIP4AQh2gjeUAWHPhwCDRDwD//6gNoAwFAIivG9SI6yYLIXiBAAD/AAYV4AwFAOgmCSVI +4QAA+EEGFeANJQD/QeYV756FAO4kBSlYBIAAWHHswCDRD2wQBIgiyIfAINEPAAAAAACJNyQgByqZ +FPWoRAXhRAEA7ZIJJQVBgADq1BsaTwKAAKWZK5KeCkwK7MLDKAQKgAD3YASCUgCdACuSnQy7AWSw +gvpAaB2gDFUA/mEEFeCO5QBYdMT4YQgV4A8FAOgyCSp3AoAA9cAAR3ANRQDt5p0kgIGAAJ87mYCK +OJihnzifOYs8JDBF/2VgB9+ctQAsNAWNLi4sOP+/+vUiAJ0A+J/6sNIAnQD6QggVoAs1AFj3WcAg +0Q/aMFmydGP/0//9YA2gDQUA60wYKVAEgAD8ACIdoA1FAFh0xMAg0Q8AbBAEKTAT8SEgDeD1hQD1 +IAZ4kgCdAMAg0Q8AAIQniDAqMBGETuI8GCQtfIAA+gACHeBMBQDqRAQiKA8AAOgwEiKosQAA6EQF +KtAEgABZq6UkTQP0jYAVoAsFAPqAaB2hDAUAWaug2lDsMBEpWASAAFj2+9pA7DASIdlhAABY9vjA +INEPAAAAAPwcAh2gCwUA6kQCIjALAADoMBIjMzEAAOhEAytQBIAAWauOJE0D9JWAFaALBQD6gGgd +oIwFAFmridpg7DARKVgEgABY9uWlO+wwEipQBIAAWPbhwCDRDwAAhCeETsCw6jARIkgXAAD7LEYd +oOwFAOgwEiI4EwAA6JRjK9AEgABZq3cmTQX23AAVoAsFAPrAaB2gjAUAWatx2nDsMBEh2GEAAFj2 +zaU77DASK1AEgABY9srqJAAKWASAAFj4XsAg0Q8AAABsEAQX05sW0+sncsMmYomkdwl3EadmhG3y +QGAlqIMdAPCCgA3nxMEALCRSi20LC18rJFOKbQqKFCokVIltKSRVKCRWIyRX0Q8AAAAA8krmHeiD +HQD4SsYdoEUFAPRKRh3gDwUA/kpmHeAuhQD+SoYdr/2FAC0kVdEPAAAAbBAGiCLxAXAN5zUBANog +WOypiSLLlWgyTsAg0Q8AAADqIhApWASAAFjWQWgyaYonjKz7RgAVoAsFAOrNDAZjIQAADcs5WHNy +0qDRDwArIAfaIPogAAXwDAUA+2MAFeANBQBYdDhpMrAf03GfEI4g2iD9p2QF4AwVAO0WAi92AoAA +7O4CCNgEgADuFgEq6ASAAFhzQsAg0Q/AINEPbBAGIyIYGtOHiTqIIsBB+yYADLC5UQDpNgokASGA +ANogWOx9HNOBKzIRDLsCKzYRjSJk0EYFDkdo4lzAINEP2iBY1cH/XowN5/UBAGjyeBzTc4onKzIR +iKzsuwIFUMEAAPpiJhXgCwUA6okMBEMhAAAJizlYcz/SoNEPACsgB9og+iAABfAMBQD7YwAV4A0F +AFh0BWP/nQAe0z6eEI0g2iDs02IY2ASAAOwWAi7uAoAA9aYADrAMFQDtFgEq6ASAAFhzD8Ag0Q/A +INEPbBA2iTUlMgD3pugFoAQFAPem5gXgCIUA+QiyDeJVCQDbMPomABWhXAUAWarX+iYAFeAYZQDo +tBEqUASAAFj2R5YQ/CYAFaANJQD7QGgd4A4FAPpAaB2gDxUAWbEqwCDRDykwEGiRUvUgBikSAJ0A +aJQDwCDRD4g2JHKLDwIACYgRCEQIJBZgJEIKJEIJ61QAClAEgABY+TfpEmAtfCYAACmQBSoKlXqZ +yPosCBWgCyUAWPZVwCDRDwAAKjITWPkz5KQACtgEgABY+Splr1HaMFj4n2Svm4uni74sso782QAH +MA11AP+gBw4iAJ0A/ABiHejsuQD/oAaOIgCdABjS4/1gQCWgDgUALsQRKIK/K3KL+KAARDANJQDm +FgAsRkKAAPlgAEWwDwUAWbD2wCDRDxTTK4c2JEKLCXcRp0QkFmCESodIhEnrVAAKUASAAFj5CWWu +yyoSYIqniq4pooDHuAuZASmmgIswCxtCD7sRC5kCKaaAKDIAEtLT/wIAB9ADFQArEmArsAUsCpJ8 +sUOMcmTApNpwWOvtjXJk0KqSGI5w2nDv0wwQ2IEAAO8WCi92AoAA88YAD3AMFQD+ISYVoA0lAFhy +nMAg0Q9Y93DAINEPAGR+nCRyGBrS4IlKiHL7JgAMsLlRAOlGCiQDwYAA2nBY69Yc0torQhEMuwIr +RhGNcmTQapIUjnDacO/S1RDYQQAA7xYGL3YCgADzxgAPcAwVAP4gphWgDSUAWHKCwCDRDwAAAAAA +AOpyECvYBIAAWNVhwCDRDwArcAfacPogAAXwDAUA+2MAFeANBQBYc19j/znacFjVBWWvlGP+AwAA +K3AH2nD6IAAF8AwFAPtjABXgDQUAWHNVY/95AGwQBIguIyw4c4EtKSISep8yiy6Is+okAApgBIAA +67zgKugEgAALgACMIu0gBS4AXgAAyNOOLnPp18Ag0Q8AAAAAAAAA/EAIFeAKVQD9pYQFoDsFAFmv +usAg0Q8AbBAYJRYZlB4rIAcjFh6HNegyBCn4BIAA/+HkFeADFQDyIgYV4bsBAPojBhXgyFEALBYa +/CPIFaDYWQD8I6YV4L95ACsWFSrAAP+DsBWj9vUA/YekFeB3+QD8ImYV7DgdAP4gBh2ge3UA7MIf +JFRCgAAPCEn4IeYVoAAeAACWHxnSnygSGfwiJhWgDwUA+S/kFeAEBQD7QBG8Z4gBAC8WFAk5DPgi +5hWvmQEAKRYW9QBIMRIAnQCKIvtAVGCSAJ0A8OcQDeAOBQDuFhIjgFGAAAM6AlkBfsBQ8oVADeAG +BQAtEh4t0IMNXUIvEh0rEhr+AGIdoAwlAO/sOQvQBIAAWQFdpqbwgQAN4Ar1ACkSHimSKihsMAmG +OXagbPQhphWkth0A4xYMJdgFAAD6I2YV4AGaAAAALBIT0w8PAgD7gEYYEgCdAC0SHg8CAI3V8b/7 +u1IAnQDrEhMp0ASAAPwiKBWgDhUA7hYSKOgEgABZAYn7QE3gUgCdAP4AYh3gBQUACvU6ZFGhw2CU +HfIhhhXkhh0AKBYbKRIYE9IBHtH97NH+HKAEgAD1IAniEgCdAOsSGyy3AoAAo2YqYp77QFJL4gCd +ACZinQ6YCiiCwwhmAQZrAu/CCC2wBIAA+2BOYBIAnQArFgX34E7QkgCdACkyrhrSRPsgTEgSAJ0A +LjKtLaJf7esBB9P9AAD9wEuuYgCdAJrI/cBL1mIAnQCNHiwgFK3MDAxHLCQU9YBNZlIAnQAuEh3I +6ykSFsCD+QBOqOIAnQBkUPIqEhoPAgDIoWRQY+tkAAlQBIAA/ABiHaAdhQBZAXruEg8teASAAOYS +DCK52YAAHNIkLRIV+aO4BeAKBQCa8przmvSa9elpAg9EAoAA6fYALuiCgADo3QIK9sKAAP+mAA6w +G8UA/eAmFeAKVQBZrwwrEhf5YEkpUgCdAMAg7BIbKm8CgACj3SzWndEPLhIeLuCD/kUABzAEFQD+ +IoYVr/b6AI/I9+BKIJIAnQDpEhsqNwKAAKNmKGKe+QBKe+IAnQArYp0OTQot0sMNuwHWsPtgSggS +AJ0AsP6eyPrAaB3v+r4AAPybTA3gNgUA//bUDaANBQAvEhJk8HbrEgUpUASAAPwAYh2gHYUAWQE/ +GdHtFtHrjhwoEAAmYp8J7gIZ0cAIHxTmhgsP+wKAAOn/AgR8nIAALBIR7RITI1v/AAAosj8rsX2e +oJ+hnaKco5uk+UCmFaAAbgAsEhEtEhMrYQWIY56gn6GbopijnaScpSasGC0SFYwfAt0Q7RYILmQC +gADsFgkrsD4AAC4SHRjRh/4hiBXgCgUA6hYGL3GCgACeFwj/Av4hRhXgDyUAnxvrZAAJUASAAPwA +Yh2gHYUAWQESix0vEh6JFuYSHiWRQYAAJmCD7/IFJJF5gACIHQZOQOSCGG9zAoAAKBIeKICCCAZA +CmYQjBcG7QL9hgAOcN+hAPOoABawj5EA/YYADnDfiQDjiBAO6IKAAPmmAA6wj5kABIgQCMwCKBIe +ixoNzAKIhPtABhXj/fUAnaKcpRzRo/1AZhWpiAEAmKQY0Z+YoS4SC+mcASUwYQAA6RYGJ3P9AADu +FgsvekYAAC8SFPXgLPiSAJ0A9eAtsRIAnQD14C5xkgCdAPXgLzISAJ0A9eAv8pIAnQD14DCzEgCd +APXgMXOSAJ0Ajh3TD2TgTy8SHi/yKmTwRutkAAlQBIAA/ABiHaAdhQBZANAoEh4b0YGMGvkFSBWj +/fUAnaL9QAYVrAkFAJmj+0AmFemYsQDppgQsRYKAAOimBSUwYQAA62QACVAEgAD8AGIdoB2FAFkA +vh3RcY8YjBn2IUgVoAkFAJkRmRKZE5kUmaT5QKYV7/v1AJuim6OWoO/MAgr2woAADswC7hIeJTBh +AADtzAIA2CEAAOymASDoQQAA6hwEIOAxAABY/tj5QGgd4AgVAOqJOQ0oBIAA6RYhJSM5gAAkFiL6 +ACId4AoFAAm6OOUWIyVjmYAAE9FRjRmEHBjRIR/RUOUSHSongoAA+IYACjYMBQD4IQgVoAoVAOWl +OQrwwoAABfw5+cYADzAJNQD9xgAO8AglAAWYOSgWIA7OAi4WHP2GAA5wBQUA/CPmFaAEfgAAAAAA +AAD/92wNoAYFAMDg//fIDaAGBQCIHfwjyBXkDAUA9mAABzK2KQDxCwAN4AYFAC3SKu3GOQ3bgoAA +LBAA/2AABHDfyQDr3RAOYgKAAOzuAgxFAoAA+cYADzDPwQD1kAAWMI95AP2GAA5w36kA/0CmFaDv +sQDg7hEO68KAAP+mAA6w74EA7IgRD3ZCgAD/BgAMMe9pAATuEf8GAAww77kA7YgCD3JCgAAOvgIM +iAKNGp2gHNDfnKEI7gL+xgAPMAglAAjuAp6kGNEKmKIe0Qn/QGYVr/YuAAAAAAD6AAId4AYFAP/9 +TA2gDgUAAAAAAAAAmaGUoJ6inqOepJ6lnaadp52onakvEiDlXAElMKEAAP6gEZxiAJ0A62QACVAE +gAD8AIIdoC2FAFkAO+RQUWrOwoAA9KAKYJIAnQArEh/H7/smAAzwDQUA45kCC/0uAACNEywSHo4S +jxGLzCzCEJmhm6n1QAYVoAgFAJiimKafo56knaecpYwU/UEGFa/+JgAtEh0sEhwb0NwMmQLrmQIG +hBmAAPDiQA3v/vUAmaGUoJ6inqOepP9AphWgDQUAnaadp52o/UEmFe/9NgAvEh4iFiUr8hYm8Tgi +8Tos8hXo8TkrNAKAAAYiAibxOy3yG+7yGixEAoAACGYCKPIXL/IZn6Keo52knKabp5iolqWZoZSg +kqnyJKgVr/v2AAAAAAAAAADw4kAN7/v1AJmhlKCbopujm6T7QKYV4AgFAJimmKeYqPlBJhWv+zoA +LBIejRIvwTsmwTkowTguwTrrwhgrNAKAAOb/AgxEAoAACO4CJsIUiMwswhCbpJinlqiZoZ2ilKCc +o5+lnqmMFP1AxhWv+hoAKxId7BIcJYNRgAAb0JrH7/0mAAywDQUA65kCA4DxgACZoZSgnqKeo56k +nqWdpp2nnaj9QSYV7/kyAC4SHiIWJS3iEiziEyviGIjthu4v4hSC7y7iEZ6inaOcpJulmKaWp5+p +maGUoJKo8iSoFa/4VgArEh/H3/smAAzwDAUA45kCA4DxgACZoZSgnaKdo52knaWcppynnKj9QSYV +r/eaAJmhlKCOE/4gKBXgCAUAmKKYo5ikmKaYp5ion6X/QSYVr/cKACoSHhnQbIqlE9AGJRIj5BIi +JUwwgADj0AITg+GAABzQZoscDLsC+z9GFe/ifgAlEhDA0vetAAr/4wIAAMCl/aC+BaAbxQDuPhEJ +6ASAAFmtRmP25foiyBWgDgUAnhGeEp4TnhRY/cQkFiLlFiMlX2GAAPoiyBWgCwUAWP23JBYi9CRm +Fe/vWgAvEhH7/7nQkgCdAGP2tRrQI4gcCogC+T9GFa/gngAAwKBZcfzIpxvQRCuwgGSxLCoSFlj9 +r+kSIS1cHgAA+iLIFaALFQBY/aL4JCgV7+3CANxg6hIMKVgEgAD8I8gV4A4VAFj+VPdAaB2v6fIA +AADcYOoSDClYBIAA/CPIFeAONQBY/kz3QGgdr+l2AAAAANxg6hIMKVgEgAD8I8gV4A51AFj+RPdA +aB2v6PYAAAAA3GDqEgwpWASAAPwjyBXgDrUAWP4890BoHa/odgAAAADcYOoSDClYBIAA/CPIFeAO +xQBY/jT3QGgdr+f2AAAAANxg6hIMKVgEgAD8I8gV4A7VAFj+LPdAaB2v53YAAAAA3GDqEgwpWASA +APwjyBXgDvUAWP4k90BoHa/m9gDrEhMp0ASAAOwSESjoBIAAWP7yY/YxAAArEh6MHu0SGSlQBIAA +WGns0qDRDwAAAAD7n/AFoUsVAFmXQSwaAAysAvuf5gWhSxUAWZdBY/6zAMCwwNoN/TSdyPt/tHCS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 15 20:13:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2B97EABA1C; Tue, 15 May 2018 20:13:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF8D7BEC1; Tue, 15 May 2018 20:13:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 829E11043D; Tue, 15 May 2018 20:13:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FKD08X069931; Tue, 15 May 2018 20:13:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FKD0ZU069930; Tue, 15 May 2018 20:13:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201805152013.w4FKD0ZU069930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 15 May 2018 20:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333643 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 20:13:01 -0000 Author: brooks Date: Tue May 15 20:13:00 2018 New Revision: 333643 URL: https://svnweb.freebsd.org/changeset/base/333643 Log: Remove stray tabs from in_lltable_dump_entry(). Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue May 15 18:41:01 2018 (r333642) +++ head/sys/netinet/in.c Tue May 15 20:13:00 2018 (r333643) @@ -1412,52 +1412,52 @@ in_lltable_dump_entry(struct lltable *llt, struct llen int error; bzero(&arpc, sizeof(arpc)); - /* skip deleted entries */ - if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) - return (0); - /* Skip if jailed and not a valid IP of the prison. */ - lltable_fill_sa_entry(lle,(struct sockaddr *)&arpc.sin); - if (prison_if(wr->td->td_ucred, - (struct sockaddr *)&arpc.sin) != 0) - return (0); - /* - * produce a msg made of: - * struct rt_msghdr; - * struct sockaddr_in; (IPv4) - * struct sockaddr_dl; - */ - arpc.rtm.rtm_msglen = sizeof(arpc); - arpc.rtm.rtm_version = RTM_VERSION; - arpc.rtm.rtm_type = RTM_GET; - arpc.rtm.rtm_flags = RTF_UP; - arpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; + /* skip deleted entries */ + if ((lle->la_flags & LLE_DELETED) == LLE_DELETED) + return (0); + /* Skip if jailed and not a valid IP of the prison. */ + lltable_fill_sa_entry(lle,(struct sockaddr *)&arpc.sin); + if (prison_if(wr->td->td_ucred, + (struct sockaddr *)&arpc.sin) != 0) + return (0); + /* + * produce a msg made of: + * struct rt_msghdr; + * struct sockaddr_in; (IPv4) + * struct sockaddr_dl; + */ + arpc.rtm.rtm_msglen = sizeof(arpc); + arpc.rtm.rtm_version = RTM_VERSION; + arpc.rtm.rtm_type = RTM_GET; + arpc.rtm.rtm_flags = RTF_UP; + arpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY; - /* publish */ - if (lle->la_flags & LLE_PUB) - arpc.rtm.rtm_flags |= RTF_ANNOUNCE; + /* publish */ + if (lle->la_flags & LLE_PUB) + arpc.rtm.rtm_flags |= RTF_ANNOUNCE; - sdl = &arpc.sdl; - sdl->sdl_family = AF_LINK; - sdl->sdl_len = sizeof(*sdl); - sdl->sdl_index = ifp->if_index; - sdl->sdl_type = ifp->if_type; - if ((lle->la_flags & LLE_VALID) == LLE_VALID) { - sdl->sdl_alen = ifp->if_addrlen; - bcopy(lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); - } else { - sdl->sdl_alen = 0; - bzero(LLADDR(sdl), ifp->if_addrlen); - } + sdl = &arpc.sdl; + sdl->sdl_family = AF_LINK; + sdl->sdl_len = sizeof(*sdl); + sdl->sdl_index = ifp->if_index; + sdl->sdl_type = ifp->if_type; + if ((lle->la_flags & LLE_VALID) == LLE_VALID) { + sdl->sdl_alen = ifp->if_addrlen; + bcopy(lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); + } else { + sdl->sdl_alen = 0; + bzero(LLADDR(sdl), ifp->if_addrlen); + } - arpc.rtm.rtm_rmx.rmx_expire = - lle->la_flags & LLE_STATIC ? 0 : lle->la_expire; - arpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); - if (lle->la_flags & LLE_STATIC) - arpc.rtm.rtm_flags |= RTF_STATIC; - if (lle->la_flags & LLE_IFADDR) - arpc.rtm.rtm_flags |= RTF_PINNED; - arpc.rtm.rtm_index = ifp->if_index; - error = SYSCTL_OUT(wr, &arpc, sizeof(arpc)); + arpc.rtm.rtm_rmx.rmx_expire = + lle->la_flags & LLE_STATIC ? 0 : lle->la_expire; + arpc.rtm.rtm_flags |= (RTF_HOST | RTF_LLDATA); + if (lle->la_flags & LLE_STATIC) + arpc.rtm.rtm_flags |= RTF_STATIC; + if (lle->la_flags & LLE_IFADDR) + arpc.rtm.rtm_flags |= RTF_PINNED; + arpc.rtm.rtm_index = ifp->if_index; + error = SYSCTL_OUT(wr, &arpc, sizeof(arpc)); return (error); } From owner-svn-src-all@freebsd.org Tue May 15 20:14:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2648EABC17; Tue, 15 May 2018 20:14:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 625F07C0B5; Tue, 15 May 2018 20:14:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43A9E10441; Tue, 15 May 2018 20:14:39 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FKEdmJ070039; Tue, 15 May 2018 20:14:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FKEdrG070038; Tue, 15 May 2018 20:14:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201805152014.w4FKEdrG070038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 15 May 2018 20:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333644 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 20:14:39 -0000 Author: brooks Date: Tue May 15 20:14:38 2018 New Revision: 333644 URL: https://svnweb.freebsd.org/changeset/base/333644 Log: Unwrap a line that no longer requires wrapping. Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue May 15 20:13:00 2018 (r333643) +++ head/sys/netinet/in.c Tue May 15 20:14:38 2018 (r333644) @@ -1417,8 +1417,7 @@ in_lltable_dump_entry(struct lltable *llt, struct llen return (0); /* Skip if jailed and not a valid IP of the prison. */ lltable_fill_sa_entry(lle,(struct sockaddr *)&arpc.sin); - if (prison_if(wr->td->td_ucred, - (struct sockaddr *)&arpc.sin) != 0) + if (prison_if(wr->td->td_ucred, (struct sockaddr *)&arpc.sin) != 0) return (0); /* * produce a msg made of: From owner-svn-src-all@freebsd.org Tue May 15 20:28:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9DBDEAC987; Tue, 15 May 2018 20:28:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5878C7CFB3; Tue, 15 May 2018 20:28:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 398EE105DF; Tue, 15 May 2018 20:28:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FKSpgp075559; Tue, 15 May 2018 20:28:51 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FKSoua075558; Tue, 15 May 2018 20:28:50 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201805152028.w4FKSoua075558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 15 May 2018 20:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333645 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 333645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 20:28:52 -0000 Author: rmacklem Date: Tue May 15 20:28:50 2018 New Revision: 333645 URL: https://svnweb.freebsd.org/changeset/base/333645 Log: End grace for the NFSv4 server if all mounts do ReclaimComplete. The NFSv4 protocol requires that the server only allow reclaim of state and not issue any new open/lock state for a grace period after booting. The NFSv4.0 protocol required this grace period to be greater than the lease duration (over 2minutes). For NFSv4.1, the client tells the server that it has done reclaiming state by doing a ReclaimComplete operation. If all NFSv4 clients are NFSv4.1, the grace period can end once all the clients have done ReclaimComplete, shortening the time period considerably. This patch does this. If there are any NFSv4.0 mounts, the grace period will still be over 2minutes. This change is only an optimization and does not affect correct operation. Tested by: andreas.nagy@frequentis.com MFC after: 2 months Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue May 15 20:14:38 2018 (r333644) +++ head/sys/fs/nfs/nfsport.h Tue May 15 20:28:50 2018 (r333645) @@ -590,6 +590,7 @@ struct nfst_rec { #define NFSNST_NEWSTATE 0x1 #define NFSNST_REVOKE 0x2 #define NFSNST_GOTSTATE 0x4 +#define NFSNST_RECLAIMED 0x8 /* * This structure is linked onto nfsrv_stablefirst for the duration of Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Tue May 15 20:14:38 2018 (r333644) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Tue May 15 20:28:50 2018 (r333645) @@ -136,6 +136,7 @@ static int nfsrv_cbcallargs(struct nfsrv_descript *nd, static u_int32_t nfsrv_nextclientindex(void); static u_int32_t nfsrv_nextstateindex(struct nfsclient *clp); static void nfsrv_markstable(struct nfsclient *clp); +static void nfsrv_markreclaim(struct nfsclient *clp); static int nfsrv_checkstable(struct nfsclient *clp); static int nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, struct vnode *vp, NFSPROC_T *p); @@ -4091,8 +4092,27 @@ static int nfsrv_checkgrace(struct nfsrv_descript *nd, struct nfsclient *clp, u_int32_t flags) { - int error = 0; + int error = 0, notreclaimed; + struct nfsrv_stable *sp; + if ((nfsrv_stablefirst.nsf_flags & (NFSNSF_UPDATEDONE | + NFSNSF_GRACEOVER)) == 0) { + /* + * First, check to see if all of the clients have done a + * ReclaimComplete. If so, grace can end now. + */ + notreclaimed = 0; + LIST_FOREACH(sp, &nfsrv_stablefirst.nsf_head, nst_list) { + if ((sp->nst_flag & NFSNST_RECLAIMED) == 0) { + notreclaimed = 1; + break; + } + } + if (notreclaimed == 0) + nfsrv_stablefirst.nsf_flags |= (NFSNSF_GRACEOVER | + NFSNSF_NEEDLOCK); + } + if ((nfsrv_stablefirst.nsf_flags & NFSNSF_GRACEOVER) != 0) { if (flags & NFSLCK_RECLAIM) { error = NFSERR_NOGRACE; @@ -4749,6 +4769,32 @@ nfsrv_markstable(struct nfsclient *clp) } /* + * This function is called when a NFSv4.1 client does a ReclaimComplete. + * Very similar to nfsrv_markstable(), except for the flag being set. + */ +static void +nfsrv_markreclaim(struct nfsclient *clp) +{ + struct nfsrv_stable *sp; + + /* + * First find the client structure. + */ + LIST_FOREACH(sp, &nfsrv_stablefirst.nsf_head, nst_list) { + if (sp->nst_len == clp->lc_idlen && + !NFSBCMP(sp->nst_client, clp->lc_id, sp->nst_len)) + break; + } + if (sp == LIST_END(&nfsrv_stablefirst.nsf_head)) + return; + + /* + * Now, just set the flag. + */ + sp->nst_flag |= NFSNST_RECLAIMED; +} + +/* * This function is called for a reclaim, to see if it gets grace. * It returns 0 if a reclaim is allowed, 1 otherwise. */ @@ -5904,8 +5950,10 @@ nfsrv_checkreclaimcomplete(struct nfsrv_descript *nd) /* Check to see if reclaim complete has already happened. */ if ((sep->sess_clp->lc_flags & LCL_RECLAIMCOMPLETE) != 0) error = NFSERR_COMPLETEALREADY; - else + else { sep->sess_clp->lc_flags |= LCL_RECLAIMCOMPLETE; + nfsrv_markreclaim(sep->sess_clp); + } NFSUNLOCKSESSION(shp); NFSUNLOCKSTATE(); return (error); From owner-svn-src-all@freebsd.org Tue May 15 21:07:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B57CDEAF370; Tue, 15 May 2018 21:07:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AE8D80C65; Tue, 15 May 2018 21:07:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47D8710C63; Tue, 15 May 2018 21:07:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FL7Cbb096395; Tue, 15 May 2018 21:07:12 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FL7CGl096394; Tue, 15 May 2018 21:07:12 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805152107.w4FL7CGl096394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 15 May 2018 21:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333646 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 333646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 21:07:12 -0000 Author: marius Date: Tue May 15 21:07:11 2018 New Revision: 333646 URL: https://svnweb.freebsd.org/changeset/base/333646 Log: Restore style(9) conformance after r320844 (actually requested pre- commit) and bring the r320844 additions in line with existing bits. Modified: head/sys/dev/mmc/mmcreg.h Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Tue May 15 20:28:50 2018 (r333645) +++ head/sys/dev/mmc/mmcreg.h Tue May 15 21:07:11 2018 (r333646) @@ -159,34 +159,35 @@ struct mmc_command { #define R1_STATE_PRG 7 #define R1_STATE_DIS 8 -/* R4 response (SDIO) */ -#define R4_IO_NUM_FUNCTIONS(ocr) (((ocr) >> 28) & 0x3) -#define R4_IO_MEM_PRESENT (0x1<<27) -#define R4_IO_OCR_MASK 0x00fffff0 +/* R4 responses (SDIO) */ +#define R4_IO_NUM_FUNCTIONS(ocr) (((ocr) >> 28) & 0x3) +#define R4_IO_MEM_PRESENT (0x1 << 27) +#define R4_IO_OCR_MASK 0x00fffff0 /* * R5 responses * * Types (per SD 2.0 standard) - *e : error bit - *s : status bit - *r : detected and set for the actual command response - *x : Detected and set during command execution. The host can get - * the status by issuing a command with R1 response. + * e : error bit + * s : status bit + * r : detected and set for the actual command response + * x : Detected and set during command execution. The host can get + * the status by issuing a command with R1 response. * * Clear Condition (per SD 2.0 standard) - *a : according to the card current state. - *b : always related to the previous command. reception of a valid - * command will clear it (with a delay of one command). - *c : clear by read + * a : according to the card current state. + * b : always related to the previous command. reception of a valid + * command will clear it (with a delay of one command). + * c : clear by read */ -#define R5_COM_CRC_ERROR (1u << 15)/* er, b */ -#define R5_ILLEGAL_COMMAND (1u << 14)/* er, b */ -#define R5_IO_CURRENT_STATE_MASK (3u << 12)/* s, b */ -#define R5_IO_CURRENT_STATE(x) (((x) & R5_IO_CURRENT_STATE_MASK) >> 12) -#define R5_ERROR (1u << 11)/* erx, c */ -#define R5_FUNCTION_NUMBER (1u << 9)/* er, c */ -#define R5_OUT_OF_RANGE (1u << 8)/* er, c */ +#define R5_COM_CRC_ERROR (1u << 15) /* er, b */ +#define R5_ILLEGAL_COMMAND (1u << 14) /* er, b */ +#define R5_IO_CURRENT_STATE_MASK (3u << 12) /* s, b */ +#define R5_IO_CURRENT_STATE(x) (((x) & R5_IO_CURRENT_STATE_MASK) >> 12) +#define R5_ERROR (1u << 11) /* erx, c */ +#define R5_FUNCTION_NUMBER (1u << 9) /* er, c */ +#define R5_OUT_OF_RANGE (1u << 8) /* er, c */ + struct mmc_data { size_t len; /* size of the data */ size_t xfer_len; @@ -219,7 +220,7 @@ struct mmc_request { #define SD_SEND_RELATIVE_ADDR 3 #define MMC_SET_DSR 4 #define MMC_SLEEP_AWAKE 5 -#define IO_SEND_OP_COND 5 +#define IO_SEND_OP_COND 5 #define MMC_SWITCH_FUNC 6 #define MMC_SWITCH_FUNC_CMDS 0 #define MMC_SWITCH_FUNC_SET 1 @@ -310,30 +311,30 @@ struct mmc_request { /* Class 9: I/O cards (sd) */ #define SD_IO_RW_DIRECT 52 /* CMD52 arguments */ -#define SD_ARG_CMD52_READ (0<<31) -#define SD_ARG_CMD52_WRITE (1<<31) -#define SD_ARG_CMD52_FUNC_SHIFT 28 -#define SD_ARG_CMD52_FUNC_MASK 0x7 -#define SD_ARG_CMD52_EXCHANGE (1<<27) -#define SD_ARG_CMD52_REG_SHIFT 9 -#define SD_ARG_CMD52_REG_MASK 0x1ffff -#define SD_ARG_CMD52_DATA_SHIFT 0 -#define SD_ARG_CMD52_DATA_MASK 0xff -#define SD_R5_DATA(resp) ((resp)[0] & 0xff) +#define SD_ARG_CMD52_READ (0 << 31) +#define SD_ARG_CMD52_WRITE (1 << 31) +#define SD_ARG_CMD52_FUNC_SHIFT 28 +#define SD_ARG_CMD52_FUNC_MASK 0x7 +#define SD_ARG_CMD52_EXCHANGE (1 << 27) +#define SD_ARG_CMD52_REG_SHIFT 9 +#define SD_ARG_CMD52_REG_MASK 0x1ffff +#define SD_ARG_CMD52_DATA_SHIFT 0 +#define SD_ARG_CMD52_DATA_MASK 0xff +#define SD_R5_DATA(resp) ((resp)[0] & 0xff) #define SD_IO_RW_EXTENDED 53 /* CMD53 arguments */ -#define SD_ARG_CMD53_READ (0<<31) -#define SD_ARG_CMD53_WRITE (1<<31) -#define SD_ARG_CMD53_FUNC_SHIFT 28 -#define SD_ARG_CMD53_FUNC_MASK 0x7 -#define SD_ARG_CMD53_BLOCK_MODE (1<<27) -#define SD_ARG_CMD53_INCREMENT (1<<26) -#define SD_ARG_CMD53_REG_SHIFT 9 -#define SD_ARG_CMD53_REG_MASK 0x1ffff -#define SD_ARG_CMD53_LENGTH_SHIFT 0 -#define SD_ARG_CMD53_LENGTH_MASK 0x1ff -#define SD_ARG_CMD53_LENGTH_MAX 64 /* XXX should be 511? */ +#define SD_ARG_CMD53_READ (0 << 31) +#define SD_ARG_CMD53_WRITE (1 << 31) +#define SD_ARG_CMD53_FUNC_SHIFT 28 +#define SD_ARG_CMD53_FUNC_MASK 0x7 +#define SD_ARG_CMD53_BLOCK_MODE (1 << 27) +#define SD_ARG_CMD53_INCREMENT (1 << 26) +#define SD_ARG_CMD53_REG_SHIFT 9 +#define SD_ARG_CMD53_REG_MASK 0x1ffff +#define SD_ARG_CMD53_LENGTH_SHIFT 0 +#define SD_ARG_CMD53_LENGTH_MASK 0x1ff +#define SD_ARG_CMD53_LENGTH_MAX 64 /* XXX should be 511? */ /* Class 10: Switch function commands */ #define SD_SWITCH_FUNC 6 @@ -525,50 +526,50 @@ struct mmc_request { /* * SDIO Direct & Extended I/O */ -#define SD_IO_RW_WR (1u << 31) -#define SD_IO_RW_FUNC(x) (((x) & 0x7) << 28) -#define SD_IO_RW_RAW (1u << 27) -#define SD_IO_RW_INCR (1u << 26) -#define SD_IO_RW_ADR(x) (((x) & 0x1FFFF) << 9) -#define SD_IO_RW_DAT(x) (((x) & 0xFF) << 0) -#define SD_IO_RW_LEN(x) (((x) & 0xFF) << 0) +#define SD_IO_RW_WR (1u << 31) +#define SD_IO_RW_FUNC(x) (((x) & 0x7) << 28) +#define SD_IO_RW_RAW (1u << 27) +#define SD_IO_RW_INCR (1u << 26) +#define SD_IO_RW_ADR(x) (((x) & 0x1FFFF) << 9) +#define SD_IO_RW_DAT(x) (((x) & 0xFF) << 0) +#define SD_IO_RW_LEN(x) (((x) & 0xFF) << 0) -#define SD_IOE_RW_LEN(x) (((x) & 0x1FF) << 0) -#define SD_IOE_RW_BLK (1u << 27) +#define SD_IOE_RW_LEN(x) (((x) & 0x1FF) << 0) +#define SD_IOE_RW_BLK (1u << 27) /* Card Common Control Registers (CCCR) */ -#define SD_IO_CCCR_START 0x00000 -#define SD_IO_CCCR_SIZE 0x100 -#define SD_IO_CCCR_FN_ENABLE 0x02 -#define SD_IO_CCCR_FN_READY 0x03 -#define SD_IO_CCCR_INT_ENABLE 0x04 -#define SD_IO_CCCR_INT_PENDING 0x05 -#define SD_IO_CCCR_CTL 0x06 -#define CCCR_CTL_RES (1<<3) -#define SD_IO_CCCR_BUS_WIDTH 0x07 -#define CCCR_BUS_WIDTH_4 (1<<1) -#define CCCR_BUS_WIDTH_1 (1<<0) -#define SD_IO_CCCR_CARDCAP 0x08 -#define SD_IO_CCCR_CISPTR 0x09 /* XXX 9-10, 10-11, or 9-12 */ +#define SD_IO_CCCR_START 0x00000 +#define SD_IO_CCCR_SIZE 0x100 +#define SD_IO_CCCR_FN_ENABLE 0x02 +#define SD_IO_CCCR_FN_READY 0x03 +#define SD_IO_CCCR_INT_ENABLE 0x04 +#define SD_IO_CCCR_INT_PENDING 0x05 +#define SD_IO_CCCR_CTL 0x06 +#define CCCR_CTL_RES (1 << 3) +#define SD_IO_CCCR_BUS_WIDTH 0x07 +#define CCCR_BUS_WIDTH_4 (1 << 1) +#define CCCR_BUS_WIDTH_1 (1 << 0) +#define SD_IO_CCCR_CARDCAP 0x08 +#define SD_IO_CCCR_CISPTR 0x09 /* XXX 9-10, 10-11, or 9-12 */ /* Function Basic Registers (FBR) */ -#define SD_IO_FBR_START 0x00100 -#define SD_IO_FBR_SIZE 0x00700 +#define SD_IO_FBR_START 0x00100 +#define SD_IO_FBR_SIZE 0x00700 /* Card Information Structure (CIS) */ -#define SD_IO_CIS_START 0x01000 -#define SD_IO_CIS_SIZE 0x17000 +#define SD_IO_CIS_START 0x01000 +#define SD_IO_CIS_SIZE 0x17000 /* CIS tuple codes (based on PC Card 16) */ -#define SD_IO_CISTPL_VERS_1 0x15 -#define SD_IO_CISTPL_MANFID 0x20 -#define SD_IO_CISTPL_FUNCID 0x21 -#define SD_IO_CISTPL_FUNCE 0x22 -#define SD_IO_CISTPL_END 0xff +#define SD_IO_CISTPL_VERS_1 0x15 +#define SD_IO_CISTPL_MANFID 0x20 +#define SD_IO_CISTPL_FUNCID 0x21 +#define SD_IO_CISTPL_FUNCE 0x22 +#define SD_IO_CISTPL_END 0xff /* CISTPL_FUNCID codes */ /* OpenBSD incorrectly defines 0x0c as FUNCTION_WLAN */ -/* #define SDMMC_FUNCTION_WLAN 0x0c */ +/* #define SDMMC_FUNCTION_WLAN 0x0c */ /* OCR bits */ From owner-svn-src-all@freebsd.org Tue May 15 21:15:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B41EAFAB6; Tue, 15 May 2018 21:15:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EEB78119A; Tue, 15 May 2018 21:15:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 122F610E0D; Tue, 15 May 2018 21:15:10 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FLF9fG001459; Tue, 15 May 2018 21:15:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FLF9mX001458; Tue, 15 May 2018 21:15:09 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805152115.w4FLF9mX001458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 15 May 2018 21:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333647 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 333647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 21:15:10 -0000 Author: marius Date: Tue May 15 21:15:09 2018 New Revision: 333647 URL: https://svnweb.freebsd.org/changeset/base/333647 Log: - If present, take advantage of the R/W cache of eMMC revision 1.5 and later devices. These caches work akin to the ones found in HDDs/SSDs that ada(4)/da(4) also enable if existent, but likewise increase the likelihood of data loss in case of a sudden power outage etc. On the other hand, write performance is up to twice as high for e. g. 1 GiB files depending on the actual chip and transfer mode employed. For maximum data integrity, the usage of eMMC caches can be disabled via the hw.mmcsd.cache tunable. - Get rid of the NOP mmcsd_open(). Modified: head/sys/dev/mmc/mmcreg.h head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Tue May 15 21:07:11 2018 (r333646) +++ head/sys/dev/mmc/mmcreg.h Tue May 15 21:15:09 2018 (r333647) @@ -357,6 +357,8 @@ struct mmc_request { /* * EXT_CSD fields */ +#define EXT_CSD_FLUSH_CACHE 32 /* W/E */ +#define EXT_CSD_CACHE_CTRL 33 /* R/W/E */ #define EXT_CSD_EXT_PART_ATTR 52 /* R/W, 2 bytes */ #define EXT_CSD_ENH_START_ADDR 136 /* R/W, 4 bytes */ #define EXT_CSD_ENH_SIZE_MULT 140 /* R/W, 3 bytes */ @@ -390,12 +392,19 @@ struct mmc_request { #define EXT_CSD_PWR_CL_200_360 237 /* RO */ #define EXT_CSD_PWR_CL_52_195_DDR 238 /* RO */ #define EXT_CSD_PWR_CL_52_360_DDR 239 /* RO */ +#define EXT_CSD_CACHE_FLUSH_POLICY 249 /* RO */ #define EXT_CSD_GEN_CMD6_TIME 248 /* RO */ +#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ #define EXT_CSD_PWR_CL_200_360_DDR 253 /* RO */ /* * EXT_CSD field definitions */ +#define EXT_CSD_FLUSH_CACHE_FLUSH 0x01 +#define EXT_CSD_FLUSH_CACHE_BARRIER 0x02 + +#define EXT_CSD_CACHE_CTRL_CACHE_EN 0x01 + #define EXT_CSD_EXT_PART_ATTR_DEFAULT 0x0 #define EXT_CSD_EXT_PART_ATTR_SYSTEMCODE 0x1 #define EXT_CSD_EXT_PART_ATTR_NPERSISTENT 0x2 @@ -474,6 +483,8 @@ struct mmc_request { #define EXT_CSD_SEC_FEATURE_SUPPORT_BD_BLK_EN 0x04 #define EXT_CSD_SEC_FEATURE_SUPPORT_GB_CL_EN 0x10 #define EXT_CSD_SEC_FEATURE_SUPPORT_SANITIZE 0x40 + +#define EXT_CSD_CACHE_FLUSH_POLICY_FIFO 0x01 /* * Vendor specific EXT_CSD fields Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Tue May 15 21:07:11 2018 (r333646) +++ head/sys/dev/mmc/mmcsd.c Tue May 15 21:15:09 2018 (r333647) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -132,6 +133,8 @@ struct mmcsd_softc { uint32_t flags; #define MMCSD_INAND_CMD38 0x0001 #define MMCSD_USE_TRIM 0x0002 +#define MMCSD_FLUSH_CACHE 0x0004 +#define MMCSD_DIRTY 0x0008 uint32_t cmd6_time; /* Generic switch timeout [us] */ uint32_t part_time; /* Partition switch timeout [us] */ off_t enh_base; /* Enhanced user data area slice base ... */ @@ -152,12 +155,19 @@ static const char *errmsg[] = "NO MEMORY" }; +static SYSCTL_NODE(_hw, OID_AUTO, mmcsd, CTLFLAG_RD, NULL, "mmcsd driver"); + +static int mmcsd_cache = 1; +SYSCTL_INT(_hw_mmcsd, OID_AUTO, cache, CTLFLAG_RDTUN, &mmcsd_cache, 0, + "Device R/W cache enabled if present"); + #define LOG_PPS 5 /* Log no more than 5 errors per second. */ /* bus entry points */ static int mmcsd_attach(device_t dev); static int mmcsd_detach(device_t dev); static int mmcsd_probe(device_t dev); +static int mmcsd_shutdown(device_t dev); /* disk routines */ static int mmcsd_close(struct disk *dp); @@ -166,7 +176,6 @@ static int mmcsd_dump(void *arg, void *virtual, vm_off static int mmcsd_getattr(struct bio *); static int mmcsd_ioctl_disk(struct disk *disk, u_long cmd, void *data, int fflag, struct thread *td); -static int mmcsd_open(struct disk *dp); static void mmcsd_strategy(struct bio *bp); static void mmcsd_task(void *arg); @@ -179,6 +188,7 @@ static void mmcsd_add_part(struct mmcsd_softc *sc, u_i static int mmcsd_bus_bit_width(device_t dev); static daddr_t mmcsd_delete(struct mmcsd_part *part, struct bio *bp); static const char *mmcsd_errmsg(int e); +static int mmcsd_flush_cache(struct mmcsd_softc *sc); static int mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag, struct thread *td); static int mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, @@ -297,6 +307,31 @@ mmcsd_attach(device_t dev) rev = ext_csd[EXT_CSD_REV]; /* + * With revision 1.5 (MMC v4.5, EXT_CSD_REV == 6) and later, take + * advantage of the device R/W cache if present and useage is not + * disabled. + */ + if (rev >= 6 && mmcsd_cache != 0) { + size = ext_csd[EXT_CSD_CACHE_SIZE] | + ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | + ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | + ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; + if (bootverbose) + device_printf(dev, "cache size %juKB\n", size); + if (size > 0) { + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmc_switch(mmcbus, dev, sc->rca, + EXT_CSD_CMD_SET_NORMAL, EXT_CSD_CACHE_CTRL, + EXT_CSD_CACHE_CTRL_CACHE_EN, sc->cmd6_time, true); + MMCBUS_RELEASE_BUS(mmcbus, dev); + if (err != MMC_ERR_NONE) + device_printf(dev, "failed to enable cache\n"); + else + sc->flags |= MMCSD_FLUSH_CACHE; + } + } + + /* * Ignore user-creatable enhanced user data area and general purpose * partitions partitions as long as partitioning hasn't been finished. */ @@ -505,7 +540,6 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con MMCSD_DISK_LOCK_INIT(part); d = part->disk = disk_alloc(); - d->d_open = mmcsd_open; d->d_close = mmcsd_close; d->d_strategy = mmcsd_strategy; d->d_ioctl = mmcsd_ioctl_disk; @@ -519,6 +553,8 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con d->d_stripesize = sc->erase_sector * d->d_sectorsize; d->d_unit = cnt; d->d_flags = DISKFLAG_CANDELETE; + if ((sc->flags & MMCSD_FLUSH_CACHE) != 0) + d->d_flags |= DISKFLAG_CANFLUSHCACHE; d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize; strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); @@ -671,10 +707,22 @@ mmcsd_detach(device_t dev) free(part, M_DEVBUF); } } + if (mmcsd_flush_cache(sc) != MMC_ERR_NONE) + device_printf(dev, "failed to flush cache\n"); return (0); } static int +mmcsd_shutdown(device_t dev) +{ + struct mmcsd_softc *sc = device_get_softc(dev); + + if (mmcsd_flush_cache(sc) != MMC_ERR_NONE) + device_printf(dev, "failed to flush cache\n"); + return (0); +} + +static int mmcsd_suspend(device_t dev) { struct mmcsd_softc *sc = device_get_softc(dev); @@ -706,6 +754,8 @@ mmcsd_suspend(device_t dev) MMCSD_IOCTL_UNLOCK(part); } } + if (mmcsd_flush_cache(sc) != MMC_ERR_NONE) + device_printf(dev, "failed to flush cache\n"); return (0); } @@ -740,19 +790,18 @@ mmcsd_resume(device_t dev) } static int -mmcsd_open(struct disk *dp __unused) +mmcsd_close(struct disk *dp) { + struct mmcsd_softc *sc; + if ((dp->d_flags & DISKFLAG_OPEN) != 0) { + sc = ((struct mmcsd_part *)dp->d_drv1)->sc; + if (mmcsd_flush_cache(sc) != MMC_ERR_NONE) + device_printf(sc->dev, "failed to flush cache\n"); + } return (0); } -static int -mmcsd_close(struct disk *dp __unused) -{ - - return (0); -} - static void mmcsd_strategy(struct bio *bp) { @@ -943,6 +992,8 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io if (err != MMC_ERR_NONE) goto switch_back; } + if (mic->write_flag != 0) + sc->flags |= MMCSD_DIRTY; if (mic->is_acmd != 0) (void)mmc_wait_for_app_cmd(mmcbus, dev, rca, &cmd, 0); else @@ -1155,6 +1206,7 @@ mmcsd_rw(struct mmcsd_part *part, struct bio *bp) else cmd.opcode = MMC_READ_SINGLE_BLOCK; } else { + sc->flags |= MMCSD_DIRTY; if (numblocks > 1) cmd.opcode = MMC_WRITE_MULTIPLE_BLOCK; else @@ -1340,13 +1392,18 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physi device_t dev, mmcbus; int err; - /* length zero is special and really means flush buffers to media */ - if (!length) - return (0); - disk = arg; part = disk->d_drv1; sc = part->sc; + + /* length zero is special and really means flush buffers to media */ + if (length == 0) { + err = mmcsd_flush_cache(sc); + if (err != MMC_ERR_NONE) + return (EIO); + return (0); + } + dev = sc->dev; mmcbus = sc->mmcbus; @@ -1396,6 +1453,14 @@ mmcsd_task(void *arg) "mmcsd disk jobqueue", 0); } while (bp == NULL); MMCSD_DISK_UNLOCK(part); + if (__predict_false(bp->bio_cmd == BIO_FLUSH)) { + if (mmcsd_flush_cache(sc) != MMC_ERR_NONE) { + bp->bio_error = EIO; + bp->bio_flags |= BIO_ERROR; + } + biodone(bp); + continue; + } if (bp->bio_cmd != BIO_READ && part->ro) { bp->bio_error = EROFS; bp->bio_resid = bp->bio_bcount; @@ -1453,10 +1518,35 @@ mmcsd_bus_bit_width(device_t dev) return (8); } +static int +mmcsd_flush_cache(struct mmcsd_softc *sc) +{ + device_t dev, mmcbus; + int err; + + if ((sc->flags & MMCSD_FLUSH_CACHE) == 0) + return (MMC_ERR_NONE); + + dev = sc->dev; + mmcbus = sc->mmcbus; + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + if ((sc->flags & MMCSD_DIRTY) == 0) { + MMCBUS_RELEASE_BUS(mmcbus, dev); + return (MMC_ERR_NONE); + } + err = mmc_switch(mmcbus, dev, sc->rca, EXT_CSD_CMD_SET_NORMAL, + EXT_CSD_FLUSH_CACHE, EXT_CSD_FLUSH_CACHE_FLUSH, 60 * 1000, true); + if (err == MMC_ERR_NONE) + sc->flags &= ~MMCSD_DIRTY; + MMCBUS_RELEASE_BUS(mmcbus, dev); + return (err); +} + static device_method_t mmcsd_methods[] = { DEVMETHOD(device_probe, mmcsd_probe), DEVMETHOD(device_attach, mmcsd_attach), DEVMETHOD(device_detach, mmcsd_detach), + DEVMETHOD(device_shutdown, mmcsd_shutdown), DEVMETHOD(device_suspend, mmcsd_suspend), DEVMETHOD(device_resume, mmcsd_resume), DEVMETHOD_END From owner-svn-src-all@freebsd.org Tue May 15 21:25:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFDB2EB039E; Tue, 15 May 2018 21:25:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E79681EBB; Tue, 15 May 2018 21:25:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F1C310FA2; Tue, 15 May 2018 21:25:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FLPa9G006473; Tue, 15 May 2018 21:25:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FLPajh006472; Tue, 15 May 2018 21:25:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805152125.w4FLPajh006472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 May 2018 21:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333648 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 333648 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 21:25:36 -0000 Author: imp Date: Tue May 15 21:25:35 2018 New Revision: 333648 URL: https://svnweb.freebsd.org/changeset/base/333648 Log: Hold the reference count until the CCB is released When a disk disappears and the periph is invalidated, any I/Os that are pending with the controller can cause a crash when they complete. Move to holding the softc reference count taken in dastart() until the I/O is complete rather than only until xpt_action() returns. (This approach was suggested by Ken Merry.) Sponsored by: Netflix Submitted by: Chuck Silvers Differential Revision: https://reviews.freebsd.org/D15435 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue May 15 21:15:09 2018 (r333647) +++ head/sys/cam/scsi/scsi_da.c Tue May 15 21:25:35 2018 (r333648) @@ -3300,7 +3300,6 @@ out: cam_periph_unlock(periph); xpt_action(start_ccb); cam_periph_lock(periph); - softc->refcount--; /* May have more work to do, so ensure we stay scheduled */ daschedule(periph); @@ -4443,13 +4442,15 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) softc->flags |= DA_FLAG_WAS_OTAG; /* - * We need to call cam_iosched before we call biodone so that we - * don't measure any activity that happens in the completion - * routine, which in the case of sendfile can be quite - * extensive. + * We need to call cam_iosched before we call biodone so that we don't + * measure any activity that happens in the completion routine, which in + * the case of sendfile can be quite extensive. Release the periph + * refcount taken in dastart() for each CCB. */ cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb); xpt_release_ccb(done_ccb); + KASSERT(softc->refcount >= 1, ("dadone softc %p refcount %d", softc, softc->refcount)); + softc->refcount--; if (state == DA_CCB_DELETE) { TAILQ_HEAD(, bio) queue; From owner-svn-src-all@freebsd.org Tue May 15 21:51:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09ECBEB1C3D; Tue, 15 May 2018 21:51:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B43D382FD1; Tue, 15 May 2018 21:51:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 963DB11343; Tue, 15 May 2018 21:51:30 +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 w4FLpUOM018360; Tue, 15 May 2018 21:51:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FLpUvt018358; Tue, 15 May 2018 21:51:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805152151.w4FLpUvt018358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 May 2018 21:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333649 - head/tools/tools/intel-ucode-split X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/intel-ucode-split X-SVN-Commit-Revision: 333649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 21:51:31 -0000 Author: emaste Date: Tue May 15 21:51:29 2018 New Revision: 333649 URL: https://svnweb.freebsd.org/changeset/base/333649 Log: Add a tool to split Intel microcode into one file per Platform Id Intel now releases microcode updates in files named after --. In some cases a single file may include microcode for multiple Platform Ids for the same family, model, and stepping. Our current microcode update tooling (/usr/sbin/cpucontrol) only processes the first microcode update in the file. This tool splits combined files into individual files with one microcode update each, named as --.. Adding this to tools/ for experimentation and testing. In the future we'll want to have cpucontrol or other tooling work directly with the Intel-provided microcode files. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15433 Added: head/tools/tools/intel-ucode-split/ head/tools/tools/intel-ucode-split/Makefile (contents, props changed) head/tools/tools/intel-ucode-split/intel-ucode-split.c (contents, props changed) Added: head/tools/tools/intel-ucode-split/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/intel-ucode-split/Makefile Tue May 15 21:51:29 2018 (r333649) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= intel-ucode-split +MAN= + +.include Added: head/tools/tools/intel-ucode-split/intel-ucode-split.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Tue May 15 21:51:29 2018 (r333649) @@ -0,0 +1,169 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 The FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include + +static const size_t bufsize = 65536; + +/* SDM vol 3 9.11.1 Intel microcode header. */ +struct microcode_update_header { + uint32_t header_version; + uint32_t update_revision; + uint32_t date; /* BCD mmddyyyy */ + uint32_t processor_signature; + uint32_t checksum; /* Over update data and header */ + uint32_t loader_revision; + uint32_t processor_flags; + uint32_t data_size; + uint32_t total_size; + uint32_t reserved[3]; +}; + +/* + * SDM vol 2A CPUID EAX = 01h Returns Model, Family, Stepping Information. + * 9 chars including the NUL terminator will be written to buf. + */ + +static char * +format_signature(char *buf, uint32_t signature) +{ + unsigned family, model, stepping; + + family = (signature & 0xf00) >> 8; + model = (signature & 0xf0) >> 4; + stepping = signature & 0xf; + if (family == 0x06 || family == 0x0f) + model += (signature & 0xf0000) >> 12; + if (family == 0x0f) + family += (signature & 0xff00000) >> 20; + sprintf(buf, "%02x-%02x-%02x", family, model, stepping); + return (buf); +} + +static void +dump_header(const struct microcode_update_header *hdr) +{ + char buf[16]; + + printf("version\t\t0x%x\n", hdr->header_version); + printf("revision\t0x%x\n", hdr->update_revision); + printf("date\t\t0x%x\t%04x-%02x-%02x\n", hdr->date, + hdr->date & 0xffff, (hdr->date & 0xff000000) >> 24, + (hdr->date & 0xff0000) >> 16); + printf("signature\t0x%x\t\t%s\n", hdr->processor_signature, + format_signature(buf, hdr->processor_signature)); + printf("checksum\t0x%x\n", hdr->checksum); + printf("loader revision\t0x%x\n", hdr->loader_revision); + printf("processor flags\t0x%x\n", hdr->processor_flags); + printf("datasize\t0x%x\t\t0x%x\n", hdr->data_size, + hdr->data_size != 0 ? hdr->data_size : 2000); + printf("size\t\t0x%x\t\t0x%x\n", hdr->total_size, + hdr->total_size != 0 ? hdr->total_size : 2048); +} + +static void +usage(void) +{ + + printf("ucode-split microcode_file\n"); + exit(1); +} + +int +main(int argc, char *argv[]) +{ + struct microcode_update_header hdr; + char output_file[128]; + char *buf; + size_t len, resid; + ssize_t rv; + int ifd, ofd; + + if (argc != 2) + usage(); + + ifd = open(argv[1], O_RDONLY); + if (ifd < 0) + err(1, "open"); + + buf = malloc(bufsize); + if (buf == NULL) + err(1, "malloc"); + + for (;;) { + /* Read header. */ + rv = read(ifd, &hdr, sizeof(hdr)); + if (rv < 0) { + err(1, "read"); + } else if (rv == 0) { + break; + } else if (rv < (ssize_t)sizeof(hdr)) { + errx(1, "invalid microcode header"); + } + + dump_header(&hdr); + + format_signature(output_file, hdr.processor_signature); + sprintf(output_file + strlen(output_file), ".%02x", + hdr.processor_flags & 0xff); + ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); + if (ofd < 0) + err(1, "open"); + + /* Write header. */ + rv = write(ofd, &hdr, sizeof(hdr)); + if (rv < (ssize_t)sizeof(hdr)) + err(1, "write"); + + /* Copy data. */ + resid = (hdr.total_size != 0 ? hdr.total_size : 2048) - + sizeof(hdr); + if (resid > 1 << 24) /* Arbitrary chosen maximum size. */ + errx(1, "header total_size too large"); + while (resid > 0) { + len = resid < bufsize ? resid : bufsize; + rv = read(ifd, buf, len); + if (rv < 0) + err(1, "read"); + else if (rv < (ssize_t)len) + errx(1, "truncated microcode data"); + if (write(ofd, buf, len) < (ssize_t)len) + err(1, "write"); + resid -= len; + } + printf("written to %s\n\n", output_file); + close(ofd); + } +} From owner-svn-src-all@freebsd.org Tue May 15 21:55:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80016EB1F60; Tue, 15 May 2018 21:55:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35C0D833DF; Tue, 15 May 2018 21:55:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18497114BA; Tue, 15 May 2018 21:55:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FLsxXl021386; Tue, 15 May 2018 21:54:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FLsxic021385; Tue, 15 May 2018 21:54:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805152154.w4FLsxic021385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 15 May 2018 21:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333650 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 333650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 21:55:00 -0000 Author: np Date: Tue May 15 21:54:59 2018 New Revision: 333650 URL: https://svnweb.freebsd.org/changeset/base/333650 Log: cxgbe(4): Claim some more T5 and T6 boards. MFC after: 2 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue May 15 21:51:29 2018 (r333649) +++ head/sys/dev/cxgbe/t4_main.c Tue May 15 21:54:59 2018 (r333650) @@ -645,16 +645,10 @@ struct { {0x5412, "Chelsio T560-CR"}, /* 1 x 40G, 2 x 10G */ {0x5414, "Chelsio T580-LP-SO-CR"}, /* 2 x 40G, nomem */ {0x5415, "Chelsio T502-BT"}, /* 2 x 1G */ -#ifdef notyet - {0x5404, "Chelsio T520-BCH"}, - {0x5405, "Chelsio T540-BCH"}, - {0x5406, "Chelsio T540-CH"}, - {0x5408, "Chelsio T520-CX"}, - {0x540b, "Chelsio B520-SR"}, - {0x540c, "Chelsio B504-BT"}, - {0x540f, "Chelsio Amsterdam"}, - {0x5413, "Chelsio T580-CHR"}, -#endif + {0x5418, "Chelsio T540-BT"}, /* 4 x 10GBaseT */ + {0x5419, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ + {0x541a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ + {0x541b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ {0x6400, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ @@ -674,9 +668,14 @@ struct { {0x6415, "Chelsio T6201-BT"}, /* 2 x 1000BASE-T */ /* Custom */ - {0x6480, "Chelsio T6225 80"}, - {0x6481, "Chelsio T62100 81"}, - {0x6484, "Chelsio T62100 84"}, + {0x6480, "Custom T6225-CR"}, + {0x6481, "Custom T62100-CR"}, + {0x6482, "Custom T6225-CR"}, + {0x6483, "Custom T62100-CR"}, + {0x6484, "Custom T64100-CR"}, + {0x6485, "Custom T6240-SO"}, + {0x6486, "Custom T6225-SO-CR"}, + {0x6487, "Custom T6225-CR"}, }; #ifdef TCP_OFFLOAD From owner-svn-src-all@freebsd.org Tue May 15 22:22:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D71ED799D; Tue, 15 May 2018 22:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4710384C38; Tue, 15 May 2018 22:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29B701196D; Tue, 15 May 2018 22:22:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FMMBhq036323; Tue, 15 May 2018 22:22:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FMMAxI036320; Tue, 15 May 2018 22:22:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805152222.w4FMMAxI036320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 May 2018 22:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333651 - in head/sys/cam: ata mmc nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/cam: ata mmc nvme X-SVN-Commit-Revision: 333651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 22:22:11 -0000 Author: imp Date: Tue May 15 22:22:10 2018 New Revision: 333651 URL: https://svnweb.freebsd.org/changeset/base/333651 Log: Hold the reference count until the CCB is released When a disk disappears and the periph is invalidated, any I/Os that are pending with the controller can cause a crash when they complete. Move to holding the softc reference count taken in dastart() until the I/O is complete rather than only until xpt_action() returns. (This approach was suggested by Ken Merry.) This extends the method used in da to ada, nda, and mda. Sponsored by: Netflix Submitted by: Chuck Silvers Modified: head/sys/cam/ata/ata_da.c head/sys/cam/mmc/mmc_da.c head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue May 15 21:54:59 2018 (r333650) +++ head/sys/cam/ata/ata_da.c Tue May 15 22:22:10 2018 (r333651) @@ -2458,7 +2458,6 @@ out: cam_periph_unlock(periph); xpt_action(start_ccb); cam_periph_lock(periph); - softc->refcount--; /* May have more work to do, so ensure we stay scheduled */ adaschedule(periph); @@ -2856,10 +2855,13 @@ adadone(struct cam_periph *periph, union ccb *done_ccb * We need to call cam_iosched before we call biodone so that we * don't measure any activity that happens in the completion * routine, which in the case of sendfile can be quite - * extensive. + * extensive. Release the periph refcount taken in adastart() + * for each CCB. */ cam_iosched_bio_complete(softc->cam_iosched, bp, done_ccb); xpt_release_ccb(done_ccb); + KASSERT(softc->refcount >= 1, ("adadone softc %p refcount %d", softc, softc->refcount)); + softc->refcount--; if (state == ADA_CCB_TRIM) { TAILQ_HEAD(, bio) queue; struct bio *bp1; Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue May 15 21:54:59 2018 (r333650) +++ head/sys/cam/mmc/mmc_da.c Tue May 15 22:22:10 2018 (r333651) @@ -1357,7 +1357,6 @@ sddastart(struct cam_periph *periph, union ccb *start_ cam_periph_unlock(periph); xpt_action(start_ccb); cam_periph_lock(periph); - softc->refcount--; /* May have more work to do, so ensure we stay scheduled */ sddaschedule(periph); @@ -1418,6 +1417,11 @@ sddadone(struct cam_periph *periph, union ccb *done_cc softc->outstanding_cmds--; xpt_release_ccb(done_ccb); + /* + * Release the periph refcount taken in mdastart() for each CCB. + */ + KASSERT(softc->refcount >= 1, ("mdadone softc %p refcount %d", softc, softc->refcount)); + softc->refcount--; biodone(bp); } Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue May 15 21:54:59 2018 (r333650) +++ head/sys/cam/nvme/nvme_da.c Tue May 15 22:22:10 2018 (r333651) @@ -990,7 +990,6 @@ out: cam_periph_unlock(periph); xpt_action(start_ccb); cam_periph_lock(periph); - softc->refcount--; /* May have more work to do, so ensure we stay scheduled */ ndaschedule(periph); @@ -1101,6 +1100,11 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb biodone(bp2); } } + /* + * Release the periph refcount taken in mdastart() for each CCB. + */ + KASSERT(softc->refcount >= 1, ("ndadone softc %p refcount %d", softc, softc->refcount)); + softc->refcount--; return; } case NDA_CCB_DUMP: From owner-svn-src-all@freebsd.org Tue May 15 22:26:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A2E9ED7D9D; Tue, 15 May 2018 22:26:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E184084FE0; Tue, 15 May 2018 22:26:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C292D1198B; Tue, 15 May 2018 22:26:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FMQ969036508; Tue, 15 May 2018 22:26:09 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FMQ9Ac036507; Tue, 15 May 2018 22:26:09 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805152226.w4FMQ9Ac036507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 15 May 2018 22:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333652 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 333652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 22:26:10 -0000 Author: np Date: Tue May 15 22:26:09 2018 New Revision: 333652 URL: https://svnweb.freebsd.org/changeset/base/333652 Log: cxgbe(4): Add support for two more flash parts. Obtained from: Chelsio Communications MFC after: 2 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue May 15 22:22:10 2018 (r333651) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue May 15 22:26:09 2018 (r333652) @@ -7905,6 +7905,44 @@ int t4_get_flash_params(struct adapter *adapter) break; } + case 0x9d: { /* ISSI -- Integrated Silicon Solution, Inc. */ + /* + * This Density -> Size decoding table is taken from ISSI + * Data Sheets. + */ + density = (flashid >> 16) & 0xff; + switch (density) { + case 0x16: size = 1 << 25; break; /* 32MB */ + case 0x17: size = 1 << 26; break; /* 64MB */ + + default: + CH_ERR(adapter, "ISSI Flash Part has bad size, " + "ID = %#x, Density code = %#x\n", + flashid, density); + return -EINVAL; + } + break; + } + + case 0xc2: { /* Macronix */ + /* + * This Density -> Size decoding table is taken from Macronix + * Data Sheets. + */ + density = (flashid >> 16) & 0xff; + switch (density) { + case 0x17: size = 1 << 23; break; /* 8MB */ + case 0x18: size = 1 << 24; break; /* 16MB */ + + default: + CH_ERR(adapter, "Macronix Flash Part has bad size, " + "ID = %#x, Density code = %#x\n", + flashid, density); + return -EINVAL; + } + break; + } + case 0xef: { /* Winbond */ /* * This Density -> Size decoding table is taken from Winbond From owner-svn-src-all@freebsd.org Tue May 15 23:46:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85482EDCBE7; Tue, 15 May 2018 23:46:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 331FC68E3F; Tue, 15 May 2018 23:46:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14344126A0; Tue, 15 May 2018 23:46:50 +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 w4FNkn1U076249; Tue, 15 May 2018 23:46:49 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FNknH6076248; Tue, 15 May 2018 23:46:49 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201805152346.w4FNknH6076248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 May 2018 23:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333654 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 333654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 23:46:50 -0000 Author: bdrewery Date: Tue May 15 23:46:49 2018 New Revision: 333654 URL: https://svnweb.freebsd.org/changeset/base/333654 Log: Fix stale dependencies on libcasper libraries. Libcasper and its modules have no static libraries so don't define paths to them. This fixes LIBADD automatically adding DPADD entries for casper. Reported by: sbruno Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Tue May 15 23:02:47 2018 (r333653) +++ head/share/mk/bsd.libnames.mk Tue May 15 23:46:49 2018 (r333654) @@ -33,13 +33,6 @@ LIBBZ2?= ${LIBDESTDIR}${LIBDIR_BASE}/libbz2.a LIBC?= ${LIBDESTDIR}${LIBDIR_BASE}/libc.a LIBCALENDAR?= ${LIBDESTDIR}${LIBDIR_BASE}/libcalendar.a LIBCAM?= ${LIBDESTDIR}${LIBDIR_BASE}/libcam.a -LIBCAP_DNS?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_dns.a -LIBCAP_GRP?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_grp.a -LIBCAP_PWD?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_pwd.a -LIBCAP_RANDOM?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_random.a -LIBCAP_SYSCTL?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_sysctl.a -LIBCAP_SYSLOG?= ${LIBDESTDIR}${LIBDIR_BASE}/libcap_syslog.a -LIBCASPER?= ${LIBDESTDIR}${LIBDIR_BASE}/libcasper.a LIBCOMPAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libcompat.a LIBCOMPILER_RT?=${LIBDESTDIR}${LIBDIR_BASE}/libcompiler_rt.a LIBCOM_ERR?= ${LIBDESTDIR}${LIBDIR_BASE}/libcom_err.a From owner-svn-src-all@freebsd.org Tue May 15 23:55:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A01EDD4AD; Tue, 15 May 2018 23:55:39 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F9969AF6; Tue, 15 May 2018 23:55:38 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A95C512840; Tue, 15 May 2018 23:55:38 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4FNtc0g081222; Tue, 15 May 2018 23:55:38 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4FNtcni081221; Tue, 15 May 2018 23:55:38 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201805152355.w4FNtcni081221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 15 May 2018 23:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333655 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 15 May 2018 23:55:39 -0000 Author: gallatin Date: Tue May 15 23:55:38 2018 New Revision: 333655 URL: https://svnweb.freebsd.org/changeset/base/333655 Log: Unhook DEBUG_BUFRING from INVARIANTS Some of the DEBUG_BUFRING checks are racy, and can lead to spurious assertions when run under high load. Unhook these from INVARIANTS until the author can fix or remove them. Reviewed by: mmacy Sponsored by: Netflix Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Tue May 15 23:46:49 2018 (r333654) +++ head/sys/sys/buf_ring.h Tue May 15 23:55:38 2018 (r333655) @@ -34,10 +34,6 @@ #include -#if defined(INVARIANTS) && !defined(DEBUG_BUFRING) -#define DEBUG_BUFRING 1 -#endif - #ifdef DEBUG_BUFRING #include #include @@ -69,6 +65,12 @@ buf_ring_enqueue(struct buf_ring *br, void *buf) uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; + + /* + * Note: It is possible to encounter an mbuf that was removed + * via drbr_peek(), and then re-added via drbr_putback() and + * trigger a spurious panic. + */ for (i = br->br_cons_head; i != br->br_prod_head; i = ((i + 1) & br->br_cons_mask)) if(br->br_ring[i] == buf) From owner-svn-src-all@freebsd.org Wed May 16 01:08:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 700E7EE2CAB; Wed, 16 May 2018 01:08:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FFF06E2CB; Wed, 16 May 2018 01:08:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F07BE13404; Wed, 16 May 2018 01:08:11 +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 w4G18Blu021000; Wed, 16 May 2018 01:08:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G18Bks020999; Wed, 16 May 2018 01:08:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160108.w4G18Bks020999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 01:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333657 - head/tools/tools/intel-ucode-split X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/intel-ucode-split X-SVN-Commit-Revision: 333657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 01:08:12 -0000 Author: emaste Date: Wed May 16 01:08:11 2018 New Revision: 333657 URL: https://svnweb.freebsd.org/changeset/base/333657 Log: intel-ucode-split: add a -v verbose flag And be quiet by default. Sponsored by: The FreeBSD Foundation Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c ============================================================================== --- head/tools/tools/intel-ucode-split/intel-ucode-split.c Wed May 16 00:57:42 2018 (r333656) +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Wed May 16 01:08:11 2018 (r333657) @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -97,7 +98,7 @@ static void usage(void) { - printf("ucode-split microcode_file\n"); + printf("ucode-split [-v] microcode_file\n"); exit(1); } @@ -109,12 +110,26 @@ main(int argc, char *argv[]) char *buf; size_t len, resid; ssize_t rv; - int ifd, ofd; + int c, ifd, ofd; + bool vflag; - if (argc != 2) + vflag = false; + while ((c = getopt(argc, argv, "v")) != -1) { + switch (c) { + case 'v': + vflag = true; + break; + default: + usage(); + } + } + argc -= optind; + argv += optind; + + if (argc != 1) usage(); - ifd = open(argv[1], O_RDONLY); + ifd = open(argv[0], O_RDONLY); if (ifd < 0) err(1, "open"); @@ -133,7 +148,8 @@ main(int argc, char *argv[]) errx(1, "invalid microcode header"); } - dump_header(&hdr); + if (vflag) + dump_header(&hdr); format_signature(output_file, hdr.processor_signature); sprintf(output_file + strlen(output_file), ".%02x", @@ -163,7 +179,8 @@ main(int argc, char *argv[]) err(1, "write"); resid -= len; } - printf("written to %s\n\n", output_file); + if (vflag) + printf("written to %s\n\n", output_file); close(ofd); } } From owner-svn-src-all@freebsd.org Wed May 16 01:33:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC6EEE47DD; Wed, 16 May 2018 01:33:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9716F3B2; Wed, 16 May 2018 01:33:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E227138F5; Wed, 16 May 2018 01:33:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4G1Xnmq035760; Wed, 16 May 2018 01:33:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G1Xngd035759; Wed, 16 May 2018 01:33:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160133.w4G1Xngd035759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 01:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333658 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 333658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 01:33:49 -0000 Author: emaste Date: Wed May 16 01:33:48 2018 New Revision: 333658 URL: https://svnweb.freebsd.org/changeset/base/333658 Log: Force WITHOUT_FREEBSD_UPDATE when WITHOUT_PORTSNAP is set freebsd-update depends on phttpget from portsnap. We could move phttpget out of portsnap and build it as long as WITHOUT_FREEBSD_UPDATE and WITHOUT_PORTSNAP are not both set, but for now just make the dependency explicit. PR: 228220 Reported by: Dries Michiels Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed May 16 01:08:11 2018 (r333657) +++ head/share/mk/src.opts.mk Wed May 16 01:33:48 2018 (r333658) @@ -424,6 +424,11 @@ MK_KERBEROS:= no MK_AUTHPF:= no .endif +.if ${MK_PORTSNAP} == "no" +# freebsd-update depends on phttpget from portsnap +MK_FREEBSD_UPDATE:= no +.endif + .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no .endif From owner-svn-src-all@freebsd.org Wed May 16 01:34:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58E05EE4942; Wed, 16 May 2018 01:34:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01EFF6F544; Wed, 16 May 2018 01:34:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D74F6138F8; Wed, 16 May 2018 01:34:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4G1Yaol035845; Wed, 16 May 2018 01:34:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G1Yaxk035844; Wed, 16 May 2018 01:34:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160134.w4G1Yaxk035844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 01:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333659 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 333659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 01:34:37 -0000 Author: emaste Date: Wed May 16 01:34:36 2018 New Revision: 333659 URL: https://svnweb.freebsd.org/changeset/base/333659 Log: Regen src.conf.5 after r333658 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed May 16 01:33:48 2018 (r333658) +++ head/share/man/man5/src.conf.5 Wed May 16 01:34:36 2018 (r333659) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 14, 2018 +.Dd May 15, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1309,6 +1309,12 @@ and related programs. Set to not build or install .Xr portsnap 8 and related files. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_FREEBSD_UPDATE +.El .It Va WITHOUT_PPP Set to not build .Xr ppp 8 From owner-svn-src-all@freebsd.org Wed May 16 01:41:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 834D7EE529F; Wed, 16 May 2018 01:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3186E6FA44; Wed, 16 May 2018 01:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1297A13A53; Wed, 16 May 2018 01:41:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4G1fale037863; Wed, 16 May 2018 01:41:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G1faKJ037862; Wed, 16 May 2018 01:41:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160141.w4G1faKJ037862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 01:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333660 - head/tools/tools/intel-ucode-split X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/intel-ucode-split X-SVN-Commit-Revision: 333660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 01:41:37 -0000 Author: emaste Date: Wed May 16 01:41:36 2018 New Revision: 333660 URL: https://svnweb.freebsd.org/changeset/base/333660 Log: intel-ucode-split: exit on unknown ucode header version Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c ============================================================================== --- head/tools/tools/intel-ucode-split/intel-ucode-split.c Wed May 16 01:34:36 2018 (r333659) +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Wed May 16 01:41:36 2018 (r333660) @@ -78,7 +78,7 @@ dump_header(const struct microcode_update_header *hdr) { char buf[16]; - printf("version\t\t0x%x\n", hdr->header_version); + printf("header version\t0x%x\n", hdr->header_version); printf("revision\t0x%x\n", hdr->update_revision); printf("date\t\t0x%x\t%04x-%02x-%02x\n", hdr->date, hdr->date & 0xffff, (hdr->date & 0xff000000) >> 24, @@ -147,6 +147,8 @@ main(int argc, char *argv[]) } else if (rv < (ssize_t)sizeof(hdr)) { errx(1, "invalid microcode header"); } + if (hdr.header_version != 1) + errx(1, "invalid header version"); if (vflag) dump_header(&hdr); From owner-svn-src-all@freebsd.org Wed May 16 01:55:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D869FEE5E4A; Wed, 16 May 2018 01:55:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1477027D; Wed, 16 May 2018 01:55:52 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E02913C46; Wed, 16 May 2018 01:55:52 +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 w4G1tq6S045966; Wed, 16 May 2018 01:55:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G1tqsv045965; Wed, 16 May 2018 01:55:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160155.w4G1tqsv045965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 01:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333661 - head/tools/tools/intel-ucode-split X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/intel-ucode-split X-SVN-Commit-Revision: 333661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 01:55:53 -0000 Author: emaste Date: Wed May 16 01:55:52 2018 New Revision: 333661 URL: https://svnweb.freebsd.org/changeset/base/333661 Log: intel-ucode-split: list platform ids based on processor_flags The Intel CPU "Platform Id" is a 3-bit integer reported by a given MSR. Intel microcode updates have an 8-bit field to indicate Platform Id compatibility - one bit in the mask for each of the possible Platform Id values. To simplify interpretation, report the Platform Id mask also as a list. Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c ============================================================================== --- head/tools/tools/intel-ucode-split/intel-ucode-split.c Wed May 16 01:41:36 2018 (r333660) +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Wed May 16 01:55:52 2018 (r333661) @@ -77,6 +77,8 @@ static void dump_header(const struct microcode_update_header *hdr) { char buf[16]; + int i; + bool platformid_printed; printf("header version\t0x%x\n", hdr->header_version); printf("revision\t0x%x\n", hdr->update_revision); @@ -87,7 +89,15 @@ dump_header(const struct microcode_update_header *hdr) format_signature(buf, hdr->processor_signature)); printf("checksum\t0x%x\n", hdr->checksum); printf("loader revision\t0x%x\n", hdr->loader_revision); - printf("processor flags\t0x%x\n", hdr->processor_flags); + printf("processor flags\t0x%x", hdr->processor_flags); + platformid_printed = false; + for (i = 0; i < 8; i++) { + if (hdr->processor_flags & 1 << i) { + printf("%s%d", platformid_printed ? ", " : "\t\t", i); + platformid_printed = true; + } + } + printf("\n"); printf("datasize\t0x%x\t\t0x%x\n", hdr->data_size, hdr->data_size != 0 ? hdr->data_size : 2000); printf("size\t\t0x%x\t\t0x%x\n", hdr->total_size, From owner-svn-src-all@freebsd.org Wed May 16 02:15:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40AB6EE7130; Wed, 16 May 2018 02:15:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA0EB70F7F; Wed, 16 May 2018 02:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66A013F9F; Wed, 16 May 2018 02:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4G2FJkV055915; Wed, 16 May 2018 02:15:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G2FJYm055913; Wed, 16 May 2018 02:15:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160215.w4G2FJYm055913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 02:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333662 - in head: sbin/reboot stand/man X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: sbin/reboot stand/man X-SVN-Commit-Revision: 333662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 02:15:20 -0000 Author: emaste Date: Wed May 16 02:15:18 2018 New Revision: 333662 URL: https://svnweb.freebsd.org/changeset/base/333662 Log: Clarify that boot_mute / boot -m mutes kernel console only Perhaps RB_MUTE could mute user startup (rc) output as well, but right now it mutes only kernel console output, so make the documentation match reality. PR: 228193 Sponsored by: The FreeBSD Foundation Modified: head/sbin/reboot/boot_i386.8 head/stand/man/loader.8 Modified: head/sbin/reboot/boot_i386.8 ============================================================================== --- head/sbin/reboot/boot_i386.8 Wed May 16 01:55:52 2018 (r333661) +++ head/sbin/reboot/boot_i386.8 Wed May 16 02:15:18 2018 (r333662) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2014 +.Dd May 15, 2018 .Dt BOOT 8 i386 .Os .Sh NAME @@ -233,7 +233,7 @@ regardless of the .Fl h option described here. .It Fl m -mute the console to suppress all console input and output during the +mute the console to suppress all kernel console input and output during the boot. .It Fl n ignore key press to interrupt boot before Modified: head/stand/man/loader.8 ============================================================================== --- head/stand/man/loader.8 Wed May 16 01:55:52 2018 (r333661) +++ head/stand/man/loader.8 Wed May 16 02:15:18 2018 (r333662) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2015 +.Dd May 15, 2018 .Dt LOADER 8 .Os .Sh NAME @@ -390,7 +390,7 @@ by the .Xr conscontrol 8 utility. .It Va boot_mute -All console output is suppressed when console is muted. +All kernel console output is suppressed when console is muted. In a running system, the state of console muting can be manipulated by the .Xr conscontrol 8 utility. From owner-svn-src-all@freebsd.org Wed May 16 02:51:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7BEEE98E7; Wed, 16 May 2018 02:51:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D90B72B4C; Wed, 16 May 2018 02:51:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3E9F14637; Wed, 16 May 2018 02:51:30 +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 w4G2pUtI075469; Wed, 16 May 2018 02:51:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G2pUaY075468; Wed, 16 May 2018 02:51:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160251.w4G2pUaY075468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 02:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333663 - head/usr.sbin X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin X-SVN-Commit-Revision: 333663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 02:51:31 -0000 Author: emaste Date: Wed May 16 02:51:30 2018 New Revision: 333663 URL: https://svnweb.freebsd.org/changeset/base/333663 Log: Sort mlx5tool correctly in usr.sbin/Makefile Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Wed May 16 02:15:18 2018 (r333662) +++ head/usr.sbin/Makefile Wed May 16 02:51:30 2018 (r333663) @@ -121,7 +121,6 @@ SUBDIR.${MK_BSDINSTALL}+= bsdinstall SUBDIR.${MK_BSNMP}+= bsnmpd SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_CXGBETOOL}+= cxgbetool -SUBDIR.${MK_MLX5TOOL}+= mlx5tool SUBDIR.${MK_DIALOG}+= bsdconfig SUBDIR.${MK_EFI}+= efivar efidp efibootmgr SUBDIR.${MK_FLOPPY}+= fdcontrol @@ -159,6 +158,7 @@ SUBDIR.${MK_NS_CACHING}+= nscd .endif SUBDIR.${MK_LPR}+= lpr SUBDIR.${MK_MAN_UTILS}+= manctl +SUBDIR.${MK_MLX5TOOL}+= mlx5tool SUBDIR.${MK_NAND}+= nandsim SUBDIR.${MK_NAND}+= nandtool SUBDIR.${MK_NETGRAPH}+= flowctl From owner-svn-src-all@freebsd.org Wed May 16 02:58:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31E4EEE9F0B; Wed, 16 May 2018 02:58:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CCBA173025; Wed, 16 May 2018 02:58:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E835146A2; Wed, 16 May 2018 02:58:06 +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 w4G2w6Wh075749; Wed, 16 May 2018 02:58:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G2w6q7075747; Wed, 16 May 2018 02:58:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160258.w4G2w6q7075747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 02:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333664 - in head/usr.sbin/makefs: cd9660 ffs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/usr.sbin/makefs: cd9660 ffs X-SVN-Commit-Revision: 333664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 02:58:07 -0000 Author: emaste Date: Wed May 16 02:58:05 2018 New Revision: 333664 URL: https://svnweb.freebsd.org/changeset/base/333664 Log: makefs: ANSIfy Modified: head/usr.sbin/makefs/cd9660/cd9660_debug.c head/usr.sbin/makefs/ffs/ffs_subr.c Modified: head/usr.sbin/makefs/cd9660/cd9660_debug.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_debug.c Wed May 16 02:51:30 2018 (r333663) +++ head/usr.sbin/makefs/cd9660/cd9660_debug.c Wed May 16 02:58:05 2018 (r333664) @@ -59,8 +59,7 @@ print_n_tabs(int n) #if 0 void -debug_print_rrip_info(n) -cd9660node *n; +debug_print_rrip_info(cd9660node *n) { struct ISO_SUSP_ATTRIBUTES *t; TAILQ_FOREACH(t, &node->head, rr_ll) { Modified: head/usr.sbin/makefs/ffs/ffs_subr.c ============================================================================== --- head/usr.sbin/makefs/ffs/ffs_subr.c Wed May 16 02:51:30 2018 (r333663) +++ head/usr.sbin/makefs/ffs/ffs_subr.c Wed May 16 02:58:05 2018 (r333664) @@ -85,10 +85,7 @@ ffs_fragacct_swap(struct fs *fs, int fragmap, int32_t * returns false if any corresponding bit in the free map is 0 */ int -ffs_isblock(fs, cp, h) - struct fs *fs; - u_char *cp; - int32_t h; +ffs_isblock(struct fs *fs, u_char *cp, int32_t h) { u_char mask; @@ -116,10 +113,7 @@ ffs_isblock(fs, cp, h) * returns false if any corresponding bit in the free map is 1 */ int -ffs_isfreeblock(fs, cp, h) - struct fs *fs; - u_char *cp; - int32_t h; +ffs_isfreeblock(struct fs *fs, u_char *cp, int32_t h) { switch ((int)fs->fs_fragshift) { @@ -141,10 +135,7 @@ ffs_isfreeblock(fs, cp, h) * take a block out of the map */ void -ffs_clrblock(fs, cp, h) - struct fs *fs; - u_char *cp; - int32_t h; +ffs_clrblock(struct fs *fs, u_char *cp, int32_t h) { switch ((int)fs->fs_fragshift) { @@ -170,10 +161,7 @@ ffs_clrblock(fs, cp, h) * put a block into the map */ void -ffs_setblock(fs, cp, h) - struct fs *fs; - u_char *cp; - int32_t h; +ffs_setblock(struct fs *fs, u_char *cp, int32_t h) { switch ((int)fs->fs_fragshift) { From owner-svn-src-all@freebsd.org Wed May 16 03:08:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAA8EEA99C; Wed, 16 May 2018 03:08:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5A1B739C4; Wed, 16 May 2018 03:08:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 981CC148C3; Wed, 16 May 2018 03:08:06 +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 w4G3867L081798; Wed, 16 May 2018 03:08:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G386t8081797; Wed, 16 May 2018 03:08:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160308.w4G386t8081797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 03:08:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333665 - head/tools/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools X-SVN-Commit-Revision: 333665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 03:08:07 -0000 Author: emaste Date: Wed May 16 03:08:06 2018 New Revision: 333665 URL: https://svnweb.freebsd.org/changeset/base/333665 Log: Add intel-ucode-split to tools README Modified: head/tools/tools/README Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Wed May 16 02:58:05 2018 (r333664) +++ head/tools/tools/README Wed May 16 03:08:06 2018 (r333665) @@ -33,6 +33,7 @@ html-mv Rename HTML generated filenames to hum ifinfo Uses the interface MIB to print out all the information an interface exports in an ugly form. indent_wrapper Tool for style(9) checking SVN/GIT patches. +intel-ucode-split Tool to split Intel microcode into individual files. iso Tool to compare the iso3166 and iso639 files in /usr/share/misc with the data from the master sites. iwi Tools specific to the Intel PRO/Wireless 2200BG/2225BG/2915ABG From owner-svn-src-all@freebsd.org Wed May 16 03:17:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAFEDEEB181; Wed, 16 May 2018 03:17:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CE3F73F9E; Wed, 16 May 2018 03:17:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E0F114A64; Wed, 16 May 2018 03:17:38 +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 w4G3HcYn086690; Wed, 16 May 2018 03:17:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G3HcLF086689; Wed, 16 May 2018 03:17:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805160317.w4G3HcLF086689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 03:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333666 - head/sys/dev/usb/input X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/input X-SVN-Commit-Revision: 333666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 03:17:38 -0000 Author: emaste Date: Wed May 16 03:17:37 2018 New Revision: 333666 URL: https://svnweb.freebsd.org/changeset/base/333666 Log: Attempt to fix build by removing EOF backslash-newline GCC complains: In file included from .../sys/dev/usb/input/uhid.c:77: .../usb_rdesc.h:280:37: error: backslash-newline at end of file Modified: head/sys/dev/usb/input/usb_rdesc.h Modified: head/sys/dev/usb/input/usb_rdesc.h ============================================================================== --- head/sys/dev/usb/input/usb_rdesc.h Wed May 16 03:08:06 2018 (r333665) +++ head/sys/dev/usb/input/usb_rdesc.h Wed May 16 03:17:37 2018 (r333666) @@ -303,4 +303,4 @@ 0x95, 0x0A, /* Report Count (10), */\ 0x81, 0x01, /* Input (Constant), */\ 0xC0, /* End Collection, */\ - 0xC0 /* End Collection */\ + 0xC0 /* End Collection */ From owner-svn-src-all@freebsd.org Wed May 16 06:52:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1BF9EA993E; Wed, 16 May 2018 06:52:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53B467A922; Wed, 16 May 2018 06:52:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3596E16DBC; Wed, 16 May 2018 06:52:09 +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 w4G6q9xM096046; Wed, 16 May 2018 06:52:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G6q8mY096043; Wed, 16 May 2018 06:52:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201805160652.w4G6q8mY096043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 16 May 2018 06:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333667 - in head/sys: arm/arm arm64/arm64 mips/mips X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 mips/mips X-SVN-Commit-Revision: 333667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 06:52:09 -0000 Author: avg Date: Wed May 16 06:52:08 2018 New Revision: 333667 URL: https://svnweb.freebsd.org/changeset/base/333667 Log: followup to r332730/r332752: set kdb_why to "trap" for fatal traps This change updates arm, arm64 and mips achitectures. Additionally, it removes redundant checks for kdb_active where it already results in kdb_reenter() and adds kdb_reenter() calls where they were missing. Some architectures check the return value of kdb_trap(), but some don't. I haven't changed any of that. Some trap handling routines have a return code. I am not sure if I provided correct ones for returns after kdb_reenter(). kdb_reenter should never return unless kdb_jmpbufp is NULL for some reason. Only compile tested for all affected architectures. There can be bugs resulting from my poor understanding of architecture specific details. Reported by: jhb Reviewed by: jhb, eadler MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D15431 Modified: head/sys/arm/arm/trap-v4.c head/sys/arm/arm/trap-v6.c head/sys/arm64/arm64/trap.c head/sys/mips/mips/trap.c Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Wed May 16 03:17:37 2018 (r333666) +++ head/sys/arm/arm/trap-v4.c Wed May 16 06:52:08 2018 (r333667) @@ -404,7 +404,16 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct ksig *ksig) { const char *mode; +#ifdef KDB + bool handled; +#endif +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return (0); + } +#endif #ifdef KDTRACE_HOOKS if (!TRAP_USERMODE(tf)) { if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, far & FAULT_TYPE_MASK)) @@ -447,9 +456,13 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic || kdb_active) - if (kdb_trap(fsr, 0, tf)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(fsr, 0, tf); + kdb_why = KDB_WHY_UNSET; + if (handled) return (0); + } #endif panic("Fatal abort"); /*NOTREACHED*/ Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Wed May 16 03:17:37 2018 (r333666) +++ head/sys/arm/arm/trap-v6.c Wed May 16 06:52:08 2018 (r333667) @@ -599,8 +599,11 @@ abort_fatal(struct trapframe *tf, u_int idx, u_int fsr printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic || kdb_active) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; kdb_trap(fsr, 0, tf); + kdb_why = KDB_WHY_UNSET; + } #endif panic("Fatal abort"); /*NOTREACHED*/ Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed May 16 03:17:37 2018 (r333666) +++ head/sys/arm64/arm64/trap.c Wed May 16 06:52:08 2018 (r333667) @@ -156,6 +156,9 @@ data_abort(struct thread *td, struct trapframe *frame, vm_prot_t ftype; vm_offset_t va; int error, sig, ucode; +#ifdef KDB + bool handled; +#endif /* * According to the ARMv8-A rev. A.g, B2.10.5 "Load-Exclusive @@ -226,9 +229,14 @@ data_abort(struct thread *td, struct trapframe *frame, printf(" esr: %.8lx\n", esr); #ifdef KDB - if (debugger_on_panic || kdb_active) - if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(ESR_ELx_EXCEPTION(esr), 0, + frame); + kdb_why = KDB_WHY_UNSET; + if (handled) return; + } #endif panic("vm_fault failed: %lx", frame->tf_elr); } Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed May 16 03:17:37 2018 (r333666) +++ head/sys/mips/mips/trap.c Wed May 16 06:52:08 2018 (r333667) @@ -530,7 +530,12 @@ trap(struct trapframe *trapframe) register_t *frame_regs; trapdebug_enter(trapframe, 0); - +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return (0); + } +#endif type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT; if (TRAPF_USERMODE(trapframe)) { type |= T_USER; @@ -1095,8 +1100,10 @@ err: #endif #ifdef KDB - if (debugger_on_panic || kdb_active) { + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; kdb_trap(type, 0, trapframe); + kdb_why = KDB_WHY_UNSET; } #endif panic("trap"); From owner-svn-src-all@freebsd.org Wed May 16 08:43:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F1AEAEFC0; Wed, 16 May 2018 08:43:09 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE7377E501; Wed, 16 May 2018 08:43:08 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADF9517F80; Wed, 16 May 2018 08:43:08 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4G8h8Hd050801; Wed, 16 May 2018 08:43:08 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G8h8oW050800; Wed, 16 May 2018 08:43:08 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201805160843.w4G8h8oW050800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Wed, 16 May 2018 08:43:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333668 - vendor/tcpdump/dist X-SVN-Group: vendor X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: vendor/tcpdump/dist X-SVN-Commit-Revision: 333668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 08:43:09 -0000 Author: slavash Date: Wed May 16 08:43:08 2018 New Revision: 333668 URL: https://svnweb.freebsd.org/changeset/base/333668 Log: Vendor import two upstream commits: c1bb8784abd3ca978e376b0d10e324db0491237b 9c4af7213cc2543a1f5586d8f2c19f86aa0cbe72 When using tcpdump -I -i wlanN and wlanN is not a monitor mode VAP, tcpdump will print an error message saying rfmon is not supported. Give a concise explanation as to how one might solve this problem by creating a monitor mode VAP. Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: vendor/tcpdump/dist/tcpdump.c Modified: vendor/tcpdump/dist/tcpdump.c ============================================================================== --- vendor/tcpdump/dist/tcpdump.c Wed May 16 06:52:08 2018 (r333667) +++ vendor/tcpdump/dist/tcpdump.c Wed May 16 08:43:08 2018 (r333668) @@ -108,6 +108,10 @@ The Regents of the University of California. All righ #endif /* HAVE_CAP_NG_H */ #endif /* HAVE_LIBCAP_NG */ +#ifdef __FreeBSD__ +#include +#endif /* __FreeBSD__ */ + #include "netdissect.h" #include "interface.h" #include "addrtoname.h" @@ -1044,6 +1048,30 @@ open_interface(const char *device, netdissect_options } else if (status == PCAP_ERROR_PERM_DENIED && *cp != '\0') error("%s: %s\n(%s)", device, pcap_statustostr(status), cp); +#ifdef __FreeBSD__ + else if (status == PCAP_ERROR_RFMON_NOTSUP && + strncmp(device, "wlan", 4) == 0) { + char parent[8], newdev[8]; + char sysctl[32]; + size_t s = sizeof(parent); + + snprintf(sysctl, sizeof(sysctl), + "net.wlan.%d.%%parent", atoi(device + 4)); + sysctlbyname(sysctl, parent, &s, NULL, 0); + strlcpy(newdev, device, sizeof(newdev)); + /* Suggest a new wlan device. */ + /* FIXME: incrementing the index this way is not going to work well + * when the index is 9 or greater but the only consequence in this + * specific case would be an error message that looks a bit odd. + */ + newdev[strlen(newdev)-1]++; + error("%s is not a monitor mode VAP\n" + "To create a new monitor mode VAP use:\n" + " ifconfig %s create wlandev %s wlanmode monitor\n" + "and use %s as the tcpdump interface", + device, newdev, parent, newdev); + } +#endif else error("%s: %s", device, pcap_statustostr(status)); From owner-svn-src-all@freebsd.org Wed May 16 09:01:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D99EFEB0424; Wed, 16 May 2018 09:01:03 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0B187EDC6; Wed, 16 May 2018 09:01:03 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92F3918244; Wed, 16 May 2018 09:01:03 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4G913r4056139; Wed, 16 May 2018 09:01:03 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4G912FD056132; Wed, 16 May 2018 09:01:02 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201805160901.w4G912FD056132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Wed, 16 May 2018 09:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333669 - in head/sys: dev/vt kern sys teken X-SVN-Group: head X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: in head/sys: dev/vt kern sys teken X-SVN-Commit-Revision: 333669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 09:01:04 -0000 Author: dumbbell Date: Wed May 16 09:01:02 2018 New Revision: 333669 URL: https://svnweb.freebsd.org/changeset/base/333669 Log: teken, vt(4): New callbacks to lock the terminal once ... to process input, instead of inside each smaller operations such as appending a character or moving the cursor forward. In other words, before we were doing (oversimplified): teken_input() vtterm_putchar() VTBUF_LOCK() VTBUF_UNLOCK() vtterm_cursor_position() VTBUF_LOCK() VTBUF_UNLOCK() Now, we are doing: vtterm_pre_input() VTBUF_LOCK() teken_input() vtterm_putchar() vtterm_cursor_position() vtterm_post_input() VTBUF_UNLOCK() The situation was even worse when the vtterm_copy() and vtterm_fill() callbacks were involved. The new callbacks are: * struct terminal_class->tc_pre_input() * struct terminal_class->tc_post_input() They are called in teken_input(), surrounding the while() loop. The goal is to improve input processing speed of vt(4). As a benchmark, here is the time taken to write a text file of 360 000 lines (26 MiB) on `ttyv0`: * vt(4), unmodified: 1500 ms * vt(4), with this patch: 1200 ms * syscons(4): 700 ms This is on a Haswell laptop with a GENERIC-NODEBUG kernel. At the same time, the locking is changed in the vt_flush() function which is responsible to draw the text on screen. So instead of (indirectly) using VTBUF_LOCK() just to read and reset the dirty area of the internal buffer, the lock is held for about the entire function, including the drawing part. The change is mostly visible while content is scrolling fast: before, lines could appear garbled while scrolling because the internal buffer was accessed without locks (once the scrolling was finished, the output was correct). Now, the scrolling appears correct. In the end, the locking model is closer to what syscons(4) does. Differential Revision: https://reviews.freebsd.org/D15302 Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c head/sys/kern/subr_terminal.c head/sys/sys/terminal.h head/sys/teken/teken.c head/sys/teken/teken.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Wed May 16 08:43:08 2018 (r333668) +++ head/sys/dev/vt/vt.h Wed May 16 09:01:02 2018 (r333669) @@ -213,8 +213,10 @@ struct vt_buf { #define VBF_DEFAULT_HISTORY_SIZE 500 #endif +void vtbuf_lock(struct vt_buf *); +void vtbuf_unlock(struct vt_buf *); void vtbuf_copy(struct vt_buf *, const term_rect_t *, const term_pos_t *); -void vtbuf_fill_locked(struct vt_buf *, const term_rect_t *, term_char_t); +void vtbuf_fill(struct vt_buf *, const term_rect_t *, term_char_t); void vtbuf_init_early(struct vt_buf *); void vtbuf_init(struct vt_buf *, const term_pos_t *); void vtbuf_grow(struct vt_buf *, const term_pos_t *, unsigned int); Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Wed May 16 08:43:08 2018 (r333668) +++ head/sys/dev/vt/vt_buf.c Wed May 16 09:01:02 2018 (r333669) @@ -253,10 +253,24 @@ vtbuf_iscursor(const struct vt_buf *vb, int row, int c return (0); } -static inline void -vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_t *area) +void +vtbuf_lock(struct vt_buf *vb) { + VTBUF_LOCK(vb); +} + +void +vtbuf_unlock(struct vt_buf *vb) +{ + + VTBUF_UNLOCK(vb); +} + +void +vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area) +{ + if (vb->vb_dirtyrect.tr_begin.tp_row > area->tr_begin.tp_row) vb->vb_dirtyrect.tr_begin.tp_row = area->tr_begin.tp_row; if (vb->vb_dirtyrect.tr_begin.tp_col > area->tr_begin.tp_col) @@ -267,24 +281,15 @@ vtbuf_dirty_locked(struct vt_buf *vb, const term_rect_ vb->vb_dirtyrect.tr_end.tp_col = area->tr_end.tp_col; } -void -vtbuf_dirty(struct vt_buf *vb, const term_rect_t *area) -{ - - VTBUF_LOCK(vb); - vtbuf_dirty_locked(vb, area); - VTBUF_UNLOCK(vb); -} - static inline void -vtbuf_dirty_cell_locked(struct vt_buf *vb, const term_pos_t *p) +vtbuf_dirty_cell(struct vt_buf *vb, const term_pos_t *p) { term_rect_t area; area.tr_begin = *p; area.tr_end.tp_row = p->tp_row + 1; area.tr_end.tp_col = p->tp_col + 1; - vtbuf_dirty_locked(vb, &area); + vtbuf_dirty(vb, &area); } static void @@ -299,10 +304,8 @@ void vtbuf_undirty(struct vt_buf *vb, term_rect_t *r) { - VTBUF_LOCK(vb); *r = vb->vb_dirtyrect; vtbuf_make_undirty(vb); - VTBUF_UNLOCK(vb); } void @@ -366,7 +369,7 @@ vtbuf_copy(struct vt_buf *vb, const term_rect_t *r, co } static void -vtbuf_fill(struct vt_buf *vb, const term_rect_t *r, term_char_t c) +vtbuf_do_fill(struct vt_buf *vb, const term_rect_t *r, term_char_t c) { unsigned int pr, pc; term_char_t *row; @@ -381,26 +384,25 @@ vtbuf_fill(struct vt_buf *vb, const term_rect_t *r, te } void -vtbuf_fill_locked(struct vt_buf *vb, const term_rect_t *r, term_char_t c) +vtbuf_fill(struct vt_buf *vb, const term_rect_t *r, term_char_t c) { + KASSERT(r->tr_begin.tp_row < vb->vb_scr_size.tp_row, - ("vtbuf_fill_locked begin.tp_row %d must be < screen height %d", + ("vtbuf_fill begin.tp_row %d must be < screen height %d", r->tr_begin.tp_row, vb->vb_scr_size.tp_row)); KASSERT(r->tr_begin.tp_col < vb->vb_scr_size.tp_col, - ("vtbuf_fill_locked begin.tp_col %d must be < screen width %d", + ("vtbuf_fill begin.tp_col %d must be < screen width %d", r->tr_begin.tp_col, vb->vb_scr_size.tp_col)); KASSERT(r->tr_end.tp_row <= vb->vb_scr_size.tp_row, - ("vtbuf_fill_locked end.tp_row %d must be <= screen height %d", + ("vtbuf_fill end.tp_row %d must be <= screen height %d", r->tr_end.tp_row, vb->vb_scr_size.tp_row)); KASSERT(r->tr_end.tp_col <= vb->vb_scr_size.tp_col, - ("vtbuf_fill_locked end.tp_col %d must be <= screen width %d", + ("vtbuf_fill end.tp_col %d must be <= screen width %d", r->tr_end.tp_col, vb->vb_scr_size.tp_col)); - VTBUF_LOCK(vb); - vtbuf_fill(vb, r, c); - vtbuf_dirty_locked(vb, r); - VTBUF_UNLOCK(vb); + vtbuf_do_fill(vb, r, c); + vtbuf_dirty(vb, r); } static void @@ -431,7 +433,7 @@ vtbuf_init_early(struct vt_buf *vb) rect.tr_begin.tp_row = rect.tr_begin.tp_col = 0; rect.tr_end.tp_col = vb->vb_scr_size.tp_col; rect.tr_end.tp_row = vb->vb_history_size; - vtbuf_fill(vb, &rect, VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); + vtbuf_do_fill(vb, &rect, VTBUF_SPACE_CHAR(TERMINAL_NORM_ATTR)); vtbuf_make_undirty(vb); if ((vb->vb_flags & VBF_MTX_INIT) == 0) { mtx_init(&vb->vb_lock, "vtbuf", NULL, MTX_SPIN); @@ -645,23 +647,18 @@ vtbuf_putchar(struct vt_buf *vb, const term_pos_t *p, row = vb->vb_rows[(vb->vb_curroffset + p->tp_row) % VTBUF_MAX_HEIGHT(vb)]; if (row[p->tp_col] != c) { - VTBUF_LOCK(vb); row[p->tp_col] = c; - vtbuf_dirty_cell_locked(vb, p); - VTBUF_UNLOCK(vb); + vtbuf_dirty_cell(vb, p); } } void vtbuf_cursor_position(struct vt_buf *vb, const term_pos_t *p) { - if (vb->vb_flags & VBF_CURSOR) { - VTBUF_LOCK(vb); - vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); + vtbuf_dirty_cell(vb, &vb->vb_cursor); vb->vb_cursor = *p; - vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); - VTBUF_UNLOCK(vb); + vtbuf_dirty_cell(vb, &vb->vb_cursor); } else { vb->vb_cursor = *p; } @@ -687,7 +684,9 @@ vtbuf_flush_mark(struct vt_buf *vb) area.tr_end.tp_col = vb->vb_scr_size.tp_col; area.tr_end.tp_row = MAX(s, e) + 1; + VTBUF_LOCK(vb); vtbuf_dirty(vb, &area); + VTBUF_UNLOCK(vb); } } @@ -823,7 +822,6 @@ vtbuf_cursor_visibility(struct vt_buf *vb, int yes) { int oflags, nflags; - VTBUF_LOCK(vb); oflags = vb->vb_flags; if (yes) vb->vb_flags |= VBF_CURSOR; @@ -832,8 +830,7 @@ vtbuf_cursor_visibility(struct vt_buf *vb, int yes) nflags = vb->vb_flags; if (oflags != nflags) - vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); - VTBUF_UNLOCK(vb); + vtbuf_dirty_cell(vb, &vb->vb_cursor); } void @@ -850,7 +847,6 @@ vtbuf_scroll_mode(struct vt_buf *vb, int yes) nflags = vb->vb_flags; if (oflags != nflags) - vtbuf_dirty_cell_locked(vb, &vb->vb_cursor); + vtbuf_dirty_cell(vb, &vb->vb_cursor); VTBUF_UNLOCK(vb); } - Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed May 16 08:43:08 2018 (r333668) +++ head/sys/dev/vt/vt_core.c Wed May 16 09:01:02 2018 (r333669) @@ -66,6 +66,8 @@ static tc_cursor_t vtterm_cursor; static tc_putchar_t vtterm_putchar; static tc_fill_t vtterm_fill; static tc_copy_t vtterm_copy; +static tc_pre_input_t vtterm_pre_input; +static tc_post_input_t vtterm_post_input; static tc_param_t vtterm_param; static tc_done_t vtterm_done; @@ -85,6 +87,8 @@ const struct terminal_class vt_termclass = { .tc_putchar = vtterm_putchar, .tc_fill = vtterm_fill, .tc_copy = vtterm_copy, + .tc_pre_input = vtterm_pre_input, + .tc_post_input = vtterm_post_input, .tc_param = vtterm_param, .tc_done = vtterm_done, @@ -1053,7 +1057,7 @@ vtterm_fill(struct terminal *tm, const term_rect_t *r, { struct vt_window *vw = tm->tm_softc; - vtbuf_fill_locked(&vw->vw_buf, r, c); + vtbuf_fill(&vw->vw_buf, r, c); vt_resume_flush_timer(vw->vw_device, 0); } @@ -1142,7 +1146,7 @@ vt_is_cursor_in_area(const struct vt_device *vd, const } static void -vt_mark_mouse_position_as_dirty(struct vt_device *vd) +vt_mark_mouse_position_as_dirty(struct vt_device *vd, int locked) { term_rect_t area; struct vt_window *vw; @@ -1175,7 +1179,11 @@ vt_mark_mouse_position_as_dirty(struct vt_device *vd) area.tr_end.tp_row = y + 2; } + if (!locked) + vtbuf_lock(&vw->vw_buf); vtbuf_dirty(&vw->vw_buf, &area); + if (!locked) + vtbuf_unlock(&vw->vw_buf); } #endif @@ -1230,6 +1238,8 @@ vt_flush(struct vt_device *vd) if (((vd->vd_flags & VDF_TEXTMODE) == 0) && (vf == NULL)) return (0); + vtbuf_lock(&vw->vw_buf); + #ifndef SC_NO_CUTPASTE cursor_was_shown = vd->vd_mshown; cursor_moved = (vd->vd_mx != vd->vd_mx_drawn || @@ -1250,7 +1260,7 @@ vt_flush(struct vt_device *vd) */ if (cursor_was_shown != vd->vd_mshown || (vd->vd_mshown && cursor_moved)) - vt_mark_mouse_position_as_dirty(vd); + vt_mark_mouse_position_as_dirty(vd, true); /* * Save position of the mouse cursor. It's used by backends to @@ -1265,7 +1275,7 @@ vt_flush(struct vt_device *vd) * mark the new position as dirty. */ if (vd->vd_mshown && cursor_moved) - vt_mark_mouse_position_as_dirty(vd); + vt_mark_mouse_position_as_dirty(vd, true); #endif vtbuf_undirty(&vw->vw_buf, &tarea); @@ -1282,9 +1292,11 @@ vt_flush(struct vt_device *vd) if (tarea.tr_begin.tp_col < tarea.tr_end.tp_col) { vd->vd_driver->vd_bitblt_text(vd, vw, &tarea); + vtbuf_unlock(&vw->vw_buf); return (1); } + vtbuf_unlock(&vw->vw_buf); return (0); } @@ -1306,6 +1318,23 @@ vt_timer(void *arg) } static void +vtterm_pre_input(struct terminal *tm) +{ + struct vt_window *vw = tm->tm_softc; + + vtbuf_lock(&vw->vw_buf); +} + +static void +vtterm_post_input(struct terminal *tm) +{ + struct vt_window *vw = tm->tm_softc; + + vtbuf_unlock(&vw->vw_buf); + vt_resume_flush_timer(vw->vw_device, 0); +} + +static void vtterm_done(struct terminal *tm) { struct vt_window *vw = tm->tm_softc; @@ -2000,7 +2029,7 @@ vt_mouse_state(int show) } /* Mark mouse position as dirty. */ - vt_mark_mouse_position_as_dirty(vd); + vt_mark_mouse_position_as_dirty(vd, false); vt_resume_flush_timer(vw->vw_device, 0); } #endif Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Wed May 16 08:43:08 2018 (r333668) +++ head/sys/kern/subr_terminal.c Wed May 16 09:01:02 2018 (r333669) @@ -106,6 +106,8 @@ static tf_cursor_t termteken_cursor; static tf_putchar_t termteken_putchar; static tf_fill_t termteken_fill; static tf_copy_t termteken_copy; +static tf_pre_input_t termteken_pre_input; +static tf_post_input_t termteken_post_input; static tf_param_t termteken_param; static tf_respond_t termteken_respond; @@ -115,6 +117,8 @@ static teken_funcs_t terminal_drawmethods = { .tf_putchar = termteken_putchar, .tf_fill = termteken_fill, .tf_copy = termteken_copy, + .tf_pre_input = termteken_pre_input, + .tf_post_input = termteken_post_input, .tf_param = termteken_param, .tf_respond = termteken_respond, }; @@ -624,6 +628,22 @@ termteken_copy(void *softc, const teken_rect_t *r, con struct terminal *tm = softc; tm->tm_class->tc_copy(tm, r, p); +} + +static void +termteken_pre_input(void *softc) +{ + struct terminal *tm = softc; + + tm->tm_class->tc_pre_input(tm); +} + +static void +termteken_post_input(void *softc) +{ + struct terminal *tm = softc; + + tm->tm_class->tc_post_input(tm); } static void Modified: head/sys/sys/terminal.h ============================================================================== --- head/sys/sys/terminal.h Wed May 16 08:43:08 2018 (r333668) +++ head/sys/sys/terminal.h Wed May 16 09:01:02 2018 (r333669) @@ -151,6 +151,8 @@ typedef void tc_fill_t(struct terminal *tm, const term term_char_t c); typedef void tc_copy_t(struct terminal *tm, const term_rect_t *r, const term_pos_t *p); +typedef void tc_pre_input_t(struct terminal *tm); +typedef void tc_post_input_t(struct terminal *tm); typedef void tc_param_t(struct terminal *tm, int cmd, unsigned int arg); typedef void tc_done_t(struct terminal *tm); @@ -173,6 +175,8 @@ struct terminal_class { tc_putchar_t *tc_putchar; tc_fill_t *tc_fill; tc_copy_t *tc_copy; + tc_pre_input_t *tc_pre_input; + tc_post_input_t *tc_post_input; tc_param_t *tc_param; tc_done_t *tc_done; Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Wed May 16 08:43:08 2018 (r333668) +++ head/sys/teken/teken.c Wed May 16 09:01:02 2018 (r333669) @@ -133,6 +133,22 @@ teken_funcs_copy(const teken_t *t, const teken_rect_t } static inline void +teken_funcs_pre_input(const teken_t *t) +{ + + teken_assert(t->t_funcs->tf_pre_input != NULL); + t->t_funcs->tf_pre_input(t->t_softc); +} + +static inline void +teken_funcs_post_input(const teken_t *t) +{ + + teken_assert(t->t_funcs->tf_post_input != NULL); + t->t_funcs->tf_post_input(t->t_softc); +} + +static inline void teken_funcs_param(const teken_t *t, int cmd, unsigned int value) { @@ -292,8 +308,10 @@ teken_input(teken_t *t, const void *buf, size_t len) { const char *c = buf; + teken_funcs_pre_input(t); while (len-- > 0) teken_input_byte(t, *c++); + teken_funcs_post_input(t); } const teken_pos_t * Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Wed May 16 08:43:08 2018 (r333668) +++ head/sys/teken/teken.h Wed May 16 09:01:02 2018 (r333669) @@ -93,6 +93,8 @@ typedef void tf_putchar_t(void *, const teken_pos_t *, typedef void tf_fill_t(void *, const teken_rect_t *, teken_char_t, const teken_attr_t *); typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *); +typedef void tf_pre_input_t(void *); +typedef void tf_post_input_t(void *); typedef void tf_param_t(void *, int, unsigned int); #define TP_SHOWCURSOR 0 #define TP_KEYPADAPP 1 @@ -114,6 +116,8 @@ typedef struct { tf_putchar_t *tf_putchar; tf_fill_t *tf_fill; tf_copy_t *tf_copy; + tf_pre_input_t *tf_pre_input; + tf_post_input_t *tf_post_input; tf_param_t *tf_param; tf_respond_t *tf_respond; } teken_funcs_t; From owner-svn-src-all@freebsd.org Wed May 16 10:08:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96CFDED6D2C; Wed, 16 May 2018 10:08:51 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47095818A7; Wed, 16 May 2018 10:08:51 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 279D918C83; Wed, 16 May 2018 10:08:51 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GA8pZ9091710; Wed, 16 May 2018 10:08:51 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GA8oeD091706; Wed, 16 May 2018 10:08:50 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201805161008.w4GA8oeD091706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Wed, 16 May 2018 10:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333670 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 333670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 10:08:51 -0000 Author: dumbbell Date: Wed May 16 10:08:50 2018 New Revision: 333670 URL: https://svnweb.freebsd.org/changeset/base/333670 Log: vt(4): Resume vt_timer() in vtterm_post_input() only There is no need to try to resume it after each smaller operations (putchar, cursor_position, copy, fill). The resume function already checks if the timer is armed before doing anything, but it uses an atomic cmpset which is expensive. And resuming the timer at the end of input processing is enough. While here, we also skip timer resume if the input is for another windows than the currently displayed one. I.e. if `ttyv0` is currently displayed, any changes to `ttyv1` shouldn't resume the timer (which would refresh `ttyv0`). By doing the same benchmark as r333669, I get: * vt(4), before r333669: 1500 ms * vt(4), with this patch: 760 ms * syscons(4): 700 ms Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_cpulogos.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Wed May 16 09:01:02 2018 (r333669) +++ head/sys/dev/vt/vt.h Wed May 16 10:08:50 2018 (r333670) @@ -172,7 +172,7 @@ struct vt_device { #define VT_LOCK_ASSERT(vd, what) mtx_assert(&(vd)->vd_lock, what) void vt_resume(struct vt_device *vd); -void vt_resume_flush_timer(struct vt_device *vd, int ms); +void vt_resume_flush_timer(struct vt_window *vw, int ms); void vt_suspend(struct vt_device *vd); /* Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed May 16 09:01:02 2018 (r333669) +++ head/sys/dev/vt/vt_core.c Wed May 16 10:08:50 2018 (r333670) @@ -289,9 +289,13 @@ vt_schedule_flush(struct vt_device *vd, int ms) } void -vt_resume_flush_timer(struct vt_device *vd, int ms) +vt_resume_flush_timer(struct vt_window *vw, int ms) { + struct vt_device *vd = vw->vw_device; + if (vd->vd_curwindow != vw) + return; + if (!(vd->vd_flags & VDF_ASYNC) || !atomic_cmpset_int(&vd->vd_timer_armed, 0, 1)) return; @@ -564,7 +568,7 @@ vt_window_switch(struct vt_window *vw) if (vd->vd_driver->vd_postswitch) vd->vd_driver->vd_postswitch(vd); - vt_resume_flush_timer(vd, 0); + vt_resume_flush_timer(vw, 0); /* Restore per-window keyboard mode. */ mtx_lock(&Giant); @@ -684,7 +688,7 @@ vt_scroll(struct vt_window *vw, int offset, int whence diff = vthistory_seek(&vw->vw_buf, offset, whence); if (diff) vw->vw_device->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); } static int @@ -1040,7 +1044,6 @@ vtterm_cursor(struct terminal *tm, const term_pos_t *p struct vt_window *vw = tm->tm_softc; vtbuf_cursor_position(&vw->vw_buf, p); - vt_resume_flush_timer(vw->vw_device, 0); } static void @@ -1049,7 +1052,6 @@ vtterm_putchar(struct terminal *tm, const term_pos_t * struct vt_window *vw = tm->tm_softc; vtbuf_putchar(&vw->vw_buf, p, c); - vt_resume_flush_timer(vw->vw_device, 0); } static void @@ -1058,7 +1060,6 @@ vtterm_fill(struct terminal *tm, const term_rect_t *r, struct vt_window *vw = tm->tm_softc; vtbuf_fill(&vw->vw_buf, r, c); - vt_resume_flush_timer(vw->vw_device, 0); } static void @@ -1068,7 +1069,6 @@ vtterm_copy(struct terminal *tm, const term_rect_t *r, struct vt_window *vw = tm->tm_softc; vtbuf_copy(&vw->vw_buf, r, p); - vt_resume_flush_timer(vw->vw_device, 0); } static void @@ -1088,7 +1088,7 @@ vtterm_param(struct terminal *tm, int cmd, unsigned in /* FALLTHROUGH */ case TP_SHOWCURSOR: vtbuf_cursor_visibility(&vw->vw_buf, arg); - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); break; case TP_MOUSE: vw->vw_mouse_level = arg; @@ -1331,7 +1331,7 @@ vtterm_post_input(struct terminal *tm) struct vt_window *vw = tm->tm_softc; vtbuf_unlock(&vw->vw_buf); - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); } static void @@ -1684,7 +1684,7 @@ vt_change_font(struct vt_window *vw, struct vt_font *v /* Force a full redraw the next timer tick. */ if (vd->vd_curwindow == vw) { vd->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); } vw->vw_flags &= ~VWF_BUSY; VT_UNLOCK(vd); @@ -1911,7 +1911,7 @@ vt_mouse_event(int type, int x, int y, int event, int vd->vd_mx / vf->vf_width, vd->vd_my / vf->vf_height); - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); return; /* Done */ case MOUSE_BUTTON_EVENT: /* Buttons */ @@ -1975,7 +1975,7 @@ vt_mouse_event(int type, int x, int y, int event, int * We have something marked to copy, so update pointer to * window with selection. */ - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); switch (mark) { case VTB_MARK_END: @@ -2030,7 +2030,7 @@ vt_mouse_state(int show) /* Mark mouse position as dirty. */ vt_mark_mouse_position_as_dirty(vd, false); - vt_resume_flush_timer(vw->vw_device, 0); + vt_resume_flush_timer(vw, 0); } #endif @@ -2808,7 +2808,7 @@ vt_replace_backend(const struct vt_driver *drv, void * /* Allow to put chars now. */ terminal_mute(vd->vd_curwindow->vw_terminal, 0); /* Rerun timer for screen updates. */ - vt_resume_flush_timer(vd, 0); + vt_resume_flush_timer(vd->vd_curwindow, 0); } /* Modified: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- head/sys/dev/vt/vt_cpulogos.c Wed May 16 09:01:02 2018 (r333669) +++ head/sys/dev/vt/vt_cpulogos.c Wed May 16 10:08:50 2018 (r333670) @@ -194,7 +194,7 @@ vt_fini_logos(void *dummy __unused) if (vd->vd_curwindow == vw) { vd->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vd, 0); + vt_resume_flush_timer(vw, 0); } VT_UNLOCK(vd); } @@ -253,7 +253,7 @@ vt_init_logos(void *dummy) if (vd->vd_curwindow == vw) { vd->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vd, 0); + vt_resume_flush_timer(vw, 0); } callout_init(&vt_splash_cpu_callout, 1); From owner-svn-src-all@freebsd.org Wed May 16 11:06:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C46EED9DA9; Wed, 16 May 2018 11:06:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19748835F3; Wed, 16 May 2018 11:06:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA56B19619; Wed, 16 May 2018 11:06:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GB6d3n021255; Wed, 16 May 2018 11:06:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GB6dx5021254; Wed, 16 May 2018 11:06:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805161106.w4GB6dx5021254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 16 May 2018 11:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333671 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 333671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 11:06:40 -0000 Author: kib Date: Wed May 16 11:06:39 2018 New Revision: 333671 URL: https://svnweb.freebsd.org/changeset/base/333671 Log: MFC r333404, r333405: Remove PG_U from the recursive pte for kernel pmap' PML4 page and from the rest of the kernel pmap ptes. Approved by: re (marius) Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Wed May 16 10:08:50 2018 (r333670) +++ stable/11/sys/amd64/amd64/pmap.c Wed May 16 11:06:39 2018 (r333671) @@ -951,8 +951,7 @@ create_pagetables(vm_paddr_t *firstaddr) /* And connect up the PD to the PDP (leaving room for L4 pages) */ pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE)); for (i = 0; i < nkpdpe; i++) - pdp_p[i + KPDPI] = (KPDphys + ptoa(i)) | X86_PG_RW | X86_PG_V | - PG_U; + pdp_p[i + KPDPI] = (KPDphys + ptoa(i)) | X86_PG_RW | X86_PG_V; /* * Now, set up the direct map region using 2MB and/or 1GB pages. If @@ -978,24 +977,24 @@ create_pagetables(vm_paddr_t *firstaddr) } for (j = 0; i < ndmpdp; i++, j++) { pdp_p[i] = DMPDphys + ptoa(j); - pdp_p[i] |= X86_PG_RW | X86_PG_V | PG_U; + pdp_p[i] |= X86_PG_RW | X86_PG_V; } /* And recursively map PML4 to itself in order to get PTmap */ p4_p = (pml4_entry_t *)KPML4phys; p4_p[PML4PML4I] = KPML4phys; - p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | PG_U | pg_nx; + p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | pg_nx; /* Connect the Direct Map slot(s) up to the PML4. */ for (i = 0; i < ndmpdpphys; i++) { p4_p[DMPML4I + i] = DMPDPphys + ptoa(i); - p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V | PG_U; + p4_p[DMPML4I + i] |= X86_PG_RW | X86_PG_V; } /* Connect the KVA slots up to the PML4 */ for (i = 0; i < NKPML4E; i++) { p4_p[KPML4BASE + i] = KPDPphys + ptoa(i); - p4_p[KPML4BASE + i] |= X86_PG_RW | X86_PG_V | PG_U; + p4_p[KPML4BASE + i] |= X86_PG_RW | X86_PG_V; } } @@ -2564,11 +2563,11 @@ pmap_pinit_pml4(vm_page_t pml4pg) /* Wire in kernel global address entries. */ for (i = 0; i < NKPML4E; i++) { pm_pml4[KPML4BASE + i] = (KPDPphys + ptoa(i)) | X86_PG_RW | - X86_PG_V | PG_U; + X86_PG_V; } for (i = 0; i < ndmpdpphys; i++) { pm_pml4[DMPML4I + i] = (DMPDPphys + ptoa(i)) | X86_PG_RW | - X86_PG_V | PG_U; + X86_PG_V; } /* install self-referential address mapping entry(s) */ From owner-svn-src-all@freebsd.org Wed May 16 11:15:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E03DEDA5D5; Wed, 16 May 2018 11:15:03 +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 A67E783B0B; Wed, 16 May 2018 11:15:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id CC225106B6B; Wed, 16 May 2018 20:56:35 +1000 (AEST) Date: Wed, 16 May 2018 20:56:34 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333669 - in head/sys: dev/vt kern sys teken In-Reply-To: <201805160901.w4G912FD056132@repo.freebsd.org> Message-ID: <20180516191245.T5082@besplex.bde.org> References: <201805160901.w4G912FD056132@repo.freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=pAR6cuTXeNmMoLIjFSkA:9 a=h4GdewKZhCAiNIxt:21 a=VfNDe5RVxroMcmBP:21 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 11:15:03 -0000 On Wed, 16 May 2018, [UTF-8] Jean-S=C3=A9bastien P=C3=A9dron wrote: > Author: dumbbell > Date: Wed May 16 09:01:02 2018 > New Revision: 333669 > URL: https://svnweb.freebsd.org/changeset/base/333669 > > Log: > teken, vt(4): New callbacks to lock the terminal once > > ... to process input, instead of inside each smaller operations such as > appending a character or moving the cursor forward. > .... > The goal is to improve input processing speed of vt(4). As a benchmark, > here is the time taken to write a text file of 360 000 lines (26 MiB) on > `ttyv0`: > > * vt(4), unmodified: 1500 ms > * vt(4), with this patch: 1200 ms > * syscons(4): 700 ms Syscons was pessimized by a factor of about 12 using related methods (excessive layering, aktough not so much locking). So the correct comparison is with unpessimized syscons taking about 60 ms. These times are just for writing to the history buffer and are very relevan= t for normal operation. Pessimizations by factors of 12 just annoy me. > This is on a Haswell laptop with a GENERIC-NODEBUG kernel. My times are on Haswell too, but on a 4.0GHz desktop with non-GENERIC non-debug kernels. My test does 65MB of (weird) text output consisting 650 lines of length 100000. Again, this is not very representative. The (trivial) benchmark sources have almost no changes since I wrote it to benchmark and optimize syscons the Minix console driver 25-30 years ago. (I didn't do much with syscons then, but made sure that it was only slightly slower.) Old tests did 80-column output and all versions do 1 write(2) per line and it was convenient to scale up the line length to avoid having too much of the time being for syscall overhead. The 65MB is scaled to take about 1 second on an AthlonXP 2.2GHz with the best version of syscons. Approximate times on Haswell: - 0.2 seconds with FreeBSD-5.2 syscons modified to recover some of my fixes from 1993. I micro-optimized the inner loop in 1993. The inner loop handles these 100000-character lines 80 characters at a time using as close as possible to *dst++ =3D *src++, with considerable overhead for attributes, checking for escape sequences, and for reducing to 80 columns. According to the comment, this took 26 cycles on i486's (probably DX2/66), but I optimized it to only 18. This optimized inner loop was turned into mostly nonsense before FreeBSD-5.2, using inlining in all the wrong places. The loop was moved into an inline function (sc_term_gen_print()), but it calls a non-inline function (sc_vtb_putchar()). This made it about 50% slower IIRC. - 50% slower in pre-teken versions in pre-release versions of FreeBSD-8. FreeBSD-8 changed the upper layers of the tty driver. The pessimization is to do quoting stuff per-char. This made the i/o even slower than the old way. The older way produced larger tinygrams by transfering between the layers only about 100 bytes per output call, and used inefficent cli= sts. - about 500% slower for teken, by calling from the sc layer to the teken layer for every char. IIRC, there are more than 5 but less than 10 function calls per char, so it is doing OK to be only 5 times slower. - thus the time on Haswell was about 2.4 seconds for 65MB. This is for text mode. Only slightly slower for graphics mode. Screen refresh shou= ld occur at most about 50 times in 2.4 seconds, so at most 100k of the outp= ut should actually reach the screen and that shouldn't take long on a 4GHz system! (On a 30 year ET4000, the frame buffer speed was 5.9MB/sec so 100k must take at least 1/30 seconds in text mode. Any slower than that is bad.) - I optimized this a little by avoiding 1 or 2 function calls (for attribut= e handling) per character, so syscoons onl takes about 2 seconds for 65MB in -current. This is consistent with your 700 ms (26/65 * 2000 ms =3D 800). - I have syscons mostly fixed in local patches: - Method A: restore scterm-sc.c (don't use teken). This was very easy, = and fixes many other bugs much more easily than in my committed and local patches. The excessive layering in syscons actually helps here -- the API for the layering of the terminal emulator has only small changes, so scterm-sc.c from FreeBSD-7 takes only about 10 lines of changes to drop back in. Also restore optimizations from 1993 as far as possible. They moved t= o scterm-sc.c and were lost with teken. This fixes everything except the slow upper layers, so the speed is 0.33 seconds for 65MB. seconds for - Method B: restore only sctermvar.h from FreeBSD-7. Use only sc_term_gen_print() and its infrastructure from this. This does essentially *dst++ =3D *src++ to the history buffer until it hits an escape sequence, and it must not be called while in an escape sequence. Subvert the teken layering so that this can be used. > At the same time, the locking is changed in the vt_flush() function > which is responsible to draw the text on screen. So instead of > (indirectly) using VTBUF_LOCK() just to read and reset the dirty area > of the internal buffer, the lock is held for about the entire function, > including the drawing part. > > The change is mostly visible while content is scrolling fast: before, > lines could appear garbled while scrolling because the internal buffer > was accessed without locks (once the scrolling was finished, the output > was correct). Now, the scrolling appears correct. > > In the end, the locking model is closer to what syscons(4) does. This is only very fast because the output never reaches the screen. Frame buffers aren't much faster than 25 years ago. Text mode tends to be limited to a few MB/sec. Old VGA graphics modes (not supported by vt) are much slower since they require using PIO registers and there is more to do. Direct bitmapped modes might be no slower than text mode, but again there is a lot of I/O to do. Old syscons updates so fast that no scrolling is visible when all lines are the same. This also requires magic buffer sizes. clists and the transfer size of 100 gave suitable magic (e.g., 100 divides 80x25). Now tty buffer sizes are normally powers of 2, so the magic lining up rarely occurs and this looks like artifacts in scrolling. Bruce From owner-svn-src-all@freebsd.org Wed May 16 11:19:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D673CEDA964; Wed, 16 May 2018 11:19:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C18283D52; Wed, 16 May 2018 11:19:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6912F197A7; Wed, 16 May 2018 11:19:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GBJ4lL026349; Wed, 16 May 2018 11:19:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GBJ3In026346; Wed, 16 May 2018 11:19:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805161119.w4GBJ3In026346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 May 2018 11:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333672 - in head/sys/dev/vt: . hw/fb hw/ofwfb X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/dev/vt: . hw/fb hw/ofwfb X-SVN-Commit-Revision: 333672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 11:19:05 -0000 Author: emaste Date: Wed May 16 11:19:03 2018 New Revision: 333672 URL: https://svnweb.freebsd.org/changeset/base/333672 Log: Clean up vt source whitespace issues Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/hw/fb/vt_early_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_early_fb.c Wed May 16 11:06:39 2018 (r333671) +++ head/sys/dev/vt/hw/fb/vt_early_fb.c Wed May 16 11:19:03 2018 (r333672) @@ -224,7 +224,7 @@ vt_efb_init(struct vt_device *vd) * remapped for us when relocation turns on. */ if (OF_getproplen(node, "address") == sizeof(info->fb_pbase)) { - /* XXX We assume #address-cells is 1 at this point. */ + /* XXX We assume #address-cells is 1 at this point. */ OF_getencprop(node, "address", &info->fb_pbase, sizeof(info->fb_pbase)); Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed May 16 11:06:39 2018 (r333671) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed May 16 11:19:03 2018 (r333672) @@ -317,7 +317,7 @@ ofwfb_initialize(struct vt_device *vd) } if (i != 16) sc->iso_palette = 1; - + break; case 32: @@ -417,7 +417,7 @@ ofwfb_init(struct vt_device *vd) * remapped for us when relocation turns on. */ if (OF_getproplen(node, "address") == sizeof(fb_phys)) { - /* XXX We assume #address-cells is 1 at this point. */ + /* XXX We assume #address-cells is 1 at this point. */ OF_getprop(node, "address", &fb_phys, sizeof(fb_phys)); #if defined(__powerpc__) Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Wed May 16 11:06:39 2018 (r333671) +++ head/sys/dev/vt/vt.h Wed May 16 11:19:03 2018 (r333672) @@ -93,7 +93,7 @@ struct vt_driver; void vt_allocate(const struct vt_driver *, void *); void vt_deallocate(const struct vt_driver *, void *); -typedef unsigned int vt_axis_t; +typedef unsigned int vt_axis_t; /* * List of locks Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed May 16 11:06:39 2018 (r333671) +++ head/sys/dev/vt/vt_core.c Wed May 16 11:19:03 2018 (r333672) @@ -539,14 +539,14 @@ vt_window_switch(struct vt_window *vw) return (0); if (!(vw->vw_flags & (VWF_OPENED|VWF_CONSOLE))) return (EINVAL); - + vd->vd_curwindow = vw; vd->vd_flags |= VDF_INVALID; if (vd->vd_driver->vd_postswitch) vd->vd_driver->vd_postswitch(vd); return (0); } - + VT_LOCK(vd); if (curvw == vw) { /* Nothing to do. */ @@ -2279,7 +2279,7 @@ skip_thunk: /* XXX */ *(int *)data = M_CG640x480; return (0); - case CONS_BELLTYPE: /* set bell type sound */ + case CONS_BELLTYPE: /* set bell type sound */ if ((*(int *)data) & CONS_QUIET_BELL) vd->vd_flags |= VDF_QUIET_BELL; else @@ -2383,7 +2383,7 @@ skip_thunk: break; } return (0); - case KDENABIO: /* allow io operations */ + case KDENABIO: /* allow io operations */ error = priv_check(td, PRIV_IO); if (error != 0) return (error); @@ -2396,20 +2396,20 @@ skip_thunk: td->td_frame->tf_rflags |= PSL_IOPL; #endif return (0); - case KDDISABIO: /* disallow io operations (default) */ + case KDDISABIO: /* disallow io operations (default) */ #if defined(__i386__) td->td_frame->tf_eflags &= ~PSL_IOPL; #elif defined(__amd64__) td->td_frame->tf_rflags &= ~PSL_IOPL; #endif return (0); - case KDMKTONE: /* sound the bell */ + case KDMKTONE: /* sound the bell */ vtterm_beep(tm, *(u_int *)data); return (0); - case KIOCSOUND: /* make tone (*data) hz */ + case KIOCSOUND: /* make tone (*data) hz */ /* TODO */ return (0); - case CONS_SETKBD: /* set the new keyboard */ + case CONS_SETKBD: /* set the new keyboard */ mtx_lock(&Giant); error = 0; if (vd->vd_keyboard != *(int *)data) { @@ -2437,7 +2437,7 @@ skip_thunk: } mtx_unlock(&Giant); return (error); - case CONS_RELKBD: /* release the current keyboard */ + case CONS_RELKBD: /* release the current keyboard */ mtx_lock(&Giant); error = 0; if (vd->vd_keyboard != -1) { @@ -2509,7 +2509,7 @@ skip_thunk: VT_UNLOCK(vd); return (error); } - case VT_SETMODE: { /* set screen switcher mode */ + case VT_SETMODE: { /* set screen switcher mode */ struct vt_mode *mode; struct proc *p1; From owner-svn-src-all@freebsd.org Wed May 16 13:18:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5437FEE1BFD; Wed, 16 May 2018 13:18:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E80AC68147; Wed, 16 May 2018 13:18:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC7A01AAA3; Wed, 16 May 2018 13:18:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GDIdwr086349; Wed, 16 May 2018 13:18:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GDIcpx086341; Wed, 16 May 2018 13:18:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805161318.w4GDIcpx086341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 16 May 2018 13:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333673 - in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 X-SVN-Group: stable-11 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 X-SVN-Commit-Revision: 333673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 13:18:40 -0000 Author: imp Date: Wed May 16 13:18:37 2018 New Revision: 333673 URL: https://svnweb.freebsd.org/changeset/base/333673 Log: MFC r333436: only launch getty if underlying device exists Note: pc98 isn't run under VM, so I didn't do a direct commit to it. Approved by: re@ (gjb@) Modified: stable/11/etc/etc.aarch64/ttys stable/11/etc/etc.amd64/ttys stable/11/etc/etc.arm/ttys stable/11/etc/etc.i386/ttys stable/11/etc/etc.powerpc/ttys stable/11/etc/etc.riscv/ttys stable/11/etc/etc.sparc64/ttys Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/etc.aarch64/ttys ============================================================================== --- stable/11/etc/etc.aarch64/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.aarch64/ttys Wed May 16 13:18:37 2018 (r333673) @@ -29,16 +29,16 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm off secure -ttyv2 "/usr/libexec/getty Pc" xterm off secure -ttyv3 "/usr/libexec/getty Pc" xterm off secure -ttyv4 "/usr/libexec/getty Pc" xterm off secure -ttyv5 "/usr/libexec/getty Pc" xterm off secure -ttyv6 "/usr/libexec/getty Pc" xterm off secure -ttyv7 "/usr/libexec/getty Pc" xterm off secure -#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure Modified: stable/11/etc/etc.amd64/ttys ============================================================================== --- stable/11/etc/etc.amd64/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.amd64/ttys Wed May 16 13:18:37 2018 (r333673) @@ -29,15 +29,15 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm on secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm on secure -ttyv2 "/usr/libexec/getty Pc" xterm on secure -ttyv3 "/usr/libexec/getty Pc" xterm on secure -ttyv4 "/usr/libexec/getty Pc" xterm on secure -ttyv5 "/usr/libexec/getty Pc" xterm on secure -ttyv6 "/usr/libexec/getty Pc" xterm on secure -ttyv7 "/usr/libexec/getty Pc" xterm on secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. Modified: stable/11/etc/etc.arm/ttys ============================================================================== --- stable/11/etc/etc.arm/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.arm/ttys Wed May 16 13:18:37 2018 (r333673) @@ -29,15 +29,15 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm off secure -ttyv2 "/usr/libexec/getty Pc" xterm off secure -ttyv3 "/usr/libexec/getty Pc" xterm off secure -ttyv4 "/usr/libexec/getty Pc" xterm off secure -ttyv5 "/usr/libexec/getty Pc" xterm off secure -ttyv6 "/usr/libexec/getty Pc" xterm off secure -ttyv7 "/usr/libexec/getty Pc" xterm off secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. Modified: stable/11/etc/etc.i386/ttys ============================================================================== --- stable/11/etc/etc.i386/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.i386/ttys Wed May 16 13:18:37 2018 (r333673) @@ -29,15 +29,15 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm on secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm on secure -ttyv2 "/usr/libexec/getty Pc" xterm on secure -ttyv3 "/usr/libexec/getty Pc" xterm on secure -ttyv4 "/usr/libexec/getty Pc" xterm on secure -ttyv5 "/usr/libexec/getty Pc" xterm on secure -ttyv6 "/usr/libexec/getty Pc" xterm on secure -ttyv7 "/usr/libexec/getty Pc" xterm on secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. Modified: stable/11/etc/etc.powerpc/ttys ============================================================================== --- stable/11/etc/etc.powerpc/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.powerpc/ttys Wed May 16 13:18:37 2018 (r333673) @@ -29,15 +29,15 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm on secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm on secure -ttyv2 "/usr/libexec/getty Pc" xterm on secure -ttyv3 "/usr/libexec/getty Pc" xterm on secure -ttyv4 "/usr/libexec/getty Pc" xterm on secure -ttyv5 "/usr/libexec/getty Pc" xterm on secure -ttyv6 "/usr/libexec/getty Pc" xterm on secure -ttyv7 "/usr/libexec/getty Pc" xterm on secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure #ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. Modified: stable/11/etc/etc.riscv/ttys ============================================================================== --- stable/11/etc/etc.riscv/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.riscv/ttys Wed May 16 13:18:37 2018 (r333673) @@ -29,16 +29,16 @@ # when going to single-user mode. console none unknown off secure # -ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm off secure -ttyv2 "/usr/libexec/getty Pc" xterm off secure -ttyv3 "/usr/libexec/getty Pc" xterm off secure -ttyv4 "/usr/libexec/getty Pc" xterm off secure -ttyv5 "/usr/libexec/getty Pc" xterm off secure -ttyv6 "/usr/libexec/getty Pc" xterm off secure -ttyv7 "/usr/libexec/getty Pc" xterm off secure -#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm onifexists secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure Modified: stable/11/etc/etc.sparc64/ttys ============================================================================== --- stable/11/etc/etc.sparc64/ttys Wed May 16 11:19:03 2018 (r333672) +++ stable/11/etc/etc.sparc64/ttys Wed May 16 13:18:37 2018 (r333673) @@ -33,15 +33,15 @@ screen "/usr/libexec/getty Pc" vt100 off secure ttya "/usr/libexec/getty 3wire.9600" vt100 off secure ttyb "/usr/libexec/getty 3wire.9600" vt100 off secure # syscons(4) -ttyv0 "/usr/libexec/getty Pc" xterm on secure +ttyv0 "/usr/libexec/getty Pc" xterm onifexists secure # Virtual terminals -ttyv1 "/usr/libexec/getty Pc" xterm on secure -ttyv2 "/usr/libexec/getty Pc" xterm on secure -ttyv3 "/usr/libexec/getty Pc" xterm on secure -ttyv4 "/usr/libexec/getty Pc" xterm on secure -ttyv5 "/usr/libexec/getty Pc" xterm on secure -ttyv6 "/usr/libexec/getty Pc" xterm on secure -ttyv7 "/usr/libexec/getty Pc" xterm on secure +ttyv1 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv2 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv3 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv4 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv5 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv6 "/usr/libexec/getty Pc" xterm onifexists secure +ttyv7 "/usr/libexec/getty Pc" xterm onifexists secure ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure # Serial terminals # The 'dialup' keyword identifies dialin lines to login, fingerd etc. From owner-svn-src-all@freebsd.org Wed May 16 13:44:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B082EE3500; Wed, 16 May 2018 13:44:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id DA96A695F9; Wed, 16 May 2018 13:44:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 66D14104AD91; Wed, 16 May 2018 23:44:49 +1000 (AEST) Date: Wed, 16 May 2018 23:44:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333669 - in head/sys: dev/vt kern sys teken In-Reply-To: <20180516191245.T5082@besplex.bde.org> Message-ID: <20180516231304.Y6071@besplex.bde.org> References: <201805160901.w4G912FD056132@repo.freebsd.org> <20180516191245.T5082@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=I9sVfJog c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=6I5d2MoRAAAA:8 a=xwGXy3bdw3XkyXsnLswA:9 a=45ClL6m2LaAA:10 a=IjZwj45LgO3ly-622nXo:22 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 13:44:58 -0000 On Wed, 16 May 2018, Bruce Evans wrote: > On Wed, 16 May 2018, [UTF-8] Jean-S=C3=A9bastien P=C3=A9dron wrote: > >> Author: dumbbell >> Date: Wed May 16 09:01:02 2018 >> New Revision: 333669 >> URL: https://svnweb.freebsd.org/changeset/base/333669 >>=20 >> Log: >> teken, vt(4): New callbacks to lock the terminal once >>=20 >> ... to process input, instead of inside each smaller operations such as >> appending a character or moving the cursor forward. >> .... >> The goal is to improve input processing speed of vt(4). As a benchmark, >> here is the time taken to write a text file of 360 000 lines (26 MiB) o= n >> `ttyv0`: >>=20 >> * vt(4), unmodified: 1500 ms >> * vt(4), with this patch: 1200 ms >> * syscons(4): 700 ms > > Syscons was pessimized by a factor of about 12 using related methods > (excessive layering, aktough not so much locking). So the correct > comparison is with unpessimized syscons taking about 60 ms. Unrelated to my previous reply: this commit breaks syscons (especially when vt is not configured) by calling pointers that are only initialized to non-null for vt (subr_terminal.c), so the pointers are null for syscons. The following quick fix seems to work. XX Index: teken.c XX =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D XX --- teken.c=09(revision 333672) XX +++ teken.c=09(working copy) XX @@ -136,8 +136,8 @@ XX teken_funcs_pre_input(const teken_t *t) XX { XX=20 XX -=09teken_assert(t->t_funcs->tf_pre_input !=3D NULL); XX -=09t->t_funcs->tf_pre_input(t->t_softc); XX +=09if (t->t_funcs->tf_pre_input !=3D NULL) XX +=09=09t->t_funcs->tf_pre_input(t->t_softc); XX } XX=20 XX static inline void XX @@ -144,8 +144,8 @@ XX teken_funcs_post_input(const teken_t *t) XX { XX=20 XX -=09teken_assert(t->t_funcs->tf_post_input !=3D NULL); XX -=09t->t_funcs->tf_post_input(t->t_softc); XX +=09if (t->t_funcs->tf_post_input !=3D NULL) XX +=09=09t->t_funcs->tf_post_input(t->t_softc); XX } XX=20 XX static inline void Bruce From owner-svn-src-all@freebsd.org Wed May 16 13:47:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE6A9EE37F7; Wed, 16 May 2018 13:47:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D819697EF; Wed, 16 May 2018 13:47:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 572EA1AF69; Wed, 16 May 2018 13:47:31 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GDlVr9002080; Wed, 16 May 2018 13:47:31 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GDlUUo002078; Wed, 16 May 2018 13:47:30 GMT (envelope-from des@FreeBSD.org) Message-Id: <201805161347.w4GDlUUo002078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 May 2018 13:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333674 - head/lib/libpam/modules/pam_radius X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libpam/modules/pam_radius X-SVN-Commit-Revision: 333674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 13:47:32 -0000 Author: des Date: Wed May 16 13:47:30 2018 New Revision: 333674 URL: https://svnweb.freebsd.org/changeset/base/333674 Log: Forward Reply-Message attributes to the user, unless suppressed by the new no_reply_message option. MFC after: 1 week Sponsored by: The University of Oslo Modified: head/lib/libpam/modules/pam_radius/pam_radius.8 head/lib/libpam/modules/pam_radius/pam_radius.c Modified: head/lib/libpam/modules/pam_radius/pam_radius.8 ============================================================================== --- head/lib/libpam/modules/pam_radius/pam_radius.8 Wed May 16 13:18:37 2018 (r333673) +++ head/lib/libpam/modules/pam_radius/pam_radius.8 Wed May 16 13:47:30 2018 (r333674) @@ -1,9 +1,10 @@ -.\" Copyright (c) 1999 -.\" Andrzej Bialecki . All rights reserved. -.\" +.\"- .\" Copyright (c) 1992, 1993, 1994 .\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 1999 Andrzej Bialecki .\" All rights reserved. +.\" Copyright (c) 2018 The University of Oslo +.\" All rights reserved. .\" .\" This code is derived from software donated to Berkeley by .\" Jan-Simon Pendry. @@ -34,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2002 +.Dd May 16, 2018 .Dt PAM_RADIUS 8 .Os .Sh NAME @@ -80,6 +81,10 @@ specifies a non-standard location for the RADIUS clien .Pa /etc/radius.conf ) . .It Cm nas_id Ns = Ns Ar identifier specifies a NAS identifier to send instead of the hostname. +.It Cm nas_ipaddr Ns Op No = Ns Ar address +specifies a NAS IP address to be sent. +If option is present, but there is no value provided then IP address +corresponding to the current hostname will be used. .It Cm template_user Ns = Ns Ar username specifies a user whose .Xr passwd 5 @@ -97,10 +102,21 @@ If this option is omitted, and there is no username in the system databases equal to the supplied one (as determined by call to .Xr getpwnam 3 ) , the authentication will fail. -.It Cm nas_ipaddr Ns Op No = Ns Ar address -specifies a NAS IP address to be sent. -If option is present, but there is no value provided then IP address -corresponding to the current hostname will be used. +.It Cm no_reply_message +suppress printing of the contents of any +.Cm Reply-Message +attributes found in +.Cm Access-Accept +and +.Cm Access-Reject +responses. +These are normally conveyed to the user as either informational or +error messages, depending on whether the access request was accepted +or rejected. +.It Cm no_warn +suppress warning messages to the user. +These messages include reasons why the user's authentication attempt +was declined. .El .Sh FILES .Bl -tag -width /etc/radius.conf -compact Modified: head/lib/libpam/modules/pam_radius/pam_radius.c ============================================================================== --- head/lib/libpam/modules/pam_radius/pam_radius.c Wed May 16 13:18:37 2018 (r333673) +++ head/lib/libpam/modules/pam_radius/pam_radius.c Wed May 16 13:47:30 2018 (r333674) @@ -5,6 +5,8 @@ * All rights reserved. * Copyright (c) 2001-2003 Networks Associates Technology, Inc. * All rights reserved. + * Copyright (c) 2015-2018 The University of Oslo + * All rights reserved. * * Portions of this software were developed for the FreeBSD Project by * ThinkSec AS and NAI Labs, the Security Research Division of Network @@ -59,6 +61,7 @@ __FBSDID("$FreeBSD$"); #define PAM_OPT_TEMPLATE_USER "template_user" #define PAM_OPT_NAS_ID "nas_id" #define PAM_OPT_NAS_IPADDR "nas_ipaddr" +#define PAM_OPT_NO_REPLYMSG "no_reply_message" #define MAX_CHALLENGE_MSGS 10 #define PASSWORD_PROMPT "RADIUS Password:" @@ -149,15 +152,23 @@ do_accept(pam_handle_t *pamh, struct rad_handle *radh) char *s; while ((attrtype = rad_get_attr(radh, &attrval, &attrlen)) > 0) { - if (attrtype == RAD_USER_NAME) { - s = rad_cvt_string(attrval, attrlen); - if (s == NULL) { - syslog(LOG_CRIT, - "rad_cvt_string: out of memory"); - return (-1); - } + switch (attrtype) { + case RAD_USER_NAME: + if ((s = rad_cvt_string(attrval, attrlen)) == NULL) + goto enomem; pam_set_item(pamh, PAM_USER, s); free(s); + break; + case RAD_REPLY_MESSAGE: + if ((s = rad_cvt_string(attrval, attrlen)) == NULL) + goto enomem; + if (!openpam_get_option(pamh, PAM_OPT_NO_REPLYMSG)) + pam_info(pamh, "%s", s); + free(s); + break; + default: + PAM_LOG("%s(): ignoring RADIUS attribute %d", + __func__, attrtype); } } if (attrtype == -1) { @@ -165,9 +176,44 @@ do_accept(pam_handle_t *pamh, struct rad_handle *radh) return (-1); } return (0); +enomem: + syslog(LOG_CRIT, "%s(): out of memory", __func__); + return (-1); } static int +do_reject(pam_handle_t *pamh, struct rad_handle *radh) +{ + int attrtype; + const void *attrval; + size_t attrlen; + char *s; + + while ((attrtype = rad_get_attr(radh, &attrval, &attrlen)) > 0) { + switch (attrtype) { + case RAD_REPLY_MESSAGE: + if ((s = rad_cvt_string(attrval, attrlen)) == NULL) + goto enomem; + if (!openpam_get_option(pamh, PAM_OPT_NO_REPLYMSG)) + pam_error(pamh, "%s", s); + free(s); + break; + default: + PAM_LOG("%s(): ignoring RADIUS attribute %d", + __func__, attrtype); + } + } + if (attrtype < 0) { + syslog(LOG_CRIT, "rad_get_attr: %s", rad_strerror(radh)); + return (-1); + } + return (0); +enomem: + syslog(LOG_CRIT, "%s(): out of memory", __func__); + return (-1); +} + +static int do_challenge(pam_handle_t *pamh, struct rad_handle *radh, const char *user, const char *nas_id, const char *nas_ipaddr, const char *rhost) { @@ -332,6 +378,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __un return (PAM_SUCCESS); case RAD_ACCESS_REJECT: + retval = do_reject(pamh, radh); rad_close(radh); PAM_VERBOSE_ERROR("Radius rejection"); return (PAM_AUTH_ERR); From owner-svn-src-all@freebsd.org Wed May 16 13:52:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74CD4EE3C95; Wed, 16 May 2018 13:52:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2833E69C5C; Wed, 16 May 2018 13:52:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AEFD1B0ED; Wed, 16 May 2018 13:52:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GDqOea006783; Wed, 16 May 2018 13:52:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GDqOFN006782; Wed, 16 May 2018 13:52:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805161352.w4GDqOFN006782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 16 May 2018 13:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333675 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 333675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 13:52:25 -0000 Author: imp Date: Wed May 16 13:52:24 2018 New Revision: 333675 URL: https://svnweb.freebsd.org/changeset/base/333675 Log: Add note about LD=ld.lld being a temporary requirement when building the kernel the traditional way. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 16 13:47:30 2018 (r333674) +++ head/UPDATING Wed May 16 13:52:24 2018 (r333675) @@ -51,6 +51,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20150510: + The amd64 kernel now requires a ld that supports ifunc to produce a + working kernel, either lld or a newer binutils. lld is built by default + on amd64, and the 'buildkernel' target uses it automatically. However, + it is not the default linker, so building the kernel the traditional + way requires LD=ld.lld on the command line (or LD=/usr/local/bin/ld for + binutils port/package). lld will soon be default, and this requirement + will go away. + 20180508: The nxge(4) driver has been removed. This driver was for PCI-X 10g cards made by s2io/Neterion. The company was aquired by Exar and From owner-svn-src-all@freebsd.org Wed May 16 13:59:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 042CCEE4252; Wed, 16 May 2018 13:59:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EC6F6A06E; Wed, 16 May 2018 13:59:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7940E1B0FC; Wed, 16 May 2018 13:59:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GDxwhq007098; Wed, 16 May 2018 13:59:58 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GDxwvr007097; Wed, 16 May 2018 13:59:58 GMT (envelope-from des@FreeBSD.org) Message-Id: <201805161359.w4GDxwvr007097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 May 2018 13:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333676 - vendor-crypto/openssh/dist/openbsd-compat X-SVN-Group: vendor-crypto X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor-crypto/openssh/dist/openbsd-compat X-SVN-Commit-Revision: 333676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 13:59:59 -0000 Author: des Date: Wed May 16 13:59:58 2018 New Revision: 333676 URL: https://svnweb.freebsd.org/changeset/base/333676 Log: Import upstream commit cfb1d9b, which fixes tunnel forwarding. Modified: vendor-crypto/openssh/dist/openbsd-compat/port-net.c Modified: vendor-crypto/openssh/dist/openbsd-compat/port-net.c ============================================================================== --- vendor-crypto/openssh/dist/openbsd-compat/port-net.c Wed May 16 13:52:24 2018 (r333675) +++ vendor-crypto/openssh/dist/openbsd-compat/port-net.c Wed May 16 13:59:58 2018 (r333676) @@ -185,7 +185,7 @@ sys_tun_open(int tun, int mode, char **ifname) else debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); - if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) + if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) goto failed; return (fd); @@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname) goto failed; } - if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) + if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) goto failed; close(sock); From owner-svn-src-all@freebsd.org Wed May 16 14:04:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F497EE47AF; Wed, 16 May 2018 14:04:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1407D6A4EC; Wed, 16 May 2018 14:04:40 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E54771B2A1; Wed, 16 May 2018 14:04:39 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GE4dtp011963; Wed, 16 May 2018 14:04:39 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GE4dmU011962; Wed, 16 May 2018 14:04:39 GMT (envelope-from des@FreeBSD.org) Message-Id: <201805161404.w4GE4dmU011962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 May 2018 14:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333677 - head/crypto/openssh/openbsd-compat X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/crypto/openssh/openbsd-compat X-SVN-Commit-Revision: 333677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 14:04:40 -0000 Author: des Date: Wed May 16 14:04:39 2018 New Revision: 333677 URL: https://svnweb.freebsd.org/changeset/base/333677 Log: Merge upstream patch to unbreak tunnel forwarding. Reported by: cy@ Modified: head/crypto/openssh/openbsd-compat/port-net.c Modified: head/crypto/openssh/openbsd-compat/port-net.c ============================================================================== --- head/crypto/openssh/openbsd-compat/port-net.c Wed May 16 13:59:58 2018 (r333676) +++ head/crypto/openssh/openbsd-compat/port-net.c Wed May 16 14:04:39 2018 (r333677) @@ -185,7 +185,7 @@ sys_tun_open(int tun, int mode, char **ifname) else debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); - if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) + if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) goto failed; return (fd); @@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname) goto failed; } - if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) + if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) goto failed; close(sock); From owner-svn-src-all@freebsd.org Wed May 16 14:06:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94431EE4994; Wed, 16 May 2018 14:06:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 469B16A75D; Wed, 16 May 2018 14:06:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 093931B2A3; Wed, 16 May 2018 14:06:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GE6ff1012080; Wed, 16 May 2018 14:06:41 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GE6fe0012079; Wed, 16 May 2018 14:06:41 GMT (envelope-from des@FreeBSD.org) Message-Id: <201805161406.w4GE6fe0012079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Wed, 16 May 2018 14:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333678 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 333678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 14:06:42 -0000 Author: des Date: Wed May 16 14:06:41 2018 New Revision: 333678 URL: https://svnweb.freebsd.org/changeset/base/333678 Log: Missed mergeinfo in previous commit. Modified: Directory Properties: head/crypto/openssh/ (props changed) From owner-svn-src-all@freebsd.org Wed May 16 16:56:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1996FEED405; Wed, 16 May 2018 16:56:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C114D710C7; Wed, 16 May 2018 16:56: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D9111CDD2; Wed, 16 May 2018 16:56: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 w4GGuaBu097212; Wed, 16 May 2018 16:56:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GGuasU097210; Wed, 16 May 2018 16:56:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201805161656.w4GGuasU097210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 16 May 2018 16:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333679 - in head: sys/riscv/include tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sys/riscv/include tests/sys/kern X-SVN-Commit-Revision: 333679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 16:56:37 -0000 Author: jhb Date: Wed May 16 16:56:35 2018 New Revision: 333679 URL: https://svnweb.freebsd.org/changeset/base/333679 Log: Export a breakpoint() function to userland for riscv. As a result, enable tests using breakpoint() on riscv. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D15191 Modified: head/sys/riscv/include/cpufunc.h head/tests/sys/kern/ptrace_test.c Modified: head/sys/riscv/include/cpufunc.h ============================================================================== --- head/sys/riscv/include/cpufunc.h Wed May 16 14:06:41 2018 (r333678) +++ head/sys/riscv/include/cpufunc.h Wed May 16 16:56:35 2018 (r333679) @@ -37,16 +37,16 @@ #ifndef _MACHINE_CPUFUNC_H_ #define _MACHINE_CPUFUNC_H_ -#ifdef _KERNEL - -#include - static __inline void breakpoint(void) { __asm("ebreak"); } + +#ifdef _KERNEL + +#include static __inline register_t intr_disable(void) Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Wed May 16 14:06:41 2018 (r333678) +++ head/tests/sys/kern/ptrace_test.c Wed May 16 16:56:35 2018 (r333679) @@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$"); * Architectures with a user-visible breakpoint(). */ #if defined(__amd64__) || defined(__i386__) || defined(__mips__) || \ - defined(__sparc64__) + defined(__riscv) || defined(__sparc64__) #define HAVE_BREAKPOINT #endif @@ -67,6 +67,8 @@ __FBSDID("$FreeBSD$"); #define SKIP_BREAK(reg) #elif defined(__mips__) #define SKIP_BREAK(reg) ((reg)->r_regs[PC] += 4) +#elif defined(__riscv) +#define SKIP_BREAK(reg) ((reg)->sepc += 4) #elif defined(__sparc64__) #define SKIP_BREAK(reg) do { \ (reg)->r_tpc = (reg)->r_tnpc + 4; \ From owner-svn-src-all@freebsd.org Wed May 16 16:57:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 977DDEED4AD; Wed, 16 May 2018 16:57:12 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AFA37123D; Wed, 16 May 2018 16:57:12 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C1B31CDE5; Wed, 16 May 2018 16:57:12 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GGvC7t097280; Wed, 16 May 2018 16:57:12 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GGvCCl097279; Wed, 16 May 2018 16:57:12 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201805161657.w4GGvCCl097279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Wed, 16 May 2018 16:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333680 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: zec X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 333680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 16:57:12 -0000 Author: zec Date: Wed May 16 16:57:11 2018 New Revision: 333680 URL: https://svnweb.freebsd.org/changeset/base/333680 Log: A belated note crediting the FreeBSD Foundation for sponsoring technical work circa ten years ago... MFC after: 3 days Modified: head/share/man/man9/vnet.9 Modified: head/share/man/man9/vnet.9 ============================================================================== --- head/share/man/man9/vnet.9 Wed May 16 16:56:35 2018 (r333679) +++ head/share/man/man9/vnet.9 Wed May 16 16:57:11 2018 (r333680) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2014 +.Dd May 16, 2018 .Dt VNET 9 .Os .Sh NAME @@ -488,10 +488,24 @@ context of the caller. .Xr KASSERT 9 , .Xr sysctl 9 .\" .Xr SYSINIT 9 +.Pp +Marko Zec, Implementing a Clonable Network Stack in the FreeBSD Kernel, +USENIX ATC'03, June 2003, Boston .Sh HISTORY The virtual network stack implementation first appeared in .Fx 8.0 . .Sh AUTHORS +.An -nosplit +The +.Nm +framework has been designed and implemented at the University of Zagreb by +.An Marko Zec , +and later extended and refined by +.An Bjoern A. Zeeb +and +.An Robert Watson , +under contract to the FreeBSD Foundation. +.Pp This manual page was written by .An Bjoern A. Zeeb, CK Software GmbH, under sponsorship from the FreeBSD Foundation. From owner-svn-src-all@freebsd.org Wed May 16 17:54:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90D40EF03AB; Wed, 16 May 2018 17:54:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43639738C2; Wed, 16 May 2018 17:54:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EBD11D7C6; Wed, 16 May 2018 17:54:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GHselE028028; Wed, 16 May 2018 17:54:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GHsepN028027; Wed, 16 May 2018 17:54:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201805161754.w4GHsepN028027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 16 May 2018 17:54:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333681 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 333681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 17:54:41 -0000 Author: jhb Date: Wed May 16 17:54:40 2018 New Revision: 333681 URL: https://svnweb.freebsd.org/changeset/base/333681 Log: Include kernel modules for MALTA kernels. Sponsored by: DARPA / AFRL Modified: head/sys/mips/conf/std.MALTA Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Wed May 16 16:57:11 2018 (r333680) +++ head/sys/mips/conf/std.MALTA Wed May 16 17:54:40 2018 (r333681) @@ -4,9 +4,6 @@ options YAMON -# Don't build any modules yet. -makeoptions MODULES_OVERRIDE="" - options TICK_USE_YAMON_FREQ=defined #options TICK_USE_MALTA_RTC=defined From owner-svn-src-all@freebsd.org Wed May 16 17:55:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A5DEF040C; Wed, 16 May 2018 17:55:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4971D73A01; Wed, 16 May 2018 17:55:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 118B71D7C7; Wed, 16 May 2018 17:55:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GHtG9S028122; Wed, 16 May 2018 17:55:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GHtGFm028121; Wed, 16 May 2018 17:55:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805161755.w4GHtGFm028121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 16 May 2018 17:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333682 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 333682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 17:55:17 -0000 Author: np Date: Wed May 16 17:55:16 2018 New Revision: 333682 URL: https://svnweb.freebsd.org/changeset/base/333682 Log: cxgbe(4): Fall back to a failsafe configuration built into the firmware if an error is reported while pre-processing the configuration file that the driver attempted to use. Also, allow the user to explicitly use the built-in configuration with hw.cxgbe.config_file="built-in" MFC after: 2 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed May 16 17:54:40 2018 (r333681) +++ head/sys/dev/cxgbe/t4_main.c Wed May 16 17:55:16 2018 (r333682) @@ -379,9 +379,10 @@ int t4_intr_types = INTR_MSIX | INTR_MSI | INTR_INTX; TUNABLE_INT("hw.cxgbe.interrupt_types", &t4_intr_types); /* - * Configuration file. + * Configuration file. All the _CF names here are special. */ #define DEFAULT_CF "default" +#define BUILTIN_CF "built-in" #define FLASH_CF "flash" #define UWIRE_CF "uwire" #define FPGA_CF "fpga" @@ -3342,7 +3343,8 @@ partition_resources(struct adapter *sc, const struct f snprintf(sc->cfg_file, sizeof(sc->cfg_file), UWIRE_CF); if (is_fpga(sc)) snprintf(sc->cfg_file, sizeof(sc->cfg_file), FPGA_CF); - } + } else if (strncmp(t4_cfg_file, BUILTIN_CF, sizeof(t4_cfg_file)) == 0) + goto use_built_in_config; /* go straight to config. */ /* * We need to load another module if the profile is anything except @@ -3453,8 +3455,31 @@ use_config_on_flash: if (rc != 0) { device_printf(sc->dev, "failed to pre-process config file: %d " - "(mtype %d, moff 0x%x).\n", rc, mtype, moff); - goto done; + "(mtype %d, moff 0x%x). Will reset the firmware and retry " + "with the built-in configuration.\n", rc, mtype, moff); + + rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST); + if (rc != 0) { + device_printf(sc->dev, + "firmware reset failed: %d.\n", rc); + if (rc != ETIMEDOUT && rc != EIO) { + t4_fw_bye(sc, sc->mbox); + sc->flags &= ~FW_OK; + } + goto done; + } + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", "built-in"); +use_built_in_config: + bzero(&caps, sizeof(caps)); + caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ); + caps.cfvalid_to_len16 = htobe32(FW_LEN16(caps)); + rc = t4_wr_mbox(sc, sc->mbox, &caps, sizeof(caps), &caps); + if (rc != 0) { + device_printf(sc->dev, + "built-in configuration failed: %d.\n", rc); + goto done; + } } finicsum = be32toh(caps.finicsum); From owner-svn-src-all@freebsd.org Wed May 16 18:12:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A74BEA86ED; Wed, 16 May 2018 18:12:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93477494E; Wed, 16 May 2018 18:12:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B0A31DB2C; Wed, 16 May 2018 18:12:49 +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 w4GICnCI038113; Wed, 16 May 2018 18:12:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GICnwN038112; Wed, 16 May 2018 18:12:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201805161812.w4GICnwN038112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 16 May 2018 18:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333683 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 333683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 18:12:50 -0000 Author: cem Date: Wed May 16 18:12:49 2018 New Revision: 333683 URL: https://svnweb.freebsd.org/changeset/base/333683 Log: teken: Unbreak syscons' use of teken Only vt(4) initializes these callbacks non-NULL at this time, so invoke the function pointers conditionally. Broken in r333669. Submitted by: bde@ Modified: head/sys/teken/teken.c Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Wed May 16 17:55:16 2018 (r333682) +++ head/sys/teken/teken.c Wed May 16 18:12:49 2018 (r333683) @@ -136,16 +136,16 @@ static inline void teken_funcs_pre_input(const teken_t *t) { - teken_assert(t->t_funcs->tf_pre_input != NULL); - t->t_funcs->tf_pre_input(t->t_softc); + if (t->t_funcs->tf_pre_input != NULL) + t->t_funcs->tf_pre_input(t->t_softc); } static inline void teken_funcs_post_input(const teken_t *t) { - teken_assert(t->t_funcs->tf_post_input != NULL); - t->t_funcs->tf_post_input(t->t_softc); + if (t->t_funcs->tf_post_input != NULL) + t->t_funcs->tf_post_input(t->t_softc); } static inline void From owner-svn-src-all@freebsd.org Wed May 16 20:12:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B86E0EAEED4 for ; Wed, 16 May 2018 20:12:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5337479B56 for ; Wed, 16 May 2018 20:12:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x22f.google.com with SMTP id u83-v6so641898ywc.4 for ; Wed, 16 May 2018 13:12:10 -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:from:date:message-id:subject:to :cc; bh=Wr0z+HOL5tP/D3VeRmWCyI93dmPXEtmArWv8z7ZQUfo=; b=WGGEn4zbSAfgrTULYsfEeE/52TsyANDmWVN6asmgnNBZn5+n+oL1Z+5PrYskslquD/ Fw7mpk5qT4HDZkpeXASheNurdivsCpue7MQUtN9Z5wh0Gs6D1+KDAEFwAIQg+BrMXRze kfsnBMD9/H9nx2uGfhSYSE6JkqEUTNx2c6o/nPjecZMT9TnBIC8DbapzSCGELfTChcEF VwjYGpiboGVP7YqrlQfi+bfCzpbmfRFEbdZ2vZCjl1HylVrPfWL+RLssR7DsgdPQR72/ BWaaNUkYbbciZdJsKtUNt3D00j5It4fz2UjdB1o/EEJgcHJ/ZVmgyN5s2K3AWNaF1baM MLxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Wr0z+HOL5tP/D3VeRmWCyI93dmPXEtmArWv8z7ZQUfo=; b=Y/O6TPmqkKNX8u0mBWznjOZ1kbR+M2rEn7uFYmNeaRaUWq/sXKtG0kRv6zjEwkgkae q9WfdLIFUhsLeGDkxTvxe8AKu52XFS0Z3yxirn8Rsna/27V/X4UQ9AQJTjk3m3DB3pMg k58WTgW5vPYx9rbxmtgXzWWbOQ5mMO2PDY0sGmCG1VPX7+BLQtxGoH3gsAHknoEPR08L 5SNetmPp8hfc2L6ih8KpwT/zsAUIFf6ah/GNBx8cGmvcTGA3jM9WsweE3his2Cy7Duvj Ay2kq86EzjmUoRimIMvgs+1/p3gAJiFW470peMC3eZ3D2YWwKM0Vn3q38QhvXzM1gGQF 60wQ== X-Gm-Message-State: ALKqPwcITlwoVb/FOaJ9faC/eFKQaPlK3WmijEZzSheRFXew/kwT7k0N 3BHj91UwXmsB/YK3+3N0mz15/ES4L3HT/AE0INoc/w== X-Google-Smtp-Source: AB8JxZpwKHNZiZIGAJQhPwydSRupDJEMJDohXiClSnUbEIuY4NdAlK0OhE+mDEK7vIRA8ifRvJJnAMh11vvvWqIgWUs= X-Received: by 2002:a81:6905:: with SMTP id e5-v6mr1197957ywc.265.1526501529733; Wed, 16 May 2018 13:12:09 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:3894:0:0:0:0:0 with HTTP; Wed, 16 May 2018 13:12:09 -0700 (PDT) In-Reply-To: <201805161352.w4GDqOFN006782@repo.freebsd.org> References: <201805161352.w4GDqOFN006782@repo.freebsd.org> From: Oliver Pinter Date: Wed, 16 May 2018 22:12:09 +0200 Message-ID: Subject: Re: svn commit: r333675 - head To: Warner Losh 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.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 20:12:11 -0000 On 5/16/18, Warner Losh wrote: > Author: imp > Date: Wed May 16 13:52:24 2018 > New Revision: 333675 > URL: https://svnweb.freebsd.org/changeset/base/333675 > > Log: > Add note about LD=ld.lld being a temporary requirement when building > the kernel the traditional way. > > Modified: > head/UPDATING > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Wed May 16 13:47:30 2018 (r333674) > +++ head/UPDATING Wed May 16 13:52:24 2018 (r333675) > @@ -51,6 +51,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > > ****************************** SPECIAL WARNING: > ****************************** > > +20150510: 2018 :) > + The amd64 kernel now requires a ld that supports ifunc to produce a > + working kernel, either lld or a newer binutils. lld is built by default > + on amd64, and the 'buildkernel' target uses it automatically. However, > + it is not the default linker, so building the kernel the traditional > + way requires LD=ld.lld on the command line (or LD=/usr/local/bin/ld for > + binutils port/package). lld will soon be default, and this requirement > + will go away. > + > 20180508: > The nxge(4) driver has been removed. This driver was for PCI-X 10g > cards made by s2io/Neterion. The company was aquired by Exar and > _______________________________________________ > 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 16 20:39:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7805EEB062E; Wed, 16 May 2018 20:39:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ABF37AF9C; Wed, 16 May 2018 20:39:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07DE11F23E; Wed, 16 May 2018 20:39:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GKdFMm013683; Wed, 16 May 2018 20:39:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GKdFds013682; Wed, 16 May 2018 20:39:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805162039.w4GKdFds013682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 16 May 2018 20:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333684 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 333684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 20:39:16 -0000 Author: trasz Date: Wed May 16 20:39:15 2018 New Revision: 333684 URL: https://svnweb.freebsd.org/changeset/base/333684 Log: Change the cfumass rc script to stop pretending the USB LUN is a virtual CD; for some reason OSX can't deal with it. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/cfumass Modified: head/etc/rc.d/cfumass ============================================================================== --- head/etc/rc.d/cfumass Wed May 16 18:12:49 2018 (r333683) +++ head/etc/rc.d/cfumass Wed May 16 20:39:15 2018 (r333684) @@ -67,7 +67,7 @@ cfumass_start() ctladm create -b block -o file="${cfumass_image}" -o readonly=on \ -o vendor="${cfumass_vendor}" -o product="${cfumass_product}" \ - -t 5 -S 0 > /dev/null + -S 0 > /dev/null err=$? if [ "${err}" -ne 0 ]; then warn "unable to create CTL LUN" From owner-svn-src-all@freebsd.org Wed May 16 20:44:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CC90EB0B21; Wed, 16 May 2018 20:44:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C291B7B410; Wed, 16 May 2018 20:44:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D5C1F3E3; Wed, 16 May 2018 20:44:08 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GKi8Xk018780; Wed, 16 May 2018 20:44:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GKi8r8018779; Wed, 16 May 2018 20:44:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805162044.w4GKi8r8018779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 16 May 2018 20:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333685 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 333685 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 20:44:09 -0000 Author: trasz Date: Wed May 16 20:44:08 2018 New Revision: 333685 URL: https://svnweb.freebsd.org/changeset/base/333685 Log: Set label when setting up USB LUNs, it looks nicer this way. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/etc/rc.d/cfumass Modified: head/etc/rc.d/cfumass ============================================================================== --- head/etc/rc.d/cfumass Wed May 16 20:39:15 2018 (r333684) +++ head/etc/rc.d/cfumass Wed May 16 20:44:08 2018 (r333685) @@ -55,7 +55,8 @@ cfumass_start() _files=`find "${cfumass_dir}" -newer "${cfumass_image}" -print 2> /dev/null` if [ ! -e "${cfumass_image}" -o -n "${_files}" ]; then # The image doesn't exist or is out of date. - makefs -t cd9660 -o rockridge "${cfumass_image}" "${cfumass_dir}" + makefs -t cd9660 -o label="${cfumass_vendor}" \ + -o rockridge "${cfumass_image}" "${cfumass_dir}" err=$? if [ "${err}" -ne 0 ]; then warn "unable to create ${cfumass_image}" From owner-svn-src-all@freebsd.org Wed May 16 21:03:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58DFDEB1A12; Wed, 16 May 2018 21:03:23 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 046DF7BEFD; Wed, 16 May 2018 21:03:23 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D98771F709; Wed, 16 May 2018 21:03:22 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GL3Mca028916; Wed, 16 May 2018 21:03:22 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GL3Mtu028914; Wed, 16 May 2018 21:03:22 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201805162103.w4GL3Mtu028914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 16 May 2018 21:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333686 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 21:03:23 -0000 Author: shurd Date: Wed May 16 21:03:22 2018 New Revision: 333686 URL: https://svnweb.freebsd.org/changeset/base/333686 Log: Work around lack of TX IRQs in iflib for netmap When poll() is called via netmap, txsync is initially called, and if there are no available buffers to reclaim, it waits for the driver to notify of new buffers. Since the TX IRQ is generally not used in iflib drivers, this ends up causing a timeout. Work around this by having the reclaim DELAY(1) if it's initially unable to reclaim anything, then schedule the tx task, which will spin by continuously rescheduling itself until some buffers are reclaimed. In general, the delay is enough to allow some buffers to be reclaimed, so spinning is minimized. Reported by: Johannes Lundberg Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15455 Modified: head/sys/net/iflib.c head/sys/net/iflib_private.h Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 16 20:44:08 2018 (r333685) +++ head/sys/net/iflib.c Wed May 16 21:03:22 2018 (r333686) @@ -960,10 +960,10 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl */ nm_i = netmap_idx_n2k(kring, kring->nr_hwcur); - pkt_info_zero(&pi); - pi.ipi_segs = txq->ift_segs; - pi.ipi_qsidx = kring->ring_id; if (nm_i != head) { /* we have new packets to send */ + pkt_info_zero(&pi); + pi.ipi_segs = txq->ift_segs; + pi.ipi_qsidx = kring->ring_id; nic_i = netmap_idx_k2n(kring, nm_i); __builtin_prefetch(&ring->slot[nm_i]); @@ -1025,11 +1025,24 @@ iflib_netmap_txsync(struct netmap_kring *kring, int fl /* * Second part: reclaim buffers for completed transmissions. + * + * If there are unclaimed buffers, attempt to reclaim them. + * If none are reclaimed, and TX IRQs are not in use, do an initial + * minimal delay, then trigger the tx handler which will spin in the + * group task queue. */ - if (iflib_tx_credits_update(ctx, txq)) { - /* some tx completed, increment avail */ - nic_i = txq->ift_cidx_processed; - kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); + if (kring->nr_hwtail != nm_prev(head, lim)) { + if (iflib_tx_credits_update(ctx, txq)) { + /* some tx completed, increment avail */ + nic_i = txq->ift_cidx_processed; + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); + } + else { + if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) { + DELAY(1); + GROUPTASK_ENQUEUE(&ctx->ifc_txqs[txq->ift_id].ift_task); + } + } } return (0); } @@ -3702,8 +3715,20 @@ _task_fn_tx(void *context) if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) return; if (if_getcapenable(ifp) & IFCAP_NETMAP) { + /* + * If there are no available credits, and TX IRQs are not in use, + * re-schedule the task immediately. + */ if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); + else { + if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) { + struct netmap_kring *kring = NA(ctx->ifc_ifp)->tx_rings[txq->ift_id]; + + if (kring->nr_hwtail != nm_prev(kring->rhead, kring->nkr_num_slots - 1)) + GROUPTASK_ENQUEUE(&txq->ift_task); + } + } IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); return; } @@ -5548,6 +5573,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in fn = _task_fn_tx; intr_fast = iflib_fast_intr; GROUPTASK_INIT(gtask, 0, fn, q); + ctx->ifc_flags |= IFC_NETMAP_TX_IRQ; break; case IFLIB_INTR_RX: q = &ctx->ifc_rxqs[qid]; Modified: head/sys/net/iflib_private.h ============================================================================== --- head/sys/net/iflib_private.h Wed May 16 20:44:08 2018 (r333685) +++ head/sys/net/iflib_private.h Wed May 16 21:03:22 2018 (r333686) @@ -43,6 +43,8 @@ #define IFC_CHECK_HUNG 0x200 #define IFC_PSEUDO 0x400 +#define IFC_NETMAP_TX_IRQ 0x80000000 + MALLOC_DECLARE(M_IFLIB); #define IFLIB_MAX_TX_BYTES (2*1024*1024) From owner-svn-src-all@freebsd.org Wed May 16 21:04:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04275EB1AD9; Wed, 16 May 2018 21:04:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB15E7C073; Wed, 16 May 2018 21:04:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D9141F713; Wed, 16 May 2018 21:04:20 +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 w4GL4K4x029012; Wed, 16 May 2018 21:04:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GL4Kmw029010; Wed, 16 May 2018 21:04:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201805162104.w4GL4Kmw029010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 16 May 2018 21:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333687 - stable/11/sys/arm/include X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/arm/include X-SVN-Commit-Revision: 333687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 21:04:21 -0000 Author: jhb Date: Wed May 16 21:04:19 2018 New Revision: 333687 URL: https://svnweb.freebsd.org/changeset/base/333687 Log: MFC 332891,332892: Fixes for atomic_*cmpset() on arm. 332891: Fix some harmless type mismatches in the ARM atomic_cmpset implementations. The return value of atomic_cmpset() and atomic_fcmpset() is an int (which is really a bool) that has the values 0 or 1. Some of the inlines were using the type being operated on (e.g. uint32_t) as either the return type of the function, or the type of a local 'ret' variable used to hold the return value. Fix all of these to just use plain 'int'. Due to C promotion rules and the fact that the value can only be 0 or 1, these should all be harmless. 332892: Implement 32-bit atomic_fcmpset() in userland for armv4/v5. - Add an implementation of atomic_fcmpset_32() using RAS for armv4/v5. This fixes recent world breakage due to use of atomic_fcmpset() in userland. - While here, be more careful to not expose wrapper macros for 64-bit atomic_*cmpset to userland for armv4/v5 as only 32-bit cmpset is implemented. This has been reviewed, but not runtime-tested, but should fix the arm.arm and arm.armeb worlds that have been broken for a while. Approved by: re (kib) Modified: stable/11/sys/arm/include/atomic-v4.h stable/11/sys/arm/include/atomic-v6.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/atomic-v4.h ============================================================================== --- stable/11/sys/arm/include/atomic-v4.h Wed May 16 21:03:22 2018 (r333686) +++ stable/11/sys/arm/include/atomic-v4.h Wed May 16 21:04:19 2018 (r333687) @@ -115,7 +115,7 @@ atomic_clear_64(volatile uint64_t *address, uint64_t c static __inline int atomic_fcmpset_32(volatile u_int32_t *p, volatile u_int32_t *cmpval, volatile u_int32_t newval) { - u_int32_t ret; + int ret; __with_interrupts_disabled( { @@ -134,7 +134,7 @@ atomic_fcmpset_32(volatile u_int32_t *p, volatile u_in static __inline int atomic_fcmpset_64(volatile u_int64_t *p, volatile u_int64_t *cmpval, volatile u_int64_t newval) { - u_int64_t ret; + int ret; __with_interrupts_disabled( { @@ -149,7 +149,7 @@ atomic_fcmpset_64(volatile u_int64_t *p, volatile u_in return (ret); } -static __inline u_int32_t +static __inline int atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { int ret; @@ -166,7 +166,7 @@ atomic_cmpset_32(volatile u_int32_t *p, volatile u_int return (ret); } -static __inline u_int64_t +static __inline int atomic_cmpset_64(volatile u_int64_t *p, volatile u_int64_t cmpval, volatile u_int64_t newval) { int ret; @@ -296,7 +296,7 @@ atomic_clear_32(volatile uint32_t *address, uint32_t c } -static __inline u_int32_t +static __inline int atomic_cmpset_32(volatile u_int32_t *p, volatile u_int32_t cmpval, volatile u_int32_t newval) { int done, ras_start = ARM_RAS_START; @@ -321,6 +321,33 @@ atomic_cmpset_32(volatile u_int32_t *p, volatile u_int return (done); } +static __inline int +atomic_fcmpset_32(volatile u_int32_t *p, volatile u_int32_t *cmpval, volatile u_int32_t newval) +{ + int done, oldval, ras_start = ARM_RAS_START; + + __asm __volatile("1:\n" + "adr %1, 1b\n" + "str %1, [%0]\n" + "adr %1, 2f\n" + "str %1, [%0, #4]\n" + "ldr %1, [%2]\n" + "ldr %5, [%3]\n" + "cmp %1, %5\n" + "streq %4, [%2]\n" + "2:\n" + "mov %5, #0\n" + "str %5, [%0]\n" + "mov %5, #0xffffffff\n" + "str %5, [%0, #4]\n" + "strne %1, [%3]\n" + "moveq %1, #1\n" + "movne %1, #0\n" + : "+r" (ras_start), "=r" (done) ,"+r" (p) + , "+r" (cmpval), "+r" (newval), "+r" (oldval) : : "cc", "memory"); + return (done); +} + static __inline uint32_t atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) { @@ -409,14 +436,18 @@ atomic_swap_32(volatile u_int32_t *p, u_int32_t v) #define atomic_fcmpset_rel_32 atomic_fcmpset_32 #define atomic_fcmpset_acq_32 atomic_fcmpset_32 +#ifdef _KERNEL #define atomic_fcmpset_rel_64 atomic_fcmpset_64 #define atomic_fcmpset_acq_64 atomic_fcmpset_64 +#endif #define atomic_fcmpset_acq_long atomic_fcmpset_long #define atomic_fcmpset_rel_long atomic_fcmpset_long #define atomic_cmpset_rel_32 atomic_cmpset_32 #define atomic_cmpset_acq_32 atomic_cmpset_32 +#ifdef _KERNEL #define atomic_cmpset_rel_64 atomic_cmpset_64 #define atomic_cmpset_acq_64 atomic_cmpset_64 +#endif #define atomic_set_rel_32 atomic_set_32 #define atomic_set_acq_32 atomic_set_32 #define atomic_clear_rel_32 atomic_clear_32 @@ -463,8 +494,6 @@ atomic_cmpset_long(volatile u_long *dst, u_long old, u return (atomic_cmpset_32((volatile uint32_t *)dst, old, newe)); } -#ifdef _KERNEL -/* atomic_fcmpset_32 is only defined for the kernel */ static __inline u_long atomic_fcmpset_long(volatile u_long *dst, u_long *old, u_long newe) { @@ -472,7 +501,6 @@ atomic_fcmpset_long(volatile u_long *dst, u_long *old, return (atomic_fcmpset_32((volatile uint32_t *)dst, (uint32_t *)old, newe)); } -#endif static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) Modified: stable/11/sys/arm/include/atomic-v6.h ============================================================================== --- stable/11/sys/arm/include/atomic-v6.h Wed May 16 21:03:22 2018 (r333686) +++ stable/11/sys/arm/include/atomic-v6.h Wed May 16 21:04:19 2018 (r333687) @@ -209,7 +209,7 @@ atomic_fcmpset_32(volatile uint32_t *p, uint32_t *cmpv return (!ret); } -static __inline uint64_t +static __inline int atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { uint64_t tmp; @@ -235,7 +235,7 @@ atomic_fcmpset_64(volatile uint64_t *p, uint64_t *cmpv return (!ret); } -static __inline u_long +static __inline int atomic_fcmpset_long(volatile u_long *p, u_long *cmpval, u_long newval) { @@ -243,38 +243,38 @@ atomic_fcmpset_long(volatile u_long *p, u_long *cmpval (uint32_t *)cmpval, newval)); } -static __inline uint64_t +static __inline int atomic_fcmpset_acq_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { - uint64_t ret; + int ret; ret = atomic_fcmpset_64(p, cmpval, newval); dmb(); return (ret); } -static __inline u_long +static __inline int atomic_fcmpset_acq_long(volatile u_long *p, u_long *cmpval, u_long newval) { - u_long ret; + int ret; ret = atomic_fcmpset_long(p, cmpval, newval); dmb(); return (ret); } -static __inline uint32_t +static __inline int atomic_fcmpset_acq_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) { - uint32_t ret; + int ret; ret = atomic_fcmpset_32(p, cmpval, newval); dmb(); return (ret); } -static __inline uint32_t +static __inline int atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t *cmpval, uint32_t newval) { @@ -282,7 +282,7 @@ atomic_fcmpset_rel_32(volatile uint32_t *p, uint32_t * return (atomic_fcmpset_32(p, cmpval, newval)); } -static __inline uint64_t +static __inline int atomic_fcmpset_rel_64(volatile uint64_t *p, uint64_t *cmpval, uint64_t newval) { @@ -290,7 +290,7 @@ atomic_fcmpset_rel_64(volatile uint64_t *p, uint64_t * return (atomic_fcmpset_64(p, cmpval, newval)); } -static __inline u_long +static __inline int atomic_fcmpset_rel_long(volatile u_long *p, u_long *cmpval, u_long newval) { @@ -298,10 +298,10 @@ atomic_fcmpset_rel_long(volatile u_long *p, u_long *cm return (atomic_fcmpset_long(p, cmpval, newval)); } -static __inline uint32_t +static __inline int atomic_cmpset_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - uint32_t ret; + int ret; __asm __volatile( "1: ldrex %0, [%1] \n" @@ -349,44 +349,44 @@ atomic_cmpset_64(volatile uint64_t *p, uint64_t cmpval return (ret); } -static __inline u_long +static __inline int atomic_cmpset_long(volatile u_long *p, u_long cmpval, u_long newval) { return (atomic_cmpset_32((volatile uint32_t *)p, cmpval, newval)); } -static __inline uint32_t +static __inline int atomic_cmpset_acq_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { - uint32_t ret; + int ret; ret = atomic_cmpset_32(p, cmpval, newval); dmb(); return (ret); } -static __inline uint64_t +static __inline int atomic_cmpset_acq_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { - uint64_t ret; + int ret; ret = atomic_cmpset_64(p, cmpval, newval); dmb(); return (ret); } -static __inline u_long +static __inline int atomic_cmpset_acq_long(volatile u_long *p, u_long cmpval, u_long newval) { - u_long ret; + int ret; ret = atomic_cmpset_long(p, cmpval, newval); dmb(); return (ret); } -static __inline uint32_t +static __inline int atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cmpval, uint32_t newval) { @@ -394,7 +394,7 @@ atomic_cmpset_rel_32(volatile uint32_t *p, uint32_t cm return (atomic_cmpset_32(p, cmpval, newval)); } -static __inline uint64_t +static __inline int atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cmpval, uint64_t newval) { @@ -402,7 +402,7 @@ atomic_cmpset_rel_64(volatile uint64_t *p, uint64_t cm return (atomic_cmpset_64(p, cmpval, newval)); } -static __inline u_long +static __inline int atomic_cmpset_rel_long(volatile u_long *p, u_long cmpval, u_long newval) { From owner-svn-src-all@freebsd.org Wed May 16 21:07:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1143BEB1D3E; Wed, 16 May 2018 21:07:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B34147C237; Wed, 16 May 2018 21:07:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 856861F714; Wed, 16 May 2018 21:07:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GL7CQx029193; Wed, 16 May 2018 21:07:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GL7CSH029192; Wed, 16 May 2018 21:07:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805162107.w4GL7CSH029192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 16 May 2018 21:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333688 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 333688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 21:07:13 -0000 Author: imp Date: Wed May 16 21:07:12 2018 New Revision: 333688 URL: https://svnweb.freebsd.org/changeset/base/333688 Log: 2018 this time. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed May 16 21:04:19 2018 (r333687) +++ head/UPDATING Wed May 16 21:07:12 2018 (r333688) @@ -51,7 +51,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** -20150510: +20180510: The amd64 kernel now requires a ld that supports ifunc to produce a working kernel, either lld or a newer binutils. lld is built by default on amd64, and the 'buildkernel' target uses it automatically. However, From owner-svn-src-all@freebsd.org Wed May 16 21:42:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0889EED6FB5; Wed, 16 May 2018 21:42:13 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mail.made4.biz (mail.made4.biz [195.154.164.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC8D7DA93; Wed, 16 May 2018 21:42:12 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freebsd.org ; s=20170531; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Sender:Reply-To:Content-Transfer-Encoding:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=//0MAbQDNO+uHn9VZhZgqItIA7aSdLABJbwyyW/cte8=; b=GkoS75yTI2YtFKTjP7ijFiSAhf snynUe9DnUXtxtd4gpZHPcDBB9LmCTV/xulbIUonypv+9FTWvl/YcQrjW36mwYYTR7aFhXx2rI7yR kWiVbayhOqadOydjkJecgpHqtEZdnLnkWgGws9PfxATg35j9ZojZb/wfikXjvAmxO/ZM=; Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=cassini.dumbbell.fr) by mail.made4.biz with esmtpa (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1fJ4BR-0003GN-7g; Wed, 16 May 2018 23:42:05 +0200 Subject: Re: svn commit: r333669 - in head/sys: dev/vt kern sys teken To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805160901.w4G912FD056132@repo.freebsd.org> <20180516191245.T5082@besplex.bde.org> <20180516231304.Y6071@besplex.bde.org> From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Openpgp: preference=signencrypt Autocrypt: addr=dumbbell@FreeBSD.org; prefer-encrypt=mutual; keydata= xsFNBFLVuqcBEADJ1gT22qIjHl/i5wD6n6Bx38BU3YxhoJKLFMtf10+hDgvttdVlRskqw5Kd hixPFbpsWPNhd09vR2He1M8+jUybsQwZulcE63+Mz7z7TVpBcepy8ejHFoQ5eT6cOfKosZZ4 5fEIZiZKSzMncIkyhUFpbpXl/MQRvCEBQEmg6NAjXmaClGcGB4J9deKrib3UvrClYGNuVPiZ 21YLrG/dOiaSWoh+367bqA8bLUIU4G3sgGCYlj9V4UGOu8belQKF1urxp87qSB3KFhVxJTCn n6+rBPYgFLfJ6UT39NwsFsfcdwq16hyIdr4lZOitTtH6WJBDRDlcxOoLcobDLEOg0xntAXEN 1X3sKhpyChmsLU0wGaCSZXTkP60UONkTAi1xCaOwq1/R/vBDWh7b/DKqg194ymZWzilEwE/x jQVT+R85EKbqW1faZrrAQWPnekw4Kl/Ozow6cgTGa96oYTmIO/nGRqRwMhyyuQMG9DUnGZvB Gy5Nub64/i2/TBWN/iiM8g+400Tkz7KUJd/6+fFKdza2i6/3vQJ+MAS3WNp7fFY4tsX1fM03 zqD2KfNE9Xt6GZEwpaUMjGkHNoi+by6CcA/saggrRZQHFp9aFde2ivCLq4n9yh2Zy9yFGklq dhyvI+iBSxt46pGlihNeTX79Yris30WR/BvLxR+z1Y6YEO6eZQARAQABzTtKZWFuLVPDqWJh c3RpZW4gUMOpZHJvbiA8amVhbi1zZWJhc3RpZW4ucGVkcm9uQGR1bWJiZWxsLmZyPsLBlwQT AQoAQQIbAwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBNcvS4RwmJJEIOYrk9k4+cho FpgcBQJYdnydBQkJYyj2AAoJENk4+choFpgcHzAP/3cbgHofr0qk7DF5Ch+3dIapxbLbbf44 af30RdML9lmFarN7nYxkTlJMSdd8d8FfkL9XuGBZWrd5zxToDJ71xcvW6zbj6DwEsuCis6Np DYX5+cjGRuyIw2/stwWGmAaqHIUAwVNFd3p8A/ZDiBbnZXMFOiJCbogMhQlFuOlgjk1DfrE+ 3rfkTt+obfIe9c7ExjkCM85K3Iud2XbmXMJ+fU0PbaH2FVRly71vH6+y/puB2SQvXQ/MKT1Y cUjKph8+koJRwLuzlmbh2UmrxVhKW/cFx5VU0xEBNY2/ysgxndKlO2Q97sedAEuVzfaAJIQx plDKhoDBWVBoleExoJyyD8QfI3ACvHKxorh+dd4wyMuU1OfWExqlEhkYa/v3S9xeWy6hyA7J wrZtuVgafJfJK3qTj98E1yXeuvAACECQtcNHuZP1TuscBztNXvzGGutPnq3MniHOITm2xdJl +zQyheAe+NbxByCtbtyp6Y+OxTXJCRoEb5eiyvhLNdhGZkyYMJ44kPosc8dOm9aNiapeZWYJ bksTKJSeXaJMP1BBDHc3kugTK+f0bkoiR/vqGNUqIGD4/7KArssRvOBHub1G1Erbkj7YoiGE iLx2mrGFM7n/JoZowlw5fvvJS+RB39u3SGiXzAIuNl2VK9tRcHSpvAzYstyQRCGYUdE6xLVy 6PZMzsFNBFLVuqcBEADNXJ6T/nh6ZuNjqULb/WVL2KUStzw9ynAazw+rz74GxH6me1oURIvV u2YKWXgTydSLNzo8bDLde0PT1si1CsKHIYiFIglmG6LEXfYj/P2xwC6IFQD4rsbtphXUkaLa 6npUgqbqhSK0NItuJGyv7ODfmkvCX1Unto+eamES3S8wil8u3Azs0qe/Q/gDGAEZTQM/Uq76 Vwp37mN4c1nGCKePZJtywtAg9vUD/Lx7uRWIjGTR95gTBY5AUeX5VGeBiomUgGnG7nI3HoiZ hWu/KdmYfSzjYYj9739uGCzdpSyR/fAL9NWa6XeVpNm4QUPJAn1Gr556l6yiE6m118RNjuI8 5+z9ABCCSAdI+XS8qyFGc+8q7phpSTNjmSrVT1qzyoeNfrdv1kgTBolSzyCnawu8MjzZ7llj DuUqiF3huIjLu5BVBq+6f0UEC0LpYohZ2KGoN1y5oSEcHN0pmXKFglYrqG4zF3SCOve+/1DK 63L8zun1PGbza/h/Cjicv7qHNhprjNEHr4Bvbq+ibKjpRClxOcLWLv5+lhc1owHSdKQp5ylC EmIxgt9Xu8SYV5pwIQam4MUV2zPN5j/Rj26F4QNNQWmXvbF2qQjutHb6YdnYdEYDjF4b86JT 1h2WBhInB6CL1EyV3dkcin4PkKpJQIEzhmIuD9NxcMxqBYZRsigU4wARAQABwsF8BBgBCgAm AhsMFiEE1y9LhHCYkkQg5iuT2Tj5yGgWmBwFAlh2fO0FCQljKUYACgkQ2Tj5yGgWmBySsQ/+ Iuxc9Q0R5BeR7o4JXbXGlCn6FqgugMfYvZ/fNxPJ5Sn9SiPOezho00jswjQC3w26SwPhGQ8L v+y4ZNWk7zsrS2Y+1m3r278rm8hr59fmbV/EjthfG4rtYlAeiWYxmg2xsFGqb9VQhj5i0Aze SbGnZ8namMU/+zfYNc4/LGGatG245lCvLMZcgGxEk2E1IVHh2g0nAC0nQ+xlmfvrNshLz4WY hrZS0t3Q4VDsL6bmywcdtFvURYKadyZ9H0UAkkg+H+QEwfH5HLhwai/5uZNfSllbQfJosy0Y KdzzMTjPYp21tKVvUIBmw5NREb5E23IzQZB1FR7nwBE2mx7O6BkVrpfo4mUqDZYuJsp9R9V5 EeMvFS9cbax8g9zCOps+rzLkz/Ab6NWdvydIZIqR+f/55o8VliNF5qANwLKcHfDdr8HljaCo tS3OnV9KdnW50/rORGvy1WXVvcKcqbPSArcjR2PZW/jPJo/2JVu9dfLT3x7U+E/jT2mYQtY2 99mVduvdNTbG30AeXfMAGikNXn9Sc3nFWTMUoiniLmYvNTwl0AhUdtXT52b+8c3hjBx2Mq9r D4PUVBn8wXqIMqQBPg633mFM9X3fAPQGvrJEpc3INv84f9DsNO65YQkS6uUEuQFMKwXIs9zl KCX0cFBuqlnaE/YLB+L4IJMyan8Jk9NDa0A= Organization: The FreeBSD Project Message-ID: <0d0d872f-226a-82d3-1f7f-00975d00716e@FreeBSD.org> Date: Wed, 16 May 2018 23:42:04 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180516231304.Y6071@besplex.bde.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Gm2uQqpyt2dlWqveku7lLe10v48gNvcCp" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 21:42:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Gm2uQqpyt2dlWqveku7lLe10v48gNvcCp Content-Type: multipart/mixed; boundary="7JHucLlDmtJ7gkf3L3Wp06RT4cS8God4r"; protected-headers="v1" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0d0d872f-226a-82d3-1f7f-00975d00716e@FreeBSD.org> Subject: Re: svn commit: r333669 - in head/sys: dev/vt kern sys teken References: <201805160901.w4G912FD056132@repo.freebsd.org> <20180516191245.T5082@besplex.bde.org> <20180516231304.Y6071@besplex.bde.org> In-Reply-To: <20180516231304.Y6071@besplex.bde.org> --7JHucLlDmtJ7gkf3L3Wp06RT4cS8God4r Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 16.05.2018 15:44, Bruce Evans wrote: > Unrelated to my previous reply: this commit breaks syscons (especially > when vt is not configured) by calling pointers that are only initialize= d > to non-null for vt (subr_terminal.c), so the pointers are null for > syscons.=C2=A0 The following quick fix seems to work. Thank you for the report and patch! I admit I didn't test the latest version of the patch with syscons(4)... Sorry about that! --=20 Jean-S=C3=A9bastien P=C3=A9dron The FreeBSD Project --7JHucLlDmtJ7gkf3L3Wp06RT4cS8God4r-- --Gm2uQqpyt2dlWqveku7lLe10v48gNvcCp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEZwh/0a6uDhLbxqbwOemXYaX9lMwFAlr8pawACgkQOemXYaX9 lMxZFQ//TyKUb3aNUEA58t8okrRUsO9hq8eOJZlMv/yUcrARjUz19iISnwEAkEQZ Ap8DgXNkUGrTdOE6/ToahXKxXGcp7V4veKfGT1s1EfiNm6kYWlF1MFtqH0QGPRpO ecyIqAQvPsXWIL/RCd/GujruRcejRMiu+AAGBBK88gVIPPtc9DyTAp4N51dzqDD6 M72hRlZRjb4KvMos+bb5CuJ7SIyvV+IU1uWYbqpTT7JoIQ/f5MXaLWqL0nmIp6+X qACmObTDIaqG2WG7q7Qk9RW2wkojytUliTUxmbV2aCQo294+zAkHQtf3QCSLnY7P NJNIbqIRxhOXjMaeLauN5Ebd1RbfI0MDlRGT6RpkOl7IOUb38X+0u08omPFu5dac OnUp026kcIEkk/mxn9EF0AP6sSYYHTCSoO+67ibVc6o3MCWnGuOlWSsy7IUWO1l6 jz8z5aX4bGEtTZEJymCNXze77q5LwC5nOEhLSUgNlhmG/cEgZhqx65FfCadl+p3U Qo5ENqCYA/+/Y+Ls428WAtoA9W+h9uxrX3U6+H61teTQwSG27M0hTGi4OpOsdfHs 3966tvBk2EN34YxvoB4IOtXbJXfB61vyHQiOEFNcEpbgRDRmAX5QGlcspBQRW/1T YMEPCHsHk0CosAWL13MVdYd6hryXRZTvcF+3Q/AEBE/nkTko8rc= =lXID -----END PGP SIGNATURE----- --Gm2uQqpyt2dlWqveku7lLe10v48gNvcCp-- From owner-svn-src-all@freebsd.org Wed May 16 21:42:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D97CED70AC; Wed, 16 May 2018 21:42:49 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [195.154.164.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B53C7DC32; Wed, 16 May 2018 21:42:48 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dumbbell.fr ; s=20170531; h=Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=Lr81XOyaI3Slc5Pdsl2IMPRDIwe6JZbxfIIyG3kVFZI=; b=RX2O1OXMmTpT2zusH0GAX+CUYX DOCcvqA0k6B2yMCE1Jzf+dfnbzI3wVbHOudyykMQ55dvvg3Fc12xRBLvgWh6jr0Fni6VHEmSuhMJp Ww+SChnVFLUyt46qNLdll2TSw1Si6ftmpilCcOhuFMA48aO9IurEaKXObeLK0E4v62SU=; Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=cassini.dumbbell.fr) by mail.made4.biz with esmtpa (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1fJ4C7-0003H7-LS; Wed, 16 May 2018 23:42:47 +0200 Subject: Re: svn commit: r333683 - head/sys/teken To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805161812.w4GICnwN038112@repo.freebsd.org> From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Openpgp: preference=signencrypt Autocrypt: addr=jean-sebastien.pedron@dumbbell.fr; prefer-encrypt=mutual; keydata= xsFNBFLVuqcBEADJ1gT22qIjHl/i5wD6n6Bx38BU3YxhoJKLFMtf10+hDgvttdVlRskqw5Kd hixPFbpsWPNhd09vR2He1M8+jUybsQwZulcE63+Mz7z7TVpBcepy8ejHFoQ5eT6cOfKosZZ4 5fEIZiZKSzMncIkyhUFpbpXl/MQRvCEBQEmg6NAjXmaClGcGB4J9deKrib3UvrClYGNuVPiZ 21YLrG/dOiaSWoh+367bqA8bLUIU4G3sgGCYlj9V4UGOu8belQKF1urxp87qSB3KFhVxJTCn n6+rBPYgFLfJ6UT39NwsFsfcdwq16hyIdr4lZOitTtH6WJBDRDlcxOoLcobDLEOg0xntAXEN 1X3sKhpyChmsLU0wGaCSZXTkP60UONkTAi1xCaOwq1/R/vBDWh7b/DKqg194ymZWzilEwE/x jQVT+R85EKbqW1faZrrAQWPnekw4Kl/Ozow6cgTGa96oYTmIO/nGRqRwMhyyuQMG9DUnGZvB Gy5Nub64/i2/TBWN/iiM8g+400Tkz7KUJd/6+fFKdza2i6/3vQJ+MAS3WNp7fFY4tsX1fM03 zqD2KfNE9Xt6GZEwpaUMjGkHNoi+by6CcA/saggrRZQHFp9aFde2ivCLq4n9yh2Zy9yFGklq dhyvI+iBSxt46pGlihNeTX79Yris30WR/BvLxR+z1Y6YEO6eZQARAQABzTtKZWFuLVPDqWJh c3RpZW4gUMOpZHJvbiA8amVhbi1zZWJhc3RpZW4ucGVkcm9uQGR1bWJiZWxsLmZyPsLBlwQT AQoAQQIbAwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZARYhBNcvS4RwmJJEIOYrk9k4+cho FpgcBQJYdnydBQkJYyj2AAoJENk4+choFpgcHzAP/3cbgHofr0qk7DF5Ch+3dIapxbLbbf44 af30RdML9lmFarN7nYxkTlJMSdd8d8FfkL9XuGBZWrd5zxToDJ71xcvW6zbj6DwEsuCis6Np DYX5+cjGRuyIw2/stwWGmAaqHIUAwVNFd3p8A/ZDiBbnZXMFOiJCbogMhQlFuOlgjk1DfrE+ 3rfkTt+obfIe9c7ExjkCM85K3Iud2XbmXMJ+fU0PbaH2FVRly71vH6+y/puB2SQvXQ/MKT1Y cUjKph8+koJRwLuzlmbh2UmrxVhKW/cFx5VU0xEBNY2/ysgxndKlO2Q97sedAEuVzfaAJIQx plDKhoDBWVBoleExoJyyD8QfI3ACvHKxorh+dd4wyMuU1OfWExqlEhkYa/v3S9xeWy6hyA7J wrZtuVgafJfJK3qTj98E1yXeuvAACECQtcNHuZP1TuscBztNXvzGGutPnq3MniHOITm2xdJl +zQyheAe+NbxByCtbtyp6Y+OxTXJCRoEb5eiyvhLNdhGZkyYMJ44kPosc8dOm9aNiapeZWYJ bksTKJSeXaJMP1BBDHc3kugTK+f0bkoiR/vqGNUqIGD4/7KArssRvOBHub1G1Erbkj7YoiGE iLx2mrGFM7n/JoZowlw5fvvJS+RB39u3SGiXzAIuNl2VK9tRcHSpvAzYstyQRCGYUdE6xLVy 6PZMzsFNBFLVuqcBEADNXJ6T/nh6ZuNjqULb/WVL2KUStzw9ynAazw+rz74GxH6me1oURIvV u2YKWXgTydSLNzo8bDLde0PT1si1CsKHIYiFIglmG6LEXfYj/P2xwC6IFQD4rsbtphXUkaLa 6npUgqbqhSK0NItuJGyv7ODfmkvCX1Unto+eamES3S8wil8u3Azs0qe/Q/gDGAEZTQM/Uq76 Vwp37mN4c1nGCKePZJtywtAg9vUD/Lx7uRWIjGTR95gTBY5AUeX5VGeBiomUgGnG7nI3HoiZ hWu/KdmYfSzjYYj9739uGCzdpSyR/fAL9NWa6XeVpNm4QUPJAn1Gr556l6yiE6m118RNjuI8 5+z9ABCCSAdI+XS8qyFGc+8q7phpSTNjmSrVT1qzyoeNfrdv1kgTBolSzyCnawu8MjzZ7llj DuUqiF3huIjLu5BVBq+6f0UEC0LpYohZ2KGoN1y5oSEcHN0pmXKFglYrqG4zF3SCOve+/1DK 63L8zun1PGbza/h/Cjicv7qHNhprjNEHr4Bvbq+ibKjpRClxOcLWLv5+lhc1owHSdKQp5ylC EmIxgt9Xu8SYV5pwIQam4MUV2zPN5j/Rj26F4QNNQWmXvbF2qQjutHb6YdnYdEYDjF4b86JT 1h2WBhInB6CL1EyV3dkcin4PkKpJQIEzhmIuD9NxcMxqBYZRsigU4wARAQABwsF8BBgBCgAm AhsMFiEE1y9LhHCYkkQg5iuT2Tj5yGgWmBwFAlh2fO0FCQljKUYACgkQ2Tj5yGgWmBySsQ/+ Iuxc9Q0R5BeR7o4JXbXGlCn6FqgugMfYvZ/fNxPJ5Sn9SiPOezho00jswjQC3w26SwPhGQ8L v+y4ZNWk7zsrS2Y+1m3r278rm8hr59fmbV/EjthfG4rtYlAeiWYxmg2xsFGqb9VQhj5i0Aze SbGnZ8namMU/+zfYNc4/LGGatG245lCvLMZcgGxEk2E1IVHh2g0nAC0nQ+xlmfvrNshLz4WY hrZS0t3Q4VDsL6bmywcdtFvURYKadyZ9H0UAkkg+H+QEwfH5HLhwai/5uZNfSllbQfJosy0Y KdzzMTjPYp21tKVvUIBmw5NREb5E23IzQZB1FR7nwBE2mx7O6BkVrpfo4mUqDZYuJsp9R9V5 EeMvFS9cbax8g9zCOps+rzLkz/Ab6NWdvydIZIqR+f/55o8VliNF5qANwLKcHfDdr8HljaCo tS3OnV9KdnW50/rORGvy1WXVvcKcqbPSArcjR2PZW/jPJo/2JVu9dfLT3x7U+E/jT2mYQtY2 99mVduvdNTbG30AeXfMAGikNXn9Sc3nFWTMUoiniLmYvNTwl0AhUdtXT52b+8c3hjBx2Mq9r D4PUVBn8wXqIMqQBPg633mFM9X3fAPQGvrJEpc3INv84f9DsNO65YQkS6uUEuQFMKwXIs9zl KCX0cFBuqlnaE/YLB+L4IJMyan8Jk9NDa0A= Message-ID: Date: Wed, 16 May 2018 23:42:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201805161812.w4GICnwN038112@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="TmgTqQIz7p2taLGSFpbAXUsoZsIQQIL69" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 21:42:49 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --TmgTqQIz7p2taLGSFpbAXUsoZsIQQIL69 Content-Type: multipart/mixed; boundary="Tz8hzJ3w8GRtAEs60k5FC3SW8hE0RH1Xf"; protected-headers="v1" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r333683 - head/sys/teken References: <201805161812.w4GICnwN038112@repo.freebsd.org> In-Reply-To: <201805161812.w4GICnwN038112@repo.freebsd.org> --Tz8hzJ3w8GRtAEs60k5FC3SW8hE0RH1Xf Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 16.05.2018 20:12, Conrad Meyer wrote: > Author: cem > Date: Wed May 16 18:12:49 2018 > New Revision: 333683 > URL: https://svnweb.freebsd.org/changeset/base/333683 >=20 > Log: > teken: Unbreak syscons' use of teken > =20 > Only vt(4) initializes these callbacks non-NULL at this time, so invo= ke the > function pointers conditionally. > =20 > Broken in r333669. Thank you! Sorry for the breakage... --=20 Jean-S=C3=A9bastien P=C3=A9dron --Tz8hzJ3w8GRtAEs60k5FC3SW8hE0RH1Xf-- --TmgTqQIz7p2taLGSFpbAXUsoZsIQQIL69 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEZwh/0a6uDhLbxqbwOemXYaX9lMwFAlr8pdcACgkQOemXYaX9 lMzaqA//WIbF4t6y8rRAvpka0TzOBKXYbJnsL9QWqPVBjK4+rtVa51OmG4v9fHHT 8q8/VrFw3Axq8o1+aVTAM3/RB+5JIH4tvB8glsjEpH3ZEc11b6APj18H+GDnyWgJ f6td2Yn/FWOLtkiGeh5QRYsf3+boFW9WkCciy9NE/j249PB/ri4Dh2jUWLIkYk9W KkdlFGtOAWpk2WVyPLwvehudIh//sWG0xXQGm201toiD2KKWtKg50RNGnQev7iUa JxZ5xVqU20U1uRCe/L+YuJifvQZHxPaHOAJRiMr2qxY6I5ASrGLKhdn01Ygit+RR cGMutatZjtqMG7bvEkmsP82OSEXkmsUNnhVj9EjpK6aF7YDIEeTqVrXvfKHtao5l 3lgzqZ70YGQkrE6rpmduyg5hhbfH+ZBxI3BnNa0zM0H1FKjt75uhImzAHlEjaYBY EKZVFObwU42DdsUQ9VT7y4QiLY8KzHfu++9brLgsMtYjlMK72+MMkYOwlHaWhVw0 Ggf4rXh5Ga4cQxDBYNpLNS5kGRC9gNk/8kMB0q/GAfIuIOUGw7DEz9BTrOR2UR72 QCrHEPwE2/KrSqNauLJvkvGEAsYJyAO0H2AAguEY3cBzeMe7z7fZY9T3ZiPPaaqN h7BZn6k5NmcvWIUzneEVjX+nFO2eOT65mL94JiAH6kOoOS3fC2E= =YoNY -----END PGP SIGNATURE----- --TmgTqQIz7p2taLGSFpbAXUsoZsIQQIL69-- From owner-svn-src-all@freebsd.org Wed May 16 22:25:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B8D2ED9598; Wed, 16 May 2018 22:25:48 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2E8D7F626; Wed, 16 May 2018 22:25:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FADE203FF; Wed, 16 May 2018 22:25:47 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GMPlbJ070569; Wed, 16 May 2018 22:25:47 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GMPlhe070568; Wed, 16 May 2018 22:25:47 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805162225.w4GMPlhe070568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 16 May 2018 22:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333689 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 22:25:48 -0000 Author: mmacy Date: Wed May 16 22:25:47 2018 New Revision: 333689 URL: https://svnweb.freebsd.org/changeset/base/333689 Log: Fix !netmap build post r333686 Approved by: sbruno Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed May 16 21:07:12 2018 (r333688) +++ head/sys/net/iflib.c Wed May 16 22:25:47 2018 (r333689) @@ -3722,12 +3722,14 @@ _task_fn_tx(void *context) if (ctx->isc_txd_credits_update(ctx->ifc_softc, txq->ift_id, false)) netmap_tx_irq(ifp, txq->ift_id); else { +#ifdef DEV_NETMAP if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ)) { struct netmap_kring *kring = NA(ctx->ifc_ifp)->tx_rings[txq->ift_id]; if (kring->nr_hwtail != nm_prev(kring->rhead, kring->nkr_num_slots - 1)) GROUPTASK_ENQUEUE(&txq->ift_task); } +#endif } IFDI_TX_QUEUE_INTR_ENABLE(ctx, txq->ift_id); return; From owner-svn-src-all@freebsd.org Wed May 16 22:29:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249CEED9779; Wed, 16 May 2018 22:29:22 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF36E7F7EC; Wed, 16 May 2018 22:29:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D75C20406; Wed, 16 May 2018 22:29:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GMTLQm070797; Wed, 16 May 2018 22:29:21 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GMTKJj070790; Wed, 16 May 2018 22:29:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805162229.w4GMTKJj070790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 16 May 2018 22:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333690 - in head/sys: dev/hwpmc kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: dev/hwpmc kern sys X-SVN-Commit-Revision: 333690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 22:29:22 -0000 Author: mmacy Date: Wed May 16 22:29:20 2018 New Revision: 333690 URL: https://svnweb.freebsd.org/changeset/base/333690 Log: hwpmc: Implement per-thread counters for PMC sampling This implements per-thread counters for PMC sampling. The thread descriptors are stored in a list attached to the process descriptor. These thread descriptors can store any per-thread information necessary for current or future features. For the moment, they just store the counters for sampling. The thread descriptors are created when the process descriptor is created. Additionally, thread descriptors are created or freed when threads are started or stopped. Because the thread exit function is called in a critical section, we can't directly free the thread descriptors. Hence, they are freed to a cache, which is also used as a source of allocations when needed for new threads. Approved by: sbruno Obtained from: jtl Sponsored by: Juniper Networks, Limelight Networks Differential Revision: https://reviews.freebsd.org/D15335 Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/kern_thr.c head/sys/kern/kern_thread.c head/sys/sys/pmc.h head/sys/sys/pmckern.h Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Wed May 16 22:25:47 2018 (r333689) +++ head/sys/dev/hwpmc/hwpmc_mod.c Wed May 16 22:29:20 2018 (r333690) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -92,6 +93,7 @@ enum pmc_flags { PMC_FLAG_NONE = 0x00, /* do nothing */ PMC_FLAG_REMOVE = 0x01, /* atomically remove entry from hash */ PMC_FLAG_ALLOCATE = 0x02, /* add entry to hash if not found */ + PMC_FLAG_NOWAIT = 0x04, /* do not wait for mallocs */ }; /* @@ -175,8 +177,22 @@ static LIST_HEAD(pmc_ownerhash, pmc_owner) *pmc_ownerh static LIST_HEAD(, pmc_owner) pmc_ss_owners; +/* + * List of free thread entries. This is protected by the spin + * mutex. + */ +static struct mtx pmc_threadfreelist_mtx; /* spin mutex */ +static LIST_HEAD(, pmc_thread) pmc_threadfreelist; +static int pmc_threadfreelist_entries=0; +#define THREADENTRY_SIZE \ +(sizeof(struct pmc_thread) + (md->pmd_npmc * sizeof(struct pmc_threadpmcstate))) /* + * Task to free thread descriptors + */ +static struct grouptask free_gtask; + +/* * A map of row indices to classdep structures. */ static struct pmc_classdep **pmc_rowindex_to_classdep; @@ -191,6 +207,8 @@ static int pmc_debugflags_parse(char *newstr, char *fe #endif static int load(struct module *module, int cmd, void *arg); +static void pmc_add_thread_descriptors_from_proc(struct proc *p, + struct pmc_process *pp); static int pmc_attach_process(struct proc *p, struct pmc *pm); static struct pmc *pmc_allocate_pmc_descriptor(void); static struct pmc_owner *pmc_allocate_owner_descriptor(struct proc *p); @@ -205,12 +223,15 @@ static int pmc_detach_one_process(struct proc *p, stru int flags); static void pmc_destroy_owner_descriptor(struct pmc_owner *po); static void pmc_destroy_pmc_descriptor(struct pmc *pm); +static void pmc_destroy_process_descriptor(struct pmc_process *pp); static struct pmc_owner *pmc_find_owner_descriptor(struct proc *p); static int pmc_find_pmc(pmc_id_t pmcid, struct pmc **pm); static struct pmc *pmc_find_pmc_descriptor_in_process(struct pmc_owner *po, pmc_id_t pmc); static struct pmc_process *pmc_find_process_descriptor(struct proc *p, uint32_t mode); +static struct pmc_thread *pmc_find_thread_descriptor(struct pmc_process *pp, + struct thread *td, uint32_t mode); static void pmc_force_context_switch(void); static void pmc_link_target_process(struct pmc *pm, struct pmc_process *pp); @@ -225,6 +246,8 @@ static void pmc_process_fork(void *arg, struct proc *p struct proc *p2, int n); static void pmc_process_samples(int cpu, int soft); static void pmc_release_pmc_descriptor(struct pmc *pmc); +static void pmc_process_thread_add(struct thread *td); +static void pmc_process_thread_delete(struct thread *td); static void pmc_remove_owner(struct pmc_owner *po); static void pmc_remove_process_descriptor(struct pmc_process *pp); static void pmc_restore_cpu_binding(struct pmc_binding *pb); @@ -233,6 +256,9 @@ static void pmc_select_cpu(int cpu); static int pmc_start(struct pmc *pm); static int pmc_stop(struct pmc *pm); static int pmc_syscall_handler(struct thread *td, void *syscall_args); +static struct pmc_thread *pmc_thread_descriptor_pool_alloc(void); +static void pmc_thread_descriptor_pool_drain(void); +static void pmc_thread_descriptor_pool_free(struct pmc_thread *pt); static void pmc_unlink_target_process(struct pmc *pmc, struct pmc_process *pp); static int generic_switch_in(struct pmc_cpu *pc, struct pmc_process *pp); @@ -312,6 +338,24 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, mtxpoolsize, CTLFLAG /* + * kern.hwpmc.threadfreelist_entries -- number of free entries + */ + +SYSCTL_INT(_kern_hwpmc, OID_AUTO, threadfreelist_entries, CTLFLAG_RD, + &pmc_threadfreelist_entries, 0, "number of avalable thread entries"); + + +/* + * kern.hwpmc.threadfreelist_max -- maximum number of free entries + */ + +static int pmc_threadfreelist_max = PMC_THREADLIST_MAX; +SYSCTL_INT(_kern_hwpmc, OID_AUTO, threadfreelist_max, CTLFLAG_RW, + &pmc_threadfreelist_max, 0, + "maximum number of available thread entries before freeing some"); + + +/* * security.bsd.unprivileged_syspmcs -- allow non-root processes to * allocate system-wide PMCs. * @@ -835,6 +879,9 @@ pmc_link_target_process(struct pmc *pm, struct pmc_pro { int ri; struct pmc_target *pt; +#ifdef INVARIANTS + struct pmc_thread *pt_td; +#endif sx_assert(&pmc_sx, SX_XLOCKED); @@ -878,6 +925,18 @@ pmc_link_target_process(struct pmc *pm, struct pmc_pro pp->pp_refcnt++; +#ifdef INVARIANTS + /* Confirm that the per-thread values at this row index are cleared. */ + if (PMC_TO_MODE(pm) == PMC_MODE_TS) { + mtx_lock_spin(pp->pp_tdslock); + LIST_FOREACH(pt_td, &pp->pp_tds, pt_next) { + KASSERT(pt_td->pt_pmcs[ri].pt_pmcval == (pmc_value_t) 0, + ("[pmc,%d] pt_pmcval not cleared for pid=%d at " + "ri=%d", __LINE__, pp->pp_proc->p_pid, ri)); + } + mtx_unlock_spin(pp->pp_tdslock); + } +#endif } /* @@ -890,6 +949,7 @@ pmc_unlink_target_process(struct pmc *pm, struct pmc_p int ri; struct proc *p; struct pmc_target *ptgt; + struct pmc_thread *pt; sx_assert(&pmc_sx, SX_XLOCKED); @@ -912,6 +972,14 @@ pmc_unlink_target_process(struct pmc *pm, struct pmc_p pp->pp_pmcs[ri].pp_pmc = NULL; pp->pp_pmcs[ri].pp_pmcval = (pmc_value_t) 0; + /* Clear the per-thread values at this row index. */ + if (PMC_TO_MODE(pm) == PMC_MODE_TS) { + mtx_lock_spin(pp->pp_tdslock); + LIST_FOREACH(pt, &pp->pp_tds, pt_next) + pt->pt_pmcs[ri].pt_pmcval = (pmc_value_t) 0; + mtx_unlock_spin(pp->pp_tdslock); + } + /* Remove owner-specific flags */ if (pm->pm_owner->po_owner == pp->pp_proc) { pp->pp_flags &= ~PMC_PP_ENABLE_MSR_ACCESS; @@ -1005,7 +1073,7 @@ pmc_can_attach(struct pmc *pm, struct proc *t) static int pmc_attach_one_process(struct proc *p, struct pmc *pm) { - int ri; + int ri, error; char *fullpath, *freepath; struct pmc_process *pp; @@ -1026,15 +1094,26 @@ pmc_attach_one_process(struct proc *p, struct pmc *pm) */ ri = PMC_TO_ROWINDEX(pm); - if ((pp = pmc_find_process_descriptor(p, PMC_FLAG_ALLOCATE)) == NULL) - return ENOMEM; + /* mark process as using HWPMCs */ + PROC_LOCK(p); + p->p_flag |= P_HWPMC; + PROC_UNLOCK(p); - if (pp->pp_pmcs[ri].pp_pmc == pm) /* already present at slot [ri] */ - return EEXIST; + if ((pp = pmc_find_process_descriptor(p, PMC_FLAG_ALLOCATE)) == NULL) { + error = ENOMEM; + goto fail; + } - if (pp->pp_pmcs[ri].pp_pmc != NULL) - return EBUSY; + if (pp->pp_pmcs[ri].pp_pmc == pm) {/* already present at slot [ri] */ + error = EEXIST; + goto fail; + } + if (pp->pp_pmcs[ri].pp_pmc != NULL) { + error = EBUSY; + goto fail; + } + pmc_link_target_process(pm, pp); if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)) && @@ -1056,12 +1135,13 @@ pmc_attach_one_process(struct proc *p, struct pmc *pm) if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) pmc_log_process_mappings(pm->pm_owner, p); } - /* mark process as using HWPMCs */ + + return (0); + fail: PROC_LOCK(p); - p->p_flag |= P_HWPMC; + p->p_flag &= ~P_HWPMC; PROC_UNLOCK(p); - - return 0; + return (error); } /* @@ -1173,7 +1253,7 @@ pmc_detach_one_process(struct proc *p, struct pmc *pm, pmc_remove_process_descriptor(pp); if (flags & PMC_FLAG_REMOVE) - free(pp, M_PMC); + pmc_destroy_process_descriptor(pp); PROC_LOCK(p); p->p_flag &= ~P_HWPMC; @@ -1250,10 +1330,11 @@ pmc_process_csw_in(struct thread *td) struct pmc_hw *phw; pmc_value_t newvalue; struct pmc_process *pp; + struct pmc_thread *pt; struct pmc_classdep *pcd; p = td->td_proc; - + pt = NULL; if ((pp = pmc_find_process_descriptor(p, PMC_FLAG_NONE)) == NULL) return; @@ -1312,23 +1393,54 @@ pmc_process_csw_in(struct thread *td) /* * Write out saved value and start the PMC. * - * Sampling PMCs use a per-process value, while + * Sampling PMCs use a per-thread value, while * counting mode PMCs use a per-pmc value that is * inherited across descendants. */ if (PMC_TO_MODE(pm) == PMC_MODE_TS) { + if (pt == NULL) + pt = pmc_find_thread_descriptor(pp, td, + PMC_FLAG_NONE); + + KASSERT(pt != NULL, + ("[pmc,%d] No thread found for td=%p", __LINE__, + td)); + mtx_pool_lock_spin(pmc_mtxpool, pm); /* - * Use the saved value calculated after the most recent - * thread switch out to start this counter. Reset - * the saved count in case another thread from this - * process switches in before any threads switch out. + * If we have a thread descriptor, use the per-thread + * counter in the descriptor. If not, we will use + * a per-process counter. + * + * TODO: Remove the per-process "safety net" once + * we have thoroughly tested that we don't hit the + * above assert. */ - newvalue = PMC_PCPU_SAVED(cpu,ri) = - pp->pp_pmcs[ri].pp_pmcval; - pp->pp_pmcs[ri].pp_pmcval = pm->pm_sc.pm_reloadcount; + if (pt != NULL) { + if (pt->pt_pmcs[ri].pt_pmcval > 0) + newvalue = pt->pt_pmcs[ri].pt_pmcval; + else + newvalue = pm->pm_sc.pm_reloadcount; + } else { + /* + * Use the saved value calculated after the most + * recent time a thread using the shared counter + * switched out. Reset the saved count in case + * another thread from this process switches in + * before any threads switch out. + */ + + newvalue = pp->pp_pmcs[ri].pp_pmcval; + pp->pp_pmcs[ri].pp_pmcval = + pm->pm_sc.pm_reloadcount; + } mtx_pool_unlock_spin(pmc_mtxpool, pm); + KASSERT(newvalue > 0 && newvalue <= + pm->pm_sc.pm_reloadcount, + ("[pmc,%d] pmcval outside of expected range cpu=%d " + "ri=%d pmcval=%jx pm_reloadcount=%jx", __LINE__, + cpu, ri, newvalue, pm->pm_sc.pm_reloadcount)); } else { KASSERT(PMC_TO_MODE(pm) == PMC_MODE_TC, ("[pmc,%d] illegal mode=%d", __LINE__, @@ -1381,6 +1493,7 @@ pmc_process_csw_out(struct thread *td) pmc_value_t newvalue; unsigned int adjri, ri; struct pmc_process *pp; + struct pmc_thread *pt = NULL; struct pmc_classdep *pcd; @@ -1476,37 +1589,50 @@ pmc_process_csw_out(struct thread *td) pcd->pcd_read_pmc(cpu, adjri, &newvalue); if (mode == PMC_MODE_TS) { - PMCDBG3(CSW,SWO,1,"cpu=%d ri=%d tmp=%jd (samp)", - cpu, ri, PMC_PCPU_SAVED(cpu,ri) - newvalue); + PMCDBG3(CSW,SWO,1,"cpu=%d ri=%d val=%jd (samp)", + cpu, ri, newvalue); + if (pt == NULL) + pt = pmc_find_thread_descriptor(pp, td, + PMC_FLAG_NONE); + + KASSERT(pt != NULL, + ("[pmc,%d] No thread found for td=%p", + __LINE__, td)); + + mtx_pool_lock_spin(pmc_mtxpool, pm); + /* - * For sampling process-virtual PMCs, - * newvalue is the number of events to be seen - * until the next sampling interrupt. - * We can just add the events left from this - * invocation to the counter, then adjust - * in case we overflow our range. + * If we have a thread descriptor, save the + * per-thread counter in the descriptor. If not, + * we will update the per-process counter. * - * (Recall that we reload the counter every - * time we use it.) + * TODO: Remove the per-process "safety net" + * once we have thoroughly tested that we + * don't hit the above assert. */ - mtx_pool_lock_spin(pmc_mtxpool, pm); - - pp->pp_pmcs[ri].pp_pmcval += newvalue; - if (pp->pp_pmcs[ri].pp_pmcval > - pm->pm_sc.pm_reloadcount) - pp->pp_pmcs[ri].pp_pmcval -= - pm->pm_sc.pm_reloadcount; - KASSERT(pp->pp_pmcs[ri].pp_pmcval > 0 && - pp->pp_pmcs[ri].pp_pmcval <= - pm->pm_sc.pm_reloadcount, - ("[pmc,%d] pp_pmcval outside of expected " - "range cpu=%d ri=%d pp_pmcval=%jx " - "pm_reloadcount=%jx", __LINE__, cpu, ri, - pp->pp_pmcs[ri].pp_pmcval, - pm->pm_sc.pm_reloadcount)); + if (pt != NULL) + pt->pt_pmcs[ri].pt_pmcval = newvalue; + else { + /* + * For sampling process-virtual PMCs, + * newvalue is the number of events to + * be seen until the next sampling + * interrupt. We can just add the events + * left from this invocation to the + * counter, then adjust in case we + * overflow our range. + * + * (Recall that we reload the counter + * every time we use it.) + */ + pp->pp_pmcs[ri].pp_pmcval += newvalue; + if (pp->pp_pmcs[ri].pp_pmcval > + pm->pm_sc.pm_reloadcount) + pp->pp_pmcs[ri].pp_pmcval -= + pm->pm_sc.pm_reloadcount; + } mtx_pool_unlock_spin(pmc_mtxpool, pm); - } else { tmp = newvalue - PMC_PCPU_SAVED(cpu,ri); @@ -1550,6 +1676,33 @@ pmc_process_csw_out(struct thread *td) } /* + * A new thread for a process. + */ +static void +pmc_process_thread_add(struct thread *td) +{ + struct pmc_process *pmc; + + pmc = pmc_find_process_descriptor(td->td_proc, PMC_FLAG_NONE); + if (pmc != NULL) + pmc_find_thread_descriptor(pmc, td, PMC_FLAG_ALLOCATE); +} + +/* + * A thread delete for a process. + */ +static void +pmc_process_thread_delete(struct thread *td) +{ + struct pmc_process *pmc; + + pmc = pmc_find_process_descriptor(td->td_proc, PMC_FLAG_NONE); + if (pmc != NULL) + pmc_thread_descriptor_pool_free(pmc_find_thread_descriptor(pmc, + td, PMC_FLAG_REMOVE)); +} + +/* * A mapping change for a process. */ @@ -1873,13 +2026,16 @@ const char *pmc_hooknames[] = { "MUNMAP", "CALLCHAIN-NMI", "CALLCHAIN-SOFT", - "SOFTSAMPLING" + "SOFTSAMPLING", + "THR-CREATE", + "THR-EXIT", }; #endif static int pmc_hook_handler(struct thread *td, int function, void *arg) { + int cpu; PMCDBG4(MOD,PMH,1, "hook td=%p func=%d \"%s\" arg=%p", td, function, pmc_hooknames[function], arg); @@ -1996,7 +2152,7 @@ pmc_hook_handler(struct thread *td, int function, void if (pp->pp_refcnt == 0) { pmc_remove_process_descriptor(pp); - free(pp, M_PMC); + pmc_destroy_process_descriptor(pp); break; } @@ -2034,8 +2190,9 @@ pmc_hook_handler(struct thread *td, int function, void * lose the interrupt sample. */ DPCPU_SET(pmc_sampled, 0); - pmc_process_samples(PCPU_GET(cpuid), PMC_HR); - pmc_process_samples(PCPU_GET(cpuid), PMC_SR); + cpu = PCPU_GET(cpuid); + pmc_process_samples(cpu, PMC_HR); + pmc_process_samples(cpu, PMC_SR); break; case PMC_FN_MMAP: @@ -2078,6 +2235,16 @@ pmc_hook_handler(struct thread *td, int function, void pmc_soft_intr((struct pmckern_soft *) arg); break; + case PMC_FN_THR_CREATE: + pmc_process_thread_add(td); + break; + + case PMC_FN_THR_EXIT: + KASSERT(td == curthread, ("[pmc,%d] td != curthread", + __LINE__)); + pmc_process_thread_delete(td); + break; + default: #ifdef HWPMC_DEBUG KASSERT(0, ("[pmc,%d] unknown hook %d\n", __LINE__, function)); @@ -2129,6 +2296,198 @@ pmc_destroy_owner_descriptor(struct pmc_owner *po) } /* + * Allocate a thread descriptor from the free pool. + * + * NOTE: This *can* return NULL. + */ +static struct pmc_thread * +pmc_thread_descriptor_pool_alloc(void) +{ + struct pmc_thread *pt; + + mtx_lock_spin(&pmc_threadfreelist_mtx); + if ((pt = LIST_FIRST(&pmc_threadfreelist)) != NULL) { + LIST_REMOVE(pt, pt_next); + pmc_threadfreelist_entries--; + } + mtx_unlock_spin(&pmc_threadfreelist_mtx); + + return (pt); +} + +/* + * Add a thread descriptor to the free pool. We use this instead of free() + * to maintain a cache of free entries. Additionally, we can safely call + * this function when we cannot call free(), such as in a critical section. + * + */ +static void +pmc_thread_descriptor_pool_free(struct pmc_thread *pt) +{ + + if (pt == NULL) + return; + + memset(pt, 0, THREADENTRY_SIZE); + mtx_lock_spin(&pmc_threadfreelist_mtx); + LIST_INSERT_HEAD(&pmc_threadfreelist, pt, pt_next); + pmc_threadfreelist_entries++; + if (pmc_threadfreelist_entries > pmc_threadfreelist_max) + GROUPTASK_ENQUEUE(&free_gtask); + mtx_unlock_spin(&pmc_threadfreelist_mtx); +} + +/* + * A callout to manage the free list. + */ +static void +pmc_thread_descriptor_pool_free_task(void *arg __unused) +{ + struct pmc_thread *pt; + LIST_HEAD(, pmc_thread) tmplist; + int delta; + + LIST_INIT(&tmplist); + /* Determine what changes, if any, we need to make. */ + mtx_lock_spin(&pmc_threadfreelist_mtx); + delta = pmc_threadfreelist_entries - pmc_threadfreelist_max; + while (delta > 0) { + pt = LIST_FIRST(&pmc_threadfreelist); + MPASS(pt); + LIST_REMOVE(pt, pt_next); + LIST_INSERT_HEAD(&tmplist, pt, pt_next); + } + mtx_unlock_spin(&pmc_threadfreelist_mtx); + + /* If there are entries to free, free them. */ + while (!LIST_EMPTY(&tmplist)) { + pt = LIST_FIRST(&pmc_threadfreelist); + LIST_REMOVE(pt, pt_next); + free(pt, M_PMC); + } +} + +/* + * Drain the thread free pool, freeing all allocations. + */ +static void +pmc_thread_descriptor_pool_drain() +{ + struct pmc_thread *pt, *next; + + LIST_FOREACH_SAFE(pt, &pmc_threadfreelist, pt_next, next) { + LIST_REMOVE(pt, pt_next); + free(pt, M_PMC); + } +} + +/* + * find the descriptor corresponding to thread 'td', adding or removing it + * as specified by 'mode'. + * + * Note that this supports additional mode flags in addition to those + * supported by pmc_find_process_descriptor(): + * PMC_FLAG_NOWAIT: Causes the function to not wait for mallocs. + * This makes it safe to call while holding certain other locks. + */ + +static struct pmc_thread * +pmc_find_thread_descriptor(struct pmc_process *pp, struct thread *td, + uint32_t mode) +{ + struct pmc_thread *pt = NULL, *ptnew = NULL; + int wait_flag; + + KASSERT(td != NULL, ("[pmc,%d] called to add NULL td", __LINE__)); + + /* + * Pre-allocate memory in the PMC_FLAG_ALLOCATE case prior to + * acquiring the lock. + */ + if (mode & PMC_FLAG_ALLOCATE) { + if ((ptnew = pmc_thread_descriptor_pool_alloc()) == NULL) { + wait_flag = (mode & PMC_FLAG_NOWAIT) ? M_NOWAIT : + M_WAITOK; + ptnew = malloc(THREADENTRY_SIZE, M_PMC, + wait_flag|M_ZERO); + } + } + + mtx_lock_spin(pp->pp_tdslock); + + LIST_FOREACH(pt, &pp->pp_tds, pt_next) + if (pt->pt_td == td) + break; + + if ((mode & PMC_FLAG_REMOVE) && pt != NULL) + LIST_REMOVE(pt, pt_next); + + if ((mode & PMC_FLAG_ALLOCATE) && pt == NULL && ptnew != NULL) { + pt = ptnew; + ptnew = NULL; + pt->pt_td = td; + LIST_INSERT_HEAD(&pp->pp_tds, pt, pt_next); + } + + mtx_unlock_spin(pp->pp_tdslock); + + if (ptnew != NULL) { + free(ptnew, M_PMC); + } + + return pt; +} + +/* + * Try to add thread descriptors for each thread in a process. + */ + +static void +pmc_add_thread_descriptors_from_proc(struct proc *p, struct pmc_process *pp) +{ + struct thread *curtd; + struct pmc_thread **tdlist; + int i, tdcnt, tdlistsz; + + KASSERT(!PROC_LOCKED(p), ("[pmc,%d] proc unexpectedly locked", + __LINE__)); + tdcnt = 32; + restart: + tdlistsz = roundup2(tdcnt, 32); + + tdcnt = 0; + tdlist = malloc(sizeof(struct pmc_thread*) * tdlistsz, M_TEMP, M_WAITOK); + + PROC_LOCK(p); + FOREACH_THREAD_IN_PROC(p, curtd) + tdcnt++; + if (tdcnt >= tdlistsz) { + PROC_UNLOCK(p); + free(tdlist, M_TEMP); + goto restart; + } + /* + * Try to add each thread to the list without sleeping. If unable, + * add to a queue to retry after dropping the process lock. + */ + tdcnt = 0; + FOREACH_THREAD_IN_PROC(p, curtd) { + tdlist[tdcnt] = pmc_find_thread_descriptor(pp, curtd, + PMC_FLAG_ALLOCATE|PMC_FLAG_NOWAIT); + if (tdlist[tdcnt] == NULL) { + PROC_UNLOCK(p); + for (i = 0; i <= tdcnt; i++) + pmc_thread_descriptor_pool_free(tdlist[i]); + free(tdlist, M_TEMP); + goto restart; + } + tdcnt++; + } + PROC_UNLOCK(p); + free(tdlist, M_TEMP); +} + +/* * find the descriptor corresponding to process 'p', adding or removing it * as specified by 'mode'. */ @@ -2146,7 +2505,7 @@ pmc_find_process_descriptor(struct proc *p, uint32_t m ppnew = NULL; /* - * Pre-allocate memory in the FIND_ALLOCATE case since we + * Pre-allocate memory in the PMC_FLAG_ALLOCATE case since we * cannot call malloc(9) once we hold a spin lock. */ if (mode & PMC_FLAG_ALLOCATE) @@ -2164,13 +2523,20 @@ pmc_find_process_descriptor(struct proc *p, uint32_t m if ((mode & PMC_FLAG_ALLOCATE) && pp == NULL && ppnew != NULL) { ppnew->pp_proc = p; + LIST_INIT(&ppnew->pp_tds); + ppnew->pp_tdslock = mtx_pool_find(pmc_mtxpool, ppnew); LIST_INSERT_HEAD(pph, ppnew, pp_next); + mtx_unlock_spin(&pmc_processhash_mtx); pp = ppnew; ppnew = NULL; + + /* Add thread descriptors for this process' current threads. */ + pmc_add_thread_descriptors_from_proc(p, pp); } - mtx_unlock_spin(&pmc_processhash_mtx); + else + mtx_unlock_spin(&pmc_processhash_mtx); - if (pp != NULL && ppnew != NULL) + if (ppnew != NULL) free(ppnew, M_PMC); return pp; @@ -2192,7 +2558,23 @@ pmc_remove_process_descriptor(struct pmc_process *pp) mtx_unlock_spin(&pmc_processhash_mtx); } +/* + * destroy a process descriptor. + */ +static void +pmc_destroy_process_descriptor(struct pmc_process *pp) +{ + struct pmc_thread *pmc_td; + + while ((pmc_td = LIST_FIRST(&pp->pp_tds)) != NULL) { + LIST_REMOVE(pmc_td, pt_next); + pmc_thread_descriptor_pool_free(pmc_td); + } + free(pp, M_PMC); +} + + /* * find an owner descriptor corresponding to proc 'p' */ @@ -2420,7 +2802,7 @@ pmc_release_pmc_descriptor(struct pmc *pm) if (pp->pp_refcnt == 0) { pmc_remove_process_descriptor(pp); - free(pp, M_PMC); + pmc_destroy_process_descriptor(pp); } } @@ -4582,15 +4964,21 @@ pmc_process_exit(void *arg __unused, struct proc *p) pm->pm_pcpu_state[cpu].pps_cpustate = 0; if (!pm->pm_pcpu_state[cpu].pps_stalled) { (void) pcd->pcd_stop_pmc(cpu, adjri); - pcd->pcd_read_pmc(cpu, adjri, - &newvalue); - tmp = newvalue - - PMC_PCPU_SAVED(cpu,ri); - mtx_pool_lock_spin(pmc_mtxpool, pm); - pm->pm_gv.pm_savedvalue += tmp; - pp->pp_pmcs[ri].pp_pmcval += tmp; - mtx_pool_unlock_spin(pmc_mtxpool, pm); + if (PMC_TO_MODE(pm) == PMC_MODE_TC) { + pcd->pcd_read_pmc(cpu, adjri, + &newvalue); + tmp = newvalue - + PMC_PCPU_SAVED(cpu,ri); + + mtx_pool_lock_spin(pmc_mtxpool, + pm); + pm->pm_gv.pm_savedvalue += tmp; + pp->pp_pmcs[ri].pp_pmcval += + tmp; + mtx_pool_unlock_spin( + pmc_mtxpool, pm); + } } } @@ -4700,6 +5088,13 @@ pmc_process_fork(void *arg __unused, struct proc *p1, if (do_descendants == 0) /* nothing to do */ goto done; + /* + * Now mark the new process as being tracked by this driver. + */ + PROC_LOCK(newproc); + newproc->p_flag |= P_HWPMC; + PROC_UNLOCK(newproc); + /* allocate a descriptor for the new process */ if ((ppnew = pmc_find_process_descriptor(newproc, PMC_FLAG_ALLOCATE)) == NULL) @@ -4724,13 +5119,6 @@ pmc_process_fork(void *arg __unused, struct proc *p1, newproc->p_pid); } - /* - * Now mark the new process as being tracked by this driver. - */ - PROC_LOCK(newproc); - newproc->p_flag |= P_HWPMC; - PROC_UNLOCK(newproc); - done: sx_xunlock(&pmc_sx); } @@ -5055,6 +5443,16 @@ pmc_initialize(void) "targethash=%p mask=0x%lx", pmc_ownerhash, pmc_ownerhashmask, pmc_processhash, pmc_processhashmask); + /* Initialize a spin mutex for the thread free list. */ + mtx_init(&pmc_threadfreelist_mtx, "pmc-threadfreelist", "pmc-leaf", + MTX_SPIN); + + /* + * Initialize the callout to monitor the thread free list. + * This callout will also handle the initial population of the list. + */ + taskqgroup_config_gtask_init(NULL, &free_gtask, pmc_thread_descriptor_pool_free_task, "thread descriptor pool free task"); + /* register process {exit,fork,exec} handlers */ pmc_exit_tag = EVENTHANDLER_REGISTER(process_exit, pmc_process_exit, NULL, EVENTHANDLER_PRI_ANY); @@ -5152,6 +5550,9 @@ pmc_cleanup(void) } /* reclaim allocated data structures */ + mtx_destroy(&pmc_threadfreelist_mtx); + pmc_thread_descriptor_pool_drain(); + if (pmc_mtxpool) mtx_pool_destroy(&pmc_mtxpool); Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Wed May 16 22:25:47 2018 (r333689) +++ head/sys/kern/kern_thr.c Wed May 16 22:29:20 2018 (r333690) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_posix.h" +#include "opt_hwpmc_hooks.h" #include #include #include @@ -55,6 +56,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include @@ -258,6 +262,10 @@ thread_create(struct thread *td, struct rtprio *rtp, newtd->td_dbgflags |= TDB_BORN; PROC_UNLOCK(p); +#ifdef HWPMC_HOOKS + if (PMC_PROC_IS_USING_PMCS(p)) + PMC_CALL_HOOK(newtd, PMC_FN_THR_CREATE, NULL); +#endif tidhash_add(newtd); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Wed May 16 22:25:47 2018 (r333689) +++ head/sys/kern/kern_thread.c Wed May 16 22:29:20 2018 (r333690) @@ -586,8 +586,10 @@ thread_exit(void) * If this thread is part of a process that is being tracked by hwpmc(4), * inform the module of the thread's impending exit. */ - if (PMC_PROC_IS_USING_PMCS(td->td_proc)) + if (PMC_PROC_IS_USING_PMCS(td->td_proc)) { PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); + PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_THR_EXIT, NULL); + } #endif PROC_UNLOCK(p); PROC_STATLOCK(p); Modified: head/sys/sys/pmc.h ============================================================================== --- head/sys/sys/pmc.h Wed May 16 22:25:47 2018 (r333689) +++ head/sys/sys/pmc.h Wed May 16 22:29:20 2018 (r333690) @@ -647,6 +647,7 @@ struct pmc_op_getdyneventinfo { #define PMC_NLOGBUFFERS_PCPU 8 #define PMC_NSAMPLES 64 #define PMC_CALLCHAIN_DEPTH 32 +#define PMC_THREADLIST_MAX 64 #define PMC_SYSCTL_NAME_PREFIX "kern." PMC_MODULE_NAME "." @@ -786,8 +787,27 @@ struct pmc { #define PMC_TO_ROWINDEX(P) PMC_ID_TO_ROWINDEX((P)->pm_id) #define PMC_TO_CPU(P) PMC_ID_TO_CPU((P)->pm_id) +/* + * struct pmc_threadpmcstate + * + * Record per-PMC, per-thread state. + */ +struct pmc_threadpmcstate { + pmc_value_t pt_pmcval; /* per-thread reload count */ +}; /* + * struct pmc_thread + * + * Record a 'target' thread being profiled. + */ +struct pmc_thread { + LIST_ENTRY(pmc_thread) pt_next; /* linked list */ + struct thread *pt_td; /* target thread */ + struct pmc_threadpmcstate pt_pmcs[]; /* per-PMC state */ +}; + +/* * struct pmc_process * * Record a 'target' process being profiled. @@ -808,9 +828,11 @@ struct pmc_targetstate { struct pmc_process { LIST_ENTRY(pmc_process) pp_next; /* hash chain */ + LIST_HEAD(,pmc_thread) pp_tds; /* list of threads */ + struct mtx *pp_tdslock; /* lock on pp_tds thread list */ int pp_refcnt; /* reference count */ uint32_t pp_flags; /* flags PMC_PP_* */ - struct proc *pp_proc; /* target thread */ + struct proc *pp_proc; /* target process */ struct pmc_targetstate pp_pmcs[]; /* NHWPMCs */ }; Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Wed May 16 22:25:47 2018 (r333689) +++ head/sys/sys/pmckern.h Wed May 16 22:29:20 2018 (r333690) @@ -60,6 +60,8 @@ #define PMC_FN_USER_CALLCHAIN 9 #define PMC_FN_USER_CALLCHAIN_SOFT 10 #define PMC_FN_SOFT_SAMPLING 11 +#define PMC_FN_THR_CREATE 12 +#define PMC_FN_THR_EXIT 13 #define PMC_HR 0 /* Hardware ring buffer */ #define PMC_SR 1 /* Software ring buffer */ From owner-svn-src-all@freebsd.org Wed May 16 23:30:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F072EDCDA1; Wed, 16 May 2018 23:30:04 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0818248A; Wed, 16 May 2018 23:30:04 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27CAF20DB6; Wed, 16 May 2018 23:30:04 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GNU3bF001920; Wed, 16 May 2018 23:30:03 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GNU3RI001919; Wed, 16 May 2018 23:30:03 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201805162330.w4GNU3RI001919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 16 May 2018 23:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333693 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 333693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 23:30:04 -0000 Author: mckusick Date: Wed May 16 23:30:03 2018 New Revision: 333693 URL: https://svnweb.freebsd.org/changeset/base/333693 Log: Revert change made in base r171522 (https://svnweb.freebsd.org/base?view=revision&revision=304232) converting clrbuf() (which clears the entire buffer) to vfs_bio_clrbuf() (which clears only the new pages that have been added to the buffer). Failure to properly remove pages from the buffer cache can make pages that appear not to need clearing to actually have bad random data in them. See for example base r304232 (https://svnweb.freebsd.org/base?view=revision&revision=304232) which noted the need to set B_INVAL and B_NOCACHE as well as clear the B_CACHE flag before calling brelse() to release the buffer. Rather than trying to find all the incomplete brelse() calls, it is simpler, though more slightly expensive, to simply clear the entire buffer when it is newly allocated. PR: 213507 Submitted by: Damjan Jovanovic Reviewed by: kib Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Wed May 16 23:10:19 2018 (r333692) +++ head/sys/fs/msdosfs/msdosfs_fat.c Wed May 16 23:30:03 2018 (r333693) @@ -1082,7 +1082,7 @@ extendfile(struct denode *dep, u_long count, struct bu else bp->b_blkno = blkno; } - vfs_bio_clrbuf(bp); + clrbuf(bp); if (bpp) { *bpp = bp; bpp = NULL; From owner-svn-src-all@freebsd.org Wed May 16 23:42:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E071EDD8E0; Wed, 16 May 2018 23:42:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FB2E82FBD; Wed, 16 May 2018 23:42:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30E4B210B6; Wed, 16 May 2018 23:42:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4GNg3Ow009700; Wed, 16 May 2018 23:42:03 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4GNg3Ud009699; Wed, 16 May 2018 23:42:03 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201805162342.w4GNg3Ud009699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 16 May 2018 23:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333694 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 333694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 23:42:03 -0000 Author: mckusick Date: Wed May 16 23:42:02 2018 New Revision: 333694 URL: https://svnweb.freebsd.org/changeset/base/333694 Log: Fix warning found by Coverity. CID 1009353: Error handling issues (CHECKED_RETURN) Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed May 16 23:30:03 2018 (r333693) +++ head/sys/ufs/ffs/ffs_softdep.c Wed May 16 23:42:02 2018 (r333694) @@ -6293,7 +6293,9 @@ setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno) * live on this newblk. */ if ((indirdep->ir_state & DEPCOMPLETE) == 0) { - newblk_lookup(mp, dbtofsb(ump->um_fs, bp->b_blkno), 0, &newblk); + if (newblk_lookup(mp, dbtofsb(ump->um_fs, bp->b_blkno), 0, + &newblk) == 0) + panic("setup_trunc_indir: lost block"); LIST_FOREACH(indirn, &newblk->nb_indirdeps, ir_next) trunc_indirdep(indirn, freeblks, bp, off); } else From owner-svn-src-all@freebsd.org Thu May 17 00:45:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D398EE1ACF; Thu, 17 May 2018 00:45:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C95186CF5; Thu, 17 May 2018 00:45:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0733221A96; Thu, 17 May 2018 00:45:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H0jZJp044723; Thu, 17 May 2018 00:45:35 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H0jZSW044721; Thu, 17 May 2018 00:45:35 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805170045.w4H0jZSW044721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 00:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333695 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 00:45:36 -0000 Author: mmacy Date: Thu May 17 00:45:35 2018 New Revision: 333695 URL: https://svnweb.freebsd.org/changeset/base/333695 Log: epoch(9): Guarantee forward progress on busy sections Add epoch section to struct thread. We can use this to ennable epoch counter to advance even if a section is perpetually occupied by a thread. Approved by: sbruno Modified: head/sys/kern/subr_epoch.c head/sys/sys/proc.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Wed May 16 23:42:02 2018 (r333694) +++ head/sys/kern/subr_epoch.c Thu May 17 00:45:35 2018 (r333695) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); /* arbitrary --- needs benchmarking */ -#define MAX_ADAPTIVE_SPIN 5000 +#define MAX_ADAPTIVE_SPIN 1000 #define EPOCH_EXITING 0x1 #ifdef __amd64__ @@ -63,6 +63,7 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re #define EPOCH_ALIGN CACHE_LINE_SIZE #endif +CTASSERT(sizeof(epoch_section_t) == sizeof(ck_epoch_section_t)); SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW, 0, "epoch information"); SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW, 0, "epoch stats"); @@ -308,8 +309,12 @@ epoch_enter(epoch_t epoch) KASSERT(found, ("recursing on a second epoch")); } #endif + if (td->td_epochnest > 1) { + critical_exit(); + return; + } sched_pin(); - ck_epoch_begin(&eps->eps_record.er_record, NULL); + ck_epoch_begin(&eps->eps_record.er_record, (ck_epoch_section_t*)&td->td_epoch_section); critical_exit(); } @@ -324,11 +329,15 @@ epoch_exit(epoch_t epoch) MPASS(td->td_epochnest); critical_enter(); eps = epoch->e_pcpu[curcpu]; - sched_unpin(); - ck_epoch_end(&eps->eps_record.er_record, NULL); td->td_epochnest--; if (td->td_epochnest == 0) TAILQ_REMOVE(&eps->eps_record.er_tdlist, td, td_epochq); + else { + critical_exit(); + return; + } + sched_unpin(); + ck_epoch_end(&eps->eps_record.er_record, (ck_epoch_section_t*)&td->td_epoch_section); eps->eps_record.er_gen++; critical_exit(); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed May 16 23:42:02 2018 (r333694) +++ head/sys/sys/proc.h Thu May 17 00:45:35 2018 (r333695) @@ -76,6 +76,18 @@ /* + * A section object may be passed to every begin-end pair to allow for + * forward progress guarantees with-in prolonged active sections. + * + * We can't include ck_epoch.h so we define our own variant here and + * then CTASSERT that it's the same size in subr_epoch.c + */ +struct epoch_section { + unsigned int bucket; +}; +typedef struct epoch_section epoch_section_t; + +/* * One structure allocated per session. * * List of locks @@ -352,6 +364,7 @@ struct thread { struct proc *td_rfppwait_p; /* (k) The vforked child */ struct vm_page **td_ma; /* (k) uio pages held */ int td_ma_cnt; /* (k) size of *td_ma */ + epoch_section_t td_epoch_section; /* (t) epoch section object */ void *td_emuldata; /* Emulator state data */ int td_lastcpu; /* (t) Last cpu we were on. */ int td_oncpu; /* (t) Which cpu we are on. */ From owner-svn-src-all@freebsd.org Thu May 17 00:52:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1610FEE21A3; Thu, 17 May 2018 00:52:49 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD868872AC; Thu, 17 May 2018 00:52:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EB1921C2B; Thu, 17 May 2018 00:52:48 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H0qmY6049582; Thu, 17 May 2018 00:52:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H0qmtq049581; Thu, 17 May 2018 00:52:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805170052.w4H0qmtq049581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 17 May 2018 00:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333696 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 333696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 00:52:49 -0000 Author: np Date: Thu May 17 00:52:48 2018 New Revision: 333696 URL: https://svnweb.freebsd.org/changeset/base/333696 Log: cxgbe(4): Add NIC_ETHOFLD to the NIC capabilities allowed by the driver by default. This is the first of a series of commits that will add support for RATELIMIT kernel option to the base if_cxgbe driver, for use with ordinary NIC traffic "flows". RATELIMIT is already supported by t4_tom for the fully-offloaded TCP connections that it handles. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 17 00:45:35 2018 (r333695) +++ head/sys/dev/cxgbe/t4_main.c Thu May 17 00:52:48 2018 (r333696) @@ -438,7 +438,7 @@ static int t4_switchcaps_allowed = FW_CAPS_CONFIG_SWIT TUNABLE_INT("hw.cxgbe.switchcaps_allowed", &t4_switchcaps_allowed); static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC | - FW_CAPS_CONFIG_NIC_HASHFILTER; + FW_CAPS_CONFIG_NIC_HASHFILTER | FW_CAPS_CONFIG_NIC_ETHOFLD; TUNABLE_INT("hw.cxgbe.niccaps_allowed", &t4_niccaps_allowed); static int t4_toecaps_allowed = -1; From owner-svn-src-all@freebsd.org Thu May 17 01:13:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E1FFEE3668; Thu, 17 May 2018 01:13:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5AF9880B4; Thu, 17 May 2018 01:13:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD3021F83; Thu, 17 May 2018 01:13:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H1DfkL060140; Thu, 17 May 2018 01:13:41 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H1Df6x060138; Thu, 17 May 2018 01:13:41 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805170113.w4H1Df6x060138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 01:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333697 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 01:13:42 -0000 Author: mmacy Date: Thu May 17 01:13:40 2018 New Revision: 333697 URL: https://svnweb.freebsd.org/changeset/base/333697 Log: epoch(9): make recursion lighter weight There isn't any real work to do except bump td_epochnest when recursing. Skip the additional work in this case. Approved by: sbruno Modified: head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 00:52:48 2018 (r333696) +++ head/sys/kern/subr_epoch.c Thu May 17 01:13:40 2018 (r333697) @@ -284,21 +284,15 @@ epoch_free(epoch_t epoch) } while (0) void -epoch_enter(epoch_t epoch) +epoch_enter_internal(epoch_t epoch, struct thread *td) { struct epoch_pcpu_state *eps; - struct thread *td; INIT_CHECK(epoch); - - td = curthread; critical_enter(); eps = epoch->e_pcpu[curcpu]; - td->td_epochnest++; - MPASS(td->td_epochnest < UCHAR_MAX - 2); - if (td->td_epochnest == 1) - TAILQ_INSERT_TAIL(&eps->eps_record.er_tdlist, td, td_epochq); #ifdef INVARIANTS + MPASS(td->td_epochnest < UCHAR_MAX - 2); if (td->td_epochnest > 1) { struct thread *curtd; int found = 0; @@ -307,38 +301,31 @@ epoch_enter(epoch_t epoch) if (curtd == td) found = 1; KASSERT(found, ("recursing on a second epoch")); - } -#endif - if (td->td_epochnest > 1) { critical_exit(); return; } +#endif + TAILQ_INSERT_TAIL(&eps->eps_record.er_tdlist, td, td_epochq); sched_pin(); ck_epoch_begin(&eps->eps_record.er_record, (ck_epoch_section_t*)&td->td_epoch_section); critical_exit(); } void -epoch_exit(epoch_t epoch) +epoch_exit_internal(epoch_t epoch, struct thread *td) { struct epoch_pcpu_state *eps; - struct thread *td; td = curthread; + MPASS(td->td_epochnest == 0); INIT_CHECK(epoch); - MPASS(td->td_epochnest); critical_enter(); eps = epoch->e_pcpu[curcpu]; - td->td_epochnest--; - if (td->td_epochnest == 0) - TAILQ_REMOVE(&eps->eps_record.er_tdlist, td, td_epochq); - else { - critical_exit(); - return; - } - sched_unpin(); + ck_epoch_end(&eps->eps_record.er_record, (ck_epoch_section_t*)&td->td_epoch_section); + TAILQ_REMOVE(&eps->eps_record.er_tdlist, td, td_epochq); eps->eps_record.er_gen++; + sched_unpin(); critical_exit(); } Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Thu May 17 00:52:48 2018 (r333696) +++ head/sys/sys/epoch.h Thu May 17 01:13:40 2018 (r333697) @@ -29,6 +29,8 @@ #ifndef _SYS_EPOCH_H_ #define _SYS_EPOCH_H_ +#include +#include struct epoch; typedef struct epoch *epoch_t; @@ -43,10 +45,35 @@ typedef struct epoch_context *epoch_context_t; epoch_t epoch_alloc(void); void epoch_free(epoch_t epoch); -void epoch_enter(epoch_t epoch); -void epoch_exit(epoch_t epoch); +void epoch_enter_internal(epoch_t epoch, struct thread *td); +void epoch_exit_internal(epoch_t epoch, struct thread *td); void epoch_wait(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(void); + +static __inline void +epoch_enter(epoch_t epoch) +{ + struct thread *td; + int nesting; + + td = curthread; + nesting = td->td_epochnest++; +#ifndef INVARIANTS + if (nesting == 0) +#endif + epoch_enter_internal(epoch, td); +} + +static __inline void +epoch_exit(epoch_t epoch) +{ + struct thread *td; + + td = curthread; + MPASS(td->td_epochnest); + if (td->td_epochnest-- == 1) + epoch_exit_internal(epoch, td); +} #endif From owner-svn-src-all@freebsd.org Thu May 17 01:42:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3A3FEE62BF; Thu, 17 May 2018 01:42:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5610789AFE; Thu, 17 May 2018 01:42:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3745022559; Thu, 17 May 2018 01:42:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H1gJUT075127; Thu, 17 May 2018 01:42:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H1gI93075124; Thu, 17 May 2018 01:42:18 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805170142.w4H1gI93075124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 17 May 2018 01:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333698 - in head/sys: dev/cxgbe modules/cxgbe/if_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys: dev/cxgbe modules/cxgbe/if_cxgbe X-SVN-Commit-Revision: 333698 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 01:42:19 -0000 Author: np Date: Thu May 17 01:42:18 2018 New Revision: 333698 URL: https://svnweb.freebsd.org/changeset/base/333698 Log: cxgbe(4): Allocate offload Tx queues when a card has resources provisioned for NIC_ETHOFLD and the kernel has option RATELIMIT. It is possible to use the chip's offload queues for normal NIC Tx and not just TOE Tx. The difference is that these queues support out of order processing of work requests and have a per-"flowid" mechanism for tracking credits between the driver and hardware. This allows Tx for any number of flows bound to different rate limits to be submitted to a single Tx queue and the work requests for slow flows won't cause HOL blocking for the rest. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/modules/cxgbe/if_cxgbe/Makefile Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 17 01:13:40 2018 (r333697) +++ head/sys/dev/cxgbe/t4_main.c Thu May 17 01:42:18 2018 (r333698) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ratelimit.h" #include "opt_rss.h" #include @@ -269,7 +270,7 @@ TUNABLE_INT("hw.cxgbe.nrxq_vi", &t4_nrxq_vi); static int t4_rsrv_noflowq = 0; TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) #define NOFLDTXQ 8 static int t4_nofldtxq = -NOFLDTXQ; TUNABLE_INT("hw.cxgbe.nofldtxq", &t4_nofldtxq); @@ -499,7 +500,7 @@ struct intrs_and_queues { uint16_t nirq; /* Total # of vectors */ uint16_t ntxq; /* # of NIC txq's for each port */ uint16_t nrxq; /* # of NIC rxq's for each port */ - uint16_t nofldtxq; /* # of TOE txq's for each port */ + uint16_t nofldtxq; /* # of TOE/ETHOFLD txq's for each port */ uint16_t nofldrxq; /* # of TOE rxq's for each port */ /* The vcxgbe/vcxl interfaces use these and not the ones above. */ @@ -834,8 +835,11 @@ t4_attach(device_t dev) struct intrs_and_queues iaq; struct sge *s; uint32_t *buf; +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + int ofld_tqidx; +#endif #ifdef TCP_OFFLOAD - int ofld_rqidx, ofld_tqidx; + int ofld_rqidx; #endif #ifdef DEV_NETMAP int nm_rqidx, nm_tqidx; @@ -1048,21 +1052,26 @@ t4_attach(device_t dev) s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ s->neq += nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + if (is_offload(sc) || is_ethoffload(sc)) { + s->nofldtxq = nports * iaq.nofldtxq; + if (num_vis > 1) + s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; + s->neq += s->nofldtxq + s->nofldrxq; + s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_wrq), + M_CXGBE, M_ZERO | M_WAITOK); + } +#endif #ifdef TCP_OFFLOAD if (is_offload(sc)) { s->nofldrxq = nports * iaq.nofldrxq; - s->nofldtxq = nports * iaq.nofldtxq; if (num_vis > 1) { s->nofldrxq += nports * (num_vis - 1) * iaq.nofldrxq_vi; - s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; } - s->neq += s->nofldtxq + s->nofldrxq; s->niq += s->nofldrxq; s->ofld_rxq = malloc(s->nofldrxq * sizeof(struct sge_ofld_rxq), M_CXGBE, M_ZERO | M_WAITOK); - s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_wrq), - M_CXGBE, M_ZERO | M_WAITOK); } #endif #ifdef DEV_NETMAP @@ -1101,8 +1110,11 @@ t4_attach(device_t dev) * tx queues that each port should get. */ rqidx = tqidx = 0; +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + ofld_tqidx = 0; +#endif #ifdef TCP_OFFLOAD - ofld_rqidx = ofld_tqidx = 0; + ofld_rqidx = 0; #endif #ifdef DEV_NETMAP nm_rqidx = nm_tqidx = 0; @@ -1135,16 +1147,18 @@ t4_attach(device_t dev) else vi->rsrv_noflowq = 0; +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + vi->first_ofld_txq = ofld_tqidx; + vi->nofldtxq = j == 0 ? iaq.nofldtxq : iaq.nofldtxq_vi; + ofld_tqidx += vi->nofldtxq; +#endif #ifdef TCP_OFFLOAD vi->ofld_tmr_idx = t4_tmr_idx_ofld; vi->ofld_pktc_idx = t4_pktc_idx_ofld; vi->first_ofld_rxq = ofld_rqidx; - vi->first_ofld_txq = ofld_tqidx; vi->nofldrxq = j == 0 ? iaq.nofldrxq : iaq.nofldrxq_vi; - vi->nofldtxq = j == 0 ? iaq.nofldtxq : iaq.nofldtxq_vi; ofld_rqidx += vi->nofldrxq; - ofld_tqidx += vi->nofldtxq; #endif #ifdef DEV_NETMAP if (j > 0) { @@ -1361,9 +1375,11 @@ t4_detach_common(device_t dev) if (sc->l2t) t4_free_l2t(sc->l2t); +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + free(sc->sge.ofld_txq, M_CXGBE); +#endif #ifdef TCP_OFFLOAD free(sc->sge.ofld_rxq, M_CXGBE); - free(sc->sge.ofld_txq, M_CXGBE); #endif #ifdef DEV_NETMAP free(sc->sge.nm_rxq, M_CXGBE); @@ -2793,10 +2809,14 @@ calculate_iaq(struct adapter *sc, struct intrs_and_que iaq->ntxq_vi = t4_ntxq_vi; iaq->nrxq = t4_nrxq; iaq->nrxq_vi = t4_nrxq_vi; -#ifdef TCP_OFFLOAD - if (is_offload(sc)) { +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) + if (is_offload(sc) || is_ethoffload(sc)) { iaq->nofldtxq = t4_nofldtxq; iaq->nofldtxq_vi = t4_nofldtxq_vi; + } +#endif +#ifdef TCP_OFFLOAD + if (is_offload(sc)) { iaq->nofldrxq = t4_nofldrxq; iaq->nofldrxq_vi = t4_nofldrxq_vi; } @@ -9657,9 +9677,11 @@ tweak_tunables(void) calculate_nqueues(&t4_nrxq_vi, nc, NRXQ_VI); -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) calculate_nqueues(&t4_nofldtxq, nc, NOFLDTXQ); calculate_nqueues(&t4_nofldtxq_vi, nc, NOFLDTXQ_VI); +#endif +#ifdef TCP_OFFLOAD calculate_nqueues(&t4_nofldrxq, nc, NOFLDRXQ); calculate_nqueues(&t4_nofldrxq_vi, nc, NOFLDRXQ_VI); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Thu May 17 01:13:40 2018 (r333697) +++ head/sys/dev/cxgbe/t4_sge.c Thu May 17 01:42:18 2018 (r333698) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ratelimit.h" #include #include @@ -224,7 +225,7 @@ static int free_nm_txq(struct vi_info *, struct sge_nm #endif static int ctrl_eq_alloc(struct adapter *, struct sge_eq *); static int eth_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *); -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) static int ofld_eq_alloc(struct adapter *, struct vi_info *, struct sge_eq *); #endif static int alloc_eq(struct adapter *, struct vi_info *, struct sge_eq *); @@ -1045,6 +1046,8 @@ t4_setup_vi_queues(struct vi_info *vi) struct sge_wrq *ctrlq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) struct sge_wrq *ofld_txq; #endif #ifdef DEV_NETMAP @@ -1160,17 +1163,23 @@ t4_setup_vi_queues(struct vi_info *vi) if (rc != 0) goto done; } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_txq", - CTLFLAG_RD, NULL, "tx queues for offloaded TCP connections"); + CTLFLAG_RD, NULL, "tx queues for TOE/ETHOFLD"); for_each_ofld_txq(vi, i, ofld_txq) { struct sysctl_oid *oid2; - iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq); snprintf(name, sizeof(name), "%s ofld_txq%d", device_get_nameunit(vi->dev), i); +#ifdef TCP_OFFLOAD + iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq); init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, sc->sge.ofld_rxq[iqidx].iq.cntxt_id, name); +#else + iqidx = vi->first_rxq + (i % vi->nrxq); + init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, + sc->sge.rxq[iqidx].iq.cntxt_id, name); +#endif snprintf(name, sizeof(name), "%d", i); oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -1215,6 +1224,8 @@ t4_teardown_vi_queues(struct vi_info *vi) struct sge_txq *txq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; +#endif +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) struct sge_wrq *ofld_txq; #endif #ifdef DEV_NETMAP @@ -1251,7 +1262,7 @@ t4_teardown_vi_queues(struct vi_info *vi) for_each_txq(vi, i, txq) { free_txq(vi, txq); } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) for_each_ofld_txq(vi, i, ofld_txq) { free_wrq(sc, ofld_txq); } @@ -3388,7 +3399,7 @@ eth_eq_alloc(struct adapter *sc, struct vi_info *vi, s return (rc); } -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) static int ofld_eq_alloc(struct adapter *sc, struct vi_info *vi, struct sge_eq *eq) { @@ -3460,7 +3471,7 @@ alloc_eq(struct adapter *sc, struct vi_info *vi, struc rc = eth_eq_alloc(sc, vi, eq); break; -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) case EQ_OFLD: rc = ofld_eq_alloc(sc, vi, eq); break; @@ -3515,7 +3526,7 @@ free_eq(struct adapter *sc, struct sge_eq *eq) eq->cntxt_id); break; -#ifdef TCP_OFFLOAD +#if defined(TCP_OFFLOAD) || defined(RATELIMIT) case EQ_OFLD: rc = -t4_ofld_eq_free(sc, sc->mbox, sc->pf, 0, eq->cntxt_id); Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile ============================================================================== --- head/sys/modules/cxgbe/if_cxgbe/Makefile Thu May 17 01:13:40 2018 (r333697) +++ head/sys/modules/cxgbe/if_cxgbe/Makefile Thu May 17 01:42:18 2018 (r333698) @@ -12,6 +12,7 @@ SRCS+= opt_ddb.h SRCS+= opt_inet.h SRCS+= opt_inet6.h SRCS+= opt_ofed.h +SRCS+= opt_ratelimit.h SRCS+= opt_rss.h SRCS+= pci_if.h pci_iov_if.h SRCS+= t4_filter.c From owner-svn-src-all@freebsd.org Thu May 17 02:19:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9EF1EE9B48; Thu, 17 May 2018 02:19:46 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (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 4E6128B6B8; Thu, 17 May 2018 02:19:46 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f47.google.com with SMTP id a8-v6so5621763wmg.5; Wed, 16 May 2018 19:19:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EPy8OOrUt9H0/cuB7eX6tFgA4jDFBWphkdi6s8tjts0=; b=QTNpBZTF5rurom1UZq7Nbt7cgXCs9yZr7A/TKWPPsFR0XEJKgLCbE7ITPB+rTztaK5 0g9bVN+gEBkZftBY/EgdOHJmEBnl8tgz9SZsSDysOWt1Cnb7EBMJ0Laghvr4b+4scBWN smFrKgxQSZiyKx7KP5Tj1l1RqWggQuAYHee97DhJjMjVPDbzjNo4BKYLuQ8x94wzOxzi b8rYt8CzO0BEjLcIUzPpnaYsvisME9G6Xpza6cwkcyAg3H/m1th0vexceGgZVeHyuq4z sUHpIsaqsod5GQNafJd2nY9HjLE7fzaG7LcpP2Ex+QK4I3//UvGtHNRPZ94zFnTXGD81 gDTA== X-Gm-Message-State: ALKqPwfUdbOJEoBlw5zUZOPBkpMnQvCkAbwnJzNZ8spGTmg5BqkatkH1 yXvNoK3zz2kqBOYhXqEcbfwL8oXt X-Google-Smtp-Source: AB8JxZoiZrGrrdA7t+Xn4jCJCmcbvyvEkIgVq27jsUNMzIW26Oj25iNr3XdPf8QJqyRuWvzz/XqC1Q== X-Received: by 2002:a50:b266:: with SMTP id o93-v6mr4408242edd.47.1526523584936; Wed, 16 May 2018 19:19:44 -0700 (PDT) Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com. [209.85.128.170]) by smtp.gmail.com with ESMTPSA id q6-v6sm1894630edh.9.2018.05.16.19.19.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 19:19:44 -0700 (PDT) Received: by mail-wr0-f170.google.com with SMTP id t16-v6so777285wrm.9; Wed, 16 May 2018 19:19:44 -0700 (PDT) X-Received: by 2002:adf:b583:: with SMTP id c3-v6mr2693480wre.228.1526523584361; Wed, 16 May 2018 19:19:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.197.74 with HTTP; Wed, 16 May 2018 19:19:43 -0700 (PDT) In-Reply-To: <201805162229.w4GMTKJj070790@repo.freebsd.org> References: <201805162229.w4GMTKJj070790@repo.freebsd.org> From: "Jonathan T. Looney" Date: Wed, 16 May 2018 22:19:43 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333690 - in head/sys: dev/hwpmc kern sys To: Matt Macy Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 02:19:47 -0000 On Wed, May 16, 2018 at 6:29 PM, Matt Macy wrote: > > Author: mmacy > Date: Wed May 16 22:29:20 2018 > New Revision: 333690 > URL: https://svnweb.freebsd.org/changeset/base/333690 > > Log: > hwpmc: Implement per-thread counters for PMC sampling > > This implements per-thread counters for PMC sampling. The thread > descriptors are stored in a list attached to the process descriptor. > These thread descriptors can store any per-thread information necessary > for current or future features. For the moment, they just store the counters > for sampling. > > The thread descriptors are created when the process descriptor is created. > Additionally, thread descriptors are created or freed when threads > are started or stopped. Because the thread exit function is called in a > critical section, we can't directly free the thread descriptors. Hence, > they are freed to a cache, which is also used as a source of allocations > when needed for new threads. > > Approved by: sbruno > Obtained from: jtl > Sponsored by: Juniper Networks, Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15335 Thanks! Jonathan From owner-svn-src-all@freebsd.org Thu May 17 02:46:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4A4BEEC543; Thu, 17 May 2018 02:46:28 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 961E88CDAC; Thu, 17 May 2018 02:46:28 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 772492307F; Thu, 17 May 2018 02:46:28 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H2kSCl006604; Thu, 17 May 2018 02:46:28 GMT (envelope-from lstewart@FreeBSD.org) Received: (from lstewart@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H2kRpl006601; Thu, 17 May 2018 02:46:27 GMT (envelope-from lstewart@FreeBSD.org) Message-Id: <201805170246.w4H2kRpl006601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lstewart set sender to lstewart@FreeBSD.org using -f From: Lawrence Stewart Date: Thu, 17 May 2018 02:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333699 - in head: lib/libc/sys share/man/man4 sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: lstewart X-SVN-Commit-Paths: in head: lib/libc/sys share/man/man4 sys/netinet/cc X-SVN-Commit-Revision: 333699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 02:46:29 -0000 Author: lstewart Date: Thu May 17 02:46:27 2018 New Revision: 333699 URL: https://svnweb.freebsd.org/changeset/base/333699 Log: Plug a memory leak and potential NULL-pointer dereference introduced in r331214. Each TCP connection that uses the system default cc_newreno(4) congestion control algorithm module leaks a "struct newreno" (8 bytes of memory) at connection initialisation time. The NULL-pointer dereference is only germane when using the ABE feature, which is disabled by default. While at it: - Defer the allocation of memory until it is actually needed given that ABE is optional and disabled by default. - Document the ENOMEM errno in getsockopt(2)/setsockopt(2). - Document ENOMEM and ENOBUFS in tcp(4) as being synonymous given that they are used interchangeably throughout the code. - Fix a few other nits also accidentally omitted from the original patch. Reported by: Harsh Jain on freebsd-net@ Tested by: tjh@ Differential Revision: https://reviews.freebsd.org/D15358 Modified: head/lib/libc/sys/getsockopt.2 head/share/man/man4/tcp.4 head/sys/netinet/cc/cc_newreno.c Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Thu May 17 01:42:18 2018 (r333698) +++ head/lib/libc/sys/getsockopt.2 Thu May 17 02:46:27 2018 (r333699) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd January 18, 2017 +.Dd May 9, 2018 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -548,6 +548,8 @@ is not in a valid part of the process address space. Installing an .Xr accept_filter 9 on a non-listening socket was attempted. +.It Bq Er ENOMEM +A memory allocation failed that was required to service the request. .El .Sh SEE ALSO .Xr ioctl 2 , Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Thu May 17 01:42:18 2018 (r333698) +++ head/share/man/man4/tcp.4 Thu May 17 02:46:27 2018 (r333699) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 6, 2017 +.Dd May 9, 2018 .Dt TCP 4 .Os .Sh NAME @@ -599,7 +599,7 @@ A socket operation may fail with one of the following .It Bq Er EISCONN when trying to establish a connection on a socket which already has one; -.It Bq Er ENOBUFS +.It Bo Er ENOBUFS Bc or Bo Er ENOMEM Bc when the system runs out of memory for an internal data structure; .It Bq Er ETIMEDOUT Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Thu May 17 01:42:18 2018 (r333698) +++ head/sys/netinet/cc/cc_newreno.c Thu May 17 02:46:27 2018 (r333699) @@ -81,7 +81,7 @@ static MALLOC_DEFINE(M_NEWRENO, "newreno data", #define CAST_PTR_INT(X) (*((int*)(X))) -static int newreno_cb_init(struct cc_var *ccv); +static void newreno_cb_destroy(struct cc_var *ccv); static void newreno_ack_received(struct cc_var *ccv, uint16_t type); static void newreno_after_idle(struct cc_var *ccv); static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); @@ -95,7 +95,7 @@ static VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80; struct cc_algo newreno_cc_algo = { .name = "newreno", - .cb_init = newreno_cb_init, + .cb_destroy = newreno_cb_destroy, .ack_received = newreno_ack_received, .after_idle = newreno_after_idle, .cong_signal = newreno_cong_signal, @@ -108,21 +108,31 @@ struct newreno { uint32_t beta_ecn; }; -int -newreno_cb_init(struct cc_var *ccv) +static inline struct newreno * +newreno_malloc(struct cc_var *ccv) { - struct newreno *nreno; + struct newreno *nreno; - nreno = malloc(sizeof(struct newreno), M_NEWRENO, M_NOWAIT|M_ZERO); + nreno = malloc(sizeof(struct newreno), M_NEWRENO, M_NOWAIT); if (nreno != NULL) { + /* NB: nreno is not zeroed, so initialise all fields. */ nreno->beta = V_newreno_beta; nreno->beta_ecn = V_newreno_beta_ecn; + ccv->cc_data = nreno; } - return (0); + return (nreno); } static void +newreno_cb_destroy(struct cc_var *ccv) +{ + + if (ccv->cc_data != NULL) + free(ccv->cc_data, M_NEWRENO); +} + +static void newreno_ack_received(struct cc_var *ccv, uint16_t type) { if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && @@ -224,20 +234,18 @@ static void newreno_cong_signal(struct cc_var *ccv, uint32_t type) { struct newreno *nreno; - uint32_t cwin, factor; + uint32_t beta, beta_ecn, cwin, factor; u_int mss; - factor = V_newreno_beta; - nreno = ccv->cc_data; - if (nreno != NULL) { - if (V_cc_do_abe) - factor = (type == CC_ECN ? nreno->beta_ecn: nreno->beta); - else - factor = nreno->beta; - } - cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); + nreno = ccv->cc_data; + beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; + beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; + if (V_cc_do_abe && type == CC_ECN) + factor = beta_ecn; + else + factor = beta; /* Catch algos which mistakenly leak private signal types. */ KASSERT((type & CC_SIGPRIVMASK) == 0, @@ -253,8 +261,8 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) V_cc_do_abe && V_cc_abe_frlossreduce)) { CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_ssthresh) * - (uint64_t)nreno->beta) / - (100ULL * (uint64_t)nreno->beta_ecn); + (uint64_t)beta) / + (100ULL * (uint64_t)beta_ecn); } if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) CCV(ccv, snd_ssthresh) = cwin; @@ -278,7 +286,6 @@ static void newreno_post_recovery(struct cc_var *ccv) { int pipe; - pipe = 0; if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { /* @@ -302,7 +309,7 @@ newreno_post_recovery(struct cc_var *ccv) } } -int +static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) { struct newreno *nreno; @@ -313,9 +320,15 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt nreno = ccv->cc_data; opt = buf; - + switch (sopt->sopt_dir) { case SOPT_SET: + /* We cannot set without cc_data memory. */ + if (nreno == NULL) { + nreno = newreno_malloc(ccv); + if (nreno == NULL) + return (ENOMEM); + } switch (opt->name) { case CC_NEWRENO_BETA: nreno->beta = opt->val; @@ -328,17 +341,21 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt default: return (ENOPROTOOPT); } + break; case SOPT_GET: switch (opt->name) { case CC_NEWRENO_BETA: - opt->val = nreno->beta; + opt->val = (nreno == NULL) ? + V_newreno_beta : nreno->beta; break; case CC_NEWRENO_BETA_ECN: - opt->val = nreno->beta_ecn; + opt->val = (nreno == NULL) ? + V_newreno_beta_ecn : nreno->beta_ecn; break; default: return (ENOPROTOOPT); } + break; default: return (EINVAL); } @@ -349,6 +366,7 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt static int newreno_beta_handler(SYSCTL_HANDLER_ARGS) { + if (req->newptr != NULL ) { if (arg1 == &VNET_NAME(newreno_beta_ecn) && !V_cc_do_abe) return (EACCES); From owner-svn-src-all@freebsd.org Thu May 17 02:54:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96936EED1D7; Thu, 17 May 2018 02:54:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A1C38D579; Thu, 17 May 2018 02:54:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B38823281; Thu, 17 May 2018 02:54:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H2sUge011622; Thu, 17 May 2018 02:54:30 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H2sU35011621; Thu, 17 May 2018 02:54:30 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805170254.w4H2sU35011621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 02:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333700 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 02:54:31 -0000 Author: mmacy Date: Thu May 17 02:54:30 2018 New Revision: 333700 URL: https://svnweb.freebsd.org/changeset/base/333700 Log: Fix i386 build Move epoch_section to after td_emuldata, but note the 3 surrounding LP64 holes while I'm here. Approved by: sbruno Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu May 17 02:46:27 2018 (r333699) +++ head/sys/sys/proc.h Thu May 17 02:54:30 2018 (r333700) @@ -347,6 +347,7 @@ struct thread { } td_uretoff; /* (k) Syscall aux returns. */ #define td_retval td_uretoff.tdu_retval u_int td_cowgen; /* (k) Generation of COW pointers. */ + /* LP64 hole */ struct callout td_slpcallout; /* (h) Callout for sleep. */ struct trapframe *td_frame; /* (k) */ struct vm_object *td_kstack_obj;/* (a) Kstack object. */ @@ -358,18 +359,20 @@ struct thread { struct lpohead td_lprof[2]; /* (a) lock profiling objects. */ struct kdtrace_thread *td_dtrace; /* (*) DTrace-specific data. */ int td_errno; /* Error returned by last syscall. */ + /* LP64 hole */ struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ struct proc *td_rfppwait_p; /* (k) The vforked child */ struct vm_page **td_ma; /* (k) uio pages held */ int td_ma_cnt; /* (k) size of *td_ma */ - epoch_section_t td_epoch_section; /* (t) epoch section object */ + /* LP64 hole */ void *td_emuldata; /* Emulator state data */ int td_lastcpu; /* (t) Last cpu we were on. */ int td_oncpu; /* (t) Which cpu we are on. */ void *td_lkpi_task; /* LinuxKPI task struct pointer */ TAILQ_ENTRY(thread) td_epochq; /* (t) Epoch queue. */ + epoch_section_t td_epoch_section; /* (t) epoch section object */ }; struct thread0_storage { From owner-svn-src-all@freebsd.org Thu May 17 03:19:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4CBAEEF2AD; Thu, 17 May 2018 03:19:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58CDD8E8C5; Thu, 17 May 2018 03:19:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39E5A23663; Thu, 17 May 2018 03:19:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H3JW9a022996; Thu, 17 May 2018 03:19:32 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H3JW0O022995; Thu, 17 May 2018 03:19:32 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805170319.w4H3JW0O022995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 03:19:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333701 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 333701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 03:19:32 -0000 Author: mmacy Date: Thu May 17 03:19:31 2018 New Revision: 333701 URL: https://svnweb.freebsd.org/changeset/base/333701 Log: Fix powerpc64 LINT vm_object_reserve() == true is impossible on power. Make conditional on VM_LEVEL_0_ORDER being defined. Reviewed by: jeff Approved by: sbruno Modified: head/sys/vm/vm_domainset.c Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Thu May 17 02:54:30 2018 (r333700) +++ head/sys/vm/vm_domainset.c Thu May 17 03:19:31 2018 (r333701) @@ -81,6 +81,7 @@ vm_domainset_iter_init(struct vm_domainset_iter *di, s } di->di_policy = di->di_domain->ds_policy; if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) { +#ifdef VM_LEVEL_0_ORDER if (vm_object_reserv(obj)) { /* * Color the pindex so we end up on the correct @@ -88,7 +89,9 @@ vm_domainset_iter_init(struct vm_domainset_iter *di, s */ pindex += obj->pg_color; pindex >>= VM_LEVEL_0_ORDER; - } else + } + else +#endif pindex /= vm_domainset_default_stride; /* * Offset pindex so the first page of each object does From owner-svn-src-all@freebsd.org Thu May 17 04:08:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91721A1A; Thu, 17 May 2018 04:08:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3ED356895C; Thu, 17 May 2018 04:08:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F92323F61; Thu, 17 May 2018 04:08:58 +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 w4H48wfI049098; Thu, 17 May 2018 04:08:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H48vMp049097; Thu, 17 May 2018 04:08:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805170408.w4H48vMp049097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 May 2018 04:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333702 - head/sys/netinet/netdump X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet/netdump X-SVN-Commit-Revision: 333702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 04:08:58 -0000 Author: markj Date: Thu May 17 04:08:57 2018 New Revision: 333702 URL: https://svnweb.freebsd.org/changeset/base/333702 Log: Fix netdump configuration when VIMAGE is enabled. We need to set the current vnet before iterating over the global interface list. Because the dump device may only be set from the host, only proceed with configuration if the thread belongs to the default vnet. [1] Also fix a resource leak that occurs if the priv_check() in set_dumper() fails. Reported by: mmacy, sbruno [1] Reviewed by: sbruno X-MFC with: r333283 Differential Revision: https://reviews.freebsd.org/D15449 Modified: head/sys/netinet/netdump/netdump_client.c Modified: head/sys/netinet/netdump/netdump_client.c ============================================================================== --- head/sys/netinet/netdump/netdump_client.c Thu May 17 03:19:31 2018 (r333701) +++ head/sys/netinet/netdump/netdump_client.c Thu May 17 04:08:57 2018 (r333702) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -88,7 +89,7 @@ __FBSDID("$FreeBSD$"); static int netdump_arp_gw(void); static void netdump_cleanup(void); -static int netdump_configure(struct netdump_conf *); +static int netdump_configure(struct netdump_conf *, struct thread *); static int netdump_dumper(void *priv __unused, void *virtual, vm_offset_t physical __unused, off_t offset, size_t length); static int netdump_ether_output(struct mbuf *m, struct ifnet *ifp, @@ -1058,10 +1059,15 @@ static struct cdevsw netdump_cdevsw = { static struct cdev *netdump_cdev; static int -netdump_configure(struct netdump_conf *conf) +netdump_configure(struct netdump_conf *conf, struct thread *td) { struct ifnet *ifp; + CURVNET_SET(TD_TO_VNET(td)); + if (!IS_DEFAULT_VNET(curvnet)) { + CURVNET_RESTORE(); + return (EINVAL); + } IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (strcmp(ifp->if_xname, conf->ndc_iface) == 0) @@ -1069,6 +1075,7 @@ netdump_configure(struct netdump_conf *conf) } /* XXX ref */ IFNET_RUNLOCK_NOSLEEP(); + CURVNET_RESTORE(); if (ifp == NULL) return (ENOENT); @@ -1170,13 +1177,15 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c if (kda->kda_enable == 0) { if (nd_enabled) { error = clear_dumper(td); - if (error == 0) + if (error == 0) { nd_enabled = 0; + netdump_mbuf_drain(); + } } break; } - error = netdump_configure(conf); + error = netdump_configure(conf, td); if (error != 0) break; @@ -1212,8 +1221,10 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c explicit_bzero(encryptedkey, kda->kda_encryptedkeysize); free(encryptedkey, M_TEMP); } - if (error != 0) + if (error != 0) { nd_enabled = 0; + netdump_mbuf_drain(); + } break; default: error = EINVAL; @@ -1268,7 +1279,7 @@ netdump_modevent(module_t mod __unused, int what, void } /* Ignore errors; we print a message to the console. */ - (void)netdump_configure(&conf); + (void)netdump_configure(&conf, curthread); } break; case MOD_UNLOAD: From owner-svn-src-all@freebsd.org Thu May 17 04:27:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A40FDEA9063; Thu, 17 May 2018 04:27:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 558726950C; Thu, 17 May 2018 04:27:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36922242C3; Thu, 17 May 2018 04:27:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H4R8f9058776; Thu, 17 May 2018 04:27:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H4R8lv058775; Thu, 17 May 2018 04:27:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805170427.w4H4R8lv058775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 May 2018 04:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333703 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 333703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 04:27:09 -0000 Author: markj Date: Thu May 17 04:27:08 2018 New Revision: 333703 URL: https://svnweb.freebsd.org/changeset/base/333703 Log: Fix a race in vm_page_pagequeue_lockptr(). The value of m->queue must be cached after comparing it with PQ_NONE, since it may be concurrently changing. Reported by: glebius Reviewed by: jeff Differential Revision: https://reviews.freebsd.org/D15462 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu May 17 04:08:57 2018 (r333702) +++ head/sys/vm/vm_page.c Thu May 17 04:27:08 2018 (r333703) @@ -3088,10 +3088,11 @@ vm_page_pagequeue(vm_page_t m) static struct mtx * vm_page_pagequeue_lockptr(vm_page_t m) { + uint8_t queue; - if (m->queue == PQ_NONE) + if ((queue = m->queue) == PQ_NONE) return (NULL); - return (&vm_page_pagequeue(m)->pq_mutex); + return (&vm_pagequeue_domain(m)->vmd_pagequeues[queue].pq_mutex); } static inline void Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu May 17 04:08:57 2018 (r333702) +++ head/sys/vm/vm_page.h Thu May 17 04:27:08 2018 (r333703) @@ -208,7 +208,7 @@ struct vm_page { uint16_t flags; /* page PG_* flags (P) */ uint8_t aflags; /* access is atomic */ uint8_t oflags; /* page VPO_* flags (O) */ - uint8_t queue; /* page queue index (Q) */ + volatile uint8_t queue; /* page queue index (Q) */ int8_t psind; /* pagesizes[] index (O) */ int8_t segind; /* vm_phys segment index (C) */ uint8_t order; /* index of the buddy queue (F) */ From owner-svn-src-all@freebsd.org Thu May 17 06:04:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86A97EAFD72; Thu, 17 May 2018 06:04:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 269956D278; Thu, 17 May 2018 06:04:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF177253BE; Thu, 17 May 2018 06:04:50 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4H64oNq009133; Thu, 17 May 2018 06:04:50 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4H64oBf009132; Thu, 17 May 2018 06:04:50 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805170604.w4H64oBf009132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 17 May 2018 06:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333704 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 333704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 06:04:51 -0000 Author: np Date: Thu May 17 06:04:50 2018 New Revision: 333704 URL: https://svnweb.freebsd.org/changeset/base/333704 Log: cxgbe(4): Fix s->neq miscalculation in r333698. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 17 04:27:08 2018 (r333703) +++ head/sys/dev/cxgbe/t4_main.c Thu May 17 06:04:50 2018 (r333704) @@ -1057,7 +1057,8 @@ t4_attach(device_t dev) s->nofldtxq = nports * iaq.nofldtxq; if (num_vis > 1) s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; - s->neq += s->nofldtxq + s->nofldrxq; + s->neq += s->nofldtxq; + s->ofld_txq = malloc(s->nofldtxq * sizeof(struct sge_wrq), M_CXGBE, M_ZERO | M_WAITOK); } @@ -1065,9 +1066,9 @@ t4_attach(device_t dev) #ifdef TCP_OFFLOAD if (is_offload(sc)) { s->nofldrxq = nports * iaq.nofldrxq; - if (num_vis > 1) { + if (num_vis > 1) s->nofldrxq += nports * (num_vis - 1) * iaq.nofldrxq_vi; - } + s->neq += s->nofldrxq; /* free list */ s->niq += s->nofldrxq; s->ofld_rxq = malloc(s->nofldrxq * sizeof(struct sge_ofld_rxq), From owner-svn-src-all@freebsd.org Thu May 17 07:06:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31E3AED92EC for ; Thu, 17 May 2018 07:06:55 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C0D36FCB7 for ; Thu, 17 May 2018 07:06:54 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-wm0-x241.google.com with SMTP id o78-v6so6998213wmg.0 for ; Thu, 17 May 2018 00:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Mppx/qgNUHglFFQwJ1B6P+GY34lS4S1VI0B5e+b9JpM=; b=o+Br4YKsEQBtbNqUTnP1IILmMdpUaPomhb7Gq5q6QEw2Y5Q+v4tyfM8GXd0KNgdBc2 +HVNvdCC0C3KZo0s6viUikwQiU83K3AdDbKVPZ9P5prsT+27xgbn95QztZfqmCvQJMcB mbE6hmZKCBlmkPG+7LgvKDD9EHPHizhE80Raolb2rYf2VYF/5ckJNx4X/wr80rAdWake HSbVApCcIJWvjfcdZfKvJtllWDBFB+aS7AeN/QJK45n9xDqIBtzYsr1M9IRs1GdY8wns gZ54SLvUw5bHBCL9KJO38CY2ZAAPSOQo/ZzrCVI2tmbELWPzgFz9+tbViUCQGR4ZNKlx rsTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Mppx/qgNUHglFFQwJ1B6P+GY34lS4S1VI0B5e+b9JpM=; b=n6biEppTsCTFGMlssb01XoJ7R90Hl+PJurmaZAEnx9XUghTaVmxFu/cU/oX6TWVeUO E3yYJkyfU0xR8zAAEPAnWf0ZN0jTcEj2Xr/dz0Ye0AuDerMezOOV9kFyu1seAMuQ7gd2 P774F4VJFKwv/YYnY/AQkeUNUfrpOInVVLj0+sbSSvcOkbFyon1+J6VxMh8YhXnVnYg+ 6lcvp0x50bw50Arxf0CHGC1XsVU8w81ObTa2lN2+w1stEd6N/L8N8NhPs9PeY2dX1tOx FqoPYuLMpggdJoTD8hxZpNKJwLMg74MCjYEKm6xwfMGo2oRTLdmakjMX7un9EiOTDuqy WbzQ== X-Gm-Message-State: ALKqPwf3oZE30YP3KmZiq0nvKjczLCVTzY6g0wqYkL5SkuE8v3pQ5ueN zuoI15qKfdGlh9lKBNJ1IK6F4JV60w/r9nojmxJtAQ== X-Google-Smtp-Source: AB8JxZreXU2sT8H8lxCjfbzPhYoOUHnCkhJhfO9GsJR4aegsn6RXe5tB1T5DUZkElV5kdun/XTJikcA+dg6VFYVlito= X-Received: by 2002:a50:a4f6:: with SMTP id x51-v6mr5267271edb.247.1526540812599; Thu, 17 May 2018 00:06:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.148.173 with HTTP; Thu, 17 May 2018 00:06:22 -0700 (PDT) In-Reply-To: <201805132316.w4DNG4oh092482@repo.freebsd.org> References: <201805132316.w4DNG4oh092482@repo.freebsd.org> From: Ed Schouten Date: Thu, 17 May 2018 09:06:22 +0200 Message-ID: Subject: Re: svn commit: r333590 - head/share/man/man9 To: Matt Macy Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 07:06:55 -0000 Hi Matt, 2018-05-14 1:16 GMT+02:00 Matt Macy : > +Epochs do not have any lock ordering issues. Entering and leaving It looks like the man page is missing some newlines between sentences. Quick question: How does this work relate to RCU (https://en.wikipedia.org/wiki/Read-copy-update)? If there is any relation, should we mention it in the documentation? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands From owner-svn-src-all@freebsd.org Thu May 17 10:01:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7090EEE538F; Thu, 17 May 2018 10:01:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E459772B1; Thu, 17 May 2018 10:01:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3507279DF; Thu, 17 May 2018 10:01:47 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HA1lWW030307; Thu, 17 May 2018 10:01:47 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HA1lxw030306; Thu, 17 May 2018 10:01:47 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201805171001.w4HA1lxw030306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 17 May 2018 10:01:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333705 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 333705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:01:48 -0000 Author: ae Date: Thu May 17 10:01:47 2018 New Revision: 333705 URL: https://svnweb.freebsd.org/changeset/base/333705 Log: MFC r333458: Fix the printing of rule comments. Change uint8_t type of opcode argument to int in the print_opcode() function. Use negative value to print the rest of opcodes, because zero value is O_NOP, and it can't be uses for this purpose. Reported by: lev Approved by: re (gjb) Modified: stable/11/sbin/ipfw/ipfw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Thu May 17 06:04:50 2018 (r333704) +++ stable/11/sbin/ipfw/ipfw2.c Thu May 17 10:01:47 2018 (r333705) @@ -1708,7 +1708,7 @@ print_instruction(struct buf_pr *bp, const struct form static ipfw_insn * print_opcode(struct buf_pr *bp, struct format_opts *fo, - struct show_state *state, uint8_t opcode) + struct show_state *state, int opcode) { ipfw_insn *cmd; int l; @@ -1716,7 +1716,7 @@ print_opcode(struct buf_pr *bp, struct format_opts *fo for (l = state->rule->act_ofs, cmd = state->rule->cmd; l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { /* We use zero opcode to print the rest of options */ - if (opcode != 0 && cmd->opcode != opcode) + if (opcode >= 0 && cmd->opcode != opcode) continue; /* * Skip O_NOP, when we printing the rest @@ -2192,7 +2192,7 @@ show_static_rule(struct cmdline_opts *co, struct forma O_IP_DSTPORT, HAVE_DSTIP); /* Print the rest of options */ - while (print_opcode(bp, fo, &state, 0)) + while (print_opcode(bp, fo, &state, -1)) ; end: /* Print comment at the end */ From owner-svn-src-all@freebsd.org Thu May 17 10:13:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61CA3EE5EAC; Thu, 17 May 2018 10:13:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 188AC77CF9; Thu, 17 May 2018 10:13:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDAA827CD7; Thu, 17 May 2018 10:13:18 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HADI9W037317; Thu, 17 May 2018 10:13:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HADIMm037316; Thu, 17 May 2018 10:13:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171013.w4HADIMm037316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 10:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333706 - head/sys/dev/flash X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/flash X-SVN-Commit-Revision: 333706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:13:19 -0000 Author: manu Date: Thu May 17 10:13:18 2018 New Revision: 333706 URL: https://svnweb.freebsd.org/changeset/base/333706 Log: mx25l: Add mx25l1606e This is a 16Mbits spi flash arranged in 32x64k blocks or 512x4k sectors. Modified: head/sys/dev/flash/mx25l.c Modified: head/sys/dev/flash/mx25l.c ============================================================================== --- head/sys/dev/flash/mx25l.c Thu May 17 10:01:47 2018 (r333705) +++ head/sys/dev/flash/mx25l.c Thu May 17 10:13:18 2018 (r333706) @@ -124,6 +124,7 @@ struct mx25l_flash_ident flash_devices[] = { { "en25q64", 0x1c, 0x3017, 64 * 1024, 128, FL_ERASE_4K }, { "m25p32", 0x20, 0x2016, 64 * 1024, 64, FL_NONE }, { "m25p64", 0x20, 0x2017, 64 * 1024, 128, FL_NONE }, + { "mx25l1606e", 0xc2, 0x2015, 64 * 1024, 32, FL_ERASE_4K}, { "mx25ll32", 0xc2, 0x2016, 64 * 1024, 64, FL_NONE }, { "mx25ll64", 0xc2, 0x2017, 64 * 1024, 128, FL_NONE }, { "mx25ll128", 0xc2, 0x2018, 64 * 1024, 256, FL_ERASE_4K | FL_ERASE_32K }, From owner-svn-src-all@freebsd.org Thu May 17 10:16:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5575AEE634D; Thu, 17 May 2018 10:16:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 094B377FF8; Thu, 17 May 2018 10:16:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE55C27CDD; Thu, 17 May 2018 10:16:20 +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 w4HAGKMw037617; Thu, 17 May 2018 10:16:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HAGKre037616; Thu, 17 May 2018 10:16:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201805171016.w4HAGKre037616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 17 May 2018 10:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333707 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:16:21 -0000 Author: avg Date: Thu May 17 10:16:20 2018 New Revision: 333707 URL: https://svnweb.freebsd.org/changeset/base/333707 Log: fix a problem with bad performance after wakeup caused by r333321 This change reverts a "while here" part of r333321 that moved clearing of suspended_cpus to an earlier place. Apparently, there can be a problem when modifying (shared) memory before restoring proper cache attributes. So, to be safe, move the clearing to the old place. Many thanks to Johannes Lundberg for bisecting the changes to that particular commit and then bisecting the commit to the particular change. Reported by: many Debugged by: Johannes Lundberg MFC after: 1 week X-MFC with: r333321 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Thu May 17 10:13:18 2018 (r333706) +++ head/sys/x86/x86/mp_x86.c Thu May 17 10:16:20 2018 (r333707) @@ -1457,8 +1457,6 @@ cpususpend_handler(void) */ wbinvd(); } else { - /* Indicate that we have restarted and restored the context. */ - CPU_CLR_ATOMIC(cpu, &suspended_cpus); #ifdef __amd64__ fpuresume(susppcbs[cpu]->sp_fpususpend); #else @@ -1468,6 +1466,9 @@ cpususpend_handler(void) initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); + + /* Indicate that we have restarted and restored the context. */ + CPU_CLR_ATOMIC(cpu, &suspended_cpus); } /* Wait for resume directive */ From owner-svn-src-all@freebsd.org Thu May 17 10:19:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC69EE66A3; Thu, 17 May 2018 10:19:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 897FB7822A; Thu, 17 May 2018 10:19:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 685F627CE0; Thu, 17 May 2018 10:19:53 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HAJrnR037799; Thu, 17 May 2018 10:19:53 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HAJrrI037798; Thu, 17 May 2018 10:19:53 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171019.w4HAJrrI037798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 10:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333708 - in head/sys: conf modules X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf modules X-SVN-Commit-Revision: 333708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:19:54 -0000 Author: manu Date: Thu May 17 10:19:52 2018 New Revision: 333708 URL: https://svnweb.freebsd.org/changeset/base/333708 Log: allwinner: Add h3 spi driver This driver is compatible with H3/H5/A64. Test was done on the OrangePi-PC2 board (H5 based), which have a mx25l1606e spi flash on it, by writing u-boot image, reading it and booting from the spi. There is still room for improvement especially on reading using the controller automatic burst which will avoid us to write dummy data to the TX FIFO. DMA is also not supported as we currently don't support the DMA controller on those SoCs Only add a kernel module for it. Modified: head/sys/conf/files.arm64 head/sys/modules/Makefile Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu May 17 10:16:20 2018 (r333707) +++ head/sys/conf/files.arm64 Thu May 17 10:19:52 2018 (r333708) @@ -33,6 +33,7 @@ arm/allwinner/aw_nmi.c optional aw_nmi fdt \ arm/allwinner/aw_rsb.c optional aw_rsb fdt arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_sid.c optional aw_sid fdt +arm/allwinner/aw_spi.c optional aw_spi fdt arm/allwinner/aw_thermal.c optional aw_thermal fdt arm/allwinner/aw_usbphy.c optional ehci aw_usbphy fdt arm/allwinner/aw_wdog.c optional aw_wdog fdt Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu May 17 10:16:20 2018 (r333707) +++ head/sys/modules/Makefile Thu May 17 10:19:52 2018 (r333708) @@ -42,6 +42,7 @@ SUBDIR= \ ${_aout} \ ${_apm} \ ${_arcmsr} \ + ${_allwinner} \ ${_armv8crypto} \ ${_asmc} \ ata \ @@ -558,6 +559,7 @@ _cxgb= cxgb .endif .if ${MACHINE_CPUARCH} == "aarch64" +_allwinner= allwinner _armv8crypto= armv8crypto _efirt= efirt _em= em From owner-svn-src-all@freebsd.org Thu May 17 10:25:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5264FEE6E60; Thu, 17 May 2018 10:25:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F25A378773; Thu, 17 May 2018 10:25:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1A4627E73; Thu, 17 May 2018 10:25:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HAP1J8042796; Thu, 17 May 2018 10:25:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HAP1oD042793; Thu, 17 May 2018 10:25:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171025.w4HAP1oD042793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 10:25:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333709 - in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_spi X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner modules/allwinner modules/allwinner/aw_spi X-SVN-Commit-Revision: 333709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:25:02 -0000 Author: manu Date: Thu May 17 10:25:01 2018 New Revision: 333709 URL: https://svnweb.freebsd.org/changeset/base/333709 Log: alwinner: Add missing files in r333708 Added: head/sys/arm/allwinner/aw_spi.c (contents, props changed) head/sys/modules/allwinner/ head/sys/modules/allwinner/Makefile (contents, props changed) head/sys/modules/allwinner/aw_spi/ head/sys/modules/allwinner/aw_spi/Makefile (contents, props changed) Added: head/sys/arm/allwinner/aw_spi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_spi.c Thu May 17 10:25:01 2018 (r333709) @@ -0,0 +1,603 @@ +/*- + * Copyright (c) 2018 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include "spibus_if.h" + +#define AW_SPI_GCR 0x04 /* Global Control Register */ +#define AW_SPI_GCR_EN (1 << 0) /* ENable */ +#define AW_SPI_GCR_MODE_MASTER (1 << 1) /* 1 = Master, 0 = Slave */ +#define AW_SPI_GCR_TP_EN (1 << 7) /* 1 = Stop transmit when FIFO is full */ +#define AW_SPI_GCR_SRST (1 << 31) /* Soft Reset */ + +#define AW_SPI_TCR 0x08 /* Transfer Control register */ +#define AW_SPI_TCR_XCH (1 << 31) /* Initiate transfer */ +#define AW_SPI_TCR_SDDM (1 << 14) /* Sending Delay Data Mode */ +#define AW_SPI_TCR_SDM (1 << 13) /* Master Sample Data Mode */ +#define AW_SPI_TCR_FBS (1 << 12) /* First Transmit Bit Select (1 == LSB) */ +#define AW_SPI_TCR_SDC (1 << 11) /* Master Sample Data Control */ +#define AW_SPI_TCR_RPSM (1 << 10) /* Rapid Mode Select */ +#define AW_SPI_TCR_DDB (1 << 9) /* Dummy Burst Type */ +#define AW_SPI_TCR_SSSEL_MASK 0x30 /* Chip select */ +#define AW_SPI_TCR_SSSEL_SHIFT 4 +#define AW_SPI_TCR_SS_LEVEL (1 << 7) /* 1 == CS High */ +#define AW_SPI_TCR_SS_OWNER (1 << 6) /* 1 == Software controlled */ +#define AW_SPI_TCR_SPOL (1 << 2) /* 1 == Active low */ +#define AW_SPI_TCR_CPOL (1 << 1) /* 1 == Active low */ +#define AW_SPI_TCR_CPHA (1 << 0) /* 1 == Phase 1 */ + +#define AW_SPI_IER 0x10 /* Interrupt Control Register */ +#define AW_SPI_IER_SS (1 << 13) /* Chip select went from valid to invalid */ +#define AW_SPI_IER_TC (1 << 12) /* Transfer complete */ +#define AW_SPI_IER_TF_UDR (1 << 11) /* TXFIFO underrun */ +#define AW_SPI_IER_TF_OVF (1 << 10) /* TXFIFO overrun */ +#define AW_SPI_IER_RF_UDR (1 << 9) /* RXFIFO underrun */ +#define AW_SPI_IER_RF_OVF (1 << 8) /* RXFIFO overrun */ +#define AW_SPI_IER_TF_FULL (1 << 6) /* TXFIFO Full */ +#define AW_SPI_IER_TF_EMP (1 << 5) /* TXFIFO Empty */ +#define AW_SPI_IER_TF_ERQ (1 << 4) /* TXFIFO Empty Request */ +#define AW_SPI_IER_RF_FULL (1 << 2) /* RXFIFO Full */ +#define AW_SPI_IER_RF_EMP (1 << 1) /* RXFIFO Empty */ +#define AW_SPI_IER_RF_ERQ (1 << 0) /* RXFIFO Empty Request */ + +#define AW_SPI_ISR 0x14 /* Interrupt Status Register */ + +#define AW_SPI_FCR 0x18 /* FIFO Control Register */ +#define AW_SPI_FCR_TX_RST (1 << 31) /* Reset TX FIFO */ +#define AW_SPI_FCR_TX_TRIG_MASK 0xFF0000 /* TX FIFO Trigger level */ +#define AW_SPI_FCR_TX_TRIG_SHIFT 16 +#define AW_SPI_FCR_RX_RST (1 << 15) /* Reset RX FIFO */ +#define AW_SPI_FCR_RX_TRIG_MASK 0xFF /* RX FIFO Trigger level */ +#define AW_SPI_FCR_RX_TRIG_SHIFT 0 + +#define AW_SPI_FSR 0x1C /* FIFO Status Register */ +#define AW_SPI_FSR_TB_WR (1 << 31) +#define AW_SPI_FSR_TB_CNT_MASK 0x70000000 +#define AW_SPI_FSR_TB_CNT_SHIFT 28 +#define AW_SPI_FSR_TF_CNT_MASK 0xFF0000 +#define AW_SPI_FSR_TF_CNT_SHIFT 16 +#define AW_SPI_FSR_RB_WR (1 << 15) +#define AW_SPI_FSR_RB_CNT_MASK 0x7000 +#define AW_SPI_FSR_RB_CNT_SHIFT 12 +#define AW_SPI_FSR_RF_CNT_MASK 0xFF +#define AW_SPI_FSR_RF_CNT_SHIFT 0 + +#define AW_SPI_WCR 0x20 /* Wait Clock Counter Register */ + +#define AW_SPI_CCR 0x24 /* Clock Rate Control Register */ +#define AW_SPI_CCR_DRS (1 << 12) /* Clock divider select */ +#define AW_SPI_CCR_CDR1_MASK 0xF00 +#define AW_SPI_CCR_CDR1_SHIFT 8 +#define AW_SPI_CCR_CDR2_MASK 0xFF +#define AW_SPI_CCR_CDR2_SHIFT 0 + +#define AW_SPI_MBC 0x30 /* Burst Counter Register */ +#define AW_SPI_MTC 0x34 /* Transmit Counter Register */ +#define AW_SPI_BCC 0x38 /* Burst Control Register */ +#define AW_SPI_MDMA_CTL 0x88 /* Normal DMA Control Register */ +#define AW_SPI_TXD 0x200 /* TX Data Register */ +#define AW_SPI_RDX 0x300 /* RX Data Register */ + +#define AW_SPI_MAX_CS 4 +#define AW_SPI_FIFO_SIZE 64 + +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun8i-h3-spi", 1 }, + { NULL, 0 } +}; + +static struct resource_spec aw_spi_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +struct aw_spi_softc { + device_t dev; + device_t spibus; + struct resource *res[2]; + struct mtx mtx; + clk_t clk_ahb; + clk_t clk_mod; + uint64_t ahb_freq; + hwreset_t rst_ahb; + void * intrhand; + int transfer; + + uint8_t *rxbuf; + uint32_t rxcnt; + uint8_t *txbuf; + uint32_t txcnt; + uint32_t txlen; + uint32_t rxlen; +}; + +#define AW_SPI_LOCK(sc) mtx_lock(&(sc)->mtx) +#define AW_SPI_UNLOCK(sc) mtx_unlock(&(sc)->mtx) +#define AW_SPI_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) +#define AW_SPI_READ_1(sc, reg) bus_read_1((sc)->res[0], (reg)) +#define AW_SPI_WRITE_1(sc, reg, val) bus_write_1((sc)->res[0], (reg), (val)) +#define AW_SPI_READ_4(sc, reg) bus_read_4((sc)->res[0], (reg)) +#define AW_SPI_WRITE_4(sc, reg, val) bus_write_4((sc)->res[0], (reg), (val)) + +static int aw_spi_probe(device_t dev); +static int aw_spi_attach(device_t dev); +static int aw_spi_detach(device_t dev); +static void aw_spi_intr(void *arg); + +static int +aw_spi_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "Allwinner SPI"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_spi_attach(device_t dev) +{ + struct aw_spi_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + if (bus_alloc_resources(dev, aw_spi_spec, sc->res) != 0) { + device_printf(dev, "cannot allocate resources for device\n"); + error = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->res[1], + INTR_TYPE_MISC | INTR_MPSAFE, NULL, aw_spi_intr, sc, + &sc->intrhand)) { + bus_release_resources(dev, aw_spi_spec, sc->res); + device_printf(dev, "cannot setup interrupt handler\n"); + return (ENXIO); + } + + /* De-assert reset */ + if (hwreset_get_by_ofw_idx(dev, 0, 0, &sc->rst_ahb) == 0) { + error = hwreset_deassert(sc->rst_ahb); + if (error != 0) { + device_printf(dev, "cannot de-assert reset\n"); + goto fail; + } + } + + /* Activate the module clock. */ + error = clk_get_by_ofw_name(dev, 0, "ahb", &sc->clk_ahb); + if (error != 0) { + device_printf(dev, "cannot get ahb clock\n"); + goto fail; + } + error = clk_get_by_ofw_name(dev, 0, "mod", &sc->clk_mod); + if (error != 0) { + device_printf(dev, "cannot get mod clock\n"); + goto fail; + } + error = clk_enable(sc->clk_ahb); + if (error != 0) { + device_printf(dev, "cannot enable ahb clock\n"); + goto fail; + } + error = clk_enable(sc->clk_mod); + if (error != 0) { + device_printf(dev, "cannot enable mod clock\n"); + goto fail; + } + + clk_get_freq(sc->clk_ahb, &sc->ahb_freq); + + sc->spibus = device_add_child(dev, "spibus", -1); + + return (0); + +fail: + aw_spi_detach(dev); + return (error); +} + +static int +aw_spi_detach(device_t dev) +{ + struct aw_spi_softc *sc; + + sc = device_get_softc(dev); + + bus_generic_detach(sc->dev); + if (sc->spibus != NULL) + device_delete_child(dev, sc->spibus); + + if (sc->clk_mod != NULL) + clk_release(sc->clk_mod); + if (sc->clk_ahb) + clk_release(sc->clk_ahb); + if (sc->rst_ahb) + hwreset_assert(sc->rst_ahb); + + if (sc->intrhand != NULL) + bus_teardown_intr(sc->dev, sc->res[1], sc->intrhand); + + bus_release_resources(dev, aw_spi_spec, sc->res); + mtx_destroy(&sc->mtx); + + return (0); +} + +static phandle_t +aw_spi_get_node(device_t bus, device_t dev) +{ + + return ofw_bus_get_node(bus); +} + +static void +aw_spi_setup_mode(struct aw_spi_softc *sc, uint32_t mode) +{ + uint32_t reg; + + /* We only support master mode */ + reg = AW_SPI_READ_4(sc, AW_SPI_GCR); + reg |= AW_SPI_GCR_MODE_MASTER; + AW_SPI_WRITE_4(sc, AW_SPI_GCR, reg); + + /* Setup the modes */ + reg = AW_SPI_READ_4(sc, AW_SPI_TCR); + if (mode & SPIBUS_MODE_CPHA) + reg |= AW_SPI_TCR_CPHA; + if (mode & SPIBUS_MODE_CPOL) + reg |= AW_SPI_TCR_CPOL; + + AW_SPI_WRITE_4(sc, AW_SPI_TCR, reg); +} + +static void +aw_spi_setup_cs(struct aw_spi_softc *sc, uint32_t cs, bool low) +{ + uint32_t reg; + + /* Setup CS */ + reg = AW_SPI_READ_4(sc, AW_SPI_TCR); + reg &= ~(AW_SPI_TCR_SSSEL_MASK); + reg |= cs << AW_SPI_TCR_SSSEL_SHIFT; + reg |= AW_SPI_TCR_SS_OWNER; + if (low) + reg &= ~(AW_SPI_TCR_SS_LEVEL); + else + reg |= AW_SPI_TCR_SS_LEVEL; + + AW_SPI_WRITE_4(sc, AW_SPI_TCR, reg); +} + +static uint64_t +aw_spi_clock_test_cdr1(struct aw_spi_softc *sc, uint64_t clock, uint32_t *ccr) +{ + uint64_t cur, best = 0; + int i, max, best_div; + + max = AW_SPI_CCR_CDR1_MASK >> AW_SPI_CCR_CDR1_SHIFT; + for (i = 0; i < max; i++) { + cur = sc->ahb_freq / (1 << i); + if ((clock - cur) < (clock - best)) { + best = cur; + best_div = i; + } + } + + *ccr = (i << AW_SPI_CCR_CDR1_SHIFT); + return (best); +} + +static uint64_t +aw_spi_clock_test_cdr2(struct aw_spi_softc *sc, uint32_t clock, uint32_t *ccr) +{ + uint64_t cur, best = 0; + int i, max, best_div; + + max = ((AW_SPI_CCR_CDR2_MASK) >> AW_SPI_CCR_CDR2_SHIFT); + for (i = 0; i < max; i++) { + cur = sc->ahb_freq / (1 << i); + if ((clock - cur) < (clock - best)) { + best = cur; + best_div = i; + } + } + + *ccr = AW_SPI_CCR_DRS | (i << AW_SPI_CCR_CDR2_SHIFT); + return (best); +} + +static void +aw_spi_setup_clock(struct aw_spi_softc *sc, uint64_t clock) +{ + uint64_t best_ccr1, best_ccr2; + uint32_t ccr, ccr1, ccr2; + + best_ccr1 = aw_spi_clock_test_cdr1(sc, clock, &ccr1); + best_ccr2 = aw_spi_clock_test_cdr2(sc, clock, &ccr2); + + if (best_ccr1 == clock) { + ccr = ccr1; + } else if (best_ccr2 == clock) { + ccr = ccr2; + } else { + if ((clock - best_ccr1) < (clock - best_ccr2)) + ccr = ccr1; + else + ccr = ccr2; + } + + AW_SPI_WRITE_4(sc, AW_SPI_CCR, ccr); +} + +static inline void +aw_spi_fill_txfifo(struct aw_spi_softc *sc) +{ + uint32_t reg, txcnt; + int i; + + if (sc->txcnt == sc->txlen) + return; + + reg = AW_SPI_READ_4(sc, AW_SPI_FSR); + reg &= AW_SPI_FSR_TF_CNT_MASK; + txcnt = reg >> AW_SPI_FSR_TF_CNT_SHIFT; + + for (i = 0; i < (AW_SPI_FIFO_SIZE - txcnt); i++) { + AW_SPI_WRITE_1(sc, AW_SPI_TXD, sc->txbuf[sc->txcnt++]); + if (sc->txcnt == sc->txlen) + break; + } + + return; +} + +static inline void +aw_spi_read_rxfifo(struct aw_spi_softc *sc) +{ + uint32_t reg; + uint8_t val; + int i; + + if (sc->rxcnt == sc->rxlen) + return; + + reg = AW_SPI_READ_4(sc, AW_SPI_FSR); + reg = (reg & AW_SPI_FSR_RF_CNT_MASK) >> AW_SPI_FSR_RF_CNT_SHIFT; + + for (i = 0; i < reg; i++) { + val = AW_SPI_READ_1(sc, AW_SPI_RDX); + if (sc->rxcnt < sc->rxlen) + sc->rxbuf[sc->rxcnt++] = val; + } +} + +static void +aw_spi_intr(void *arg) +{ + struct aw_spi_softc *sc; + uint32_t intr; + + sc = (struct aw_spi_softc *)arg; + + intr = AW_SPI_READ_4(sc, AW_SPI_ISR); + + if (intr & AW_SPI_IER_RF_FULL) + aw_spi_read_rxfifo(sc); + + if (intr & AW_SPI_IER_TF_EMP) { + aw_spi_fill_txfifo(sc); + /* + * If we don't have anything else to write + * disable TXFifo interrupts + */ + if (sc->txcnt == sc->txlen) + AW_SPI_WRITE_4(sc, AW_SPI_IER, AW_SPI_IER_TC | + AW_SPI_IER_RF_FULL); + } + + if (intr & AW_SPI_IER_TC) { + /* read the rest of the data from the fifo */ + aw_spi_read_rxfifo(sc); + + /* Disable the interrupts */ + AW_SPI_WRITE_4(sc, AW_SPI_IER, 0); + sc->transfer = 0; + wakeup(sc); + } + + /* Clear Interrupts */ + AW_SPI_WRITE_4(sc, AW_SPI_ISR, intr); +} + +static int +aw_spi_xfer(struct aw_spi_softc *sc, void *rxbuf, void *txbuf, uint32_t txlen, uint32_t rxlen) +{ + uint32_t reg; + int error = 0, timeout; + + sc->rxbuf = rxbuf; + sc->rxcnt = 0; + sc->txbuf = txbuf; + sc->txcnt = 0; + sc->txlen = txlen; + sc->rxlen = rxlen; + + /* Reset the FIFOs */ + AW_SPI_WRITE_4(sc, AW_SPI_FCR, AW_SPI_FCR_TX_RST | AW_SPI_FCR_RX_RST); + + for (timeout = 1000; timeout > 0; timeout--) { + reg = AW_SPI_READ_4(sc, AW_SPI_FCR); + if (reg == 0) + break; + } + if (timeout == 0) { + device_printf(sc->dev, "Cannot reset the FIFOs\n"); + return (EIO); + } + + /* Write the counters */ + AW_SPI_WRITE_4(sc, AW_SPI_MBC, txlen); + AW_SPI_WRITE_4(sc, AW_SPI_MTC, txlen); + AW_SPI_WRITE_4(sc, AW_SPI_BCC, txlen); + + /* First fill */ + aw_spi_fill_txfifo(sc); + + /* Start transmit */ + reg = AW_SPI_READ_4(sc, AW_SPI_TCR); + reg |= AW_SPI_TCR_XCH; + AW_SPI_WRITE_4(sc, AW_SPI_TCR, reg); + + /* + * Enable interrupts for : + * Transmit complete + * TX Fifo empty + * RX Fifo full + */ + AW_SPI_WRITE_4(sc, AW_SPI_IER, AW_SPI_IER_TC | + AW_SPI_IER_TF_EMP | AW_SPI_IER_RF_FULL); + + sc->transfer = 1; + + while (error == 0 && sc->transfer != 0) + error = msleep(sc, &sc->mtx, 0, "aw_spi", 10 * hz); + + return (0); +} + +static int +aw_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct aw_spi_softc *sc; + uint32_t cs, mode, clock, reg; + int err = 0; + + sc = device_get_softc(dev); + + spibus_get_cs(child, &cs); + spibus_get_clock(child, &clock); + spibus_get_mode(child, &mode); + + if (cs >= AW_SPI_MAX_CS) { + device_printf(dev, "Invalid cs %d\n", cs); + return (EINVAL); + } + + mtx_lock(&sc->mtx); + + /* Enable and reset the module */ + reg = AW_SPI_READ_4(sc, AW_SPI_GCR); + reg |= AW_SPI_GCR_EN | AW_SPI_GCR_SRST; + AW_SPI_WRITE_4(sc, AW_SPI_GCR, reg); + + /* Setup clock, CS and mode */ + aw_spi_setup_clock(sc, clock); + aw_spi_setup_mode(sc, mode); + if (cs & SPIBUS_CS_HIGH) + aw_spi_setup_cs(sc, cs, false); + else + aw_spi_setup_cs(sc, cs, true); + + /* xfer */ + err = 0; + if (cmd->tx_cmd_sz > 0) + err = aw_spi_xfer(sc, cmd->rx_cmd, cmd->tx_cmd, + cmd->tx_cmd_sz, cmd->rx_cmd_sz); + if (cmd->tx_data_sz > 0 && err == 0) + err = aw_spi_xfer(sc, cmd->rx_data, cmd->tx_data, + cmd->tx_data_sz, cmd->rx_data_sz); + + if (cs & SPIBUS_CS_HIGH) + aw_spi_setup_cs(sc, cs, true); + else + aw_spi_setup_cs(sc, cs, false); + + /* Disable the module */ + reg = AW_SPI_READ_4(sc, AW_SPI_GCR); + reg &= ~AW_SPI_GCR_EN; + AW_SPI_WRITE_4(sc, AW_SPI_GCR, reg); + + mtx_unlock(&sc->mtx); + + return (err); +} + +static device_method_t aw_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, aw_spi_probe), + DEVMETHOD(device_attach, aw_spi_attach), + DEVMETHOD(device_detach, aw_spi_detach), + + /* spibus_if */ + DEVMETHOD(spibus_transfer, aw_spi_transfer), + + /* ofw_bus_if */ + DEVMETHOD(ofw_bus_get_node, aw_spi_get_node), + + DEVMETHOD_END +}; + +static driver_t aw_spi_driver = { + "aw_spi", + aw_spi_methods, + sizeof(struct aw_spi_softc), +}; + +static devclass_t aw_spi_devclass; + +DRIVER_MODULE(aw_spi, simplebus, aw_spi_driver, aw_spi_devclass, 0, 0); +DRIVER_MODULE(ofw_spibus, aw_spi, ofw_spibus_driver, ofw_spibus_devclass, 0, 0); +MODULE_DEPEND(aw_spi, ofw_spibus, 1, 1, 1); Added: head/sys/modules/allwinner/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/Makefile Thu May 17 10:25:01 2018 (r333709) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# Build modules specific to Allwinner. + +SUBDIR = \ + aw_spi \ + +.include Added: head/sys/modules/allwinner/aw_spi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/allwinner/aw_spi/Makefile Thu May 17 10:25:01 2018 (r333709) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/arm/allwinner + +KMOD= aw_spi +SRCS= aw_spi.c + +SRCS+= \ + bus_if.h \ + clknode_if.h \ + device_if.h \ + ofw_bus_if.h \ + spibus_if.h \ + +.include From owner-svn-src-all@freebsd.org Thu May 17 10:25:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9694EE6FDA; Thu, 17 May 2018 10:25:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBD3788EC; Thu, 17 May 2018 10:25:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FF8E27E75; Thu, 17 May 2018 10:25:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HAPo9D042870; Thu, 17 May 2018 10:25:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HAPnPT042868; Thu, 17 May 2018 10:25:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171025.w4HAPnPT042868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 10:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333710 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 10:25:51 -0000 Author: manu Date: Thu May 17 10:25:49 2018 New Revision: 333710 URL: https://svnweb.freebsd.org/changeset/base/333710 Log: aw_spi: Add manpage for this driver Added: head/share/man/man4/aw_spi.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu May 17 10:25:01 2018 (r333709) +++ head/share/man/man4/Makefile Thu May 17 10:25:49 2018 (r333710) @@ -74,6 +74,7 @@ MAN= aac.4 \ ${_aw_mmc.4} \ ${_aw_rtc.4} \ ${_aw_sid.4} \ + ${_aw_spi.4} \ ${_aw_syscon.4} \ axe.4 \ axge.4 \ @@ -773,6 +774,7 @@ _aw_gpio.4= aw_gpio.4 _aw_mmc.4= aw_mmc.4 _aw_rtc.4= aw_rtc.4 _aw_sid.4= aw_sid.4 +_aw_spi.4= aw_spi.4 _aw_syscon.4= aw_syscon.4 .endif Added: head/share/man/man4/aw_spi.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aw_spi.4 Thu May 17 10:25:49 2018 (r333710) @@ -0,0 +1,116 @@ +.\"- +.\" Copyright (c) 2018 Emmanuel Vadot +.\" 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 May 17, 2018 +.Dt AW_SPI 4 +.Os +.Sh NAME +.Nm aw_spi +.Nd driver for the SPI controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device aw_spi" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SPI host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD/MMC controller with one of the following compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun8i-h3-spi +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . +.\"- +.\" Copyright (c) 2018 Emmanuel Vadot +.\" 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 May 17, 2018 +.Dt AW_SPI 4 +.Os +.Sh NAME +.Nm aw_spi +.Nd driver for the SPI controller in Allwinner SoC +.Sh SYNOPSIS +.Cd "device aw_spi" +.Sh DESCRIPTION +The +.Nm +device driver provides support for the Allwinner SPI host controller. +.Sh HARDWARE +The current version of the +.Nm +driver supports the SD/MMC controller with one of the following compatible strings : +.Pp +.Bl -bullet -compact +.It +allwinner,sun8i-h3-spi +.El +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +device driver was written by +.An Emmanuel Vadot Aq Mt manu@freebsd.org . From owner-svn-src-all@freebsd.org Thu May 17 11:53:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EDF6EEBD89; Thu, 17 May 2018 11:53:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CEE17BD24; Thu, 17 May 2018 11:53:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B7FCD19; Thu, 17 May 2018 11:53:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HBr4eW087579; Thu, 17 May 2018 11:53:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HBr4E9087578; Thu, 17 May 2018 11:53:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171153.w4HBr4E9087578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 11:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333711 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 11:53:05 -0000 Author: manu Date: Thu May 17 11:53:04 2018 New Revision: 333711 URL: https://svnweb.freebsd.org/changeset/base/333711 Log: aw_spi: Fix manpages Somehow two copies of the man was in the file, remove one. Replace an occurence of 'SD/MMC' that was left from copy/paste. Remove space before ':' Reported by: 0mp Modified: head/share/man/man4/aw_spi.4 Modified: head/share/man/man4/aw_spi.4 ============================================================================== --- head/share/man/man4/aw_spi.4 Thu May 17 10:25:49 2018 (r333710) +++ head/share/man/man4/aw_spi.4 Thu May 17 11:53:04 2018 (r333711) @@ -40,65 +40,7 @@ device driver provides support for the Allwinner SPI h .Sh HARDWARE The current version of the .Nm -driver supports the SD/MMC controller with one of the following compatible strings : -.Pp -.Bl -bullet -compact -.It -allwinner,sun8i-h3-spi -.El -.Sh HISTORY -The -.Nm -device driver first appeared in -.Fx 12.0 . -.Sh AUTHORS -The -.Nm -device driver was written by -.An Emmanuel Vadot Aq Mt manu@freebsd.org . -.\"- -.\" Copyright (c) 2018 Emmanuel Vadot -.\" 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 May 17, 2018 -.Dt AW_SPI 4 -.Os -.Sh NAME -.Nm aw_spi -.Nd driver for the SPI controller in Allwinner SoC -.Sh SYNOPSIS -.Cd "device aw_spi" -.Sh DESCRIPTION -The -.Nm -device driver provides support for the Allwinner SPI host controller. -.Sh HARDWARE -The current version of the -.Nm -driver supports the SD/MMC controller with one of the following compatible strings : +driver supports the SPI controller with one of the following compatible strings: .Pp .Bl -bullet -compact .It From owner-svn-src-all@freebsd.org Thu May 17 12:18:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE65CEEDC93; Thu, 17 May 2018 12:18:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9502A7CED8; Thu, 17 May 2018 12:18:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76F121052; Thu, 17 May 2018 12:18:42 +0000 (UTC) (envelope-from rgrimes@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HCIgma098044; Thu, 17 May 2018 12:18:42 GMT (envelope-from rgrimes@FreeBSD.org) Received: (from rgrimes@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HCIgjl098043; Thu, 17 May 2018 12:18:42 GMT (envelope-from rgrimes@FreeBSD.org) Message-Id: <201805171218.w4HCIgjl098043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to rgrimes@FreeBSD.org using -f From: "Rodney W. Grimes" Date: Thu, 17 May 2018 12:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333712 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: rgrimes X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 333712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 12:18:43 -0000 Author: rgrimes Date: Thu May 17 12:18:41 2018 New Revision: 333712 URL: https://svnweb.freebsd.org/changeset/base/333712 Log: Add missing newline to end of -c usage string . Pointy hat: me Submitted by: novel Approved by: bde(mentor), grehan (maintainer) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15421 Modified: head/usr.sbin/bhyve/bhyverun.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu May 17 11:53:04 2018 (r333711) +++ head/usr.sbin/bhyve/bhyverun.c Thu May 17 12:18:41 2018 (r333712) @@ -147,7 +147,7 @@ usage(int code) " %*s [-m mem] [-p vcpu:hostcpu] [-s ] [-U uuid] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create ACPI tables\n" - " -c: number of cpus and/or topology specification" + " -c: number of cpus and/or topology specification\n" " -C: include guest memory in core file\n" " -e: exit on unhandled I/O access\n" " -g: gdb port\n" From owner-svn-src-all@freebsd.org Thu May 17 14:05:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB02EA81C0; Thu, 17 May 2018 14:05:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 791A7813C3; Thu, 17 May 2018 14:05:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56B7F225D; Thu, 17 May 2018 14:05:00 +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 w4HE50xO052671; Thu, 17 May 2018 14:05:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HE50pg052669; Thu, 17 May 2018 14:05:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805171405.w4HE50pg052669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 May 2018 14:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333713 - in head/sys: dev/usb/net modules/usb/muge X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: dev/usb/net modules/usb/muge X-SVN-Commit-Revision: 333713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:05:01 -0000 Author: emaste Date: Thu May 17 14:04:59 2018 New Revision: 333713 URL: https://svnweb.freebsd.org/changeset/base/333713 Log: Add driver for Microchip LAN78xx USB3-GigE controller This driver supports two Microchip USB-Ethernet controllers: LAN7800 USB 3.1 to 10/100/1000 Mbps Ethernet LAN7515 USB 2 to 10/100/1000 Mbps Ethernet with built-in USB hub The LAN7515 is the Ethernet controller on the Raspberry Pi 3B+. At present there is no datasheet for the LAN7515, but it is effectively a USB 2 hub combined with a LAN7800 controller. A comprehensive LAN7800 datasheet is at http://www.microchip.com/wwwproducts/en/LAN7800. This driver is based on the structure of the smsc(4) driver which supports Microchip/SMSC's LAN95xx family. (Microchip acquired SMSC in May 2012.) The Linux lan78xx driver served as a reference for some functionality and registers. The 'muge' driver name comes from "Microchip USB Gigabit Ethernet". I made some style adjustments and minor edits to Arshan's submission. It will be connected to the build after additional review and testing. Thanks to Microchip for providing a number of Evaluation Boards (EVBs) for development and testing. Submitted by: Arshan Khanifar Reviewed by: hselasky (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15168 Added: head/sys/dev/usb/net/if_muge.c (contents, props changed) head/sys/dev/usb/net/if_mugereg.h (contents, props changed) head/sys/modules/usb/muge/ head/sys/modules/usb/muge/Makefile (contents, props changed) Added: head/sys/dev/usb/net/if_muge.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_muge.c Thu May 17 14:04:59 2018 (r333713) @@ -0,0 +1,2199 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2012 Ben Gray . + * Copyright (C) 2018 The FreeBSD Foundation. + * + * This software was developed by Arshan Khanifar + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * USB-To-Ethernet adapter driver for Microchip's LAN78XX and related families. + * + * USB 3.1 to 10/100/1000 Mbps Ethernet + * LAN7800 http://www.microchip.com/wwwproducts/en/LAN7800 + * + * USB 2 to 10/100/1000 Mbps Ethernet with built-in USB hub + * LAN7515 (no datasheet available, but probes and functions as LAN7800) + * + * This driver is based on the if_smsc driver, with lan78xx-specific + * functionality modelled on Microchip's Linux lan78xx driver. + * + * UNIMPLEMENTED FEATURES + * ------------------ + * A number of features supported by the lan78xx are not yet implemented in + * this driver: + * + * 1. RX/TX checksum offloading: Nothing has been implemented yet for + * TX checksumming. RX checksumming works with ICMP messages, but is broken + * for TCP/UDP packets. + * 2. Direct address translation filtering: Implemented but untested. + * 3. VLAN tag removal. + * 4. Reading MAC address from the device tree: Specific to the RPi 3B+. + * Currently, the driver assigns a random MAC address itself. + * 5. Support for USB interrupt endpoints. + * 6. Latency Tolerance Messaging (LTM) support. + * 7. TCP LSO support. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "opt_platform.h" + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR lan78xx_debug +#include +#include + +#include + +#include + +#ifdef USB_DEBUG +static int muge_debug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, muge, CTLFLAG_RW, 0, + "Microchip LAN78xx USB-GigE"); +SYSCTL_INT(_hw_usb_muge, OID_AUTO, debug, CTLFLAG_RWTUN, &muge_debug, 0, + "Debug level"); +#endif + +#define MUGE_DEFAULT_RX_CSUM_ENABLE (false) +#define MUGE_DEFAULT_TX_CSUM_ENABLE (false) +#define MUGE_DEFAULT_TSO_CSUM_ENABLE (false) + +/* Supported Vendor and Product IDs. */ +static const struct usb_device_id lan78xx_devs[] = { +#define MUGE_DEV(p,i) { USB_VPI(USB_VENDOR_SMC2, USB_PRODUCT_SMC2_##p, i) } + MUGE_DEV(LAN7800_ETH, 0), +#undef MUGE_DEV +}; + +#ifdef USB_DEBUG +#define lan78xx_dbg_printf(sc, fmt, args...) \ +do { \ + if (muge_debug > 0) \ + device_printf((sc)->sc_ue.ue_dev, "debug: " fmt, ##args); \ +} while(0) +#else +#define muge_dbg_printf(sc, fmt, args...) do { } while (0) +#endif + +#define muge_warn_printf(sc, fmt, args...) \ + device_printf((sc)->sc_ue.ue_dev, "warning: " fmt, ##args) + +#define muge_err_printf(sc, fmt, args...) \ + device_printf((sc)->sc_ue.ue_dev, "error: " fmt, ##args) + +#define ETHER_IS_ZERO(addr) \ + (!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5])) + +#define ETHER_IS_VALID(addr) \ + (!ETHER_IS_MULTICAST(addr) && !ETHER_IS_ZERO(addr)) + +/* USB endpoints. */ + +enum { + MUGE_BULK_DT_RD, + MUGE_BULK_DT_WR, + /* + * the device does support interrupt endpoints, + * but they're not needed as we poll on MII status. + * MUGE_INTR_DT_WR, + * MUGE_INTR_DT_RD, + */ + MUGE_N_TRANSFER, +}; + +struct muge_softc { + struct usb_ether sc_ue; + struct mtx sc_mtx; + struct usb_xfer *sc_xfer[MUGE_N_TRANSFER]; + int sc_phyno; + + /* Settings for the mac control (MAC_CSR) register. */ + uint32_t sc_rfe_ctl; + uint32_t sc_mdix_ctl; + uint32_t sc_rev_id; + uint32_t sc_mchash_table[DP_SEL_VHF_HASH_LEN]; + uint32_t sc_pfilter_table[MUGE_NUM_PFILTER_ADDRS_][2]; + + uint32_t sc_flags; +#define MUGE_FLAG_LINK 0x0001 +}; + +#define MUGE_IFACE_IDX 0 + +#define MUGE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define MUGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define MUGE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) + + +static device_probe_t muge_probe; +static device_attach_t muge_attach; +static device_detach_t muge_detach; + +static usb_callback_t muge_bulk_read_callback; +static usb_callback_t muge_bulk_write_callback; + +static miibus_readreg_t lan78xx_miibus_readreg; +static miibus_writereg_t lan78xx_miibus_writereg; +static miibus_statchg_t lan78xx_miibus_statchg; + +static int muge_attach_post_sub(struct usb_ether *ue); +static uether_fn_t muge_attach_post; +static uether_fn_t muge_init; +static uether_fn_t muge_stop; +static uether_fn_t muge_start; +static uether_fn_t muge_tick; +static uether_fn_t muge_setmulti; +static uether_fn_t muge_setpromisc; + +static int muge_ifmedia_upd(struct ifnet *); +static void muge_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static int lan78xx_chip_init(struct muge_softc *sc); +static int muge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); + +static const struct usb_config muge_config[MUGE_N_TRANSFER] = { + + [MUGE_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .frames = 16, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = muge_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + + [MUGE_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 20480, /* bytes */ + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = muge_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, + /* + * The chip supports interrupt endpoints, however they aren't + * needed as we poll on the MII status. + */ +}; + +static const struct usb_ether_methods muge_ue_methods = { + .ue_attach_post = muge_attach_post, + .ue_attach_post_sub = muge_attach_post_sub, + .ue_start = muge_start, + .ue_ioctl = muge_ioctl, + .ue_init = muge_init, + .ue_stop = muge_stop, + .ue_tick = muge_tick, + .ue_setmulti = muge_setmulti, + .ue_setpromisc = muge_setpromisc, + .ue_mii_upd = muge_ifmedia_upd, + .ue_mii_sts = muge_ifmedia_sts, +}; + +/** + * lan78xx_read_reg - Read a 32-bit register on the device + * @sc: driver soft context + * @off: offset of the register + * @data: pointer a value that will be populated with the register value + * + * LOCKING: + * The device lock must be held before calling this function. + * + * RETURNS: + * 0 on success, a USB_ERR_?? error code on failure. + */ +static int +lan78xx_read_reg(struct muge_softc *sc, uint32_t off, uint32_t *data) +{ + struct usb_device_request req; + uint32_t buf; + usb_error_t err; + + MUGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = UVR_READ_REG; + USETW(req.wValue, 0); + USETW(req.wIndex, off); + USETW(req.wLength, 4); + + err = uether_do_request(&sc->sc_ue, &req, &buf, 1000); + if (err != 0) + muge_warn_printf(sc, "Failed to read register 0x%0x\n", off); + *data = le32toh(buf); + return (err); +} + +/** + * lan78xx_write_reg - Write a 32-bit register on the device + * @sc: driver soft context + * @off: offset of the register + * @data: the 32-bit value to write into the register + * + * LOCKING: + * The device lock must be held before calling this function. + * + * RETURNS: + * 0 on success, a USB_ERR_?? error code on failure. + */ +static int +lan78xx_write_reg(struct muge_softc *sc, uint32_t off, uint32_t data) +{ + struct usb_device_request req; + uint32_t buf; + usb_error_t err; + + MUGE_LOCK_ASSERT(sc, MA_OWNED); + + buf = htole32(data); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = UVR_WRITE_REG; + USETW(req.wValue, 0); + USETW(req.wIndex, off); + USETW(req.wLength, 4); + + err = uether_do_request(&sc->sc_ue, &req, &buf, 1000); + if (err != 0) + muge_warn_printf(sc, "Failed to write register 0x%0x\n", off); + return (err); +} + +/** + * lan78xx_wait_for_bits - Poll on a register value until bits are cleared + * @sc: soft context + * @reg: offset of the register + * @bits: if the bits are clear the function returns + * + * LOCKING: + * The device lock must be held before calling this function. + * + * RETURNS: + * 0 on success, or a USB_ERR_?? error code on failure. + */ +static int +lan78xx_wait_for_bits(struct muge_softc *sc, uint32_t reg, uint32_t bits) +{ + usb_ticks_t start_ticks; + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + uint32_t val; + int err; + + MUGE_LOCK_ASSERT(sc, MA_OWNED); + + start_ticks = (usb_ticks_t)ticks; + do { + if ((err = lan78xx_read_reg(sc, reg, &val)) != 0) + return (err); + if (!(val & bits)) + return (0); + uether_pause(&sc->sc_ue, hz / 100); + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); + + return (USB_ERR_TIMEOUT); +} + +/** + * lan78xx_eeprom_read_raw - Read the attached EEPROM + * @sc: soft context + * @off: the eeprom address offset + * @buf: stores the bytes + * @buflen: the number of bytes to read + * + * Simply reads bytes from an attached eeprom. + * + * LOCKING: + * The function takes and releases the device lock if not already held. + * + * RETURNS: + * 0 on success, or a USB_ERR_?? error code on failure. + */ +static int +lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_t off, uint8_t *buf, + uint16_t buflen) +{ + usb_ticks_t start_ticks; + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + int err, locked; + uint32_t val, saved; + uint16_t i; + + locked = mtx_owned(&sc->sc_mtx); /* XXX */ + if (!locked) + MUGE_LOCK(sc); + + err = lan78xx_read_reg(sc, HW_CFG, &val); + saved = val; + + val &= ~(HW_CFG_LEDO_EN_ | HW_CFG_LED1_EN_); + err = lan78xx_write_reg(sc, HW_CFG, val); + + err = lan78xx_wait_for_bits(sc, E2P_CMD, E2P_CMD_BUSY_); + if (err != 0) { + muge_warn_printf(sc, "eeprom busy, failed to read data\n"); + goto done; + } + + /* Start reading the bytes, one at a time. */ + for (i = 0; i < buflen; i++) { + val = E2P_CMD_BUSY_ | E2P_CMD_READ_; + val |= (E2P_CMD_ADDR_MASK_ & (off + i)); + if ((err = lan78xx_write_reg(sc, E2P_CMD, val)) != 0) + goto done; + + start_ticks = (usb_ticks_t)ticks; + do { + if ((err = lan78xx_read_reg(sc, E2P_CMD, &val)) != 0) + goto done; + if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_)) + break; + + uether_pause(&sc->sc_ue, hz / 100); + } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); + + if (val & (E2P_CMD_BUSY_ | E2P_CMD_TIMEOUT_)) { + muge_warn_printf(sc, "eeprom command failed\n"); + err = USB_ERR_IOERROR; + break; + } + + if ((err = lan78xx_read_reg(sc, E2P_DATA, &val)) != 0) + goto done; + + buf[i] = (val & 0xff); + } + +done: + if (!locked) + MUGE_UNLOCK(sc); + lan78xx_write_reg(sc, HW_CFG, saved); + return (err); +} + +/** + * lan78xx_eeprom_read - Read EEPROM and confirm it is programmed + * @sc: soft context + * @off: the eeprom address offset + * @buf: stores the bytes + * @buflen: the number of bytes to read + * + * RETURNS: + * 0 on success, or a USB_ERR_?? error code on failure. + */ +static int +lan78xx_eeprom_read(struct muge_softc *sc, uint16_t off, uint8_t *buf, + uint16_t buflen) +{ + uint8_t sig; + int ret; + + ret = lan78xx_eeprom_read_raw(sc, E2P_INDICATOR_OFFSET, &sig, 1); + if ((ret == 0) && (sig == E2P_INDICATOR)) { + ret = lan78xx_eeprom_read_raw(sc, off, buf, buflen); + muge_dbg_printf(sc, "EEPROM present\n"); + } else { + ret = -EINVAL; + muge_dbg_printf(sc, "EEPROM not present\n"); + } + return ret; +} + +/** + * lan78xx_otp_read_raw + * @sc: soft context + * @off: the otp address offset + * @buf: stores the bytes + * @buflen: the number of bytes to read + * + * Simply reads bytes from the OTP. + * + * LOCKING: + * The function takes and releases the device lock if not already held. + * + * RETURNS: + * 0 on success, or a USB_ERR_?? error code on failure. + * + */ +static int +lan78xx_otp_read_raw(struct muge_softc *sc, uint16_t off, uint8_t *buf, + uint16_t buflen) +{ + int locked, err; + uint32_t val; + uint16_t i; + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MUGE_LOCK(sc); + + err = lan78xx_read_reg(sc, OTP_PWR_DN, &val); + + /* checking if bit is set */ + if (val & OTP_PWR_DN_PWRDN_N) { + /* clearing it, then waiting for it to be cleared */ + lan78xx_write_reg(sc, OTP_PWR_DN, 0); + err = lan78xx_wait_for_bits(sc, OTP_PWR_DN, OTP_PWR_DN_PWRDN_N); + if (err != 0) { + muge_warn_printf(sc, "OTP off? failed to read data\n"); + goto done; + } + } + /* start reading the bytes, one at a time */ + for (i = 0; i < buflen; i++) { + err = lan78xx_write_reg(sc, OTP_ADDR1, + ((off + i) >> 8) & OTP_ADDR1_15_11); + err = lan78xx_write_reg(sc, OTP_ADDR2, + ((off + i) & OTP_ADDR2_10_3)); + err = lan78xx_write_reg(sc, OTP_FUNC_CMD, OTP_FUNC_CMD_READ_); + err = lan78xx_write_reg(sc, OTP_CMD_GO, OTP_CMD_GO_GO_); + + err = lan78xx_wait_for_bits(sc, OTP_STATUS, OTP_STATUS_BUSY_); + if (err != 0) { + muge_warn_printf(sc, "OTP busy failed to read data\n"); + goto done; + } + + if ((err = lan78xx_read_reg(sc, OTP_RD_DATA, &val)) != 0) + goto done; + + buf[i] = (uint8_t)(val & 0xff); + } + +done: + if (!locked) + MUGE_UNLOCK(sc); + return (err); +} + +/** + * lan78xx_otp_read + * @sc: soft context + * @off: the otp address offset + * @buf: stores the bytes + * @buflen: the number of bytes to read + * + * Simply reads bytes from the otp. + * + * LOCKING: + * The function takes and releases device lock if it is not already held. + * + * RETURNS: + * 0 on success, or a USB_ERR_?? error code on failure. + */ +static int +lan78xx_otp_read(struct muge_softc *sc, uint16_t off, uint8_t *buf, + uint16_t buflen) +{ + uint8_t sig; + int err; + + err = lan78xx_otp_read_raw(sc, OTP_INDICATOR_OFFSET, &sig, 1); + if (err == 0) { + if (sig == OTP_INDICATOR_1) { + } else if (sig == OTP_INDICATOR_2) { + off += 0x100; + } else { + err = -EINVAL; + } + if(!err) + err = lan78xx_otp_read_raw(sc, off, buf, buflen); + } + return err; +} + +/** + * lan78xx_setmacaddress - Set the mac address in the device + * @sc: driver soft context + * @addr: pointer to array contain at least 6 bytes of the mac + * + * LOCKING: + * Should be called with the MUGE lock held. + * + * RETURNS: + * Returns 0 on success or a negative error code. + */ +static int +lan78xx_setmacaddress(struct muge_softc *sc, const uint8_t *addr) +{ + int err; + uint32_t val; + + muge_dbg_printf(sc, + "setting mac address to %02x:%02x:%02x:%02x:%02x:%02x\n", + addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); + + MUGE_LOCK_ASSERT(sc, MA_OWNED); + + val = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0]; + if ((err = lan78xx_write_reg(sc, RX_ADDRL, val)) != 0) + goto done; + + val = (addr[5] << 8) | addr[4]; + err = lan78xx_write_reg(sc, RX_ADDRH, val); + +done: + return (err); +} + +/** + * lan78xx_set_rx_max_frame_length + * @sc: driver soft context + * @size: pointer to array contain at least 6 bytes of the mac + * + * Sets the maximum frame length to be received. Frames bigger than + * this size are aborted. + * + * RETURNS: + * Returns 0 on success or a negative error code. + */ +static int +lan78xx_set_rx_max_frame_length(struct muge_softc *sc, int size) +{ + int err = 0; + uint32_t buf; + bool rxenabled; + + /* first we have to disable rx before changing the length */ + + err = lan78xx_read_reg(sc, MAC_RX, &buf); + rxenabled = ((buf & MAC_RX_EN_) != 0); + + if (rxenabled) { + buf &= ~MAC_RX_EN_; + err = lan78xx_write_reg(sc, MAC_RX, buf); + } + + /* setting max frame length */ + + buf &= ~MAC_RX_MAX_FR_SIZE_MASK_; + buf |= (((size + 4) << MAC_RX_MAX_FR_SIZE_SHIFT_) & + MAC_RX_MAX_FR_SIZE_MASK_); + err = lan78xx_write_reg(sc, MAC_RX, buf); + + /* If it were enabled before, we enable it back. */ + + if (rxenabled) { + buf |= MAC_RX_EN_; + err = lan78xx_write_reg(sc, MAC_RX, buf); + } + + return 0; +} + +/** + * lan78xx_miibus_readreg - Read a MII/MDIO register + * @dev: usb ether device + * @phy: the number of phy reading from + * @reg: the register address + * + * LOCKING: + * Takes and releases the device mutex lock if not already held. + * + * RETURNS: + * Returns the 16-bits read from the MII register, if this function fails + * 0 is returned. + */ +static int +lan78xx_miibus_readreg(device_t dev, int phy, int reg) { + + struct muge_softc *sc = device_get_softc(dev); + int locked; + uint32_t addr, val; + + val = 0; + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MUGE_LOCK(sc); + + if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) { + muge_warn_printf(sc, "MII is busy\n"); + goto done; + } + + addr = (phy << 11) | (reg << 6) | MII_READ_ | MII_BUSY_; + lan78xx_write_reg(sc, MII_ACCESS, addr); + + if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) { + muge_warn_printf(sc, "MII read timeout\n"); + goto done; + } + + lan78xx_read_reg(sc, MII_DATA, &val); + val = le32toh(val); + +done: + if (!locked) + MUGE_UNLOCK(sc); + + return (val & 0xFFFF); +} + +/** + * lan78xx_miibus_writereg - Writes a MII/MDIO register + * @dev: usb ether device + * @phy: the number of phy writing to + * @reg: the register address + * @val: the value to write + * + * Attempts to write a PHY register through the usb controller registers. + * + * LOCKING: + * Takes and releases the device mutex lock if not already held. + * + * RETURNS: + * Always returns 0 regardless of success or failure. + */ +static int +lan78xx_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct muge_softc *sc = device_get_softc(dev); + int locked; + uint32_t addr; + + if (sc->sc_phyno != phy) + return (0); + + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MUGE_LOCK(sc); + + if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) { + muge_warn_printf(sc, "MII is busy\n"); + goto done; + } + + val = htole32(val); + lan78xx_write_reg(sc, MII_DATA, val); + + addr = (phy << 11) | (reg << 6) | MII_WRITE_ | MII_BUSY_; + lan78xx_write_reg(sc, MII_ACCESS, addr); + + if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) + muge_warn_printf(sc, "MII write timeout\n"); + +done: + if (!locked) + MUGE_UNLOCK(sc); + return (0); +} + +/* + * lan78xx_miibus_statchg - Called to detect phy status change + * @dev: usb ether device + * + * This function is called periodically by the system to poll for status + * changes of the link. + * + * LOCKING: + * Takes and releases the device mutex lock if not already held. + */ +static void +lan78xx_miibus_statchg(device_t dev) +{ + struct muge_softc *sc = device_get_softc(dev); + struct mii_data *mii = uether_getmii(&sc->sc_ue); + struct ifnet *ifp; + int locked; + int err; + uint32_t flow = 0; + uint32_t fct_flow = 0; + + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MUGE_LOCK(sc); + + ifp = uether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + /* Use the MII status to determine link status */ + sc->sc_flags &= ~MUGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + muge_dbg_printf(sc, "media is active\n"); + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->sc_flags |= MUGE_FLAG_LINK; + muge_dbg_printf(sc, "10/100 ethernet\n"); + break; + case IFM_1000_T: + sc->sc_flags |= MUGE_FLAG_LINK; + muge_dbg_printf(sc, "Gigabit ethernet\n"); + break; + default: + break; + } + } + /* Lost link, do nothing. */ + if ((sc->sc_flags & MUGE_FLAG_LINK) == 0) { + muge_dbg_printf(sc, "link flag not set\n"); + goto done; + } + + err = lan78xx_read_reg(sc, FCT_FLOW, &fct_flow); + if (err) { + muge_warn_printf(sc, + "failed to read initial flow control thresholds, error %d\n", + err); + goto done; + } + + /* Enable/disable full duplex operation and TX/RX pause */ + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + muge_dbg_printf(sc, "full duplex operation\n"); + + /* enable transmit MAC flow control function */ + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + flow |= FLOW_CR_TX_FCEN_ | 0xFFFF; + + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + flow |= FLOW_CR_RX_FCEN_; + } + + switch(usbd_get_speed(sc->sc_ue.ue_udev)) { + case USB_SPEED_SUPER: + fct_flow = 0x817; /* XXX */ + break; + case USB_SPEED_HIGH: + fct_flow = 0x211; /* XXX */ + break; + default: + break; + } + + err += lan78xx_write_reg(sc, FLOW, flow); + err += lan78xx_write_reg(sc, FCT_FLOW, fct_flow); + if (err) + muge_warn_printf(sc, "media change failed, error %d\n", err); + +done: + if (!locked) + MUGE_UNLOCK(sc); +} + +/* + * lan78xx_set_mdix_auto - Configure the device to enable automatic + * crossover and polarity detection. LAN7800 provides HP Auto-MDIX + * functionality for seamless crossover and polarity detection. + * + * @sc: driver soft context + * + * LOCKING: + * Takes and releases the device mutex lock if not already held. + */ +static void +lan78xx_set_mdix_auto(struct muge_softc *sc) +{ + uint32_t buf, err; + + err = lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_EXT_PAGE_ACCESS, MUGE_EXT_PAGE_SPACE_1); + + buf = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_EXT_MODE_CTRL); + buf &= ~MUGE_EXT_MODE_CTRL_MDIX_MASK_; + buf |= MUGE_EXT_MODE_CTRL_AUTO_MDIX_; + + lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); + err += lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_EXT_MODE_CTRL, buf); + + err += lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_EXT_PAGE_ACCESS, MUGE_EXT_PAGE_SPACE_0); + + if (err != 0) + muge_warn_printf(sc, "error setting PHY's MDIX status\n"); + + sc->sc_mdix_ctl = buf; +} + +/** + * lan78xx_phy_init - Initialises the in-built MUGE phy + * @sc: driver soft context + * + * Resets the PHY part of the chip and then initialises it to default + * values. The 'link down' and 'auto-negotiation complete' interrupts + * from the PHY are also enabled, however we don't monitor the interrupt + * endpoints for the moment. + * + * RETURNS: + * Returns 0 on success or EIO if failed to reset the PHY. + */ +static int +lan78xx_phy_init(struct muge_softc *sc) +{ + muge_dbg_printf(sc, "Initializing PHY.\n"); + uint16_t bmcr; + usb_ticks_t start_ticks; + const usb_ticks_t max_ticks = USB_MS_TO_TICKS(1000); + + MUGE_LOCK_ASSERT(sc, MA_OWNED); + + /* Reset phy and wait for reset to complete */ + lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR, + BMCR_RESET); + + start_ticks = ticks; + do { + uether_pause(&sc->sc_ue, hz / 100); + bmcr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, + MII_BMCR); + } while ((bmcr & BMCR_RESET) && ((ticks - start_ticks) < max_ticks)); + + if (((usb_ticks_t)(ticks - start_ticks)) >= max_ticks) { + muge_err_printf(sc, "PHY reset timed-out\n"); + return (EIO); + } + + /* Setup phy to interrupt upon link down or autoneg completion. */ + lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_PHY_INTR_STAT); + lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, + MUGE_PHY_INTR_MASK, + (MUGE_PHY_INTR_ANEG_COMP | MUGE_PHY_INTR_LINK_CHANGE)); + + /* Enable Auto-MDIX for crossover and polarity detection. */ + lan78xx_set_mdix_auto(sc); + + /* Enable all modes. */ + lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_ANAR, + ANAR_10 | ANAR_10_FD | ANAR_TX | ANAR_TX_FD | + ANAR_CSMA | ANAR_FC | ANAR_PAUSE_ASYM); + + /* Restart auto-negotation */ + bmcr |= BMCR_STARTNEG; + bmcr |= BMCR_AUTOEN; + lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR, bmcr); + bmcr = lan78xx_miibus_readreg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR); + return (0); +} + +/** + * lan78xx_chip_init - Initialises the chip after power on + * @sc: driver soft context + * + * This initialisation sequence is modelled on the procedure in the Linux + * driver. + * + * RETURNS: + * Returns 0 on success or an error code on failure. + */ +static int +lan78xx_chip_init(struct muge_softc *sc) +{ + int err; + int locked; + uint32_t buf; + uint32_t burst_cap; + + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + MUGE_LOCK(sc); + + /* Enter H/W config mode */ + lan78xx_write_reg(sc, HW_CFG, HW_CFG_LRST_); + + if ((err = lan78xx_wait_for_bits(sc, HW_CFG, HW_CFG_LRST_)) != 0) { + muge_warn_printf(sc, + "timed-out waiting for lite reset to complete\n"); + goto init_failed; + } + + /* Set the mac address */ + if ((err = lan78xx_setmacaddress(sc, sc->sc_ue.ue_eaddr)) != 0) { + muge_warn_printf(sc, "failed to set the MAC address\n"); + goto init_failed; + } + + /* Read and display the revision register */ + if ((err = lan78xx_read_reg(sc, ID_REV, &sc->sc_rev_id)) < 0) { + muge_warn_printf(sc, "failed to read ID_REV (err = %d)\n", err); + goto init_failed; + } + + device_printf(sc->sc_ue.ue_dev, "chip 0x%04lx, rev. %04lx\n", + (sc->sc_rev_id & ID_REV_CHIP_ID_MASK_) >> 16, + (sc->sc_rev_id & ID_REV_CHIP_REV_MASK_)); + + /* Respond to BULK-IN tokens with a NAK when RX FIFO is empty. */ + if ((err = lan78xx_read_reg(sc, USB_CFG0, &buf)) != 0) { + muge_warn_printf(sc, "failed to read USB_CFG0: %d\n", err); + goto init_failed; + } + buf |= USB_CFG_BIR_; + lan78xx_write_reg(sc, USB_CFG0, buf); + + /* + * LTM support will go here. + */ + + /* Configuring the burst cap. */ + switch (usbd_get_speed(sc->sc_ue.ue_udev)) { + case USB_SPEED_SUPER: + burst_cap = MUGE_DEFAULT_BURST_CAP_SIZE/MUGE_SS_USB_PKT_SIZE; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 17 14:26:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E73EA944B; Thu, 17 May 2018 14:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F036820D1; Thu, 17 May 2018 14:26:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1DF125E8; Thu, 17 May 2018 14:26:12 +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 w4HEQCid062671; Thu, 17 May 2018 14:26:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HEQCT8062670; Thu, 17 May 2018 14:26:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805171426.w4HEQCT8062670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 May 2018 14:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333714 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:26:13 -0000 Author: emaste Date: Thu May 17 14:26:12 2018 New Revision: 333714 URL: https://svnweb.freebsd.org/changeset/base/333714 Log: Add initial man page for Microchip USB 3 Gigabit Ethernet controller Sponsored by: The FreeBSD Foundation Added: head/share/man/man4/muge.4 (contents, props changed) Added: head/share/man/man4/muge.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/muge.4 Thu May 17 14:26:12 2018 (r333714) @@ -0,0 +1,70 @@ +.\" Copyright (c) 2018 The FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 17, 2018 +.Dt MUGE 4 +.Os +.Sh NAME +.Nm muge +.Nd "Microchip LAN78xx USB Gigabit Ethernet driver" +.Sh SYNOPSIS +To load the driver as a module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_muge_load="YES" +.Ed +.Pp +.\" Alternatively, to compile this driver into the kernel, place the +.\" following lines in your kernel configuration file: +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for USB Gigabit Ethernet adapters based on +Microchip's LAN78xx and LAN7515 chipsets. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports: +.Pp +.Bl -bullet -compact +.It +Microchip LAN7800 USB 3.1 Gigabit Ethernet controller with PHY +.It +Microchip LAN7515 USB 2 hub and Gigabit Ethernet controller with PHY +.El +.Sh SEE ALSO +.Xr arp 4 , +.Xr miibus 4 , +.Xr usb 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . From owner-svn-src-all@freebsd.org Thu May 17 14:38:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32FE7EA9E03; Thu, 17 May 2018 14:38:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5C8D8281D; Thu, 17 May 2018 14:38:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5BA12782; Thu, 17 May 2018 14:38:58 +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 w4HEcwpB067819; Thu, 17 May 2018 14:38:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HEcwmP067818; Thu, 17 May 2018 14:38:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201805171438.w4HEcwmP067818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 17 May 2018 14:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333715 - head/contrib/llvm/lib/CodeGen X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/CodeGen X-SVN-Commit-Revision: 333715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:38:59 -0000 Author: dim Date: Thu May 17 14:38:58 2018 New Revision: 333715 URL: https://svnweb.freebsd.org/changeset/base/333715 Log: Pull in r322325 from upstream llvm trunk (by Matthias Braun): PeepholeOpt cleanup/refactor; NFC - Less unnecessary use of `auto` - Add early `using RegSubRegPair(AndIdx) =` to avoid countless `TargetInstrInfo::` qualifications. - Use references instead of pointers where possible. - Remove unused parameters. - Rewrite the CopyRewriter class hierarchy: - Pull out uncoalescable copy rewriting functionality into PeepholeOptimizer class. - Use an abstract base class to make it clear that rewriters are independent. - Remove unnecessary \brief in doxygen comments. - Remove unused constructor and method from ValueTracker. - Replace UseAdvancedTracking of ValueTracker with DisableAdvCopyOpt use. Even though upstream marked this as "No Functional Change", it does contain some functional changes, and these fix a compiler hang for one particular source file in the devel/godot port. PR: 228261 MFC after: 3 days Modified: head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp Modified: head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp Thu May 17 14:26:12 2018 (r333714) +++ head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp Thu May 17 14:38:58 2018 (r333715) @@ -98,6 +98,8 @@ #include using namespace llvm; +using RegSubRegPair = TargetInstrInfo::RegSubRegPair; +using RegSubRegPairAndIdx = TargetInstrInfo::RegSubRegPairAndIdx; #define DEBUG_TYPE "peephole-opt" @@ -110,6 +112,9 @@ static cl::opt DisablePeephole("disable-peephole", cl::Hidden, cl::init(false), cl::desc("Disable the peephole optimizer")); +/// Specifiy whether or not the value tracking looks through +/// complex instructions. When this is true, the value tracker +/// bails on everything that is not a copy or a bitcast. static cl::opt DisableAdvCopyOpt("disable-adv-copy-opt", cl::Hidden, cl::init(false), cl::desc("Disable advanced copy optimization")); @@ -132,11 +137,11 @@ static cl::opt MaxRecurrenceChain( "of commuting operands")); -STATISTIC(NumReuse, "Number of extension results reused"); -STATISTIC(NumCmps, "Number of compares eliminated"); -STATISTIC(NumImmFold, "Number of move immediate folded"); -STATISTIC(NumLoadFold, "Number of loads folded"); -STATISTIC(NumSelects, "Number of selects optimized"); +STATISTIC(NumReuse, "Number of extension results reused"); +STATISTIC(NumCmps, "Number of compares eliminated"); +STATISTIC(NumImmFold, "Number of move immediate folded"); +STATISTIC(NumLoadFold, "Number of loads folded"); +STATISTIC(NumSelects, "Number of selects optimized"); STATISTIC(NumUncoalescableCopies, "Number of uncoalescable copies optimized"); STATISTIC(NumRewrittenCopies, "Number of copies rewritten"); STATISTIC(NumNAPhysCopies, "Number of non-allocatable physical copies removed"); @@ -149,9 +154,9 @@ namespace { class PeepholeOptimizer : public MachineFunctionPass { const TargetInstrInfo *TII; const TargetRegisterInfo *TRI; - MachineRegisterInfo *MRI; - MachineDominatorTree *DT; // Machine dominator tree - MachineLoopInfo *MLI; + MachineRegisterInfo *MRI; + MachineDominatorTree *DT; // Machine dominator tree + MachineLoopInfo *MLI; public: static char ID; // Pass identification @@ -173,31 +178,28 @@ namespace { } } - /// \brief Track Def -> Use info used for rewriting copies. - using RewriteMapTy = - SmallDenseMap; + /// Track Def -> Use info used for rewriting copies. + using RewriteMapTy = SmallDenseMap; - /// \brief Sequence of instructions that formulate recurrence cycle. + /// Sequence of instructions that formulate recurrence cycle. using RecurrenceCycle = SmallVector; private: - bool optimizeCmpInstr(MachineInstr *MI, MachineBasicBlock *MBB); - bool optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB, + bool optimizeCmpInstr(MachineInstr &MI); + bool optimizeExtInstr(MachineInstr &MI, MachineBasicBlock &MBB, SmallPtrSetImpl &LocalMIs); - bool optimizeSelect(MachineInstr *MI, + bool optimizeSelect(MachineInstr &MI, SmallPtrSetImpl &LocalMIs); - bool optimizeCondBranch(MachineInstr *MI); - bool optimizeCoalescableCopy(MachineInstr *MI); - bool optimizeUncoalescableCopy(MachineInstr *MI, + bool optimizeCondBranch(MachineInstr &MI); + bool optimizeCoalescableCopy(MachineInstr &MI); + bool optimizeUncoalescableCopy(MachineInstr &MI, SmallPtrSetImpl &LocalMIs); bool optimizeRecurrence(MachineInstr &PHI); - bool findNextSource(unsigned Reg, unsigned SubReg, - RewriteMapTy &RewriteMap); - bool isMoveImmediate(MachineInstr *MI, + bool findNextSource(RegSubRegPair RegSubReg, RewriteMapTy &RewriteMap); + bool isMoveImmediate(MachineInstr &MI, SmallSet &ImmDefRegs, DenseMap &ImmDefMIs); - bool foldImmediate(MachineInstr *MI, MachineBasicBlock *MBB, - SmallSet &ImmDefRegs, + bool foldImmediate(MachineInstr &MI, SmallSet &ImmDefRegs, DenseMap &ImmDefMIs); /// \brief Finds recurrence cycles, but only ones that formulated around @@ -212,11 +214,11 @@ namespace { /// the set \p CopySrcRegs and \p CopyMIs. If this virtual register was /// previously seen as a copy, replace the uses of this copy with the /// previously seen copy's destination register. - bool foldRedundantCopy(MachineInstr *MI, + bool foldRedundantCopy(MachineInstr &MI, SmallSet &CopySrcRegs, DenseMap &CopyMIs); - /// \brief Is the register \p Reg a non-allocatable physical register? + /// Is the register \p Reg a non-allocatable physical register? bool isNAPhysCopy(unsigned Reg); /// \brief If copy instruction \p MI is a non-allocatable virtual<->physical @@ -224,11 +226,10 @@ namespace { /// non-allocatable physical register was previously copied to a virtual /// registered and hasn't been clobbered, the virt->phys copy can be /// deleted. - bool foldRedundantNAPhysCopy( - MachineInstr *MI, + bool foldRedundantNAPhysCopy(MachineInstr &MI, DenseMap &NAPhysToVirtMIs); - bool isLoadFoldable(MachineInstr *MI, + bool isLoadFoldable(MachineInstr &MI, SmallSet &FoldAsLoadDefCandidates); /// \brief Check whether \p MI is understood by the register coalescer @@ -249,10 +250,13 @@ namespace { (MI.isRegSequenceLike() || MI.isInsertSubregLike() || MI.isExtractSubregLike())); } + + MachineInstr &rewriteSource(MachineInstr &CopyLike, + RegSubRegPair Def, RewriteMapTy &RewriteMap); }; - /// \brief Helper class to hold instructions that are inside recurrence - /// cycles. The recurrence cycle is formulated around 1) a def operand and its + /// Helper class to hold instructions that are inside recurrence cycles. + /// The recurrence cycle is formulated around 1) a def operand and its /// tied use operand, or 2) a def operand and a use operand that is commutable /// with another use operand which is tied to the def operand. In the latter /// case, index of the tied use operand and the commutable use operand are @@ -273,13 +277,13 @@ namespace { Optional CommutePair; }; - /// \brief Helper class to hold a reply for ValueTracker queries. Contains the - /// returned sources for a given search and the instructions where the sources - /// were tracked from. + /// Helper class to hold a reply for ValueTracker queries. + /// Contains the returned sources for a given search and the instructions + /// where the sources were tracked from. class ValueTrackerResult { private: /// Track all sources found by one ValueTracker query. - SmallVector RegSrcs; + SmallVector RegSrcs; /// Instruction using the sources in 'RegSrcs'. const MachineInstr *Inst = nullptr; @@ -302,16 +306,20 @@ namespace { } void addSource(unsigned SrcReg, unsigned SrcSubReg) { - RegSrcs.push_back(TargetInstrInfo::RegSubRegPair(SrcReg, SrcSubReg)); + RegSrcs.push_back(RegSubRegPair(SrcReg, SrcSubReg)); } void setSource(int Idx, unsigned SrcReg, unsigned SrcSubReg) { assert(Idx < getNumSources() && "Reg pair source out of index"); - RegSrcs[Idx] = TargetInstrInfo::RegSubRegPair(SrcReg, SrcSubReg); + RegSrcs[Idx] = RegSubRegPair(SrcReg, SrcSubReg); } int getNumSources() const { return RegSrcs.size(); } + RegSubRegPair getSrc(int Idx) const { + return RegSrcs[Idx]; + } + unsigned getSrcReg(int Idx) const { assert(Idx < getNumSources() && "Reg source out of index"); return RegSrcs[Idx].Reg; @@ -367,59 +375,41 @@ namespace { /// The register where the value can be found. unsigned Reg; - /// Specifiy whether or not the value tracking looks through - /// complex instructions. When this is false, the value tracker - /// bails on everything that is not a copy or a bitcast. - /// - /// Note: This could have been implemented as a specialized version of - /// the ValueTracker class but that would have complicated the code of - /// the users of this class. - bool UseAdvancedTracking; - /// MachineRegisterInfo used to perform tracking. const MachineRegisterInfo &MRI; - /// Optional TargetInstrInfo used to perform some complex - /// tracking. + /// Optional TargetInstrInfo used to perform some complex tracking. const TargetInstrInfo *TII; - /// \brief Dispatcher to the right underlying implementation of - /// getNextSource. + /// Dispatcher to the right underlying implementation of getNextSource. ValueTrackerResult getNextSourceImpl(); - /// \brief Specialized version of getNextSource for Copy instructions. + /// Specialized version of getNextSource for Copy instructions. ValueTrackerResult getNextSourceFromCopy(); - /// \brief Specialized version of getNextSource for Bitcast instructions. + /// Specialized version of getNextSource for Bitcast instructions. ValueTrackerResult getNextSourceFromBitcast(); - /// \brief Specialized version of getNextSource for RegSequence - /// instructions. + /// Specialized version of getNextSource for RegSequence instructions. ValueTrackerResult getNextSourceFromRegSequence(); - /// \brief Specialized version of getNextSource for InsertSubreg - /// instructions. + /// Specialized version of getNextSource for InsertSubreg instructions. ValueTrackerResult getNextSourceFromInsertSubreg(); - /// \brief Specialized version of getNextSource for ExtractSubreg - /// instructions. + /// Specialized version of getNextSource for ExtractSubreg instructions. ValueTrackerResult getNextSourceFromExtractSubreg(); - /// \brief Specialized version of getNextSource for SubregToReg - /// instructions. + /// Specialized version of getNextSource for SubregToReg instructions. ValueTrackerResult getNextSourceFromSubregToReg(); - /// \brief Specialized version of getNextSource for PHI instructions. + /// Specialized version of getNextSource for PHI instructions. ValueTrackerResult getNextSourceFromPHI(); public: - /// \brief Create a ValueTracker instance for the value defined by \p Reg. + /// Create a ValueTracker instance for the value defined by \p Reg. /// \p DefSubReg represents the sub register index the value tracker will /// track. It does not need to match the sub register index used in the /// definition of \p Reg. - /// \p UseAdvancedTracking specifies whether or not the value tracker looks - /// through complex instructions. By default (false), it handles only copy - /// and bitcast instructions. /// If \p Reg is a physical register, a value tracker constructed with /// this constructor will not find any alternative source. /// Indeed, when \p Reg is a physical register that constructor does not @@ -427,46 +417,20 @@ namespace { /// Use the next constructor to track a physical register. ValueTracker(unsigned Reg, unsigned DefSubReg, const MachineRegisterInfo &MRI, - bool UseAdvancedTracking = false, const TargetInstrInfo *TII = nullptr) - : DefSubReg(DefSubReg), Reg(Reg), - UseAdvancedTracking(UseAdvancedTracking), MRI(MRI), TII(TII) { + : DefSubReg(DefSubReg), Reg(Reg), MRI(MRI), TII(TII) { if (!TargetRegisterInfo::isPhysicalRegister(Reg)) { Def = MRI.getVRegDef(Reg); DefIdx = MRI.def_begin(Reg).getOperandNo(); } } - /// \brief Create a ValueTracker instance for the value defined by - /// the pair \p MI, \p DefIdx. - /// Unlike the other constructor, the value tracker produced by this one - /// may be able to find a new source when the definition is a physical - /// register. - /// This could be useful to rewrite target specific instructions into - /// generic copy instructions. - ValueTracker(const MachineInstr &MI, unsigned DefIdx, unsigned DefSubReg, - const MachineRegisterInfo &MRI, - bool UseAdvancedTracking = false, - const TargetInstrInfo *TII = nullptr) - : Def(&MI), DefIdx(DefIdx), DefSubReg(DefSubReg), - UseAdvancedTracking(UseAdvancedTracking), MRI(MRI), TII(TII) { - assert(DefIdx < Def->getDesc().getNumDefs() && - Def->getOperand(DefIdx).isReg() && "Invalid definition"); - Reg = Def->getOperand(DefIdx).getReg(); - } - /// \brief Following the use-def chain, get the next available source /// for the tracked value. /// \return A ValueTrackerResult containing a set of registers /// and sub registers with tracked values. A ValueTrackerResult with /// an empty set of registers means no source was found. ValueTrackerResult getNextSource(); - - /// \brief Get the last register where the initial value can be found. - /// Initially this is the register of the definition. - /// Then, after each successful call to getNextSource, this is the - /// register of the last source. - unsigned getReg() const { return Reg; } }; } // end anonymous namespace @@ -476,11 +440,11 @@ char PeepholeOptimizer::ID = 0; char &llvm::PeepholeOptimizerID = PeepholeOptimizer::ID; INITIALIZE_PASS_BEGIN(PeepholeOptimizer, DEBUG_TYPE, - "Peephole Optimizations", false, false) + "Peephole Optimizations", false, false) INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree) INITIALIZE_PASS_DEPENDENCY(MachineLoopInfo) INITIALIZE_PASS_END(PeepholeOptimizer, DEBUG_TYPE, - "Peephole Optimizations", false, false) + "Peephole Optimizations", false, false) /// If instruction is a copy-like instruction, i.e. it reads a single register /// and writes a single register and it does not modify the source, and if the @@ -491,10 +455,10 @@ INITIALIZE_PASS_END(PeepholeOptimizer, DEBUG_TYPE, /// the code. Since this code does not currently share EXTRACTs, just ignore all /// debug uses. bool PeepholeOptimizer:: -optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB, +optimizeExtInstr(MachineInstr &MI, MachineBasicBlock &MBB, SmallPtrSetImpl &LocalMIs) { unsigned SrcReg, DstReg, SubIdx; - if (!TII->isCoalescableExtInstr(*MI, SrcReg, DstReg, SubIdx)) + if (!TII->isCoalescableExtInstr(MI, SrcReg, DstReg, SubIdx)) return false; if (TargetRegisterInfo::isPhysicalRegister(DstReg) || @@ -535,7 +499,7 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock * bool ExtendLife = true; for (MachineOperand &UseMO : MRI->use_nodbg_operands(SrcReg)) { MachineInstr *UseMI = UseMO.getParent(); - if (UseMI == MI) + if (UseMI == &MI) continue; if (UseMI->isPHI()) { @@ -568,7 +532,7 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock * continue; MachineBasicBlock *UseMBB = UseMI->getParent(); - if (UseMBB == MBB) { + if (UseMBB == &MBB) { // Local uses that come after the extension. if (!LocalMIs.count(UseMI)) Uses.push_back(&UseMO); @@ -576,7 +540,7 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock * // Non-local uses where the result of the extension is used. Always // replace these unless it's a PHI. Uses.push_back(&UseMO); - } else if (Aggressive && DT->dominates(MBB, UseMBB)) { + } else if (Aggressive && DT->dominates(&MBB, UseMBB)) { // We may want to extend the live range of the extension result in order // to replace these uses. ExtendedUses.push_back(&UseMO); @@ -640,19 +604,18 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock * /// against already sets (or could be modified to set) the same flag as the /// compare, then we can remove the comparison and use the flag from the /// previous instruction. -bool PeepholeOptimizer::optimizeCmpInstr(MachineInstr *MI, - MachineBasicBlock *MBB) { +bool PeepholeOptimizer::optimizeCmpInstr(MachineInstr &MI) { // If this instruction is a comparison against zero and isn't comparing a // physical register, we can try to optimize it. unsigned SrcReg, SrcReg2; int CmpMask, CmpValue; - if (!TII->analyzeCompare(*MI, SrcReg, SrcReg2, CmpMask, CmpValue) || + if (!TII->analyzeCompare(MI, SrcReg, SrcReg2, CmpMask, CmpValue) || TargetRegisterInfo::isPhysicalRegister(SrcReg) || (SrcReg2 != 0 && TargetRegisterInfo::isPhysicalRegister(SrcReg2))) return false; // Attempt to optimize the comparison instruction. - if (TII->optimizeCompareInstr(*MI, SrcReg, SrcReg2, CmpMask, CmpValue, MRI)) { + if (TII->optimizeCompareInstr(MI, SrcReg, SrcReg2, CmpMask, CmpValue, MRI)) { ++NumCmps; return true; } @@ -661,27 +624,26 @@ bool PeepholeOptimizer::optimizeCmpInstr(MachineInstr } /// Optimize a select instruction. -bool PeepholeOptimizer::optimizeSelect(MachineInstr *MI, +bool PeepholeOptimizer::optimizeSelect(MachineInstr &MI, SmallPtrSetImpl &LocalMIs) { unsigned TrueOp = 0; unsigned FalseOp = 0; bool Optimizable = false; SmallVector Cond; - if (TII->analyzeSelect(*MI, Cond, TrueOp, FalseOp, Optimizable)) + if (TII->analyzeSelect(MI, Cond, TrueOp, FalseOp, Optimizable)) return false; if (!Optimizable) return false; - if (!TII->optimizeSelect(*MI, LocalMIs)) + if (!TII->optimizeSelect(MI, LocalMIs)) return false; - MI->eraseFromParent(); + MI.eraseFromParent(); ++NumSelects; return true; } -/// \brief Check if a simpler conditional branch can be -/// generated -bool PeepholeOptimizer::optimizeCondBranch(MachineInstr *MI) { - return TII->optimizeCondBranch(*MI); +/// Check if a simpler conditional branch can be generated. +bool PeepholeOptimizer::optimizeCondBranch(MachineInstr &MI) { + return TII->optimizeCondBranch(MI); } /// \brief Try to find the next source that share the same register file @@ -695,30 +657,29 @@ bool PeepholeOptimizer::optimizeCondBranch(MachineInst /// share the same register file as \p Reg and \p SubReg. The client should /// then be capable to rewrite all intermediate PHIs to get the next source. /// \return False if no alternative sources are available. True otherwise. -bool PeepholeOptimizer::findNextSource(unsigned Reg, unsigned SubReg, +bool PeepholeOptimizer::findNextSource(RegSubRegPair RegSubReg, RewriteMapTy &RewriteMap) { // Do not try to find a new source for a physical register. // So far we do not have any motivating example for doing that. // Thus, instead of maintaining untested code, we will revisit that if // that changes at some point. + unsigned Reg = RegSubReg.Reg; if (TargetRegisterInfo::isPhysicalRegister(Reg)) return false; const TargetRegisterClass *DefRC = MRI->getRegClass(Reg); - SmallVector SrcToLook; - TargetInstrInfo::RegSubRegPair CurSrcPair(Reg, SubReg); + SmallVector SrcToLook; + RegSubRegPair CurSrcPair = RegSubReg; SrcToLook.push_back(CurSrcPair); unsigned PHICount = 0; - while (!SrcToLook.empty() && PHICount < RewritePHILimit) { - TargetInstrInfo::RegSubRegPair Pair = SrcToLook.pop_back_val(); + do { + CurSrcPair = SrcToLook.pop_back_val(); // As explained above, do not handle physical registers - if (TargetRegisterInfo::isPhysicalRegister(Pair.Reg)) + if (TargetRegisterInfo::isPhysicalRegister(CurSrcPair.Reg)) return false; - CurSrcPair = Pair; - ValueTracker ValTracker(CurSrcPair.Reg, CurSrcPair.SubReg, *MRI, - !DisableAdvCopyOpt, TII); + ValueTracker ValTracker(CurSrcPair.Reg, CurSrcPair.SubReg, *MRI, TII); // Follow the chain of copies until we find a more suitable source, a phi // or have to abort. @@ -747,14 +708,17 @@ bool PeepholeOptimizer::findNextSource(unsigned Reg, u unsigned NumSrcs = Res.getNumSources(); if (NumSrcs > 1) { PHICount++; + if (PHICount >= RewritePHILimit) { + DEBUG(dbgs() << "findNextSource: PHI limit reached\n"); + return false; + } + for (unsigned i = 0; i < NumSrcs; ++i) - SrcToLook.push_back(TargetInstrInfo::RegSubRegPair( - Res.getSrcReg(i), Res.getSrcSubReg(i))); + SrcToLook.push_back(Res.getSrc(i)); break; } - CurSrcPair.Reg = Res.getSrcReg(0); - CurSrcPair.SubReg = Res.getSrcSubReg(0); + CurSrcPair = Res.getSrc(0); // Do not extend the live-ranges of physical registers as they add // constraints to the register allocator. Moreover, if we want to extend // the live-range of a physical register, unlike SSA virtual register, @@ -764,7 +728,8 @@ bool PeepholeOptimizer::findNextSource(unsigned Reg, u // Keep following the chain if the value isn't any better yet. const TargetRegisterClass *SrcRC = MRI->getRegClass(CurSrcPair.Reg); - if (!TRI->shouldRewriteCopySrc(DefRC, SubReg, SrcRC, CurSrcPair.SubReg)) + if (!TRI->shouldRewriteCopySrc(DefRC, RegSubReg.SubReg, SrcRC, + CurSrcPair.SubReg)) continue; // We currently cannot deal with subreg operands on PHI instructions @@ -775,7 +740,7 @@ bool PeepholeOptimizer::findNextSource(unsigned Reg, u // We found a suitable source, and are done with this chain. break; } - } + } while (!SrcToLook.empty()); // If we did not find a more suitable source, there is nothing to optimize. return CurSrcPair.Reg != Reg; @@ -786,54 +751,50 @@ bool PeepholeOptimizer::findNextSource(unsigned Reg, u /// successfully traverse a PHI instruction and find suitable sources coming /// from its edges. By inserting a new PHI, we provide a rewritten PHI def /// suitable to be used in a new COPY instruction. -static MachineInstr * -insertPHI(MachineRegisterInfo *MRI, const TargetInstrInfo *TII, - const SmallVectorImpl &SrcRegs, - MachineInstr *OrigPHI) { +static MachineInstr & +insertPHI(MachineRegisterInfo &MRI, const TargetInstrInfo &TII, + const SmallVectorImpl &SrcRegs, + MachineInstr &OrigPHI) { assert(!SrcRegs.empty() && "No sources to create a PHI instruction?"); - const TargetRegisterClass *NewRC = MRI->getRegClass(SrcRegs[0].Reg); + const TargetRegisterClass *NewRC = MRI.getRegClass(SrcRegs[0].Reg); // NewRC is only correct if no subregisters are involved. findNextSource() // should have rejected those cases already. assert(SrcRegs[0].SubReg == 0 && "should not have subreg operand"); - unsigned NewVR = MRI->createVirtualRegister(NewRC); - MachineBasicBlock *MBB = OrigPHI->getParent(); - MachineInstrBuilder MIB = BuildMI(*MBB, OrigPHI, OrigPHI->getDebugLoc(), - TII->get(TargetOpcode::PHI), NewVR); + unsigned NewVR = MRI.createVirtualRegister(NewRC); + MachineBasicBlock *MBB = OrigPHI.getParent(); + MachineInstrBuilder MIB = BuildMI(*MBB, &OrigPHI, OrigPHI.getDebugLoc(), + TII.get(TargetOpcode::PHI), NewVR); unsigned MBBOpIdx = 2; - for (auto RegPair : SrcRegs) { + for (const RegSubRegPair &RegPair : SrcRegs) { MIB.addReg(RegPair.Reg, 0, RegPair.SubReg); - MIB.addMBB(OrigPHI->getOperand(MBBOpIdx).getMBB()); + MIB.addMBB(OrigPHI.getOperand(MBBOpIdx).getMBB()); // Since we're extended the lifetime of RegPair.Reg, clear the // kill flags to account for that and make RegPair.Reg reaches // the new PHI. - MRI->clearKillFlags(RegPair.Reg); + MRI.clearKillFlags(RegPair.Reg); MBBOpIdx += 2; } - return MIB; + return *MIB; } namespace { -/// \brief Helper class to rewrite the arguments of a copy-like instruction. -class CopyRewriter { +/// Interface to query instructions amenable to copy rewriting. +class Rewriter { protected: - /// The copy-like instruction. MachineInstr &CopyLike; - - /// The index of the source being rewritten. - unsigned CurrentSrcIdx = 0; - + unsigned CurrentSrcIdx = 0; ///< The index of the source being rewritten. public: - CopyRewriter(MachineInstr &MI) : CopyLike(MI) {} - virtual ~CopyRewriter() = default; + Rewriter(MachineInstr &CopyLike) : CopyLike(CopyLike) {} + virtual ~Rewriter() {} /// \brief Get the next rewritable source (SrcReg, SrcSubReg) and - /// the related value that it affects (TrackReg, TrackSubReg). + /// the related value that it affects (DstReg, DstSubReg). /// A source is considered rewritable if its register class and the - /// register class of the related TrackReg may not be register + /// register class of the related DstReg may not be register /// coalescer friendly. In other words, given a copy-like instruction /// not all the arguments may be returned at rewritable source, since /// some arguments are none to be register coalescer friendly. @@ -848,137 +809,72 @@ class CopyRewriter { (public) /// the only source this instruction has: /// (SrcReg, SrcSubReg) = (src, srcSubIdx). /// This source defines the whole definition, i.e., - /// (TrackReg, TrackSubReg) = (dst, dstSubIdx). + /// (DstReg, DstSubReg) = (dst, dstSubIdx). /// /// The second and subsequent calls will return false, as there is only one /// rewritable source. /// /// \return True if a rewritable source has been found, false otherwise. /// The output arguments are valid if and only if true is returned. - virtual bool getNextRewritableSource(unsigned &SrcReg, unsigned &SrcSubReg, - unsigned &TrackReg, - unsigned &TrackSubReg) { - // If CurrentSrcIdx == 1, this means this function has already been called - // once. CopyLike has one definition and one argument, thus, there is - // nothing else to rewrite. - if (!CopyLike.isCopy() || CurrentSrcIdx == 1) + virtual bool getNextRewritableSource(RegSubRegPair &Src, + RegSubRegPair &Dst) = 0; + + /// Rewrite the current source with \p NewReg and \p NewSubReg if possible. + /// \return True if the rewriting was possible, false otherwise. + virtual bool RewriteCurrentSource(unsigned NewReg, unsigned NewSubReg) = 0; +}; + +/// Rewriter for COPY instructions. +class CopyRewriter : public Rewriter { +public: + CopyRewriter(MachineInstr &MI) : Rewriter(MI) { + assert(MI.isCopy() && "Expected copy instruction"); + } + virtual ~CopyRewriter() = default; + + bool getNextRewritableSource(RegSubRegPair &Src, + RegSubRegPair &Dst) override { + // CurrentSrcIdx > 0 means this function has already been called. + if (CurrentSrcIdx > 0) return false; // This is the first call to getNextRewritableSource. // Move the CurrentSrcIdx to remember that we made that call. CurrentSrcIdx = 1; // The rewritable source is the argument. const MachineOperand &MOSrc = CopyLike.getOperand(1); - SrcReg = MOSrc.getReg(); - SrcSubReg = MOSrc.getSubReg(); + Src = RegSubRegPair(MOSrc.getReg(), MOSrc.getSubReg()); // What we track are the alternative sources of the definition. const MachineOperand &MODef = CopyLike.getOperand(0); - TrackReg = MODef.getReg(); - TrackSubReg = MODef.getSubReg(); + Dst = RegSubRegPair(MODef.getReg(), MODef.getSubReg()); return true; } - /// \brief Rewrite the current source with \p NewReg and \p NewSubReg - /// if possible. - /// \return True if the rewriting was possible, false otherwise. - virtual bool RewriteCurrentSource(unsigned NewReg, unsigned NewSubReg) { - if (!CopyLike.isCopy() || CurrentSrcIdx != 1) + bool RewriteCurrentSource(unsigned NewReg, unsigned NewSubReg) override { + if (CurrentSrcIdx != 1) return false; MachineOperand &MOSrc = CopyLike.getOperand(CurrentSrcIdx); MOSrc.setReg(NewReg); MOSrc.setSubReg(NewSubReg); return true; } - - /// \brief Given a \p Def.Reg and Def.SubReg pair, use \p RewriteMap to find - /// the new source to use for rewrite. If \p HandleMultipleSources is true and - /// multiple sources for a given \p Def are found along the way, we found a - /// PHI instructions that needs to be rewritten. - /// TODO: HandleMultipleSources should be removed once we test PHI handling - /// with coalescable copies. - TargetInstrInfo::RegSubRegPair - getNewSource(MachineRegisterInfo *MRI, const TargetInstrInfo *TII, - TargetInstrInfo::RegSubRegPair Def, - PeepholeOptimizer::RewriteMapTy &RewriteMap, - bool HandleMultipleSources = true) { - TargetInstrInfo::RegSubRegPair LookupSrc(Def.Reg, Def.SubReg); - do { - ValueTrackerResult Res = RewriteMap.lookup(LookupSrc); - // If there are no entries on the map, LookupSrc is the new source. - if (!Res.isValid()) - return LookupSrc; - - // There's only one source for this definition, keep searching... - unsigned NumSrcs = Res.getNumSources(); - if (NumSrcs == 1) { - LookupSrc.Reg = Res.getSrcReg(0); - LookupSrc.SubReg = Res.getSrcSubReg(0); - continue; - } - - // TODO: Remove once multiple srcs w/ coalescable copies are supported. - if (!HandleMultipleSources) - break; - - // Multiple sources, recurse into each source to find a new source - // for it. Then, rewrite the PHI accordingly to its new edges. - SmallVector NewPHISrcs; - for (unsigned i = 0; i < NumSrcs; ++i) { - TargetInstrInfo::RegSubRegPair PHISrc(Res.getSrcReg(i), - Res.getSrcSubReg(i)); - NewPHISrcs.push_back( - getNewSource(MRI, TII, PHISrc, RewriteMap, HandleMultipleSources)); - } - - // Build the new PHI node and return its def register as the new source. - MachineInstr *OrigPHI = const_cast(Res.getInst()); - MachineInstr *NewPHI = insertPHI(MRI, TII, NewPHISrcs, OrigPHI); - DEBUG(dbgs() << "-- getNewSource\n"); - DEBUG(dbgs() << " Replacing: " << *OrigPHI); - DEBUG(dbgs() << " With: " << *NewPHI); - const MachineOperand &MODef = NewPHI->getOperand(0); - return TargetInstrInfo::RegSubRegPair(MODef.getReg(), MODef.getSubReg()); - - } while (true); - - return TargetInstrInfo::RegSubRegPair(0, 0); - } - - /// \brief Rewrite the source found through \p Def, by using the \p RewriteMap - /// and create a new COPY instruction. More info about RewriteMap in - /// PeepholeOptimizer::findNextSource. Right now this is only used to handle - /// Uncoalescable copies, since they are copy like instructions that aren't - /// recognized by the register allocator. - virtual MachineInstr * - RewriteSource(TargetInstrInfo::RegSubRegPair Def, - PeepholeOptimizer::RewriteMapTy &RewriteMap) { - return nullptr; - } }; /// \brief Helper class to rewrite uncoalescable copy like instructions /// into new COPY (coalescable friendly) instructions. -class UncoalescableRewriter : public CopyRewriter { -protected: - const TargetInstrInfo &TII; - MachineRegisterInfo &MRI; +class UncoalescableRewriter : public Rewriter { + unsigned NumDefs; ///< Number of defs in the bitcast. - /// The number of defs in the bitcast - unsigned NumDefs; - public: - UncoalescableRewriter(MachineInstr &MI, const TargetInstrInfo &TII, - MachineRegisterInfo &MRI) - : CopyRewriter(MI), TII(TII), MRI(MRI) { + UncoalescableRewriter(MachineInstr &MI) : Rewriter(MI) { NumDefs = MI.getDesc().getNumDefs(); } - /// \brief Get the next rewritable def source (TrackReg, TrackSubReg) + /// \see See Rewriter::getNextRewritableSource() /// All such sources need to be considered rewritable in order to /// rewrite a uncoalescable copy-like instruction. This method return /// each definition that must be checked if rewritable. - bool getNextRewritableSource(unsigned &SrcReg, unsigned &SrcSubReg, - unsigned &TrackReg, - unsigned &TrackSubReg) override { + bool getNextRewritableSource(RegSubRegPair &Src, + RegSubRegPair &Dst) override { // Find the next non-dead definition and continue from there. if (CurrentSrcIdx == NumDefs) return false; @@ -990,64 +886,27 @@ class UncoalescableRewriter : public CopyRewriter { (p } // What we track are the alternative sources of the definition. + Src = RegSubRegPair(0, 0); const MachineOperand &MODef = CopyLike.getOperand(CurrentSrcIdx); - TrackReg = MODef.getReg(); - TrackSubReg = MODef.getSubReg(); + Dst = RegSubRegPair(MODef.getReg(), MODef.getSubReg()); CurrentSrcIdx++; return true; } - /// \brief Rewrite the source found through \p Def, by using the \p RewriteMap - /// and create a new COPY instruction. More info about RewriteMap in - /// PeepholeOptimizer::findNextSource. Right now this is only used to handle - /// Uncoalescable copies, since they are copy like instructions that aren't - /// recognized by the register allocator. - MachineInstr * - RewriteSource(TargetInstrInfo::RegSubRegPair Def, - PeepholeOptimizer::RewriteMapTy &RewriteMap) override { - assert(!TargetRegisterInfo::isPhysicalRegister(Def.Reg) && - "We do not rewrite physical registers"); - - // Find the new source to use in the COPY rewrite. - TargetInstrInfo::RegSubRegPair NewSrc = - getNewSource(&MRI, &TII, Def, RewriteMap); - - // Insert the COPY. - const TargetRegisterClass *DefRC = MRI.getRegClass(Def.Reg); - unsigned NewVR = MRI.createVirtualRegister(DefRC); - - MachineInstr *NewCopy = - BuildMI(*CopyLike.getParent(), &CopyLike, CopyLike.getDebugLoc(), - TII.get(TargetOpcode::COPY), NewVR) - .addReg(NewSrc.Reg, 0, NewSrc.SubReg); - - NewCopy->getOperand(0).setSubReg(Def.SubReg); - if (Def.SubReg) - NewCopy->getOperand(0).setIsUndef(); - - DEBUG(dbgs() << "-- RewriteSource\n"); - DEBUG(dbgs() << " Replacing: " << CopyLike); - DEBUG(dbgs() << " With: " << *NewCopy); - MRI.replaceRegWith(Def.Reg, NewVR); - MRI.clearKillFlags(NewVR); - - // We extended the lifetime of NewSrc.Reg, clear the kill flags to - // account for that. - MRI.clearKillFlags(NewSrc.Reg); - - return NewCopy; + bool RewriteCurrentSource(unsigned NewReg, unsigned NewSubReg) override { + return false; } }; -/// \brief Specialized rewriter for INSERT_SUBREG instruction. -class InsertSubregRewriter : public CopyRewriter { +/// Specialized rewriter for INSERT_SUBREG instruction. +class InsertSubregRewriter : public Rewriter { public: - InsertSubregRewriter(MachineInstr &MI) : CopyRewriter(MI) { + InsertSubregRewriter(MachineInstr &MI) : Rewriter(MI) { assert(MI.isInsertSubreg() && "Invalid instruction"); } - /// \brief See CopyRewriter::getNextRewritableSource. + /// \see See Rewriter::getNextRewritableSource() /// Here CopyLike has the following form: /// dst = INSERT_SUBREG Src1, Src2.src2SubIdx, subIdx. /// Src1 has the same register class has dst, hence, there is @@ -1055,29 +914,27 @@ class InsertSubregRewriter : public CopyRewriter { (pu /// Src2.src2SubIdx, may not be register coalescer friendly. /// Therefore, the first call to this method returns: /// (SrcReg, SrcSubReg) = (Src2, src2SubIdx). - /// (TrackReg, TrackSubReg) = (dst, subIdx). + /// (DstReg, DstSubReg) = (dst, subIdx). /// /// Subsequence calls will return false. - bool getNextRewritableSource(unsigned &SrcReg, unsigned &SrcSubReg, - unsigned &TrackReg, - unsigned &TrackSubReg) override { + bool getNextRewritableSource(RegSubRegPair &Src, + RegSubRegPair &Dst) override { // If we already get the only source we can rewrite, return false. if (CurrentSrcIdx == 2) return false; // We are looking at v2 = INSERT_SUBREG v0, v1, sub0. CurrentSrcIdx = 2; const MachineOperand &MOInsertedReg = CopyLike.getOperand(2); - SrcReg = MOInsertedReg.getReg(); - SrcSubReg = MOInsertedReg.getSubReg(); + Src = RegSubRegPair(MOInsertedReg.getReg(), MOInsertedReg.getSubReg()); const MachineOperand &MODef = CopyLike.getOperand(0); // We want to track something that is compatible with the // partial definition. - TrackReg = MODef.getReg(); if (MODef.getSubReg()) // Bail if we have to compose sub-register indices. return false; - TrackSubReg = (unsigned)CopyLike.getOperand(3).getImm(); + Dst = RegSubRegPair(MODef.getReg(), + (unsigned)CopyLike.getOperand(3).getImm()); return true; } @@ -1092,41 +949,39 @@ class InsertSubregRewriter : public CopyRewriter { (pu } }; -/// \brief Specialized rewriter for EXTRACT_SUBREG instruction. -class ExtractSubregRewriter : public CopyRewriter { +/// Specialized rewriter for EXTRACT_SUBREG instruction. +class ExtractSubregRewriter : public Rewriter { const TargetInstrInfo &TII; public: ExtractSubregRewriter(MachineInstr &MI, const TargetInstrInfo &TII) - : CopyRewriter(MI), TII(TII) { + : Rewriter(MI), TII(TII) { assert(MI.isExtractSubreg() && "Invalid instruction"); } - /// \brief See CopyRewriter::getNextRewritableSource. + /// \see Rewriter::getNextRewritableSource() /// Here CopyLike has the following form: /// dst.dstSubIdx = EXTRACT_SUBREG Src, subIdx. /// There is only one rewritable source: Src.subIdx, /// which defines dst.dstSubIdx. - bool getNextRewritableSource(unsigned &SrcReg, unsigned &SrcSubReg, - unsigned &TrackReg, - unsigned &TrackSubReg) override { + bool getNextRewritableSource(RegSubRegPair &Src, + RegSubRegPair &Dst) override { // If we already get the only source we can rewrite, return false. if (CurrentSrcIdx == 1) return false; // We are looking at v1 = EXTRACT_SUBREG v0, sub0. CurrentSrcIdx = 1; const MachineOperand &MOExtractedReg = CopyLike.getOperand(1); - SrcReg = MOExtractedReg.getReg(); // If we have to compose sub-register indices, bail out. if (MOExtractedReg.getSubReg()) return false; - SrcSubReg = CopyLike.getOperand(2).getImm(); + Src = RegSubRegPair(MOExtractedReg.getReg(), + CopyLike.getOperand(2).getImm()); // We want to track something that is compatible with the definition. const MachineOperand &MODef = CopyLike.getOperand(0); - TrackReg = MODef.getReg(); - TrackSubReg = MODef.getSubReg(); + Dst = RegSubRegPair(MODef.getReg(), MODef.getSubReg()); return true; } @@ -1156,14 +1011,14 @@ class ExtractSubregRewriter : public CopyRewriter { (p } }; -/// \brief Specialized rewriter for REG_SEQUENCE instruction. -class RegSequenceRewriter : public CopyRewriter { +/// Specialized rewriter for REG_SEQUENCE instruction. +class RegSequenceRewriter : public Rewriter { public: - RegSequenceRewriter(MachineInstr &MI) : CopyRewriter(MI) { + RegSequenceRewriter(MachineInstr &MI) : Rewriter(MI) { assert(MI.isRegSequence() && "Invalid instruction"); } - /// \brief See CopyRewriter::getNextRewritableSource. + /// \see Rewriter::getNextRewritableSource() /// Here CopyLike has the following form: /// dst = REG_SEQUENCE Src1.src1SubIdx, subIdx1, Src2.src2SubIdx, subIdx2. /// Each call will return a different source, walking all the available @@ -1171,17 +1026,16 @@ class RegSequenceRewriter : public CopyRewriter { (pub /// /// The first call returns: /// (SrcReg, SrcSubReg) = (Src1, src1SubIdx). - /// (TrackReg, TrackSubReg) = (dst, subIdx1). + /// (DstReg, DstSubReg) = (dst, subIdx1). /// /// The second call returns: /// (SrcReg, SrcSubReg) = (Src2, src2SubIdx). - /// (TrackReg, TrackSubReg) = (dst, subIdx2). + /// (DstReg, DstSubReg) = (dst, subIdx2). /// /// And so on, until all the sources have been traversed, then /// it returns false. - bool getNextRewritableSource(unsigned &SrcReg, unsigned &SrcSubReg, - unsigned &TrackReg, - unsigned &TrackSubReg) override { + bool getNextRewritableSource(RegSubRegPair &Src, + RegSubRegPair &Dst) override { // We are looking at v0 = REG_SEQUENCE v1, sub1, v2, sub2, etc. // If this is the first call, move to the first argument. @@ -1194,17 +1048,17 @@ class RegSequenceRewriter : public CopyRewriter { (pub return false; } const MachineOperand &MOInsertedReg = CopyLike.getOperand(CurrentSrcIdx); - SrcReg = MOInsertedReg.getReg(); + Src.Reg = MOInsertedReg.getReg(); // If we have to compose sub-register indices, bail out. - if ((SrcSubReg = MOInsertedReg.getSubReg())) + if ((Src.SubReg = MOInsertedReg.getSubReg())) return false; // We want to track something that is compatible with the related // partial definition. - TrackSubReg = CopyLike.getOperand(CurrentSrcIdx + 1).getImm(); + Dst.SubReg = CopyLike.getOperand(CurrentSrcIdx + 1).getImm(); const MachineOperand &MODef = CopyLike.getOperand(0); - TrackReg = MODef.getReg(); + Dst.Reg = MODef.getReg(); // If we have to compose sub-registers, bail. return MODef.getSubReg() == 0; } @@ -1224,16 +1078,14 @@ class RegSequenceRewriter : public CopyRewriter { (pub } // end anonymous namespace -/// \brief Get the appropriated CopyRewriter for \p MI. -/// \return A pointer to a dynamically allocated CopyRewriter or nullptr -/// if no rewriter works for \p MI. -static CopyRewriter *getCopyRewriter(MachineInstr &MI, - const TargetInstrInfo &TII, - MachineRegisterInfo &MRI) { +/// Get the appropriated Rewriter for \p MI. +/// \return A pointer to a dynamically allocated Rewriter or nullptr if no +/// rewriter works for \p MI. +static Rewriter *getCopyRewriter(MachineInstr &MI, const TargetInstrInfo &TII) { // Handle uncoalescable copy-like instructions. - if (MI.isBitcast() || (MI.isRegSequenceLike() || MI.isInsertSubregLike() || - MI.isExtractSubregLike())) - return new UncoalescableRewriter(MI, TII, MRI); + if (MI.isBitcast() || MI.isRegSequenceLike() || MI.isInsertSubregLike() || + MI.isExtractSubregLike()) + return new UncoalescableRewriter(MI); switch (MI.getOpcode()) { default: @@ -1247,53 +1099,102 @@ static CopyRewriter *getCopyRewriter(MachineInstr &MI, case TargetOpcode::REG_SEQUENCE: return new RegSequenceRewriter(MI); } - llvm_unreachable(nullptr); } -/// \brief Optimize generic copy instructions to avoid cross -/// register bank copy. The optimization looks through a chain of -/// copies and tries to find a source that has a compatible register -/// class. -/// Two register classes are considered to be compatible if they share -/// the same register bank. +/// \brief Given a \p Def.Reg and Def.SubReg pair, use \p RewriteMap to find +/// the new source to use for rewrite. If \p HandleMultipleSources is true and +/// multiple sources for a given \p Def are found along the way, we found a +/// PHI instructions that needs to be rewritten. +/// TODO: HandleMultipleSources should be removed once we test PHI handling +/// with coalescable copies. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 17 14:51:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25849EAA9F3; Thu, 17 May 2018 14:51:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6CC183340; Thu, 17 May 2018 14:51:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8A5B2A66; Thu, 17 May 2018 14:51:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HEpMlW075779; Thu, 17 May 2018 14:51:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HEpMOD075777; Thu, 17 May 2018 14:51:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171451.w4HEpMOD075777@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 14:51:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333716 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 333716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:51:23 -0000 Author: manu Date: Thu May 17 14:51:22 2018 New Revision: 333716 URL: https://svnweb.freebsd.org/changeset/base/333716 Log: aw_spi: Fix some silly clock mistake The module uses the mod clock and not the ahb one. We need to set the mod clock to twice the speed requested as the smallest divider in the controller is 2. The clock test function weren't calculating the register value best on the best div but on the max one. The cdr2 test function was using the cdr1 formula. Pointy Hat: manu Modified: head/sys/arm/allwinner/aw_spi.c Modified: head/sys/arm/allwinner/aw_spi.c ============================================================================== --- head/sys/arm/allwinner/aw_spi.c Thu May 17 14:38:58 2018 (r333715) +++ head/sys/arm/allwinner/aw_spi.c Thu May 17 14:51:22 2018 (r333716) @@ -143,7 +143,7 @@ struct aw_spi_softc { struct mtx mtx; clk_t clk_ahb; clk_t clk_mod; - uint64_t ahb_freq; + uint64_t mod_freq; hwreset_t rst_ahb; void * intrhand; int transfer; @@ -238,8 +238,6 @@ aw_spi_attach(device_t dev) goto fail; } - clk_get_freq(sc->clk_ahb, &sc->ahb_freq); - sc->spibus = device_add_child(dev, "spibus", -1); return (0); @@ -329,33 +327,33 @@ aw_spi_clock_test_cdr1(struct aw_spi_softc *sc, uint64 max = AW_SPI_CCR_CDR1_MASK >> AW_SPI_CCR_CDR1_SHIFT; for (i = 0; i < max; i++) { - cur = sc->ahb_freq / (1 << i); + cur = sc->mod_freq / (1 << i); if ((clock - cur) < (clock - best)) { best = cur; best_div = i; } } - *ccr = (i << AW_SPI_CCR_CDR1_SHIFT); + *ccr = (best_div << AW_SPI_CCR_CDR1_SHIFT); return (best); } static uint64_t -aw_spi_clock_test_cdr2(struct aw_spi_softc *sc, uint32_t clock, uint32_t *ccr) +aw_spi_clock_test_cdr2(struct aw_spi_softc *sc, uint64_t clock, uint32_t *ccr) { uint64_t cur, best = 0; int i, max, best_div; max = ((AW_SPI_CCR_CDR2_MASK) >> AW_SPI_CCR_CDR2_SHIFT); for (i = 0; i < max; i++) { - cur = sc->ahb_freq / (1 << i); + cur = sc->mod_freq / (2 * i + 1); if ((clock - cur) < (clock - best)) { best = cur; best_div = i; } } - *ccr = AW_SPI_CCR_DRS | (i << AW_SPI_CCR_CDR2_SHIFT); + *ccr = AW_SPI_CCR_DRS | (best_div << AW_SPI_CCR_CDR2_SHIFT); return (best); } @@ -531,6 +529,9 @@ aw_spi_transfer(device_t dev, device_t child, struct s spibus_get_clock(child, &clock); spibus_get_mode(child, &mode); + /* The minimum divider is 2 so set the clock at twice the needed speed */ + clk_set_freq(sc->clk_mod, 2 * clock, CLK_SET_ROUND_DOWN); + clk_get_freq(sc->clk_mod, &sc->mod_freq); if (cs >= AW_SPI_MAX_CS) { device_printf(dev, "Invalid cs %d\n", cs); return (EINVAL); From owner-svn-src-all@freebsd.org Thu May 17 14:55:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C7FEAACEC; Thu, 17 May 2018 14:55:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F1DE83760; Thu, 17 May 2018 14:55:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFEFC2AB7; Thu, 17 May 2018 14:55:43 +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 w4HEthfU078213; Thu, 17 May 2018 14:55:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HEtg7u078204; Thu, 17 May 2018 14:55:42 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805171455.w4HEtg7u078204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 17 May 2018 14:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333717 - in head: . share/man/man4 sys/conf sys/dev/vxge sys/modules sys/modules/vxge tools/kerneldoc/subsys tools/tools tools/tools/vxge X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/vxge sys/modules sys/modules/vxge tools/kerneldoc/subsys tools/tools tools/tools/vxge X-SVN-Commit-Revision: 333717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 14:55:44 -0000 Author: sbruno Date: Thu May 17 14:55:41 2018 New Revision: 333717 URL: https://svnweb.freebsd.org/changeset/base/333717 Log: Retire vxge(4). This driver was merged to HEAD one week prior to Exar publicly announcing they had left the Ethernet market. It is not known to be used and has various code quality issues spotted by Brooks and Hiren. Retire it in preparation for FreeBSD 12.0. Submitted by: kbowling Reviewed by: brooks imp Relnotes: yes Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15442 Deleted: head/share/man/man4/vxge.4 head/sys/dev/vxge/ head/sys/modules/vxge/Makefile head/tools/kerneldoc/subsys/Doxyfile-dev_vxge head/tools/tools/vxge/ Modified: head/ObsoleteFiles.inc head/UPDATING head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/conf/makeLINT.mk head/sys/modules/Makefile head/tools/tools/README Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 17 14:51:22 2018 (r333716) +++ head/ObsoleteFiles.inc Thu May 17 14:55:41 2018 (r333717) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20180517: retire vxge +OLD_FILES+=usr/share/man/man4/if_vxge.4.gz +OLD_FILES+=usr/share/man/man4/vxge.4.gz # 20180512: Rename Unbound tools OLD_FILES+=usr/sbin/unbound OLD_FILES+=usr/sbin/unbound-anchor Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu May 17 14:51:22 2018 (r333716) +++ head/UPDATING Thu May 17 14:55:41 2018 (r333717) @@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180517: + The vxge(4) driver has been removed. This driver was introduced into + HEAD one week before the Exar left the Ethernet market and is not + known to be used. If you have device vxge in your kernel config file + it must be removed. + 20180510: The amd64 kernel now requires a ld that supports ifunc to produce a working kernel, either lld or a newer binutils. lld is built by default Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu May 17 14:51:22 2018 (r333716) +++ head/share/man/man4/Makefile Thu May 17 14:55:41 2018 (r333717) @@ -570,7 +570,6 @@ MAN= aac.4 \ vt.4 \ vte.4 \ ${_vtnet.4} \ - ${_vxge.4} \ watchdog.4 \ wb.4 \ ${_wbwd.4} \ @@ -754,7 +753,6 @@ MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 MLINKS+=${_vtnet.4} ${_if_vtnet.4} -MLINKS+=${_vxge.4} ${_if_vxge.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 MLINKS+=wi.4 if_wi.4 @@ -826,7 +824,6 @@ _if_nfe.4= if_nfe.4 _if_urtw.4= if_urtw.4 _if_vmx.4= if_vmx.4 _if_vtnet.4= if_vtnet.4 -_if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 _imcsmb.4= imcsmb.4 _ipmi.4= ipmi.4 @@ -847,7 +844,6 @@ _virtio_random.4= virtio_random.4 _virtio_scsi.4= virtio_scsi.4 _vmx.4= vmx.4 _vtnet.4= vtnet.4 -_vxge.4= vxge.4 _padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu May 17 14:51:22 2018 (r333716) +++ head/sys/conf/NOTES Thu May 17 14:55:41 2018 (r333717) @@ -2135,7 +2135,6 @@ device oce # Emulex 10 GbE (OneConnect Ethernet) device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') -device vxge # Exar/Neterion XFrame 3100 10GbE # PCI IEEE 802.11 Wireless NICs device ath # Atheros pci/cardbus NIC's Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 17 14:51:22 2018 (r333716) +++ head/sys/conf/files Thu May 17 14:55:41 2018 (r333717) @@ -3455,24 +3455,6 @@ dev/vt/vt_sysmouse.c optional vt dev/vte/if_vte.c optional vte pci dev/vx/if_vx.c optional vx dev/vx/if_vx_pci.c optional vx pci -dev/vxge/vxge.c optional vxge -dev/vxge/vxgehal/vxgehal-ifmsg.c optional vxge -dev/vxge/vxgehal/vxgehal-mrpcim.c optional vxge -dev/vxge/vxgehal/vxge-queue.c optional vxge -dev/vxge/vxgehal/vxgehal-ring.c optional vxge -dev/vxge/vxgehal/vxgehal-swapper.c optional vxge -dev/vxge/vxgehal/vxgehal-mgmt.c optional vxge -dev/vxge/vxgehal/vxgehal-srpcim.c optional vxge -dev/vxge/vxgehal/vxgehal-config.c optional vxge -dev/vxge/vxgehal/vxgehal-blockpool.c optional vxge -dev/vxge/vxgehal/vxgehal-doorbells.c optional vxge -dev/vxge/vxgehal/vxgehal-mgmtaux.c optional vxge -dev/vxge/vxgehal/vxgehal-device.c optional vxge -dev/vxge/vxgehal/vxgehal-mm.c optional vxge -dev/vxge/vxgehal/vxgehal-driver.c optional vxge -dev/vxge/vxgehal/vxgehal-virtualpath.c optional vxge -dev/vxge/vxgehal/vxgehal-channel.c optional vxge -dev/vxge/vxgehal/vxgehal-fifo.c optional vxge dev/watchdog/watchdog.c standard dev/wb/if_wb.c optional wb pci dev/wi/if_wi.c optional wi Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Thu May 17 14:51:22 2018 (r333716) +++ head/sys/conf/makeLINT.mk Thu May 17 14:55:41 2018 (r333717) @@ -45,7 +45,6 @@ LINT: ${NOTES} ${MAKELINT_SED} echo "nodevice sge" >> ${.TARGET}-NOIP echo "nodevice sk" >> ${.TARGET}-NOIP echo "nodevice txp" >> ${.TARGET}-NOIP - echo "nodevice vxge" >> ${.TARGET}-NOIP echo "nodevice netmap" >> ${.TARGET}-NOIP .endif .if ${TARGET} == "mips" Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu May 17 14:51:22 2018 (r333716) +++ head/sys/modules/Makefile Thu May 17 14:55:41 2018 (r333717) @@ -400,7 +400,6 @@ SUBDIR= \ vr \ vte \ vx \ - ${_vxge} \ wb \ ${_wbwd} \ ${_wi} \ @@ -619,7 +618,6 @@ _speaker= speaker _splash= splash _sppp= sppp _vmware= vmware -_vxge= vxge _wbwd= wbwd _wi= wi _xe= xe Modified: head/tools/tools/README ============================================================================== --- head/tools/tools/README Thu May 17 14:51:22 2018 (r333716) +++ head/tools/tools/README Thu May 17 14:55:41 2018 (r333717) @@ -64,5 +64,4 @@ vimage An interim utility for managing the virtualize stack infrastructure. vop_table Generates a HTML document that shows all the VOP's in the kernel. -vxge A diagnostic tool for the vxge(4) driver whereintheworld Summarizes "make world" output. From owner-svn-src-all@freebsd.org Thu May 17 15:11:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 201C1EABE9F; Thu, 17 May 2018 15:11:44 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80C95844BC; Thu, 17 May 2018 15:11:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4HFBe9p005936; Thu, 17 May 2018 08:11:40 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4HFBdqU005935; Thu, 17 May 2018 08:11:39 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805171511.w4HFBdqU005935@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333717 - in head: . share/man/man4 sys/conf sys/dev/vxge sys/modules sys/modules/vxge tools/kerneldoc/subsys tools/tools tools/tools/vxge In-Reply-To: <201805171455.w4HEtg7u078204@repo.freebsd.org> To: Sean Bruno Date: Thu, 17 May 2018 08:11:39 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:11:44 -0000 > Author: sbruno > Date: Thu May 17 14:55:41 2018 > New Revision: 333717 > URL: https://svnweb.freebsd.org/changeset/base/333717 > > Log: > Retire vxge(4). > > This driver was merged to HEAD one week prior to Exar publicly announcing they > had left the Ethernet market. It is not known to be used and has various code > quality issues spotted by Brooks and Hiren. Retire it in preparation for > FreeBSD 12.0. Did some form of deprecation notice make it into stable/11? I took a quick look at sys/dev/vxge/vxge.c and do not see any, nor did I find anything in the man page vxge.4. Thanks, > Submitted by: kbowling > Reviewed by: brooks imp > Relnotes: yes > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D15442 > > Deleted: > head/share/man/man4/vxge.4 > head/sys/dev/vxge/ > head/sys/modules/vxge/Makefile > head/tools/kerneldoc/subsys/Doxyfile-dev_vxge > head/tools/tools/vxge/ > Modified: > head/ObsoleteFiles.inc > head/UPDATING > head/share/man/man4/Makefile > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/makeLINT.mk > head/sys/modules/Makefile > head/tools/tools/README > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Thu May 17 14:51:22 2018 (r333716) > +++ head/ObsoleteFiles.inc Thu May 17 14:55:41 2018 (r333717) > @@ -38,6 +38,9 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20180517: retire vxge > +OLD_FILES+=usr/share/man/man4/if_vxge.4.gz > +OLD_FILES+=usr/share/man/man4/vxge.4.gz > # 20180512: Rename Unbound tools > OLD_FILES+=usr/sbin/unbound > OLD_FILES+=usr/sbin/unbound-anchor > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu May 17 14:51:22 2018 (r333716) > +++ head/UPDATING Thu May 17 14:55:41 2018 (r333717) > @@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: > > ****************************** SPECIAL WARNING: ****************************** > > +20180517: > + The vxge(4) driver has been removed. This driver was introduced into > + HEAD one week before the Exar left the Ethernet market and is not > + known to be used. If you have device vxge in your kernel config file > + it must be removed. > + > 20180510: > The amd64 kernel now requires a ld that supports ifunc to produce a > working kernel, either lld or a newer binutils. lld is built by default > > Modified: head/share/man/man4/Makefile > ============================================================================== > --- head/share/man/man4/Makefile Thu May 17 14:51:22 2018 (r333716) > +++ head/share/man/man4/Makefile Thu May 17 14:55:41 2018 (r333717) > @@ -570,7 +570,6 @@ MAN= aac.4 \ > vt.4 \ > vte.4 \ > ${_vtnet.4} \ > - ${_vxge.4} \ > watchdog.4 \ > wb.4 \ > ${_wbwd.4} \ > @@ -754,7 +753,6 @@ MLINKS+=vpo.4 imm.4 > MLINKS+=vr.4 if_vr.4 > MLINKS+=vte.4 if_vte.4 > MLINKS+=${_vtnet.4} ${_if_vtnet.4} > -MLINKS+=${_vxge.4} ${_if_vxge.4} > MLINKS+=watchdog.4 SW_WATCHDOG.4 > MLINKS+=wb.4 if_wb.4 > MLINKS+=wi.4 if_wi.4 > @@ -826,7 +824,6 @@ _if_nfe.4= if_nfe.4 > _if_urtw.4= if_urtw.4 > _if_vmx.4= if_vmx.4 > _if_vtnet.4= if_vtnet.4 > -_if_vxge.4= if_vxge.4 > _if_wpi.4= if_wpi.4 > _imcsmb.4= imcsmb.4 > _ipmi.4= ipmi.4 > @@ -847,7 +844,6 @@ _virtio_random.4= virtio_random.4 > _virtio_scsi.4= virtio_scsi.4 > _vmx.4= vmx.4 > _vtnet.4= vtnet.4 > -_vxge.4= vxge.4 > _padlock.4= padlock.4 > _rr232x.4= rr232x.4 > _speaker.4= speaker.4 > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Thu May 17 14:51:22 2018 (r333716) > +++ head/sys/conf/NOTES Thu May 17 14:55:41 2018 (r333717) > @@ -2135,7 +2135,6 @@ device oce # Emulex 10 GbE (OneConnect Ethernet) > device ti # Alteon Networks Tigon I/II gigabit Ethernet > device txp # 3Com 3cR990 (``Typhoon'') > device vx # 3Com 3c590, 3c595 (``Vortex'') > -device vxge # Exar/Neterion XFrame 3100 10GbE > > # PCI IEEE 802.11 Wireless NICs > device ath # Atheros pci/cardbus NIC's > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Thu May 17 14:51:22 2018 (r333716) > +++ head/sys/conf/files Thu May 17 14:55:41 2018 (r333717) > @@ -3455,24 +3455,6 @@ dev/vt/vt_sysmouse.c optional vt > dev/vte/if_vte.c optional vte pci > dev/vx/if_vx.c optional vx > dev/vx/if_vx_pci.c optional vx pci > -dev/vxge/vxge.c optional vxge > -dev/vxge/vxgehal/vxgehal-ifmsg.c optional vxge > -dev/vxge/vxgehal/vxgehal-mrpcim.c optional vxge > -dev/vxge/vxgehal/vxge-queue.c optional vxge > -dev/vxge/vxgehal/vxgehal-ring.c optional vxge > -dev/vxge/vxgehal/vxgehal-swapper.c optional vxge > -dev/vxge/vxgehal/vxgehal-mgmt.c optional vxge > -dev/vxge/vxgehal/vxgehal-srpcim.c optional vxge > -dev/vxge/vxgehal/vxgehal-config.c optional vxge > -dev/vxge/vxgehal/vxgehal-blockpool.c optional vxge > -dev/vxge/vxgehal/vxgehal-doorbells.c optional vxge > -dev/vxge/vxgehal/vxgehal-mgmtaux.c optional vxge > -dev/vxge/vxgehal/vxgehal-device.c optional vxge > -dev/vxge/vxgehal/vxgehal-mm.c optional vxge > -dev/vxge/vxgehal/vxgehal-driver.c optional vxge > -dev/vxge/vxgehal/vxgehal-virtualpath.c optional vxge > -dev/vxge/vxgehal/vxgehal-channel.c optional vxge > -dev/vxge/vxgehal/vxgehal-fifo.c optional vxge > dev/watchdog/watchdog.c standard > dev/wb/if_wb.c optional wb pci > dev/wi/if_wi.c optional wi > > Modified: head/sys/conf/makeLINT.mk > ============================================================================== > --- head/sys/conf/makeLINT.mk Thu May 17 14:51:22 2018 (r333716) > +++ head/sys/conf/makeLINT.mk Thu May 17 14:55:41 2018 (r333717) > @@ -45,7 +45,6 @@ LINT: ${NOTES} ${MAKELINT_SED} > echo "nodevice sge" >> ${.TARGET}-NOIP > echo "nodevice sk" >> ${.TARGET}-NOIP > echo "nodevice txp" >> ${.TARGET}-NOIP > - echo "nodevice vxge" >> ${.TARGET}-NOIP > echo "nodevice netmap" >> ${.TARGET}-NOIP > .endif > .if ${TARGET} == "mips" > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Thu May 17 14:51:22 2018 (r333716) > +++ head/sys/modules/Makefile Thu May 17 14:55:41 2018 (r333717) > @@ -400,7 +400,6 @@ SUBDIR= \ > vr \ > vte \ > vx \ > - ${_vxge} \ > wb \ > ${_wbwd} \ > ${_wi} \ > @@ -619,7 +618,6 @@ _speaker= speaker > _splash= splash > _sppp= sppp > _vmware= vmware > -_vxge= vxge > _wbwd= wbwd > _wi= wi > _xe= xe > > Modified: head/tools/tools/README > ============================================================================== > --- head/tools/tools/README Thu May 17 14:51:22 2018 (r333716) > +++ head/tools/tools/README Thu May 17 14:55:41 2018 (r333717) > @@ -64,5 +64,4 @@ vimage An interim utility for managing the virtualize > stack infrastructure. > vop_table Generates a HTML document that shows all the VOP's in > the kernel. > -vxge A diagnostic tool for the vxge(4) driver > whereintheworld Summarizes "make world" output. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 17 15:19:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0B82EAC409; Thu, 17 May 2018 15:19:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 892F0848C1; Thu, 17 May 2018 15:19:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E3DE2E01; Thu, 17 May 2018 15:19:30 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFJUS5088908; Thu, 17 May 2018 15:19:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFJUaP088907; Thu, 17 May 2018 15:19:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805171519.w4HFJUaP088907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 May 2018 15:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333718 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 333718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:19:31 -0000 Author: trasz Date: Thu May 17 15:19:29 2018 New Revision: 333718 URL: https://svnweb.freebsd.org/changeset/base/333718 Log: Fix off-by-one in usb_decode_str_desc(). Previously it would decode one character too many. Note that this function is only used to decode string descriptors generated by the kernel itself. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template.c Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Thu May 17 14:55:41 2018 (r333717) +++ head/sys/dev/usb/template/usb_template.c Thu May 17 15:19:29 2018 (r333718) @@ -127,7 +127,12 @@ usb_decode_str_desc(struct usb_string_descriptor *sd, { size_t i; - for (i = 0; i < buflen - 1 && i < sd->bLength / 2; i++) + if (sd->bLength < 2) { + buf[0] = '\0'; + return; + } + + for (i = 0; i < buflen - 1 && i < (sd->bLength / 2) - 1; i++) buf[i] = UGETW(sd->bString[i]); buf[i] = '\0'; From owner-svn-src-all@freebsd.org Thu May 17 15:21:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AF74EAC7ED; Thu, 17 May 2018 15:21:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DAAE84B74; Thu, 17 May 2018 15:21:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FCF62E56; Thu, 17 May 2018 15:21:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFLKhc089747; Thu, 17 May 2018 15:21:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFLK2o089746; Thu, 17 May 2018 15:21:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805171521.w4HFLK2o089746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 May 2018 15:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333719 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:21:20 -0000 Author: trasz Date: Thu May 17 15:21:19 2018 New Revision: 333719 URL: https://svnweb.freebsd.org/changeset/base/333719 Log: Mark usfs(4) as obsolete; users are advised to use cfumass(4) instead. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/share/man/man4/usfs.4 Modified: head/share/man/man4/usfs.4 ============================================================================== --- head/share/man/man4/usfs.4 Thu May 17 15:19:29 2018 (r333718) +++ head/share/man/man4/usfs.4 Thu May 17 15:21:19 2018 (r333719) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2016 +.Dd May 17, 2018 .Dt USFS 4 .Os .Sh NAME @@ -47,6 +47,13 @@ module at boot time, place the following line in usfs_load="YES" .Ed .Sh DESCRIPTION +.Bf -symbolic +This driver is obsolete. +Users are advised to use +.Xr cfumass 4 +instead. +.Ef +.Pp The .Nm driver provides support for emulating an USB mass storage device when From owner-svn-src-all@freebsd.org Thu May 17 15:24:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 469B4EACB61; Thu, 17 May 2018 15:24:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC2A784F70; Thu, 17 May 2018 15:24:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA6C52F9B; Thu, 17 May 2018 15:24:54 +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 w4HFOsM5093639; Thu, 17 May 2018 15:24:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFOr90093633; Thu, 17 May 2018 15:24:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805171524.w4HFOr90093633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 May 2018 15:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333720 - in stable/11/sys: amd64/amd64 i386/i386 kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: amd64/amd64 i386/i386 kern sys X-SVN-Commit-Revision: 333720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:24:55 -0000 Author: kib Date: Thu May 17 15:24:53 2018 New Revision: 333720 URL: https://svnweb.freebsd.org/changeset/base/333720 Log: MFC r333228 Implement support for ifuncs in the kernel linker on x86. MFC r333411: Avoid calls to bzero() before ireloc Approved by: re (marius) Modified: stable/11/sys/amd64/amd64/elf_machdep.c stable/11/sys/amd64/amd64/machdep.c stable/11/sys/i386/i386/elf_machdep.c stable/11/sys/i386/i386/machdep.c stable/11/sys/kern/link_elf.c stable/11/sys/kern/link_elf_obj.c stable/11/sys/sys/linker.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/elf_machdep.c Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/amd64/amd64/elf_machdep.c Thu May 17 15:24:53 2018 (r333720) @@ -173,10 +173,13 @@ elf64_dump_thread(struct thread *td, void *dst, size_t *off = len; } +#define ERI_LOCAL 0x0001 +#define ERI_ONLYIFUNC 0x0002 + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, int local, elf_lookup_fn lookup) + int type, elf_lookup_fn lookup, int flags) { Elf64_Addr *where, val; Elf32_Addr *where32, val32; @@ -215,6 +218,9 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas panic("unknown reloc type %d\n", type); } + if (((flags & ERI_ONLYIFUNC) == 0) ^ (rtype != R_X86_64_IRELATIVE)) + return (0); + switch (rtype) { case R_X86_64_NONE: /* none */ break; @@ -273,6 +279,13 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *where = val; break; + case R_X86_64_IRELATIVE: + addr = relocbase + addend; + val = ((Elf64_Addr (*)(void))addr)(); + if (*where != val) + *where = val; + break; + default: printf("kldload: unexpected relocation type %ld\n", rtype); @@ -282,11 +295,20 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas } int +elf_reloc_ifunc(linker_file_t lf, Elf_Addr relocbase, const void *data, + int type, elf_lookup_fn lookup) +{ + + return (elf_reloc_internal(lf, relocbase, data, type, lookup, + ERI_ONLYIFUNC)); +} + +int elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, 0, lookup)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup, 0)); } int @@ -294,7 +316,8 @@ elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, 1, lookup)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup, + ERI_LOCAL)); } int Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/amd64/amd64/machdep.c Thu May 17 15:24:53 2018 (r333720) @@ -1564,16 +1564,23 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) size_t kstack0_sz; int late_console; - /* - * This may be done better later if it gets more high level - * components in it. If so just link td->td_proc here. - */ - proc_linkup0(&proc0, &thread0); - kmdp = init_ops.parse_preload_data(modulep); identify_cpu1(); identify_hypervisor(); + /* + * hw.cpu_stdext_disable is ignored by the call, it will be + * re-evaluted by the below call to finishidentcpu(). + */ + identify_cpu2(); + + link_elf_ireloc(kmdp); + + /* + * This may be done better later if it gets more high level + * components in it. If so just link td->td_proc here. + */ + proc_linkup0(&proc0, &thread0); /* Init basic tunables, hz etc */ init_param1(); Modified: stable/11/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/11/sys/i386/i386/elf_machdep.c Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/i386/i386/elf_machdep.c Thu May 17 15:24:53 2018 (r333720) @@ -158,10 +158,13 @@ elf32_dump_thread(struct thread *td, void *dst, size_t *off = len; } +#define ERI_LOCAL 0x0001 +#define ERI_ONLYIFUNC 0x0002 + /* Process one elf relocation with addend. */ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, - int type, int local, elf_lookup_fn lookup) + int type, elf_lookup_fn lookup, int flags) { Elf_Addr *where; Elf_Addr addr; @@ -190,7 +193,10 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas panic("unknown reloc type %d\n", type); } - if (local) { + if (((flags & ERI_ONLYIFUNC) == 0) ^ (rtype != R_386_IRELATIVE)) + return (0); + + if ((flags & ERI_LOCAL) != 0) { if (rtype == R_386_RELATIVE) { /* A + B */ addr = elf_relocaddr(lf, relocbase + addend); if (*where != addr) @@ -242,6 +248,12 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_386_RELATIVE: break; + case R_386_IRELATIVE: + addr = relocbase + addend; + addr = ((Elf_Addr (*)(void))addr)(); + if (*where != addr) + *where = addr; + break; default: printf("kldload: unexpected relocation type %d\n", rtype); @@ -251,11 +263,20 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas } int +elf_reloc_ifunc(linker_file_t lf, Elf_Addr relocbase, const void *data, + int type, elf_lookup_fn lookup) +{ + + return (elf_reloc_internal(lf, relocbase, data, type, lookup, + ERI_ONLYIFUNC)); +} + +int elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, 0, lookup)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup, 0)); } int @@ -263,7 +284,8 @@ elf_reloc_local(linker_file_t lf, Elf_Addr relocbase, int type, elf_lookup_fn lookup) { - return (elf_reloc_internal(lf, relocbase, data, type, 1, lookup)); + return (elf_reloc_internal(lf, relocbase, data, type, lookup, + ERI_LOCAL)); } int Modified: stable/11/sys/i386/i386/machdep.c ============================================================================== --- stable/11/sys/i386/i386/machdep.c Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/i386/i386/machdep.c Thu May 17 15:24:53 2018 (r333720) @@ -2441,6 +2441,7 @@ init386(int first) int gsel_tss, metadata_missing, x, pa; struct pcpu *pc; struct xstate_hdr *xhdr; + caddr_t kmdp; int late_console; thread0.td_kstack = proc0kstack; @@ -2687,6 +2688,9 @@ init386(int first) cninit(); i386_kdb_init(); } + + kmdp = preload_search_by_type("elf kernel"); + link_elf_ireloc(kmdp); vm86_initialize(); getmemsize(first); Modified: stable/11/sys/kern/link_elf.c ============================================================================== --- stable/11/sys/kern/link_elf.c Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/kern/link_elf.c Thu May 17 15:24:53 2018 (r333720) @@ -188,6 +188,9 @@ static struct linker_class link_elf_class = { static int parse_dynamic(elf_file_t); static int relocate_file(elf_file_t); +static int relocate_file1(elf_file_t ef, int (*elf_reloc_func)( + linker_file_t lf, Elf_Addr relocbase, const void *data, + int type, elf_lookup_fn lookup)); static int link_elf_preload_parse_symbols(elf_file_t); static struct elf_set_head set_pcpu_list; @@ -1183,7 +1186,8 @@ symbol_name(elf_file_t ef, Elf_Size r_info) } static int -relocate_file(elf_file_t ef) +relocate_file1(elf_file_t ef, int (*elf_reloc_func)(linker_file_t lf, + Elf_Addr relocbase, const void *data, int type, elf_lookup_fn lookup)) { const Elf_Rel *rellim; const Elf_Rel *rel; @@ -1197,7 +1201,7 @@ relocate_file(elf_file_t ef) rellim = (const Elf_Rel *) ((const char *)ef->rel + ef->relsize); while (rel < rellim) { - if (elf_reloc(&ef->lf, (Elf_Addr)ef->address, rel, + if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rel, ELF_RELOC_REL, elf_lookup)) { symname = symbol_name(ef, rel->r_info); printf("link_elf: symbol %s undefined\n", symname); @@ -1213,7 +1217,7 @@ relocate_file(elf_file_t ef) relalim = (const Elf_Rela *) ((const char *)ef->rela + ef->relasize); while (rela < relalim) { - if (elf_reloc(&ef->lf, (Elf_Addr)ef->address, rela, + if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rela, ELF_RELOC_RELA, elf_lookup)) { symname = symbol_name(ef, rela->r_info); printf("link_elf: symbol %s undefined\n", @@ -1230,7 +1234,7 @@ relocate_file(elf_file_t ef) rellim = (const Elf_Rel *) ((const char *)ef->pltrel + ef->pltrelsize); while (rel < rellim) { - if (elf_reloc(&ef->lf, (Elf_Addr)ef->address, rel, + if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rel, ELF_RELOC_REL, elf_lookup)) { symname = symbol_name(ef, rel->r_info); printf("link_elf: symbol %s undefined\n", @@ -1247,7 +1251,7 @@ relocate_file(elf_file_t ef) relalim = (const Elf_Rela *) ((const char *)ef->pltrela + ef->pltrelasize); while (rela < relalim) { - if (elf_reloc(&ef->lf, (Elf_Addr)ef->address, rela, + if (elf_reloc_func(&ef->lf, (Elf_Addr)ef->address, rela, ELF_RELOC_RELA, elf_lookup)) { symname = symbol_name(ef, rela->r_info); printf("link_elf: symbol %s undefined\n", @@ -1261,6 +1265,19 @@ relocate_file(elf_file_t ef) return (0); } +static int +relocate_file(elf_file_t ef) +{ + int e; + + e = relocate_file1(ef, elf_reloc); +#if defined(__i386__) || defined(__amd64__) + if (e == 0) + e = relocate_file1(ef, elf_reloc_ifunc); +#endif + return (e); +} + /* * Hash function for symbol table lookup. Don't even think about changing * this. It is specified by the System V ABI. @@ -1318,7 +1335,8 @@ link_elf_lookup_symbol(linker_file_t lf, const char* n if (strcmp(name, strp) == 0) { if (symp->st_shndx != SHN_UNDEF || (symp->st_value != 0 && - ELF_ST_TYPE(symp->st_info) == STT_FUNC)) { + (ELF_ST_TYPE(symp->st_info) == STT_FUNC || + ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC))) { *sym = (c_linker_sym_t) symp; return (0); } @@ -1338,7 +1356,8 @@ link_elf_lookup_symbol(linker_file_t lf, const char* n if (strcmp(name, strp) == 0) { if (symp->st_shndx != SHN_UNDEF || (symp->st_value != 0 && - ELF_ST_TYPE(symp->st_info) == STT_FUNC)) { + (ELF_ST_TYPE(symp->st_info) == STT_FUNC || + ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC))) { *sym = (c_linker_sym_t) symp; return (0); } @@ -1353,12 +1372,18 @@ static int link_elf_symbol_values(linker_file_t lf, c_linker_sym_t sym, linker_symval_t *symval) { - elf_file_t ef = (elf_file_t) lf; - const Elf_Sym* es = (const Elf_Sym*) sym; + elf_file_t ef; + const Elf_Sym *es; + caddr_t val; + ef = (elf_file_t)lf; + es = (const Elf_Sym *)sym; if (es >= ef->symtab && es < (ef->symtab + ef->nchains)) { symval->name = ef->strtab + es->st_name; - symval->value = (caddr_t) ef->address + es->st_value; + val = (caddr_t)ef->address + es->st_value; + if (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) + val = ((caddr_t (*)(void))val)(); + symval->value = val; symval->size = es->st_size; return (0); } @@ -1366,7 +1391,10 @@ link_elf_symbol_values(linker_file_t lf, c_linker_sym_ return (ENOENT); if (es >= ef->ddbsymtab && es < (ef->ddbsymtab + ef->ddbsymcnt)) { symval->name = ef->ddbstrtab + es->st_name; - symval->value = (caddr_t) ef->address + es->st_value; + val = (caddr_t)ef->address + es->st_value; + if (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) + val = ((caddr_t (*)(void))val)(); + symval->value = val; symval->size = es->st_size; return (0); } @@ -1476,7 +1504,8 @@ link_elf_each_function_name(linker_file_t file, /* Exhaustive search */ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) { if (symp->st_value != 0 && - ELF_ST_TYPE(symp->st_info) == STT_FUNC) { + (ELF_ST_TYPE(symp->st_info) == STT_FUNC || + ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC)) { error = callback(ef->ddbstrtab + symp->st_name, opaque); if (error != 0) return (error); @@ -1497,7 +1526,8 @@ link_elf_each_function_nameval(linker_file_t file, /* Exhaustive search */ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) { if (symp->st_value != 0 && - ELF_ST_TYPE(symp->st_info) == STT_FUNC) { + (ELF_ST_TYPE(symp->st_info) == STT_FUNC || + ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC)) { error = link_elf_symbol_values(file, (c_linker_sym_t) symp, &symval); if (error != 0) @@ -1656,3 +1686,27 @@ link_elf_strtab_get(linker_file_t lf, caddr_t *strtab) return (ef->ddbstrcnt); } + +#if defined(__i386__) || defined(__amd64__) +void +link_elf_ireloc(caddr_t kmdp) +{ + struct elf_file eff; + elf_file_t ef; + volatile char *c; + size_t i; + + ef = &eff; + + /* Do not use bzero/memset before ireloc is done. */ + for (c = (char *)ef, i = 0; i < sizeof(*ef); i++) + c[i] = 0; + + ef->modptr = kmdp; + ef->dynamic = (Elf_Dyn *)&_DYNAMIC; + parse_dynamic(ef); + ef->address = 0; + link_elf_preload_parse_symbols(ef); + relocate_file1(ef, elf_reloc_ifunc); +} +#endif Modified: stable/11/sys/kern/link_elf_obj.c ============================================================================== --- stable/11/sys/kern/link_elf_obj.c Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/kern/link_elf_obj.c Thu May 17 15:24:53 2018 (r333720) @@ -1194,12 +1194,19 @@ static int link_elf_symbol_values(linker_file_t lf, c_linker_sym_t sym, linker_symval_t *symval) { - elf_file_t ef = (elf_file_t) lf; - const Elf_Sym *es = (const Elf_Sym*) sym; + elf_file_t ef; + const Elf_Sym *es; + caddr_t val; + ef = (elf_file_t) lf; + es = (const Elf_Sym*) sym; + val = (caddr_t)es->st_value; if (es >= ef->ddbsymtab && es < (ef->ddbsymtab + ef->ddbsymcnt)) { symval->name = ef->ddbstrtab + es->st_name; - symval->value = (caddr_t)es->st_value; + val = (caddr_t)es->st_value; + if (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) + val = ((caddr_t (*)(void))val)(); + symval->value = val; symval->size = es->st_size; return 0; } @@ -1284,7 +1291,8 @@ link_elf_each_function_name(linker_file_t file, /* Exhaustive search */ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) { if (symp->st_value != 0 && - ELF_ST_TYPE(symp->st_info) == STT_FUNC) { + (ELF_ST_TYPE(symp->st_info) == STT_FUNC || + ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC)) { error = callback(ef->ddbstrtab + symp->st_name, opaque); if (error) return (error); @@ -1305,8 +1313,10 @@ link_elf_each_function_nameval(linker_file_t file, /* Exhaustive search */ for (i = 0, symp = ef->ddbsymtab; i < ef->ddbsymcnt; i++, symp++) { if (symp->st_value != 0 && - ELF_ST_TYPE(symp->st_info) == STT_FUNC) { - error = link_elf_symbol_values(file, (c_linker_sym_t) symp, &symval); + (ELF_ST_TYPE(symp->st_info) == STT_FUNC || + ELF_ST_TYPE(symp->st_info) == STT_GNU_IFUNC)) { + error = link_elf_symbol_values(file, + (c_linker_sym_t)symp, &symval); if (error) return (error); error = callback(file, i, &symval, opaque); Modified: stable/11/sys/sys/linker.h ============================================================================== --- stable/11/sys/sys/linker.h Thu May 17 15:21:19 2018 (r333719) +++ stable/11/sys/sys/linker.h Thu May 17 15:24:53 2018 (r333720) @@ -269,11 +269,16 @@ extern int kld_debug; typedef int elf_lookup_fn(linker_file_t, Elf_Size, int, Elf_Addr *); /* Support functions */ -int elf_reloc(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu); -int elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, int _type, elf_lookup_fn _lu); +int elf_reloc(linker_file_t _lf, Elf_Addr base, const void *_rel, + int _type, elf_lookup_fn _lu); +int elf_reloc_ifunc(linker_file_t _lf, Elf_Addr base, const void *_rel, + int _type, elf_lookup_fn _lu); +int elf_reloc_local(linker_file_t _lf, Elf_Addr base, const void *_rel, + int _type, elf_lookup_fn _lu); Elf_Addr elf_relocaddr(linker_file_t _lf, Elf_Addr addr); const Elf_Sym *elf_get_sym(linker_file_t _lf, Elf_Size _symidx); const char *elf_get_symname(linker_file_t _lf, Elf_Size _symidx); +void link_elf_ireloc(caddr_t kmdp); typedef struct linker_ctf { const uint8_t *ctftab; /* Decompressed CTF data. */ From owner-svn-src-all@freebsd.org Thu May 17 15:31:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6338DEAD0CB; Thu, 17 May 2018 15:31:24 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFEB2854AA; Thu, 17 May 2018 15:31:23 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-228-75.albq.qwest.net [67.0.228.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 83D71192882; Thu, 17 May 2018 07:35:02 +0000 (UTC) Subject: Re: svn commit: r333717 - in head: . share/man/man4 sys/conf sys/dev/vxge sys/modules sys/modules/vxge tools/kerneldoc/subsys tools/tools tools/tools/vxge To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805171511.w4HFBdqU005935@pdx.rh.CN85.dnsmgr.net> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: <48718399-6262-b6be-f52a-5b248039ec9d@freebsd.org> Date: Thu, 17 May 2018 09:31:18 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201805171511.w4HFBdqU005935@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0XmeZqBGJ5vUh6zxD4J4a59z0cB3kFeOH" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:31:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0XmeZqBGJ5vUh6zxD4J4a59z0cB3kFeOH Content-Type: multipart/mixed; boundary="gytWVPhfq87fOw6O7dY9SWtKMOQaaLw3v"; protected-headers="v1" From: Sean Bruno To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <48718399-6262-b6be-f52a-5b248039ec9d@freebsd.org> Subject: Re: svn commit: r333717 - in head: . share/man/man4 sys/conf sys/dev/vxge sys/modules sys/modules/vxge tools/kerneldoc/subsys tools/tools tools/tools/vxge References: <201805171511.w4HFBdqU005935@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201805171511.w4HFBdqU005935@pdx.rh.CN85.dnsmgr.net> --gytWVPhfq87fOw6O7dY9SWtKMOQaaLw3v Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/17/18 09:11, Rodney W. Grimes wrote: >> Author: sbruno >> Date: Thu May 17 14:55:41 2018 >> New Revision: 333717 >> URL: https://svnweb.freebsd.org/changeset/base/333717 >> >> Log: >> Retire vxge(4). >> =20 >> This driver was merged to HEAD one week prior to Exar publicly annou= ncing they >> had left the Ethernet market. It is not known to be used and has var= ious code >> quality issues spotted by Brooks and Hiren. Retire it in preparation= for >> FreeBSD 12.0. >=20 > Did some form of deprecation notice make it into stable/11? > I took a quick look at sys/dev/vxge/vxge.c and do not see any, > nor did I find anything in the man page vxge.4. >=20 >=20 > Thanks, >=20 Bah ... I sure didn't. 0.o Let me do the right thing here and send an MFC request for the deprecation notice. sean --gytWVPhfq87fOw6O7dY9SWtKMOQaaLw3v-- --0XmeZqBGJ5vUh6zxD4J4a59z0cB3kFeOH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlr9oElfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LbQcAf/RGfAgSVyBTE/3OOuO1CnklfAbOQhdX6GHL8YdHQwAjgmZnrQbdX07YyM U7wzptyWDzPORurvvuAYuIehi4Qw+hZG6L4RITr3dx4jb6jxIdxjjqD9qN6ZsquS kB956lIHajW+Pixi2HNkCwOZUWbM1gMevgM1kvkGUA5xlwdi+sLCSEDy1OhXxnEv MurNUiZEjoW4zRYwEtudb5zhQ7YEvLzxpG5lvuiEE2KSeN/PfZcqRYf70uzmjwsA EM1bPVvOS0pSpZ8UbU3XSR4bClwvvHflHPowk0RoOsbMIvO99NtiDnU4GvGXvQN3 FPCtJNxbRPSsSGKLOeSjG5CPKsFnBw== =/Ajz -----END PGP SIGNATURE----- --0XmeZqBGJ5vUh6zxD4J4a59z0cB3kFeOH-- From owner-svn-src-all@freebsd.org Thu May 17 15:40:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D80EAD91D; Thu, 17 May 2018 15:40:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6B2385D6D; Thu, 17 May 2018 15:40:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4HFeOCP006056; Thu, 17 May 2018 08:40:24 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4HFeOMb006055; Thu, 17 May 2018 08:40:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805171540.w4HFeOMb006055@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333717 - in head: . share/man/man4 sys/conf sys/dev/vxge sys/modules sys/modules/vxge tools/kerneldoc/subsys tools/tools tools/tools/vxge In-Reply-To: <48718399-6262-b6be-f52a-5b248039ec9d@freebsd.org> To: Sean Bruno Date: Thu, 17 May 2018 08:40:24 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:40:28 -0000 > On 05/17/18 09:11, Rodney W. Grimes wrote: > >> Author: sbruno > >> Date: Thu May 17 14:55:41 2018 > >> New Revision: 333717 > >> URL: https://svnweb.freebsd.org/changeset/base/333717 > >> > >> Log: > >> Retire vxge(4). > >> > >> This driver was merged to HEAD one week prior to Exar publicly announcing they > >> had left the Ethernet market. It is not known to be used and has various code > >> quality issues spotted by Brooks and Hiren. Retire it in preparation for > >> FreeBSD 12.0. > > > > Did some form of deprecation notice make it into stable/11? > > I took a quick look at sys/dev/vxge/vxge.c and do not see any, > > nor did I find anything in the man page vxge.4. > > > > > > Thanks, > > > > Bah ... I sure didn't. 0.o Let me do the right thing here and send an > MFC request for the deprecation notice. Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu May 17 15:53:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B922CEAE5BB; Thu, 17 May 2018 15:53:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68323867CA; Thu, 17 May 2018 15:53:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 484D7347A; Thu, 17 May 2018 15:53:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrWbS008910; Thu, 17 May 2018 15:53:32 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrWJb008909; Thu, 17 May 2018 15:53:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrWJb008909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333721 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:32 -0000 Author: gjb Date: Thu May 17 15:53:31 2018 New Revision: 333721 URL: https://svnweb.freebsd.org/changeset/base/333721 Log: Document r331465, BSD-licensed diff(1) imported from OpenBSD. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:24:53 2018 (r333720) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:31 2018 (r333721) @@ -364,6 +364,12 @@ The bmake utility has been updated to upstream version 20180222. + The BSD-licensed + &man.diff.1; utility has been imported from OpenBSD, which is + installed if WITHOUT_GNU_DIFF is set in + &man.src.conf.5;, and otherwise not installed by + default. + OpenSSL has been updated to version 1.0.2o. From owner-svn-src-all@freebsd.org Thu May 17 15:53:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 393C1EAE663; Thu, 17 May 2018 15:53:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB32E868CE; Thu, 17 May 2018 15:53:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19D43347F; Thu, 17 May 2018 15:53:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFra9F009128; Thu, 17 May 2018 15:53:36 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrafk009127; Thu, 17 May 2018 15:53:36 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrafk009127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333726 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333726 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:39 -0000 Author: gjb Date: Thu May 17 15:53:36 2018 New Revision: 333726 URL: https://svnweb.freebsd.org/changeset/base/333726 Log: Document r322555, various bsdgrep(1) pattern matching fixes. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:35 2018 (r333725) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:36 2018 (r333726) @@ -200,6 +200,10 @@ &man.grep.1;, which when used is equivalent to grep -r. + The &man.bsdgrep.1; utility has been + updated to address various issues with pattern matching + behavior. + The &man.umount.8; utility has been updated to include a new flag, -N, which is used to forcefully unmount an NFS From owner-svn-src-all@freebsd.org Thu May 17 15:53:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01990EAE62F; Thu, 17 May 2018 15:53:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC9886847; Thu, 17 May 2018 15:53:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16AEB347D; Thu, 17 May 2018 15:53:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrYRt009040; Thu, 17 May 2018 15:53:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrYKH009039; Thu, 17 May 2018 15:53:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrYKH009039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333724 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:37 -0000 Author: gjb Date: Thu May 17 15:53:34 2018 New Revision: 333724 URL: https://svnweb.freebsd.org/changeset/base/333724 Log: Document r324124, getconf(1) '-a' flag addition. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:33 2018 (r333723) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:34 2018 (r333724) @@ -205,6 +205,13 @@ to the -G flag when using the usermod subcommand. + The &man.getconf.1; utility has been + updated to include a new flag, -a, which + prints the name and value of all system or path configuration + values to &man.stdout.4; or optionally a file as an argument + to -a. + The &man.ps.1; utility has been updated to reflect realtime and idle priorities in state flags. From owner-svn-src-all@freebsd.org Thu May 17 15:53:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7723EAE5F1; Thu, 17 May 2018 15:53:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42505867E9; Thu, 17 May 2018 15:53:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CE24347C; Thu, 17 May 2018 15:53:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrXil008997; Thu, 17 May 2018 15:53:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrXdP008996; Thu, 17 May 2018 15:53:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrXdP008996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333723 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:35 -0000 Author: gjb Date: Thu May 17 15:53:33 2018 New Revision: 333723 URL: https://svnweb.freebsd.org/changeset/base/333723 Log: Document r328139, du(1) '--si' option. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:32 2018 (r333722) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:33 2018 (r333723) @@ -262,6 +262,11 @@ identical across the system. + The &man.du.1; utility has been updated + to include the --si long option, which is + used to display output in "human-readable" output in + powers of 1000. + The &man.df.1; utility has been updated to include the --si long option, which is an alias to -H. From owner-svn-src-all@freebsd.org Thu May 17 15:53:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93DE9EAE5CE; Thu, 17 May 2018 15:53:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44E59867CB; Thu, 17 May 2018 15:53:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24EF5347B; Thu, 17 May 2018 15:53:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrXdo008953; Thu, 17 May 2018 15:53:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrXZw008952; Thu, 17 May 2018 15:53:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrXZw008952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333722 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:33 -0000 Author: gjb Date: Thu May 17 15:53:32 2018 New Revision: 333722 URL: https://svnweb.freebsd.org/changeset/base/333722 Log: Document r328495, dtc(1) update from upstream. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:31 2018 (r333721) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:32 2018 (r333722) @@ -343,6 +343,9 @@ Subversion has been updated to version 1.9.7. + The &man.dtc.1; utility has been updated + to upstream commit 9ce35ff8. + The &man.file.1; utility has been updated to version 5.32. From owner-svn-src-all@freebsd.org Thu May 17 15:53:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D2AEAE647; Thu, 17 May 2018 15:53:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0C2F868A6; Thu, 17 May 2018 15:53:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 123FF347E; Thu, 17 May 2018 15:53:36 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrZXn009085; Thu, 17 May 2018 15:53:35 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrZlP009084; Thu, 17 May 2018 15:53:35 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrZlP009084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333725 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:38 -0000 Author: gjb Date: Thu May 17 15:53:35 2018 New Revision: 333725 URL: https://svnweb.freebsd.org/changeset/base/333725 Log: Document r322525, rgrep(1) hard link addition. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:34 2018 (r333724) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:35 2018 (r333725) @@ -195,6 +195,11 @@ been updated to include device model when the -s flag is used. + The &man.bsdgrep.1; utility has been + updated to include a rgrep hard link to + &man.grep.1;, which when used is equivalent to + grep -r. + The &man.umount.8; utility has been updated to include a new flag, -N, which is used to forcefully unmount an NFS From owner-svn-src-all@freebsd.org Thu May 17 15:53:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66B60EAE696; Thu, 17 May 2018 15:53:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A400F86954; Thu, 17 May 2018 15:53:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A955A3480; Thu, 17 May 2018 15:53:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrcCZ009174; Thu, 17 May 2018 15:53:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrbmo009171; Thu, 17 May 2018 15:53:37 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrbmo009171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333727 - in stable/11/release/doc/en_US.ISO8859-1: hardware installation readme relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11/release/doc/en_US.ISO8859-1: hardware installation readme relnotes X-SVN-Commit-Revision: 333727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:42 -0000 Author: gjb Date: Thu May 17 15:53:37 2018 New Revision: 333727 URL: https://svnweb.freebsd.org/changeset/base/333727 Log: Bump copyright year. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml stable/11/release/doc/en_US.ISO8859-1/installation/article.xml stable/11/release/doc/en_US.ISO8859-1/readme/article.xml stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu May 17 15:53:36 2018 (r333726) +++ stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu May 17 15:53:37 2018 (r333727) @@ -37,6 +37,7 @@ 2015 2016 2017 + 2018 The &os; Documentation Project Modified: stable/11/release/doc/en_US.ISO8859-1/installation/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/installation/article.xml Thu May 17 15:53:36 2018 (r333726) +++ stable/11/release/doc/en_US.ISO8859-1/installation/article.xml Thu May 17 15:53:37 2018 (r333727) @@ -22,7 +22,7 @@ $FreeBSD$ - 2017 + 2018 The &os; Documentation Project Modified: stable/11/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/readme/article.xml Thu May 17 15:53:36 2018 (r333726) +++ stable/11/release/doc/en_US.ISO8859-1/readme/article.xml Thu May 17 15:53:37 2018 (r333727) @@ -41,6 +41,7 @@ 2015 2016 2017 + 2018 The &os; Documentation Project Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:36 2018 (r333726) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:37 2018 (r333727) @@ -25,7 +25,7 @@ - 2017 + 2018 The &os; Documentation Project From owner-svn-src-all@freebsd.org Thu May 17 15:53:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE73FEAE734; Thu, 17 May 2018 15:53:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0D7386A50; Thu, 17 May 2018 15:53:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 645923487; Thu, 17 May 2018 15:53:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrjFN009478; Thu, 17 May 2018 15:53:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrjdM009477; Thu, 17 May 2018 15:53:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrjdM009477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333734 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:49 -0000 Author: gjb Date: Thu May 17 15:53:44 2018 New Revision: 333734 URL: https://svnweb.freebsd.org/changeset/base/333734 Log: Document r332460, makefs(8) default block and fragment sizes synced with newfs(8). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:44 2018 (r333733) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:44 2018 (r333734) @@ -373,6 +373,11 @@ attempt to mount write-protected media read-write fails. This behavior is disabled by default, and can be requested with the new autoro option. + + The + &man.makefs.8; utility has been updated to default the block + and fragment sizes to match that of &man.newfs.8;, 32K and 4K, + respectively. From owner-svn-src-all@freebsd.org Thu May 17 15:53:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CFC8EAE6F1; Thu, 17 May 2018 15:53:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E18B1869B4; Thu, 17 May 2018 15:53:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 963723482; Thu, 17 May 2018 15:53:40 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFre0S009260; Thu, 17 May 2018 15:53:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrelE009259; Thu, 17 May 2018 15:53:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrelE009259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333729 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:46 -0000 Author: gjb Date: Thu May 17 15:53:40 2018 New Revision: 333729 URL: https://svnweb.freebsd.org/changeset/base/333729 Log: Document r322509, top(1) enhancement to filter on multiple user names. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:39 2018 (r333728) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:40 2018 (r333729) @@ -195,6 +195,10 @@ been updated to include device model when the -s flag is used. + The &man.top.1; utility has been updated + to allow filtering on multiple user names when the + -U flag is used. + The &man.bsdgrep.1; utility has been updated to include a rgrep hard link to &man.grep.1;, which when used is equivalent to From owner-svn-src-all@freebsd.org Thu May 17 15:53:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DA69EAE73E; Thu, 17 May 2018 15:53:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73F5586A6D; Thu, 17 May 2018 15:53:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 599693488; Thu, 17 May 2018 15:53:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrkwG009521; Thu, 17 May 2018 15:53:46 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrkoS009520; Thu, 17 May 2018 15:53:46 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrkoS009520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333735 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:49 -0000 Author: gjb Date: Thu May 17 15:53:45 2018 New Revision: 333735 URL: https://svnweb.freebsd.org/changeset/base/333735 Log: Document r332929, pwd_mkdb(8) deprecation notice when legacy (-l) mode is used. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:44 2018 (r333734) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:45 2018 (r333735) @@ -378,6 +378,12 @@ &man.makefs.8; utility has been updated to default the block and fragment sizes to match that of &man.newfs.8;, 32K and 4K, respectively. + + The + &man.pwd.mkdb.8; utility has been updated to emit a notice + that legacy database support will be removed effective + &os; 12 when the -l flag is + used. From owner-svn-src-all@freebsd.org Thu May 17 15:53:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58E57EAE6AE; Thu, 17 May 2018 15:53:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5154F86973; Thu, 17 May 2018 15:53:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A409C3481; Thu, 17 May 2018 15:53:39 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrdHO009217; Thu, 17 May 2018 15:53:39 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrdWF009216; Thu, 17 May 2018 15:53:39 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrdWF009216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333728 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:43 -0000 Author: gjb Date: Thu May 17 15:53:39 2018 New Revision: 333728 URL: https://svnweb.freebsd.org/changeset/base/333728 Log: Document r327837, lint(1) is no longer built and installed by default. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:37 2018 (r333727) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:39 2018 (r333728) @@ -265,6 +265,11 @@ The &man.mdmfs.8; utility has been updated to support &man.tmpfs.5;. + The &man.lint.1; utility is not longer + built by default. The WITH_LINT + &man.src.conf.5; option has been added to enable building and + installing the utility. + The &man.cpucontrol.8; utility has been updated to include a new flag, -e, which is used to re-evaluate reported CPU features From owner-svn-src-all@freebsd.org Thu May 17 15:53:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E306DEAE70A; Thu, 17 May 2018 15:53:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A62A869CE; Thu, 17 May 2018 15:53:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE00C3483; Thu, 17 May 2018 15:53:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrfnc009303; Thu, 17 May 2018 15:53:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrfO9009302; Thu, 17 May 2018 15:53:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrfO9009302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333730 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:47 -0000 Author: gjb Date: Thu May 17 15:53:41 2018 New Revision: 333730 URL: https://svnweb.freebsd.org/changeset/base/333730 Log: Document r328138, indent(1) supports the SIMPLE_BACKUP_SUFFIX environment variable also used by patch(1). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:40 2018 (r333729) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:41 2018 (r333730) @@ -287,6 +287,10 @@ identical across the system. + The &man.indent.1; utility has been + updated to respect the SIMPLE_BACKUP_SUFFIX + environment variable if set. + The &man.du.1; utility has been updated to include the --si long option, which is used to display output in "human-readable" output in From owner-svn-src-all@freebsd.org Thu May 17 15:53:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3929FEAE70F; Thu, 17 May 2018 15:53:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 515FD86A10; Thu, 17 May 2018 15:53:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 776763485; Thu, 17 May 2018 15:53:43 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrhGA009391; Thu, 17 May 2018 15:53:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrh2H009390; Thu, 17 May 2018 15:53:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrh2H009390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333732 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:47 -0000 Author: gjb Date: Thu May 17 15:53:43 2018 New Revision: 333732 URL: https://svnweb.freebsd.org/changeset/base/333732 Log: Document r333006, amd64 hybrid ISO images. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:42 2018 (r333731) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:43 2018 (r333732) @@ -693,6 +693,12 @@ keep their clocks synchronized using the Amazon Time Sync Service, the NTP service internal to the EC2™ infrastructure. + + The + &os; installation ISO medium creation tools + have been updated to generate hybrid images for &arch.amd64;, + supporting both BIOS and + EFI. From owner-svn-src-all@freebsd.org Thu May 17 15:53:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27E96EAE738; Thu, 17 May 2018 15:53:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43E0286A37; Thu, 17 May 2018 15:53:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DB923486; Thu, 17 May 2018 15:53:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFriwm009435; Thu, 17 May 2018 15:53:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFridJ009434; Thu, 17 May 2018 15:53:44 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFridJ009434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333733 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:49 -0000 Author: gjb Date: Thu May 17 15:53:44 2018 New Revision: 333733 URL: https://svnweb.freebsd.org/changeset/base/333733 Log: Document r322753, mount(8) 'autoro' option addition. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:43 2018 (r333732) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:44 2018 (r333733) @@ -367,6 +367,12 @@ The &man.etdump.1; utility has been added, which is used to view El Torito boot catalog information. + + The &man.mount.8; utility has been + updated to allow fallback to mount media read-only if an + attempt to mount write-protected media read-write fails. This + behavior is disabled by default, and can be requested with the + new autoro option. From owner-svn-src-all@freebsd.org Thu May 17 15:53:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 179D4EAE70B; Thu, 17 May 2018 15:53:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 856BC869F4; Thu, 17 May 2018 15:53:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A593484; Thu, 17 May 2018 15:53:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrgiM009347; Thu, 17 May 2018 15:53:42 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrg6E009346; Thu, 17 May 2018 15:53:42 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrg6E009346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333731 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:47 -0000 Author: gjb Date: Thu May 17 15:53:42 2018 New Revision: 333731 URL: https://svnweb.freebsd.org/changeset/base/333731 Log: Document r332947, etdump(1) utility addition. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:41 2018 (r333730) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:42 2018 (r333731) @@ -363,6 +363,10 @@ sponsor="&netflix;">The &man.efibootmgr.8; utility has been added, which is used to manipulate the EFI boot manager. + + The &man.etdump.1; utility has been + added, which is used to view El Torito boot catalog + information. From owner-svn-src-all@freebsd.org Thu May 17 15:53:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7E8BEAE748; Thu, 17 May 2018 15:53:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAE9686A89; Thu, 17 May 2018 15:53:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 534513489; Thu, 17 May 2018 15:53:47 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HFrlHu009564; Thu, 17 May 2018 15:53:47 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HFrlNm009563; Thu, 17 May 2018 15:53:47 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171553.w4HFrlNm009563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 15:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333736 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 15:53:50 -0000 Author: gjb Date: Thu May 17 15:53:46 2018 New Revision: 333736 URL: https://svnweb.freebsd.org/changeset/base/333736 Log: Document r333312, tzdata version 2018e. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:45 2018 (r333735) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 15:53:46 2018 (r333736) @@ -431,9 +431,6 @@ OpenSSL has been updated to version 1.0.2o. - Timezone data files have been updated to - version 2018d. - The clang, llvm, lld, @@ -441,6 +438,9 @@ compiler-rt utilities as well as libc++ have been updated to upstream version 6.0.0. + + Timezone data files have been updated to + version 2018e. From owner-svn-src-all@freebsd.org Thu May 17 16:21:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAF1AEB05D3; Thu, 17 May 2018 16:21:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D59F68E0C; Thu, 17 May 2018 16:21:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F6E33C30; Thu, 17 May 2018 16:21:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HGLDsA022944; Thu, 17 May 2018 16:21:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HGLCvB022942; Thu, 17 May 2018 16:21:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171621.w4HGLCvB022942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 16:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333737 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 333737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 16:21:13 -0000 Author: manu Date: Thu May 17 16:21:12 2018 New Revision: 333737 URL: https://svnweb.freebsd.org/changeset/base/333737 Log: release: arm: Format FAT partition as FAT16 r332674 raised the size of the FAT partition from 2MB to 41MB for some boards. But we format them in FAT12 and this size appears to be to big for FAT12 and some SoC bootrom cannot cope with that. Format the msdosfs partition as FAT16, PR: 228285 MFC after: soon Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/GUMSTIX.conf head/release/arm/PANDABOARD.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Thu May 17 15:53:46 2018 (r333736) +++ head/release/arm/BEAGLEBONE.conf Thu May 17 16:21:12 2018 (r333737) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" FAT_SIZE="41m" -FAT_TYPE="12" +FAT_TYPE="16" IMAGE_SIZE="3072M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" Modified: head/release/arm/GUMSTIX.conf ============================================================================== --- head/release/arm/GUMSTIX.conf Thu May 17 15:53:46 2018 (r333736) +++ head/release/arm/GUMSTIX.conf Thu May 17 16:21:12 2018 (r333737) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" FAT_SIZE="41m" -FAT_TYPE="12" +FAT_TYPE="16" IMAGE_SIZE="3072M" KERNEL="GUMSTIX" MD_ARGS="-x 63 -y 255" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Thu May 17 15:53:46 2018 (r333736) +++ head/release/arm/PANDABOARD.conf Thu May 17 16:21:12 2018 (r333737) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" FAT_SIZE="41m" -FAT_TYPE="12" +FAT_TYPE="16" IMAGE_SIZE="3072M" KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" From owner-svn-src-all@freebsd.org Thu May 17 16:32:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E92EB105E; Thu, 17 May 2018 16:32:39 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7BA2697D1; Thu, 17 May 2018 16:32: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88EC93F45; Thu, 17 May 2018 16:32: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 w4HGWd0U029827; Thu, 17 May 2018 16:32:39 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HGWdtP029825; Thu, 17 May 2018 16:32:39 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805171632.w4HGWdtP029825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 17 May 2018 16:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333738 - in stable/11: share/man/man4 sys/dev/vxge X-SVN-Group: stable-11 X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/vxge X-SVN-Commit-Revision: 333738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 16:32:40 -0000 Author: sbruno Date: Thu May 17 16:32:38 2018 New Revision: 333738 URL: https://svnweb.freebsd.org/changeset/base/333738 Log: MFC r333499 Add deprecation notice for vxge. This driver was merged to HEAD one week prior to Exar publicly announcing theyhad left the Ethernet market. It is not known to be used and has various code quality issues spotted by Brooks and Hiren. Retire it in preparation for FreeBSD 12.0. Submitted by: kbowling Reported by: rgrimes Approved by: re (gjb) Relnotes: yes Modified: stable/11/share/man/man4/vxge.4 stable/11/sys/dev/vxge/vxge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/vxge.4 ============================================================================== --- stable/11/share/man/man4/vxge.4 Thu May 17 16:21:12 2018 (r333737) +++ stable/11/share/man/man4/vxge.4 Thu May 17 16:32:38 2018 (r333738) @@ -44,6 +44,12 @@ module at boot time, place the following line in .Bd -literal -offset indent if_vxge_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 12.0 +and later. .Sh DESCRIPTION The .Nm Modified: stable/11/sys/dev/vxge/vxge.c ============================================================================== --- stable/11/sys/dev/vxge/vxge.c Thu May 17 16:21:12 2018 (r333737) +++ stable/11/sys/dev/vxge/vxge.c Thu May 17 16:32:38 2018 (r333738) @@ -234,6 +234,7 @@ _exit0: err = ENXIO; } + gone_in_dev(ndev, 12, "vxge(4) driver"); return (err); } From owner-svn-src-all@freebsd.org Thu May 17 17:00:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7543DED6816; Thu, 17 May 2018 17:00:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BEB36A69E; Thu, 17 May 2018 17:00:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A10742CB; Thu, 17 May 2018 17:00:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HH08ST040275; Thu, 17 May 2018 17:00:08 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HH079v040272; Thu, 17 May 2018 17:00:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171700.w4HH079v040272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 17:00:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333739 - stable/11/release/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: stable/11/release/arm X-SVN-Commit-Revision: 333739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:00:08 -0000 Author: manu Date: Thu May 17 17:00:07 2018 New Revision: 333739 URL: https://svnweb.freebsd.org/changeset/base/333739 Log: MFC r333737: release: arm: Format FAT partition as FAT16 r332674 raised the size of the FAT partition from 2MB to 41MB for some boards. But we format them in FAT12 and this size appears to be to big for FAT12 and some SoC bootrom cannot cope with that. Format the msdosfs partition as FAT16, PR: 228285 Approved by: re (marius) Modified: stable/11/release/arm/BEAGLEBONE.conf stable/11/release/arm/GUMSTIX.conf stable/11/release/arm/PANDABOARD.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/release/arm/BEAGLEBONE.conf ============================================================================== --- stable/11/release/arm/BEAGLEBONE.conf Thu May 17 16:32:38 2018 (r333738) +++ stable/11/release/arm/BEAGLEBONE.conf Thu May 17 17:00:07 2018 (r333739) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" FAT_SIZE="41m" -FAT_TYPE="12" +FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="BEAGLEBONE" MD_ARGS="-x 63 -y 255" Modified: stable/11/release/arm/GUMSTIX.conf ============================================================================== --- stable/11/release/arm/GUMSTIX.conf Thu May 17 16:32:38 2018 (r333738) +++ stable/11/release/arm/GUMSTIX.conf Thu May 17 17:00:07 2018 (r333739) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" FAT_SIZE="41m" -FAT_TYPE="12" +FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="GUMSTIX" MD_ARGS="-x 63 -y 255" Modified: stable/11/release/arm/PANDABOARD.conf ============================================================================== --- stable/11/release/arm/PANDABOARD.conf Thu May 17 16:32:38 2018 (r333738) +++ stable/11/release/arm/PANDABOARD.conf Thu May 17 17:00:07 2018 (r333739) @@ -8,7 +8,7 @@ EMBEDDED_TARGET="arm" EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" FAT_SIZE="41m" -FAT_TYPE="12" +FAT_TYPE="16" IMAGE_SIZE="1G" KERNEL="PANDABOARD" MD_ARGS="-x 63 -y 255" From owner-svn-src-all@freebsd.org Thu May 17 17:00:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69EF8ED68B9; Thu, 17 May 2018 17:00:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D0506A909; Thu, 17 May 2018 17:00:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F286542E8; Thu, 17 May 2018 17:00:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HH0npo042555; Thu, 17 May 2018 17:00:49 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HH0nm3042554; Thu, 17 May 2018 17:00:49 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171700.w4HH0nm3042554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 17:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333740 - stable/11/stand/arm64 X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/stand/arm64 X-SVN-Commit-Revision: 333740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:00:50 -0000 Author: gjb Date: Thu May 17 17:00:49 2018 New Revision: 333740 URL: https://svnweb.freebsd.org/changeset/base/333740 Log: MFC r333079 (imp): No need to make objects here. This fixes polluting the src checkout when building arm64/aarch64. Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/11/stand/arm64/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/arm64/Makefile ============================================================================== --- stable/11/stand/arm64/Makefile Thu May 17 17:00:07 2018 (r333739) +++ stable/11/stand/arm64/Makefile Thu May 17 17:00:49 2018 (r333740) @@ -1,3 +1,5 @@ # $FreeBSD$ +NO_OBJ=t + .include From owner-svn-src-all@freebsd.org Thu May 17 17:38:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D674EDAA5C; Thu, 17 May 2018 17:38:22 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) (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 2121A6BECA; Thu, 17 May 2018 17:38:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f179.google.com with SMTP id p124-v6so2992255iod.1; Thu, 17 May 2018 10:38:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=mjQpYJnYsxenrlIVkO+QKItVTC1ib+KcGqZosOJPUEc=; b=OjqgQnm3wTednKkF4Z21ylzBMUz4kkXKg9Sv1FJzVTHm0vZRgITlLxyZr/0VXYcOoc WeHY+/bYx8dWUDx15juYQEawawK5EPQi+VeuNJjzu0l8hoGrfL/hdODcyg0Ib1tdfP3c 4v7eSjrTyPrh4OPCXa5lFNNgU7KS16QSFcyNXXhKM/kf6QMyobdd7+lwIxuOprZ/AtTC gzWZAiBBUm3VZY7niM8VacEyPj2hHUUZEkRU/QdddzWRGYJQADJp7OqEeqmUuF9qgr6L svmruDio9/xTguxla3PVy6azFIoqIic6j9HOhMIBsgCH4jbrutI2Y3QRP+2oYOF/CewQ Km6g== X-Gm-Message-State: ALKqPwf+m2D3f1s3Ver8el1eMrSSBmtTP484Se1eRPfHDzJU+yyUj0o+ eKQDH54xnLph+JXlbKa6xylfnHm+ X-Google-Smtp-Source: AB8JxZqzuVmjO8RknlOmwxwnFk0gmTo+MwSoxQEu1egUc+49JX6ce58Xi/WyC4pvjhTMvMA3CfAB4g== X-Received: by 2002:a6b:9bcc:: with SMTP id d195-v6mr6679891ioe.15.1526576854959; Thu, 17 May 2018 10:07:34 -0700 (PDT) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com. [209.85.214.50]) by smtp.gmail.com with ESMTPSA id c90-v6sm3417684itd.13.2018.05.17.10.07.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 10:07:34 -0700 (PDT) Received: by mail-it0-f50.google.com with SMTP id j186-v6so9737113ita.5; Thu, 17 May 2018 10:07:34 -0700 (PDT) X-Received: by 2002:a24:7d0f:: with SMTP id b15-v6mr3583636itc.135.1526576854535; Thu, 17 May 2018 10:07:34 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:d81:0:0:0:0:0 with HTTP; Thu, 17 May 2018 10:07:34 -0700 (PDT) In-Reply-To: <201805170427.w4H4R8lv058775@repo.freebsd.org> References: <201805170427.w4H4R8lv058775@repo.freebsd.org> From: Conrad Meyer Date: Thu, 17 May 2018 10:07:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333703 - head/sys/vm To: Mark Johnston Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:38:22 -0000 On Wed, May 16, 2018 at 9:27 PM, Mark Johnston wrote: > Author: markj > Date: Thu May 17 04:27:08 2018 > New Revision: 333703 > URL: https://svnweb.freebsd.org/changeset/base/333703 > > Log: > Fix a race in vm_page_pagequeue_lockptr(). > > The value of m->queue must be cached after comparing it with PQ_NONE, > since it may be concurrently changing. > > Reported by: glebius What were the symptoms of this issue? The test plan in the linked phabricator revision says: "Gleb reported seeing panics as a result of the use of a bogus index into the pagequeue array, and also reported that this patch fixed the panics." So an attempt to lock pagequeues[PQ_NONE=255].pq_mutex, which is either something later in the vm_domain object, or bogus memory? One of the mtx asserts trips? Thanks, Conrad From owner-svn-src-all@freebsd.org Thu May 17 17:40:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E8DFEDABBD; Thu, 17 May 2018 17:40:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0FB76C0AC; Thu, 17 May 2018 17:40:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2C72494F; Thu, 17 May 2018 17:40:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HHe6mO060064; Thu, 17 May 2018 17:40:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HHe6fh060063; Thu, 17 May 2018 17:40:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805171740.w4HHe6fh060063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 17 May 2018 17:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333741 - stable/11/sys/x86/include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/include X-SVN-Commit-Revision: 333741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:40:07 -0000 Author: kib Date: Thu May 17 17:40:06 2018 New Revision: 333741 URL: https://svnweb.freebsd.org/changeset/base/333741 Log: MFC r333229: Add helper macros to hide some boring repeatable ceremonies to define ifuncs on x86. Approved by: re (marius) Added: stable/11/sys/x86/include/ifunc.h - copied unchanged from r333229, head/sys/x86/include/ifunc.h Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/x86/include/ifunc.h (from r333229, head/sys/x86/include/ifunc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/x86/include/ifunc.h Thu May 17 17:40:06 2018 (r333741, copy of r333229, head/sys/x86/include/ifunc.h) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2015, 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __X86_IFUNC_H +#define __X86_IFUNC_H + +#define DECLARE_LIFUNC(ret_type, name, args) \ +ret_type name args + +#define DEFINE_LIFUNC(scope, selector_qual, ret_type, name, args) \ +__asm__ (scope "\t" #name "\n" \ + "\t.type\t" #name ",@function\n" \ + #name ":\n" \ + "\tjmp *" #name "_selector\n" \ + "\t.size\t" #name ",\t. - "#name); \ +selector_qual ret_type (*name##_selector)args __used; \ +DECLARE_LIFUNC(ret_type, name, args) + +#define DEFINE_STATIC_LIFUNC(ret_type, name, args) \ + DEFINE_LIFUNC(".local", static, ret_type, name, args) + +#define DEFINE_GLOBAL_LIFUNC(ret_type, name, args) \ + DEFINE_LIFUNC(".globl", , ret_type, name, args) + +#define DEFINE_IFUNC(qual, ret_type, name, args, resolver_qual) \ + resolver_qual ret_type (*name##_resolver(void))args __used; \ + qual ret_type name args __attribute__((ifunc(#name "_resolver"))); \ + resolver_qual ret_type (*name##_resolver(void))args + +#endif From owner-svn-src-all@freebsd.org Thu May 17 17:44:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBC0DEDB132; Thu, 17 May 2018 17:44:03 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7A76C5BA; Thu, 17 May 2018 17:44:03 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1 (FreeBSD)) (envelope-from ) id 1fJMwa-000Ozs-4X; Thu, 17 May 2018 10:44:00 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id w4HHhxiB096079; Thu, 17 May 2018 10:43:59 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Thu, 17 May 2018 10:43:59 -0700 From: Oleksandr Tymoshenko To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r333739 - stable/11/release/arm Message-ID: <20180517174359.GA95995@bluezbox.com> References: <201805171700.w4HH079v040272@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805171700.w4HH079v040272@repo.freebsd.org> X-Operating-System: FreeBSD/11.1-RELEASE-p4 (amd64) User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Emmanuel Vadot (manu@FreeBSD.org) wrote: > Author: manu > Date: Thu May 17 17:00:07 2018 > New Revision: 333739 > URL: https://svnweb.freebsd.org/changeset/base/333739 > > Log: > MFC r333737: > > rele [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:44:04 -0000 Emmanuel Vadot (manu@FreeBSD.org) wrote: > Author: manu > Date: Thu May 17 17:00:07 2018 > New Revision: 333739 > URL: https://svnweb.freebsd.org/changeset/base/333739 > > Log: > MFC r333737: > > release: arm: Format FAT partition as FAT16 > > r332674 raised the size of the FAT partition from 2MB to 41MB for some > boards. But we format them in FAT12 and this size appears to be to big > for FAT12 and some SoC bootrom cannot cope with that. > Format the msdosfs partition as FAT16, > > PR: 228285 > Approved by: re (marius) Thanks for working on this -- gonzo From owner-svn-src-all@freebsd.org Thu May 17 17:45:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11B2BEDB259; Thu, 17 May 2018 17:45:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B84DC6C741; Thu, 17 May 2018 17:45:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 957534ADB; Thu, 17 May 2018 17:45:47 +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 w4HHjlIC064909; Thu, 17 May 2018 17:45:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HHjlrr064908; Thu, 17 May 2018 17:45:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805171745.w4HHjlrr064908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 17 May 2018 17:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333742 - head/tools/tools/intel-ucode-split X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/tools/intel-ucode-split X-SVN-Commit-Revision: 333742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:45:48 -0000 Author: emaste Date: Thu May 17 17:45:47 2018 New Revision: 333742 URL: https://svnweb.freebsd.org/changeset/base/333742 Log: intel-ucode-split: incorporate review feedback, using asprintf As reported by delphij in review D15443 asprintf cleans this up a little by avoiding hardcoded buffer sizes. Reported by: delphij Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c Modified: head/tools/tools/intel-ucode-split/intel-ucode-split.c ============================================================================== --- head/tools/tools/intel-ucode-split/intel-ucode-split.c Thu May 17 17:40:06 2018 (r333741) +++ head/tools/tools/intel-ucode-split/intel-ucode-split.c Thu May 17 17:45:47 2018 (r333742) @@ -54,12 +54,13 @@ struct microcode_update_header { /* * SDM vol 2A CPUID EAX = 01h Returns Model, Family, Stepping Information. - * 9 chars including the NUL terminator will be written to buf. + * Caller must free the returned string. */ static char * -format_signature(char *buf, uint32_t signature) +format_signature(uint32_t signature) { + char *buf; unsigned family, model, stepping; family = (signature & 0xf00) >> 8; @@ -69,24 +70,26 @@ format_signature(char *buf, uint32_t signature) model += (signature & 0xf0000) >> 12; if (family == 0x0f) family += (signature & 0xff00000) >> 20; - sprintf(buf, "%02x-%02x-%02x", family, model, stepping); + asprintf(&buf, "%02x-%02x-%02x", family, model, stepping); + if (buf == NULL) + err(1, "asprintf"); return (buf); } static void dump_header(const struct microcode_update_header *hdr) { - char buf[16]; + char *sig_str; int i; bool platformid_printed; + sig_str = format_signature(hdr->processor_signature); printf("header version\t0x%x\n", hdr->header_version); printf("revision\t0x%x\n", hdr->update_revision); printf("date\t\t0x%x\t%04x-%02x-%02x\n", hdr->date, hdr->date & 0xffff, (hdr->date & 0xff000000) >> 24, (hdr->date & 0xff0000) >> 16); - printf("signature\t0x%x\t\t%s\n", hdr->processor_signature, - format_signature(buf, hdr->processor_signature)); + printf("signature\t0x%x\t\t%s\n", hdr->processor_signature, sig_str); printf("checksum\t0x%x\n", hdr->checksum); printf("loader revision\t0x%x\n", hdr->loader_revision); printf("processor flags\t0x%x", hdr->processor_flags); @@ -102,6 +105,7 @@ dump_header(const struct microcode_update_header *hdr) hdr->data_size != 0 ? hdr->data_size : 2000); printf("size\t\t0x%x\t\t0x%x\n", hdr->total_size, hdr->total_size != 0 ? hdr->total_size : 2048); + free(sig_str); } static void @@ -116,8 +120,7 @@ int main(int argc, char *argv[]) { struct microcode_update_header hdr; - char output_file[128]; - char *buf; + char *buf, *output_file, *sig_str; size_t len, resid; ssize_t rv; int c, ifd, ofd; @@ -163,9 +166,12 @@ main(int argc, char *argv[]) if (vflag) dump_header(&hdr); - format_signature(output_file, hdr.processor_signature); - sprintf(output_file + strlen(output_file), ".%02x", + sig_str = format_signature(hdr.processor_signature); + asprintf(&output_file, "%s.%02x", sig_str, hdr.processor_flags & 0xff); + free(sig_str); + if (output_file == NULL) + err(1, "asprintf"); ofd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (ofd < 0) err(1, "open"); @@ -194,5 +200,6 @@ main(int argc, char *argv[]) if (vflag) printf("written to %s\n\n", output_file); close(ofd); + free(output_file); } } From owner-svn-src-all@freebsd.org Thu May 17 17:57:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75B51EDB7CA; Thu, 17 May 2018 17:57:42 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 228126D1B7; Thu, 17 May 2018 17:57:42 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00B784C79; Thu, 17 May 2018 17:57:41 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HHvfao069720; Thu, 17 May 2018 17:57:41 GMT (envelope-from andreast@FreeBSD.org) Received: (from andreast@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HHvfn3069719; Thu, 17 May 2018 17:57:41 GMT (envelope-from andreast@FreeBSD.org) Message-Id: <201805171757.w4HHvfn3069719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andreast set sender to andreast@FreeBSD.org using -f From: Andreas Tobler Date: Thu, 17 May 2018 17:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333743 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: andreast X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 333743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:57:42 -0000 Author: andreast Date: Thu May 17 17:57:41 2018 New Revision: 333743 URL: https://svnweb.freebsd.org/changeset/base/333743 Log: Fix build if USB_DEBUG is defined. Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Thu May 17 17:45:47 2018 (r333742) +++ head/sys/dev/usb/net/if_muge.c Thu May 17 17:57:41 2018 (r333743) @@ -126,7 +126,7 @@ static const struct usb_device_id lan78xx_devs[] = { }; #ifdef USB_DEBUG -#define lan78xx_dbg_printf(sc, fmt, args...) \ +#define muge_dbg_printf(sc, fmt, args...) \ do { \ if (muge_debug > 0) \ device_printf((sc)->sc_ue.ue_dev, "debug: " fmt, ##args); \ From owner-svn-src-all@freebsd.org Thu May 17 17:59:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6981FEDB8EF; Thu, 17 May 2018 17:59:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 171766D5AF; Thu, 17 May 2018 17:59:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC5554C8D; Thu, 17 May 2018 17:59:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HHxZ7o069823; Thu, 17 May 2018 17:59:35 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HHxZpe069821; Thu, 17 May 2018 17:59:35 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171759.w4HHxZpe069821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 17:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333744 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333744 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:59:36 -0000 Author: mmacy Date: Thu May 17 17:59:35 2018 New Revision: 333744 URL: https://svnweb.freebsd.org/changeset/base/333744 Log: AF_UNIX: make unix socket locking finer grained This change moves to using a reference count across lock drop / reacquire to guarantee liveness. Currently sends on unix sockets contend heavily on read locking the list lock. unix1_processes in will-it-scale peaks at 6 processes and then declines. With this change I get a substantial improvement in number of operations per second with 96 processes: x before + after N Min Max Median Avg Stddev x 11 1688420 1696389 1693578 1692766.3 2971.1702 + 10 63417955 71030114 70662504 69576423 2374684.6 Difference at 95.0% confidence 6.78837e+07 +/- 1.49463e+06 4010.22% +/- 88.4246% (Student's t, pooled s = 1.63437e+06) And even for 2 processes shows a ~18% improvement. "Small" iron changes (1, 2, and 4 processes): x before1 + after1.2 +------------------------------------------------------------------------+ | + | | x + | | x + | | x + | | x ++ | | xx ++ | |x x xx ++ | | |__________________A_____M_____AM____|| +------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 10 1131648 1197750 1197138.5 1190369.3 20651.839 + 10 1203840 1205056 1204919 1204827.9 353.27404 Difference at 95.0% confidence 14458.6 +/- 13723 1.21463% +/- 1.16683% (Student's t, pooled s = 14605.2) x before2 + after2.2 +------------------------------------------------------------------------+ | +| | +| | +| | +| | +| | +| | x +| | x +| | x xx +| |x xxxx +| | |___AM_| A| +------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 10 1972843 2045866 2038186.5 2030443.8 21367.694 + 10 2400853 2402196 2401043.5 2401172.7 385.40024 Difference at 95.0% confidence 370729 +/- 14198.9 18.2585% +/- 0.826943% (Student's t, pooled s = 15111.7) x before4 + after4.2 N Min Max Median Avg Stddev x 10 3986994 3991728 3990137.5 3989985.2 1300.0164 + 10 4799990 4806664 4806116.5 4805194 1990.6625 Difference at 95.0% confidence 815209 +/- 1579.64 20.4314% +/- 0.0421713% (Student's t, pooled s = 1681.19) Tested by: pho Reported by: mjg Approved by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15430 Modified: head/sys/kern/uipc_usrreq.c head/sys/sys/unpcb.h Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu May 17 17:57:41 2018 (r333743) +++ head/sys/kern/uipc_usrreq.c Thu May 17 17:59:35 2018 (r333744) @@ -191,13 +191,41 @@ SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, /* * Locking and synchronization: * - * Two types of locks exist in the local domain socket implementation: a - * a global linkage rwlock and per-unpcb mutexes. The linkage lock protects - * the socket count, global generation number, stream/datagram global lists and - * interconnection of unpcbs, the v_socket and unp_vnode pointers, and can be - * held exclusively over the acquisition of multiple unpcb locks to prevent - * deadlock. + * Three types of locks exist in the local domain socket implementation: a + * a global linkage rwlock, the mtxpool lock, and per-unpcb mutexes. + * The linkage lock protects the socket count, global generation number, + * and stream/datagram global lists. * + * The mtxpool lock protects the vnode from being modified while referenced. + * Lock ordering requires that it be acquired before any unpcb locks. + * + * The unpcb lock (unp_mtx) protects all fields in the unpcb. Of particular + * note is that this includes the unp_conn field. So long as the unpcb lock + * is held the reference to the unpcb pointed to by unp_conn is valid. If we + * require that the unpcb pointed to by unp_conn remain live in cases where + * we need to drop the unp_mtx as when we need to acquire the lock for a + * second unpcb the caller must first acquire an additional reference on the + * second unpcb and then revalidate any state (typically check that unp_conn + * is non-NULL) upon requiring the initial unpcb lock. The lock ordering + * between unpcbs is the conventional ascending address order. Two helper + * routines exist for this: + * + * - unp_pcb_lock2(unp, unp2) - which just acquires the two locks in the + * safe ordering. + * + * - unp_pcb_owned_lock2(unp, unp2, freed) - the lock for unp is held + * when called. If unp is unlocked and unp2 is subsequently freed + * freed will be set to 1. + * + * The helper routines for references are: + * + * - unp_pcb_hold(unp): Can be called any time we currently hold a valid + * reference to unp. + * + * - unp_pcb_rele(unp): The caller must hold the unp lock. If we are + * releasing the last reference, detach must have been called thus + * unp->unp_socket be NULL. + * * UNIX domain sockets each have an unpcb hung off of their so_pcb pointer, * allocated in pru_attach() and freed in pru_detach(). The validity of that * pointer is an invariant, so no lock is required to dereference the so_pcb @@ -210,16 +238,9 @@ SYSCTL_INT(_net_local, OID_AUTO, deferred, CTLFLAG_RD, * to the unpcb is held. Typically, this reference will be from the socket, * or from another unpcb when the referring unpcb's lock is held (in order * that the reference not be invalidated during use). For example, to follow - * unp->unp_conn->unp_socket, you need unlock the lock on unp, not unp_conn, - * as unp_socket remains valid as long as the reference to unp_conn is valid. + * unp->unp_conn->unp_socket, you need to hold a lock on unp_conn to guarantee + * that detach is not run clearing unp_socket. * - * Fields of unpcbss are locked using a per-unpcb lock, unp_mtx. Individual - * atomic reads without the lock may be performed "lockless", but more - * complex reads and read-modify-writes require the mutex to be held. No - * lock order is defined between unpcb locks -- multiple unpcb locks may be - * acquired at the same time only when holding the linkage rwlock - * exclusively, which prevents deadlocks. - * * Blocking with UNIX domain sockets is a tricky issue: unlike most network * protocols, bind() is a non-atomic operation, and connect() requires * potential sleeping in the protocol, due to potentially waiting on local or @@ -257,13 +278,19 @@ static struct mtx unp_defers_lock; #define UNP_DEFERRED_LOCK() mtx_lock(&unp_defers_lock) #define UNP_DEFERRED_UNLOCK() mtx_unlock(&unp_defers_lock) +#define UNP_REF_LIST_LOCK() UNP_DEFERRED_LOCK(); +#define UNP_REF_LIST_UNLOCK() UNP_DEFERRED_UNLOCK(); + #define UNP_PCB_LOCK_INIT(unp) mtx_init(&(unp)->unp_mtx, \ "unp_mtx", "unp_mtx", \ - MTX_DUPOK|MTX_DEF|MTX_RECURSE) + MTX_DUPOK|MTX_DEF) #define UNP_PCB_LOCK_DESTROY(unp) mtx_destroy(&(unp)->unp_mtx) #define UNP_PCB_LOCK(unp) mtx_lock(&(unp)->unp_mtx) +#define UNP_PCB_TRYLOCK(unp) mtx_trylock(&(unp)->unp_mtx) #define UNP_PCB_UNLOCK(unp) mtx_unlock(&(unp)->unp_mtx) +#define UNP_PCB_OWNED(unp) mtx_owned(&(unp)->unp_mtx) #define UNP_PCB_LOCK_ASSERT(unp) mtx_assert(&(unp)->unp_mtx, MA_OWNED) +#define UNP_PCB_UNLOCK_ASSERT(unp) mtx_assert(&(unp)->unp_mtx, MA_NOTOWNED) static int uipc_connect2(struct socket *, struct socket *); static int uipc_ctloutput(struct socket *, struct sockopt *); @@ -289,6 +316,75 @@ static int unp_externalize_fp(struct file *); static struct mbuf *unp_addsockcred(struct thread *, struct mbuf *); static void unp_process_defers(void * __unused, int); + +static void +unp_pcb_hold(struct unpcb *unp) +{ + MPASS(unp->unp_refcount); + refcount_acquire(&unp->unp_refcount); +} + +static int +unp_pcb_rele(struct unpcb *unp) +{ + int freed; + + UNP_PCB_LOCK_ASSERT(unp); + MPASS(unp->unp_refcount); + if ((freed = refcount_release(&unp->unp_refcount))) { + /* we got here with having detached? */ + MPASS(unp->unp_socket == NULL); + UNP_PCB_UNLOCK(unp); + UNP_PCB_LOCK_DESTROY(unp); + uma_zfree(unp_zone, unp); + } + return (freed); +} + +static void +unp_pcb_lock2(struct unpcb *unp, struct unpcb *unp2) +{ + UNP_PCB_UNLOCK_ASSERT(unp); + UNP_PCB_UNLOCK_ASSERT(unp2); + if ((uintptr_t)unp2 > (uintptr_t)unp) { + UNP_PCB_LOCK(unp); + UNP_PCB_LOCK(unp2); + } else { + UNP_PCB_LOCK(unp2); + UNP_PCB_LOCK(unp); + } +} + +static __noinline void +unp_pcb_owned_lock2_slowpath(struct unpcb *unp, struct unpcb **unp2p, int *freed) + +{ + struct unpcb *unp2; + + unp2 = *unp2p; + unp_pcb_hold((unp2)); + UNP_PCB_UNLOCK((unp)); + UNP_PCB_LOCK((unp2)); + UNP_PCB_LOCK((unp)); + *freed = unp_pcb_rele((unp2)); + if (*freed) + *unp2p = NULL; +} + +#define unp_pcb_owned_lock2(unp, unp2, freed) do { \ + freed = 0; \ + UNP_PCB_LOCK_ASSERT((unp)); \ + UNP_PCB_UNLOCK_ASSERT((unp2)); \ + if (__predict_true(UNP_PCB_TRYLOCK((unp2)))) \ + break; \ + else if ((uintptr_t)(unp2) > (uintptr_t)(unp)) \ + UNP_PCB_LOCK((unp2)); \ + else { \ + unp_pcb_owned_lock2_slowpath((unp), &(unp2), &freed); \ + } \ +} while (0) + + /* * Definitions of protocols supported in the LOCAL domain. */ @@ -344,17 +440,16 @@ uipc_abort(struct socket *so) unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_abort: unp == NULL")); + UNP_PCB_UNLOCK_ASSERT(unp); - UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); unp2 = unp->unp_conn; if (unp2 != NULL) { - UNP_PCB_LOCK(unp2); + unp_pcb_hold(unp2); + UNP_PCB_UNLOCK(unp); unp_drop(unp2); - UNP_PCB_UNLOCK(unp2); - } - UNP_PCB_UNLOCK(unp); - UNP_LINK_WUNLOCK(); + } else + UNP_PCB_UNLOCK(unp); } static int @@ -551,14 +646,12 @@ restart: ASSERT_VOP_ELOCKED(vp, "uipc_bind"); soun = (struct sockaddr_un *)sodupsockaddr(nam, M_WAITOK); - UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); VOP_UNP_BIND(vp, unp); unp->unp_vnode = vp; unp->unp_addr = soun; unp->unp_flags &= ~UNP_BINDING; UNP_PCB_UNLOCK(unp); - UNP_LINK_WUNLOCK(); VOP_UNLOCK(vp, 0); vn_finished_write(mp); free(buf, M_TEMP); @@ -585,9 +678,7 @@ uipc_connect(struct socket *so, struct sockaddr *nam, int error; KASSERT(td == curthread, ("uipc_connect: td != curthread")); - UNP_LINK_WLOCK(); error = unp_connect(so, nam, td); - UNP_LINK_WUNLOCK(); return (error); } @@ -598,9 +689,7 @@ uipc_connectat(int fd, struct socket *so, struct socka int error; KASSERT(td == curthread, ("uipc_connectat: td != curthread")); - UNP_LINK_WLOCK(); error = unp_connectat(fd, so, nam, td); - UNP_LINK_WUNLOCK(); return (error); } @@ -609,26 +698,41 @@ uipc_close(struct socket *so) { struct unpcb *unp, *unp2; struct vnode *vp = NULL; - + struct mtx *vplock; + int freed; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_close: unp == NULL")); - UNP_LINK_WLOCK(); + + vplock = NULL; + if ((vp = unp->unp_vnode) != NULL) { + vplock = mtx_pool_find(mtxpool_sleep, vp); + mtx_lock(vplock); + } UNP_PCB_LOCK(unp); - unp2 = unp->unp_conn; - if (unp2 != NULL) { - UNP_PCB_LOCK(unp2); - unp_disconnect(unp, unp2); - UNP_PCB_UNLOCK(unp2); + if (vp && unp->unp_vnode == NULL) { + mtx_unlock(vplock); + vp = NULL; } - if (SOLISTENING(so) && ((vp = unp->unp_vnode) != NULL)) { + if (vp != NULL) { VOP_UNP_DETACH(vp); unp->unp_vnode = NULL; } - UNP_PCB_UNLOCK(unp); - UNP_LINK_WUNLOCK(); - if (vp) + unp2 = unp->unp_conn; + unp_pcb_hold(unp); + if (unp2 != NULL) { + unp_pcb_hold(unp2); + unp_pcb_owned_lock2(unp, unp2, freed); + unp_disconnect(unp, unp2); + if (unp_pcb_rele(unp2) == 0) + UNP_PCB_UNLOCK(unp2); + } + if (unp_pcb_rele(unp) == 0) + UNP_PCB_UNLOCK(unp); + if (vp) { + mtx_unlock(vplock); vrele(vp); + } } static int @@ -637,17 +741,14 @@ uipc_connect2(struct socket *so1, struct socket *so2) struct unpcb *unp, *unp2; int error; - UNP_LINK_WLOCK(); unp = so1->so_pcb; KASSERT(unp != NULL, ("uipc_connect2: unp == NULL")); - UNP_PCB_LOCK(unp); unp2 = so2->so_pcb; KASSERT(unp2 != NULL, ("uipc_connect2: unp2 == NULL")); - UNP_PCB_LOCK(unp2); + unp_pcb_lock2(unp, unp2); error = unp_connect2(so1, so2, PRU_CONNECT2); UNP_PCB_UNLOCK(unp2); UNP_PCB_UNLOCK(unp); - UNP_LINK_WUNLOCK(); return (error); } @@ -655,6 +756,7 @@ static void uipc_detach(struct socket *so) { struct unpcb *unp, *unp2; + struct mtx *vplock; struct sockaddr_un *saved_unp_addr; struct vnode *vp; int freeunp, local_unp_rights; @@ -669,49 +771,77 @@ uipc_detach(struct socket *so) LIST_REMOVE(unp, unp_link); unp->unp_gencnt = ++unp_gencnt; --unp_count; + UNP_LINK_WUNLOCK(); + + UNP_PCB_UNLOCK_ASSERT(unp); + restart: + if ((vp = unp->unp_vnode) != NULL) { + vplock = mtx_pool_find(mtxpool_sleep, vp); + mtx_lock(vplock); + } UNP_PCB_LOCK(unp); - if ((unp->unp_flags & UNP_NASCENT) != 0) + if ((unp2 = unp->unp_conn) != NULL) { + unp_pcb_owned_lock2(unp, unp2, freeunp); + if (freeunp) + unp2 = NULL; + } + if (unp->unp_vnode != vp && + unp->unp_vnode != NULL) { + mtx_unlock(vplock); + UNP_PCB_UNLOCK(unp); + if (unp2) + UNP_PCB_UNLOCK(unp2); + goto restart; + } + if ((unp->unp_flags & UNP_NASCENT) != 0) { + if (unp2) + UNP_PCB_UNLOCK(unp2); goto teardown; - + } if ((vp = unp->unp_vnode) != NULL) { VOP_UNP_DETACH(vp); unp->unp_vnode = NULL; } - unp2 = unp->unp_conn; + unp_pcb_hold(unp); if (unp2 != NULL) { - UNP_PCB_LOCK(unp2); + unp_pcb_hold(unp2); unp_disconnect(unp, unp2); - UNP_PCB_UNLOCK(unp2); + if (unp_pcb_rele(unp2) == 0) + UNP_PCB_UNLOCK(unp2); } - - /* - * We hold the linkage lock exclusively, so it's OK to acquire - * multiple pcb locks at a time. - */ + UNP_PCB_UNLOCK(unp); + UNP_REF_LIST_LOCK(); while (!LIST_EMPTY(&unp->unp_refs)) { struct unpcb *ref = LIST_FIRST(&unp->unp_refs); - UNP_PCB_LOCK(ref); + unp_pcb_hold(ref); + UNP_REF_LIST_UNLOCK(); + + MPASS(ref != unp); + UNP_PCB_UNLOCK_ASSERT(ref); unp_drop(ref); - UNP_PCB_UNLOCK(ref); + UNP_REF_LIST_LOCK(); } + + UNP_REF_LIST_UNLOCK(); + UNP_PCB_LOCK(unp); + freeunp = unp_pcb_rele(unp); + MPASS(freeunp == 0); local_unp_rights = unp_rights; teardown: - UNP_LINK_WUNLOCK(); unp->unp_socket->so_pcb = NULL; saved_unp_addr = unp->unp_addr; unp->unp_addr = NULL; - unp->unp_refcount--; - freeunp = (unp->unp_refcount == 0); + unp->unp_socket = NULL; + freeunp = unp_pcb_rele(unp); if (saved_unp_addr != NULL) free(saved_unp_addr, M_SONAME); - if (freeunp) { - UNP_PCB_LOCK_DESTROY(unp); - uma_zfree(unp_zone, unp); - } else + if (!freeunp) UNP_PCB_UNLOCK(unp); - if (vp) + if (vp) { + mtx_unlock(vplock); vrele(vp); + } if (local_unp_rights) taskqueue_enqueue_timeout(taskqueue_thread, &unp_gc_task, -1); } @@ -720,20 +850,28 @@ static int uipc_disconnect(struct socket *so) { struct unpcb *unp, *unp2; + int freed; unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_disconnect: unp == NULL")); - UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); - unp2 = unp->unp_conn; - if (unp2 != NULL) { - UNP_PCB_LOCK(unp2); - unp_disconnect(unp, unp2); - UNP_PCB_UNLOCK(unp2); + if ((unp2 = unp->unp_conn) == NULL) { + UNP_PCB_UNLOCK(unp); + return (0); } - UNP_PCB_UNLOCK(unp); - UNP_LINK_WUNLOCK(); + unp_pcb_owned_lock2(unp, unp2, freed); + if (__predict_false(freed)) { + UNP_PCB_UNLOCK(unp); + return (0); + } + unp_pcb_hold(unp2); + unp_pcb_hold(unp); + unp_disconnect(unp, unp2); + if (unp_pcb_rele(unp) == 0) + UNP_PCB_UNLOCK(unp); + if (unp_pcb_rele(unp2) == 0) + UNP_PCB_UNLOCK(unp2); return (0); } @@ -852,13 +990,35 @@ uipc_rcvd(struct socket *so, int flags) } static int +connect_internal(struct socket *so, struct sockaddr *nam, struct thread *td) +{ + int error; + struct unpcb *unp; + + unp = so->so_pcb; + if (unp->unp_conn != NULL) + return (EISCONN); + error = unp_connect(so, nam, td); + if (error) + return (error); + UNP_PCB_LOCK(unp); + if (unp->unp_conn == NULL) { + UNP_PCB_UNLOCK(unp); + if (error == 0) + error = ENOTCONN; + } + return (error); +} + + +static int uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td) { struct unpcb *unp, *unp2; struct socket *so2; u_int mbcnt, sbcc; - int error = 0; + int freed, error; unp = sotounpcb(so); KASSERT(unp != NULL, ("%s: unp == NULL", __func__)); @@ -866,49 +1026,66 @@ uipc_send(struct socket *so, int flags, struct mbuf *m so->so_type == SOCK_SEQPACKET, ("%s: socktype %d", __func__, so->so_type)); + freed = error = 0; if (flags & PRUS_OOB) { error = EOPNOTSUPP; goto release; } if (control != NULL && (error = unp_internalize(&control, td))) goto release; - if ((nam != NULL) || (flags & PRUS_EOF)) - UNP_LINK_WLOCK(); - else - UNP_LINK_RLOCK(); + + unp2 = NULL; switch (so->so_type) { case SOCK_DGRAM: { const struct sockaddr *from; - unp2 = unp->unp_conn; if (nam != NULL) { - UNP_LINK_WLOCK_ASSERT(); - if (unp2 != NULL) { - error = EISCONN; + /* + * We return with UNP_PCB_LOCK_HELD so we know that + * the reference is live if the pointer is valid. + */ + if ((error = connect_internal(so, nam, td))) break; - } - error = unp_connect(so, nam, td); - if (error) - break; + MPASS(unp->unp_conn != NULL); unp2 = unp->unp_conn; - } + } else { + UNP_PCB_LOCK(unp); + /* + * Because connect() and send() are non-atomic in a sendto() + * with a target address, it's possible that the socket will + * have disconnected before the send() can run. In that case + * return the slightly counter-intuitive but otherwise + * correct error that the socket is not connected. + */ + if ((unp2 = unp->unp_conn) == NULL) { + UNP_PCB_UNLOCK(unp); + error = ENOTCONN; + break; + } + } + unp_pcb_owned_lock2(unp, unp2, freed); + if (__predict_false(freed)) { + UNP_PCB_UNLOCK(unp); + error = ENOTCONN; + break; + } /* - * Because connect() and send() are non-atomic in a sendto() - * with a target address, it's possible that the socket will - * have disconnected before the send() can run. In that case - * return the slightly counter-intuitive but otherwise - * correct error that the socket is not connected. + * The socket referencing unp2 may have been closed + * or unp may have been disconnected if the unp lock + * was dropped to acquire unp2. */ - if (unp2 == NULL) { + if (__predict_false(unp->unp_conn == NULL) || + unp2->unp_socket == NULL) { + UNP_PCB_UNLOCK(unp); + if (unp_pcb_rele(unp2) == 0) + UNP_PCB_UNLOCK(unp2); error = ENOTCONN; break; } - /* Lockless read. */ if (unp2->unp_flags & UNP_WANTCRED) control = unp_addsockcred(td, control); - UNP_PCB_LOCK(unp); if (unp->unp_addr != NULL) from = (struct sockaddr *)unp->unp_addr; else @@ -924,12 +1101,9 @@ uipc_send(struct socket *so, int flags, struct mbuf *m SOCKBUF_UNLOCK(&so2->so_rcv); error = ENOBUFS; } - if (nam != NULL) { - UNP_LINK_WLOCK_ASSERT(); - UNP_PCB_LOCK(unp2); + if (nam != NULL) unp_disconnect(unp, unp2); - UNP_PCB_UNLOCK(unp2); - } + UNP_PCB_UNLOCK(unp2); UNP_PCB_UNLOCK(unp); break; } @@ -938,42 +1112,37 @@ uipc_send(struct socket *so, int flags, struct mbuf *m case SOCK_STREAM: if ((so->so_state & SS_ISCONNECTED) == 0) { if (nam != NULL) { - UNP_LINK_WLOCK_ASSERT(); - error = unp_connect(so, nam, td); - if (error) - break; /* XXX */ - } else { + if ((error = connect_internal(so, nam, td))) + break; + } else { error = ENOTCONN; break; } - } - - /* Lockless read. */ - if (so->so_snd.sb_state & SBS_CANTSENDMORE) { + } else if ((unp2 = unp->unp_conn) == NULL) { + error = ENOTCONN; + break; + } else if (so->so_snd.sb_state & SBS_CANTSENDMORE) { error = EPIPE; break; + } else { + UNP_PCB_LOCK(unp); + if ((unp2 = unp->unp_conn) == NULL) { + UNP_PCB_UNLOCK(unp); + error = ENOTCONN; + break; + } } - - /* - * Because connect() and send() are non-atomic in a sendto() - * with a target address, it's possible that the socket will - * have disconnected before the send() can run. In that case - * return the slightly counter-intuitive but otherwise - * correct error that the socket is not connected. - * - * Locking here must be done carefully: the linkage lock - * prevents interconnections between unpcbs from changing, so - * we can traverse from unp to unp2 without acquiring unp's - * lock. Socket buffer locks follow unpcb locks, so we can - * acquire both remote and lock socket buffer locks. - */ - unp2 = unp->unp_conn; - if (unp2 == NULL) { + unp_pcb_owned_lock2(unp, unp2, freed); + UNP_PCB_UNLOCK(unp); + if (__predict_false(freed)) { error = ENOTCONN; break; } - so2 = unp2->unp_socket; - UNP_PCB_LOCK(unp2); + if ((so2 = unp2->unp_socket) == NULL) { + UNP_PCB_UNLOCK(unp2); + error = ENOTCONN; + break; + } SOCKBUF_LOCK(&so2->so_rcv); if (unp2->unp_flags & UNP_WANTCRED) { /* @@ -1046,12 +1215,6 @@ uipc_send(struct socket *so, int flags, struct mbuf *m unp_shutdown(unp); UNP_PCB_UNLOCK(unp); } - - if ((nam != NULL) || (flags & PRUS_EOF)) - UNP_LINK_WUNLOCK(); - else - UNP_LINK_RUNLOCK(); - if (control != NULL && error != 0) unp_dispose_mbuf(control); @@ -1124,12 +1287,10 @@ uipc_shutdown(struct socket *so) unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_shutdown: unp == NULL")); - UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); socantsendmore(so); unp_shutdown(unp); UNP_PCB_UNLOCK(unp); - UNP_LINK_WUNLOCK(); return (0); } @@ -1333,16 +1494,11 @@ unp_connectat(int fd, struct socket *so, struct sockad char buf[SOCK_MAXADDRLEN]; struct sockaddr *sa; cap_rights_t rights; - int error, len; + int error, len, freed; + struct mtx *vplock; if (nam->sa_family != AF_UNIX) return (EAFNOSUPPORT); - - UNP_LINK_WLOCK_ASSERT(); - - unp = sotounpcb(so); - KASSERT(unp != NULL, ("unp_connect: unp == NULL")); - if (nam->sa_len > sizeof(struct sockaddr_un)) return (EINVAL); len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); @@ -1351,12 +1507,12 @@ unp_connectat(int fd, struct socket *so, struct sockad bcopy(soun->sun_path, buf, len); buf[len] = 0; + unp = sotounpcb(so); UNP_PCB_LOCK(unp); if (unp->unp_flags & UNP_CONNECTING) { UNP_PCB_UNLOCK(unp); return (EALREADY); } - UNP_LINK_WUNLOCK(); unp->unp_flags |= UNP_CONNECTING; UNP_PCB_UNLOCK(unp); @@ -1389,11 +1545,8 @@ unp_connectat(int fd, struct socket *so, struct sockad unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); - /* - * Lock linkage lock for two reasons: make sure v_socket is stable, - * and to protect simultaneous locking of multiple pcbs. - */ - UNP_LINK_WLOCK(); + vplock = mtx_pool_find(mtxpool_sleep, vp); + mtx_lock(vplock); VOP_UNP_CONNECT(vp, &unp2); if (unp2 == NULL) { error = ECONNREFUSED; @@ -1404,8 +1557,7 @@ unp_connectat(int fd, struct socket *so, struct sockad error = EPROTOTYPE; goto bad2; } - UNP_PCB_LOCK(unp); - UNP_PCB_LOCK(unp2); + unp_pcb_lock2(unp, unp2); if (so->so_proto->pr_flags & PR_CONNREQUIRED) { if (so2->so_options & SO_ACCEPTCONN) { CURVNET_SET(so2->so_vnet); @@ -1418,7 +1570,9 @@ unp_connectat(int fd, struct socket *so, struct sockad goto bad3; } unp3 = sotounpcb(so2); - UNP_PCB_LOCK(unp3); + UNP_PCB_UNLOCK(unp); + unp_pcb_owned_lock2(unp2, unp3, freed); + MPASS(!freed); if (unp2->unp_addr != NULL) { bcopy(unp2->unp_addr, sa, unp2->unp_addr->sun_len); unp3->unp_addr = (struct sockaddr_un *) sa; @@ -1445,6 +1599,8 @@ unp_connectat(int fd, struct socket *so, struct sockad unp3->unp_flags |= UNP_WANTCRED; UNP_PCB_UNLOCK(unp2); unp2 = unp3; + unp_pcb_owned_lock2(unp2, unp, freed); + MPASS(!freed); #ifdef MAC mac_socketpeer_set_from_socket(so, so2); mac_socketpeer_set_from_socket(so2, so); @@ -1459,12 +1615,12 @@ bad3: UNP_PCB_UNLOCK(unp2); UNP_PCB_UNLOCK(unp); bad2: - UNP_LINK_WUNLOCK(); + mtx_unlock(vplock); bad: - if (vp != NULL) + if (vp != NULL) { vput(vp); + } free(sa, M_SONAME); - UNP_LINK_WLOCK(); UNP_PCB_LOCK(unp); unp->unp_flags &= ~UNP_CONNECTING; UNP_PCB_UNLOCK(unp); @@ -1482,7 +1638,6 @@ unp_connect2(struct socket *so, struct socket *so2, in unp2 = sotounpcb(so2); KASSERT(unp2 != NULL, ("unp_connect2: unp2 == NULL")); - UNP_LINK_WLOCK_ASSERT(); UNP_PCB_LOCK_ASSERT(unp); UNP_PCB_LOCK_ASSERT(unp2); @@ -1490,10 +1645,13 @@ unp_connect2(struct socket *so, struct socket *so2, in return (EPROTOTYPE); unp2->unp_flags &= ~UNP_NASCENT; unp->unp_conn = unp2; - + unp_pcb_hold(unp2); + unp_pcb_hold(unp); switch (so->so_type) { case SOCK_DGRAM: + UNP_REF_LIST_LOCK(); LIST_INSERT_HEAD(&unp2->unp_refs, unp, unp_reflink); + UNP_REF_LIST_UNLOCK(); soisconnected(so); break; @@ -1517,31 +1675,48 @@ unp_connect2(struct socket *so, struct socket *so2, in static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2) { - struct socket *so; + struct socket *so, *so2; + int rele, freed; KASSERT(unp2 != NULL, ("unp_disconnect: unp2 == NULL")); - UNP_LINK_WLOCK_ASSERT(); UNP_PCB_LOCK_ASSERT(unp); UNP_PCB_LOCK_ASSERT(unp2); + if (unp->unp_conn == NULL && unp2->unp_conn == NULL) + return; + + MPASS(unp->unp_conn == unp2); unp->unp_conn = NULL; + rele = 0; + so = unp->unp_socket; + so2 = unp2->unp_socket; switch (unp->unp_socket->so_type) { case SOCK_DGRAM: + UNP_REF_LIST_LOCK(); LIST_REMOVE(unp, unp_reflink); - so = unp->unp_socket; - SOCK_LOCK(so); - so->so_state &= ~SS_ISCONNECTED; - SOCK_UNLOCK(so); + UNP_REF_LIST_UNLOCK(); + if (so) { + SOCK_LOCK(so); + so->so_state &= ~SS_ISCONNECTED; + SOCK_UNLOCK(so); + } break; case SOCK_STREAM: case SOCK_SEQPACKET: - soisdisconnected(unp->unp_socket); + if (so) + soisdisconnected(so); + MPASS(unp2->unp_conn == unp); unp2->unp_conn = NULL; - soisdisconnected(unp2->unp_socket); + if (so2) + soisdisconnected(so2); break; } + freed = unp_pcb_rele(unp); + MPASS(freed == 0); + freed = unp_pcb_rele(unp2); + MPASS(freed == 0); } /* @@ -1625,7 +1800,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) continue; } unp_list[i++] = unp; - unp->unp_refcount++; + unp_pcb_hold(unp); } UNP_PCB_UNLOCK(unp); } @@ -1637,8 +1812,9 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) for (i = 0; i < n; i++) { unp = unp_list[i]; UNP_PCB_LOCK(unp); - unp->unp_refcount--; - if (unp->unp_refcount != 0 && unp->unp_gencnt <= gencnt) { + freeunp = unp_pcb_rele(unp); + + if (freeunp == 0 && unp->unp_gencnt <= gencnt) { xu->xu_len = sizeof *xu; xu->xu_unpp = unp; /* @@ -1665,14 +1841,8 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) sotoxsocket(unp->unp_socket, &xu->xu_socket); UNP_PCB_UNLOCK(unp); error = SYSCTL_OUT(req, xu, sizeof *xu); - } else { - freeunp = (unp->unp_refcount == 0); + } else if (freeunp == 0) UNP_PCB_UNLOCK(unp); - if (freeunp) { - UNP_PCB_LOCK_DESTROY(unp); - uma_zfree(unp_zone, unp); - } - } } free(xu, M_TEMP); if (!error) { @@ -1709,7 +1879,6 @@ unp_shutdown(struct unpcb *unp) struct unpcb *unp2; struct socket *so; - UNP_LINK_WLOCK_ASSERT(); UNP_PCB_LOCK_ASSERT(unp); unp2 = unp->unp_conn; @@ -1726,22 +1895,28 @@ unp_drop(struct unpcb *unp) { struct socket *so = unp->unp_socket; struct unpcb *unp2; + int freed; - UNP_LINK_WLOCK_ASSERT(); - UNP_PCB_LOCK_ASSERT(unp); - /* * Regardless of whether the socket's peer dropped the connection * with this socket by aborting or disconnecting, POSIX requires * that ECONNRESET is returned. */ - so->so_error = ECONNRESET; + /* acquire a reference so that unp isn't freed from underneath us */ + + UNP_PCB_LOCK(unp); + if (so) + so->so_error = ECONNRESET; unp2 = unp->unp_conn; - if (unp2 == NULL) - return; - UNP_PCB_LOCK(unp2); - unp_disconnect(unp, unp2); - UNP_PCB_UNLOCK(unp2); + if (unp2 != NULL) { + unp_pcb_hold(unp2); + unp_pcb_owned_lock2(unp, unp2, freed); + unp_disconnect(unp, unp2); + if (unp_pcb_rele(unp2) == 0) + UNP_PCB_UNLOCK(unp2); + } + if (unp_pcb_rele(unp) == 0) + UNP_PCB_UNLOCK(unp); } static void @@ -1881,7 +2056,7 @@ unp_init(void) return; #endif unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); + NULL, NULL, UMA_ALIGN_CACHE, 0); if (unp_zone == NULL) panic("unp_init"); uma_zone_set_max(unp_zone, maxsockets); @@ -2464,13 +2639,15 @@ vfs_unp_reclaim(struct vnode *vp) { struct unpcb *unp; int active; + struct mtx *vplock; ASSERT_VOP_ELOCKED(vp, "vfs_unp_reclaim"); KASSERT(vp->v_type == VSOCK, ("vfs_unp_reclaim: vp->v_type != VSOCK")); active = 0; - UNP_LINK_WLOCK(); + vplock = mtx_pool_find(mtxpool_sleep, vp); + mtx_lock(vplock); VOP_UNP_CONNECT(vp, &unp); if (unp == NULL) goto done; @@ -2481,8 +2658,8 @@ vfs_unp_reclaim(struct vnode *vp) active = 1; } UNP_PCB_UNLOCK(unp); -done: - UNP_LINK_WUNLOCK(); + done: + mtx_unlock(vplock); if (active) vunref(vp); } Modified: head/sys/sys/unpcb.h ============================================================================== --- head/sys/sys/unpcb.h Thu May 17 17:57:41 2018 (r333743) +++ head/sys/sys/unpcb.h Thu May 17 17:59:35 2018 (r333744) @@ -69,23 +69,25 @@ typedef uint64_t unp_gen_t; LIST_HEAD(unp_head, unpcb); struct unpcb { - LIST_ENTRY(unpcb) unp_link; /* glue on list of all PCBs */ - struct socket *unp_socket; /* pointer back to socket */ - struct file *unp_file; /* back-pointer to file for gc. */ - struct vnode *unp_vnode; /* if associated with file */ - ino_t unp_ino; /* fake inode number */ + /* Cache line 1 */ + struct mtx unp_mtx; /* mutex */ struct unpcb *unp_conn; /* control block of connected socket */ - struct unp_head unp_refs; /* referencing socket linked list */ - LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ - struct sockaddr_un *unp_addr; /* bound address of socket */ - unp_gen_t unp_gencnt; /* generation count of this instance */ + volatile u_int unp_refcount; short unp_flags; /* flags */ short unp_gcflag; /* Garbage collector flags. */ + struct sockaddr_un *unp_addr; /* bound address of socket */ + struct socket *unp_socket; /* pointer back to socket */ + /* Cache line 2 */ + struct vnode *unp_vnode; /* if associated with file */ struct xucred unp_peercred; /* peer credentials, if applicable */ - u_int unp_refcount; + LIST_ENTRY(unpcb) unp_reflink; /* link in unp_refs list */ + LIST_ENTRY(unpcb) unp_link; /* glue on list of all PCBs */ + struct unp_head unp_refs; /* referencing socket linked list */ + unp_gen_t unp_gencnt; /* generation count of this instance */ + struct file *unp_file; /* back-pointer to file for gc. */ u_int unp_msgcount; /* references from message queue */ - struct mtx unp_mtx; /* mutex */ -}; + ino_t unp_ino; /* fake inode number */ +} __aligned(CACHE_LINE_SIZE); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu May 17 18:08:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 524A2EDBBE2; Thu, 17 May 2018 18:08:00 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (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 CABF86DAA9; Thu, 17 May 2018 18:07:59 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id j20-v6so2465282pff.10; Thu, 17 May 2018 11:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uzVcNdjwSfboij7a8hh4bMVNEJcVz6lyJL9z2mib1Wg=; b=qDEZfroCE0b9+TlRuCwCJxLV97RVP68agWwZYNiLa11Ga1roPBH2GsG9TUu585pJ9z 9KvsATLgniZjVKV4rv+i4+sQXDvhaMMaXU4oeCmJccbCLTbgkzjYFG2HM6TTy/yVzbtE k+PW3xxzxn4EIMYp/ZsMbPNbaPADAyfOpzKfuCBk1Lw4vAKq+6pLZeyoH2QiZUBYRXoh ak7tGo4CCJIrwEgB5jPQKz3dUjtGISoD+zz81/eZxXnaGS5RmY2WqAgtoYiAsSjqg/vy CdIoImCAyuPcRLmKnPCDiAGoPPbyBDhPJaP+nHHKmlnZoxWWVQ0h5ZzSdfd03M9i0KTG Jcag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=uzVcNdjwSfboij7a8hh4bMVNEJcVz6lyJL9z2mib1Wg=; b=E2WC6PFZlZog2ESfkuPLxWcrw51WW/hHHIbI28cFdzolwYTgnZ+3VcIezeJvwaGTKb UuwrrdAQUWegRodhqXpPfa2bt0G3Ubt7/Riw2br2tsCbZRpz4Z5MM1aTxmdHaUceZv6R vLzLj70n4CaCmVCLwozylf9Z8hXe7jgfzddWczV/3mpJaXN+fbG3cEBjUlP1vl9VzpZw qoNQgCjduopUBuF2kvem3BuJVgOcLTXoSeiDOCTc2+/CMQWBIxJi2N3x2NpMvMB78/O1 +mI6Ri3zSzj3EJcAFDFInQxPL+pwdJFnS3oMctdKb0gIjyuO+hWza8evDYpHPyAVqmmT E9vA== X-Gm-Message-State: ALKqPweYo/6st7M8d2+aE0YY15UL3o5EgfmaGteIIi+EdjXD+C8hdgqO JN1ZLb28rf18kY1YMRsneFWNbTP9 X-Google-Smtp-Source: AB8JxZqya6QJCmPbKeVGr3tKSRXW7Y3Ze65dvZA2fXaJbwfBidLKAeIRSwBpZmW6yq2I1iw2PSCC1Q== X-Received: by 2002:a63:6407:: with SMTP id y7-v6mr4706562pgb.373.1526580478500; Thu, 17 May 2018 11:07:58 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-130.dsl.bell.ca. [70.49.169.130]) by smtp.gmail.com with ESMTPSA id m9-v6sm9927777pff.41.2018.05.17.11.07.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 11:07:57 -0700 (PDT) Sender: Mark Johnston Date: Thu, 17 May 2018 14:07:52 -0400 From: Mark Johnston To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333703 - head/sys/vm Message-ID: <20180517180752.GA5515@raichu> References: <201805170427.w4H4R8lv058775@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:08:00 -0000 On Thu, May 17, 2018 at 10:07:34AM -0700, Conrad Meyer wrote: > On Wed, May 16, 2018 at 9:27 PM, Mark Johnston wrote: > > Author: markj > > Date: Thu May 17 04:27:08 2018 > > New Revision: 333703 > > URL: https://svnweb.freebsd.org/changeset/base/333703 > > > > Log: > > Fix a race in vm_page_pagequeue_lockptr(). > > > > The value of m->queue must be cached after comparing it with PQ_NONE, > > since it may be concurrently changing. > > > > Reported by: glebius > > What were the symptoms of this issue? The test plan in the linked > phabricator revision says: > > "Gleb reported seeing panics as a result of the use of a bogus index > into the pagequeue array, and also reported that this patch fixed the > panics." > > So an attempt to lock pagequeues[PQ_NONE=255].pq_mutex, which is > either something later in the vm_domain object, or bogus memory? One > of the mtx asserts trips? I think it was "mtx_lock() of spin mutex"; I didn't get a lot of details. I failed to note in the commit message that this race was introduced in r332974. From owner-svn-src-all@freebsd.org Thu May 17 18:14:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57526EDBF75; Thu, 17 May 2018 18:14:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CB426E3C8; Thu, 17 May 2018 18:14:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E21AC4FE3; Thu, 17 May 2018 18:14:10 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIEA6d079836; Thu, 17 May 2018 18:14:10 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIEA0F079835; Thu, 17 May 2018 18:14:10 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171814.w4HIEA0F079835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 18:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333745 - in head/sys/contrib/ck: include src X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/contrib/ck: include src X-SVN-Commit-Revision: 333745 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:14:11 -0000 Author: mmacy Date: Thu May 17 18:14:10 2018 New Revision: 333745 URL: https://svnweb.freebsd.org/changeset/base/333745 Log: ck: add support for executing callbacks outside of main poll loop Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b | ck_epoch: introduce ck_epoch_deferred | | Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures). | Approved by: sbruno Modified: head/sys/contrib/ck/include/ck_epoch.h head/sys/contrib/ck/src/ck_epoch.c Modified: head/sys/contrib/ck/include/ck_epoch.h ============================================================================== --- head/sys/contrib/ck/include/ck_epoch.h Thu May 17 17:59:35 2018 (r333744) +++ head/sys/contrib/ck/include/ck_epoch.h Thu May 17 18:14:10 2018 (r333745) @@ -266,6 +266,7 @@ void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t void ck_epoch_unregister(ck_epoch_record_t *); bool ck_epoch_poll(ck_epoch_record_t *); +bool ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t *deferred); void ck_epoch_synchronize(ck_epoch_record_t *); void ck_epoch_synchronize_wait(ck_epoch_t *, ck_epoch_wait_cb_t *, void *); void ck_epoch_barrier(ck_epoch_record_t *); Modified: head/sys/contrib/ck/src/ck_epoch.c ============================================================================== --- head/sys/contrib/ck/src/ck_epoch.c Thu May 17 17:59:35 2018 (r333744) +++ head/sys/contrib/ck/src/ck_epoch.c Thu May 17 18:14:10 2018 (r333745) @@ -349,7 +349,7 @@ ck_epoch_scan(struct ck_epoch *global, } static void -ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e) +ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e, ck_stack_t *deferred) { unsigned int epoch = e & (CK_EPOCH_LENGTH - 1); ck_stack_entry_t *head, *next, *cursor; @@ -362,7 +362,10 @@ ck_epoch_dispatch(struct ck_epoch_record *record, unsi ck_epoch_entry_container(cursor); next = CK_STACK_NEXT(cursor); - entry->function(entry); + if (deferred != NULL) + ck_stack_push_spnc(deferred, &entry->stack_entry); + else + entry->function(entry); i++; } @@ -390,7 +393,7 @@ ck_epoch_reclaim(struct ck_epoch_record *record) unsigned int epoch; for (epoch = 0; epoch < CK_EPOCH_LENGTH; epoch++) - ck_epoch_dispatch(record, epoch); + ck_epoch_dispatch(record, epoch, NULL); return; } @@ -551,7 +554,7 @@ ck_epoch_barrier_wait(struct ck_epoch_record *record, * is far from ideal too. */ bool -ck_epoch_poll(struct ck_epoch_record *record) +ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t *deferred) { bool active; unsigned int epoch; @@ -572,7 +575,7 @@ ck_epoch_poll(struct ck_epoch_record *record) if (active == false) { record->epoch = epoch; for (epoch = 0; epoch < CK_EPOCH_LENGTH; epoch++) - ck_epoch_dispatch(record, epoch); + ck_epoch_dispatch(record, epoch, deferred); return true; } @@ -580,6 +583,13 @@ ck_epoch_poll(struct ck_epoch_record *record) /* If an active thread exists, rely on epoch observation. */ (void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1); - ck_epoch_dispatch(record, epoch + 1); + ck_epoch_dispatch(record, epoch + 1, deferred); return true; +} + +bool +ck_epoch_poll(struct ck_epoch_record *record) +{ + + return ck_epoch_poll_deferred(record, NULL); } From owner-svn-src-all@freebsd.org Thu May 17 18:16:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33C6CEDC08B; Thu, 17 May 2018 18:16:02 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD2466E60B; Thu, 17 May 2018 18:16:01 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from [192.168.200.3] (c-73-216-227-39.hsd1.va.comcast.net [73.216.227.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: gallatin) by duke.cs.duke.edu (Postfix) with ESMTPSA id 3BB5827000B0; Thu, 17 May 2018 14:15:55 -0400 (EDT) DMARC-Filter: OpenDMARC Filter v1.3.1 duke.cs.duke.edu 3BB5827000B0 Authentication-Results: duke.cs.duke.edu; dmarc=none header.from=cs.duke.edu DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=cs.duke.edu; s=mail0816; t=1526580955; bh=GQCUhzFqpi4/kPKdjB++8mpA4hI8fc56qu05u9XRFmI=; h=Subject:To:From:Date:From; b=eSNIOmXVEFD8jR/fJHuXyxbWsb0AGq+9VbnFeyxPSo7w7y6EIrj6CAnM1OR6gC/Hr nwuYVfdPyNPDSHKbyc+X+T7bAC6mW8G2frYVtg23GUy5uRv373TlqNtbjXh/oOwfHN aFpXponpq5pHF6mcKByBrx6TSysLN1JXxUVqlEXiVXpia1ni1HHA7XpvjCZvYoEEQV kYqDTpV3qnvnCHwMtlkgu0wSoO/Vb00sHoFqG4iFbXTSnkhu/Qz1Dov6RV9L7IIovI +0rQolXylxUF13J2KEollaCOsddrO3rBmuQCuOp6zA5ca8fBHKwr9IFPP+q5k+/PAW 4g7irtn+xb2mg== Subject: Re: svn commit: r333703 - head/sys/vm To: Mark Johnston , Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805170427.w4H4R8lv058775@repo.freebsd.org> <20180517180752.GA5515@raichu> From: Andrew Gallatin Message-ID: <1b4d6c8c-82a9-1953-7283-fe21158cfd5f@cs.duke.edu> Date: Thu, 17 May 2018 14:15:54 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180517180752.GA5515@raichu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:16:02 -0000 On 05/17/18 14:07, Mark Johnston wrote: > On Thu, May 17, 2018 at 10:07:34AM -0700, Conrad Meyer wrote: >> On Wed, May 16, 2018 at 9:27 PM, Mark Johnston wrote: >>> Author: markj >>> Date: Thu May 17 04:27:08 2018 >>> New Revision: 333703 >>> URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_333703&d=DwIBAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=6lhtci2MYxtyrK5Ub70QC0DcEiQ77Ry2LTAb6cDtW5A&s=z0SOGvNGORjI-SySfy-aovuyFzy_K5CtCfbNeWbRGLA&e= >>> >>> Log: >>> Fix a race in vm_page_pagequeue_lockptr(). >>> >>> The value of m->queue must be cached after comparing it with PQ_NONE, >>> since it may be concurrently changing. >>> >>> Reported by: glebius >> >> What were the symptoms of this issue? The test plan in the linked >> phabricator revision says: >> >> "Gleb reported seeing panics as a result of the use of a bogus index >> into the pagequeue array, and also reported that this patch fixed the >> panics." >> >> So an attempt to lock pagequeues[PQ_NONE=255].pq_mutex, which is >> either something later in the vm_domain object, or bogus memory? One >> of the mtx asserts trips? > > I think it was "mtx_lock() of spin mutex"; I didn't get a lot of > details. > > I failed to note in the commit message that this race was introduced in > r332974. > The most common stack was: panic: mtx_lock() of spin mutex (null) @ /data/ocafirmware.alt/FreeBSD/sys/vm/vm_page.c:3344 cpuid = 4 time = 1526415167 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe158af62380 vpanic() at vpanic+0x1a3/frame 0xfffffe158af623e0 doadump() at doadump/frame 0xfffffe158af62460 __mtx_lock_flags() at __mtx_lock_flags+0x11a/frame 0xfffffe158af624a0 vm_page_dequeue() at vm_page_dequeue+0x8a/frame 0xfffffe158af624e0 vm_page_alloc_domain_after() at vm_page_alloc_domain_after+0x2cb/frame 0xfffffe158af62560 vm_page_grab_pages() at vm_page_grab_pages+0x274/frame 0xfffffe158af62610 vn_sendfile() at vn_sendfile+0x83a/frame 0xfffffe158af628e0 [Tue May 15 20:12:48 2018]sys_sendfile() at sys_sendfile+0x119/frame 0xfffffe158af62980 amd64_syscall() at amd64_syscall+0x298/frame 0xfffffe158af62ab0 fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe158af62ab0 I once saw one like this: Fatal trap 9: general protection fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff8088bf74 stack pointer = 0x28:0xfffffe55af7712e0 frame pointer = 0x28:0xfffffe55af771330 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq446: mlx5_core0) [Mon May 14 04:45:10 2018]trap number = 9 panic: general protection fault cpuid = 0 time = 1526273109 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe55af770ff0 vpanic() at vpanic+0x1a3/frame 0xfffffe55af771050 panic() at panic+0x43/frame 0xfffffe55af7710b0 trap_fatal() at trap_fatal+0x35f/frame 0xfffffe55af771100 trap() at trap+0x6d/frame 0xfffffe55af771210 [Mon May 14 04:45:10 2018]calltrap() at calltrap+0x8/frame 0xfffffe55af771210 --- trap 0x9, rip = 0xffffffff8088bf74, rsp = 0xfffffe55af7712e0, rbp = 0xfffffe55af771330 --- vm_pqbatch_submit_page() at vm_pqbatch_submit_page+0x144/frame 0xfffffe55af771330 sendfile_free_page() at sendfile_free_page+0x10e/frame 0xfffffe55af771360 sendfile_free_mext_pg() at sendfile_free_mext_pg+0xb7/frame 0xfffffe55af7713b0 mb_free_ext() at mb_free_ext+0x103/frame 0xfffffe55af7713e0 m_freem() at m_freem+0x48/frame 0xfffffe55af771400 tcp_do_segment() at tcp_do_segment+0x1647/frame 0xfffffe55af771500 tcp_input_with_port() at tcp_input_with_port+0xfcc/frame 0xfffffe55af771650 tcp_input() at tcp_input+0xb/frame 0xfffffe55af771660 [Mon May 14 04:45:10 2018]ip_input() at ip_input+0xe9/frame 0xfffffe55af7716c0 netisr_dispatch_src() at netisr_dispatch_src+0xa8/frame 0xfffffe55af771710 ether_demux() at ether_demux+0x140/frame 0xfffffe55af771740 ether_nh_input() at ether_nh_input+0x32c/frame 0xfffffe55af7717a0 netisr_dispatch_src() at netisr_dispatch_src+0xa8/frame 0xfffffe55af7717f0 ether_input() at ether_input+0x26/frame 0xfffffe55af771810 tcp_lro_flush_all() at tcp_lro_flush_all+0xf2/frame 0xfffffe55af771850 mlx5e_rx_cq_comp() at mlx5e_rx_cq_comp+0x5e5/frame 0xfffffe55af771950 mlx5_cq_completion() at mlx5_cq_completion+0x73/frame 0xfffffe55af771990 <...> Thanks again for fixing it so quickly! Drew From owner-svn-src-all@freebsd.org Thu May 17 18:39:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDD66EDCA27; Thu, 17 May 2018 18:39:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 11A0F700E3; Thu, 17 May 2018 18:38:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id e10c1b79; Thu, 17 May 2018 20:38:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=Yyz2XlzXEdTiskgB+pXlGjWq6/o=; b=Ljtkbo/wpYwDxTtbKJDaZ7UHeI9a KtaPFCicBeu9jXCCuEIkxFpOpU/u3Z9xK3lld+z65X2RcC9QJiQSWCdbxNclu5CX dniZZTycBPtx+zoyHFOEDb2gGVRoeCRyId8xwjJpc6yQxGjt54pYsxa5QzAzJfcS 5H+A66oAK+9SPao= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=gv9sxZ8nhKEVwjeoT3iygmUhN06pfc5vVSuZsuPo/qzpochXFr65wG4l CHFvzTpWSHHGD5gxzO/KAGr6OhIDy0bGU9859b3w2MlGmK8okUmFMhkn2BcVXJv3 71YjxNtra2a1cDoXgwl1/bMIlwxjbRhwJ6dqCrMyGQDH4qk1HSY= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id c8d1f23c TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 17 May 2018 20:38:57 +0200 (CEST) Date: Thu, 17 May 2018 20:38:56 +0200 From: Emmanuel Vadot To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src Message-Id: <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> In-Reply-To: <201805171814.w4HIEA0F079835@repo.freebsd.org> References: <201805171814.w4HIEA0F079835@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:39:01 -0000 Hi Matt, On Thu, 17 May 2018 18:14:10 +0000 (UTC) Matt Macy wrote: > Author: mmacy > Date: Thu May 17 18:14:10 2018 > New Revision: 333745 > URL: https://svnweb.freebsd.org/changeset/base/333745 > > Log: > ck: add support for executing callbacks outside of main poll loop > > Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b > > | ck_epoch: introduce ck_epoch_deferred > | > | Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures). > | > > Approved by: sbruno > > Modified: > head/sys/contrib/ck/include/ck_epoch.h > head/sys/contrib/ck/src/ck_epoch.c > CK was imported in vendor-sys/ck, commiting directly into head will cause some problems in the future. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu May 17 18:40:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE07EDCAB0; Thu, 17 May 2018 18:40:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CCEE70261; Thu, 17 May 2018 18:40:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F3815324; Thu, 17 May 2018 18:40:01 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe1il092272; Thu, 17 May 2018 18:40:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe1IS092271; Thu, 17 May 2018 18:40:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe1IS092271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333746 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:01 -0000 Author: gjb Date: Thu May 17 18:40:00 2018 New Revision: 333746 URL: https://svnweb.freebsd.org/changeset/base/333746 Log: Document r331882, cm(4) and fpa(4) deprecation in FreeBSD 12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:14:10 2018 (r333745) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:00 2018 (r333746) @@ -570,6 +570,11 @@ Support for the TAIO USB multi-protocol adapter (TUMPA) has been added. + + The &man.cm.4; and &man.fpa.4; drivers + have been marked as deprecated, and will be removed in + &os; 12. From owner-svn-src-all@freebsd.org Thu May 17 18:40:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E6C0EDCB1C; Thu, 17 May 2018 18:40:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59DB0702E6; Thu, 17 May 2018 18:40:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 653485327; Thu, 17 May 2018 18:40:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe42x092404; Thu, 17 May 2018 18:40:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe4XZ092403; Thu, 17 May 2018 18:40:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe4XZ092403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333749 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:07 -0000 Author: gjb Date: Thu May 17 18:40:03 2018 New Revision: 333749 URL: https://svnweb.freebsd.org/changeset/base/333749 Log: Document r333367, nxge(4) deprecation in FreeBSD 12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:02 2018 (r333748) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:03 2018 (r333749) @@ -578,6 +578,9 @@ The &man.ixgb.4; driver has been marked as deprecated, and will be removed in &os; 12. + + The &man.nxge.4; driver has been marked + as deprecated, and will be removed in &os; 12. From owner-svn-src-all@freebsd.org Thu May 17 18:40:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A8EEDCAB7; Thu, 17 May 2018 18:40:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74E7E70262; Thu, 17 May 2018 18:40:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55F325325; Thu, 17 May 2018 18:40:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe2Q4092315; Thu, 17 May 2018 18:40:02 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe2jb092314; Thu, 17 May 2018 18:40:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe2jb092314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333747 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:02 -0000 Author: gjb Date: Thu May 17 18:40:01 2018 New Revision: 333747 URL: https://svnweb.freebsd.org/changeset/base/333747 Log: Document r332519, various GEOM classes deprecation in FreeBSD 12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:00 2018 (r333746) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:01 2018 (r333747) @@ -618,7 +618,13 @@ <literal>geom(4)</literal> -   + The geom_aes, + geom_bsd, geom_mbr, + geom_sunlabel &man.geom.4; classes have + been marked as deprecated. They have been replaced by the + geom_part class in &os; 7, and removed + from the GENERIC kernel configurations in + &os; 8, and will be removed in &os; 12. From owner-svn-src-all@freebsd.org Thu May 17 18:40:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 013F0EDCAC9; Thu, 17 May 2018 18:40:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90CA770284; Thu, 17 May 2018 18:40:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6703F5326; Thu, 17 May 2018 18:40:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe3tj092360; Thu, 17 May 2018 18:40:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe3UB092359; Thu, 17 May 2018 18:40:03 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe3UB092359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333748 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:04 -0000 Author: gjb Date: Thu May 17 18:40:02 2018 New Revision: 333748 URL: https://svnweb.freebsd.org/changeset/base/333748 Log: Document r333171, ixgb(4) deprecation in FreeBSD 12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:01 2018 (r333747) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:02 2018 (r333748) @@ -575,6 +575,9 @@ sponsor="&darpa_afrl;">The &man.cm.4; and &man.fpa.4; drivers have been marked as deprecated, and will be removed in &os; 12. + + The &man.ixgb.4; driver has been marked + as deprecated, and will be removed in &os; 12. From owner-svn-src-all@freebsd.org Thu May 17 18:40:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73D14EDCB3A; Thu, 17 May 2018 18:40:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A95BB7034C; Thu, 17 May 2018 18:40:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DFD05329; Thu, 17 May 2018 18:40:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe5WZ092491; Thu, 17 May 2018 18:40:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe5s0092490; Thu, 17 May 2018 18:40:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe5s0092490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333751 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:08 -0000 Author: gjb Date: Thu May 17 18:40:05 2018 New Revision: 333751 URL: https://svnweb.freebsd.org/changeset/base/333751 Log: Document r333738, vxge(4) deprecation in FreeBSD 12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:04 2018 (r333750) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:05 2018 (r333751) @@ -585,6 +585,9 @@ The &man.lmc.4; driver has been marked as deprecated, and will be removed in &os; 12. + + The &man.vxge.4; driver has been marked + as deprecated, and will be removed in &os; 12. From owner-svn-src-all@freebsd.org Thu May 17 18:40:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 893A4EDCB3E; Thu, 17 May 2018 18:40:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF8AB70354; Thu, 17 May 2018 18:40:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20F6D532A; Thu, 17 May 2018 18:40:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe6Ao092536; Thu, 17 May 2018 18:40:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe61O092535; Thu, 17 May 2018 18:40:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe61O092535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333752 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:08 -0000 Author: gjb Date: Thu May 17 18:40:06 2018 New Revision: 333752 URL: https://svnweb.freebsd.org/changeset/base/333752 Log: Further expand on the description of r333006, noting the ISO images can now be used to write to a memory stick, as well as a CD. Suggested by: benno Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:05 2018 (r333751) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:06 2018 (r333752) @@ -739,7 +739,9 @@ &os; installation ISO medium creation tools have been updated to generate hybrid images for &arch.amd64;, supporting both BIOS and - EFI. + EFI. The ISO image can + now be written to a memory stick as well as being used as + a CD image. From owner-svn-src-all@freebsd.org Thu May 17 18:40:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A44AEDCB34; Thu, 17 May 2018 18:40:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00D4C7033F; Thu, 17 May 2018 18:40:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 780CE5328; Thu, 17 May 2018 18:40:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIe5Hi092448; Thu, 17 May 2018 18:40:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIe55T092447; Thu, 17 May 2018 18:40:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171840.w4HIe55T092447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333750 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:40:08 -0000 Author: gjb Date: Thu May 17 18:40:04 2018 New Revision: 333750 URL: https://svnweb.freebsd.org/changeset/base/333750 Log: Document r333412, lmc(4) deprecation in FreeBSD 12. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:03 2018 (r333749) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:04 2018 (r333750) @@ -581,6 +581,10 @@ The &man.nxge.4; driver has been marked as deprecated, and will be removed in &os; 12. + + The + &man.lmc.4; driver has been marked as deprecated, and will be + removed in &os; 12. From owner-svn-src-all@freebsd.org Thu May 17 18:59:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC3FEDD6AD; Thu, 17 May 2018 18:59:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79F4F713F2; Thu, 17 May 2018 18:59:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 572FF566F; Thu, 17 May 2018 18:59:13 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HIxDmZ002997; Thu, 17 May 2018 18:59:13 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HIxDcJ002996; Thu, 17 May 2018 18:59:13 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805171859.w4HIxDcJ002996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 18:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333753 - stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 333753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 18:59:14 -0000 Author: gjb Date: Thu May 17 18:59:12 2018 New Revision: 333753 URL: https://svnweb.freebsd.org/changeset/base/333753 Log: Document r333410, i386 memory stick installer images now use MBR. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:40:06 2018 (r333752) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu May 17 18:59:12 2018 (r333753) @@ -735,6 +735,12 @@ Service, the NTP service internal to the EC2™ infrastructure. + The + &arch.i386; memory stick image installer have been changed + to use the MBR partitioning scheme, which + addresses a boot issue from a GPT partition + scheme in non-UEFI mode. + The &os; installation ISO medium creation tools have been updated to generate hybrid images for &arch.amd64;, From owner-svn-src-all@freebsd.org Thu May 17 19:06:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4E23EDD917; Thu, 17 May 2018 19:06:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AECC71865; Thu, 17 May 2018 19:06:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CB855800; Thu, 17 May 2018 19:06:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJ6jkW007720; Thu, 17 May 2018 19:06:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJ6jtC007719; Thu, 17 May 2018 19:06:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805171906.w4HJ6jtC007719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 May 2018 19:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333754 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 333754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:06:46 -0000 Author: markj Date: Thu May 17 19:06:44 2018 New Revision: 333754 URL: https://svnweb.freebsd.org/changeset/base/333754 Log: Remove a reference to NETDUMP_DEBUG, and document sysctls. NETDUMP_DEBUG was removed and replaced with a sysctl which enables debug output without requiring a recompile. Modified: head/share/man/man4/netdump.4 Modified: head/share/man/man4/netdump.4 ============================================================================== --- head/share/man/man4/netdump.4 Thu May 17 18:59:12 2018 (r333753) +++ head/share/man/man4/netdump.4 Thu May 17 19:06:44 2018 (r333754) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 4, 2018 +.Dd May 17, 2018 .Dt NETDUMP 4 .Os .Sh NAME @@ -36,11 +36,6 @@ your kernel configuration file: .Bd -ragged -offset indent .Cd "options NETDUMP" .Ed -.Pp -Debug output can be enabled by adding the following line: -.Bd -ragged -offset indent -.Cd "options NETDUMP_DEBUG" -.Ed .Sh DESCRIPTION netdump is a UDP-based protocol for transmitting kernel dumps to a remote host. A netdump client is a panicking kernel, and a netdump server is a host @@ -112,6 +107,30 @@ The following network drivers support netdump: .Xr mlx4en 4 , .Xr re 4 , .Xr vtnet 4 . +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +variables: +.Bl -tag -width "indent" +.It Va net.netdump.debug +Control debug message verbosity. +Debug messages are disabled by default, but are useful when troubleshooting +or when developing driver support. +.It Va net.netdump.path +Specify a path relative to the server's dump directory in which to store +the dump. +For example, if the +.Nm +server is configured to store dumps in +.Pa /var/crash , +a path of +.Dq foo +will cause the server to attempt to store dumps from the client in +.Pa /var/crash/foo . +The server will not automatically create the relative directory. +.El .Sh SEE ALSO .Xr decryptcore 8 , .Xr dumpon 8 , From owner-svn-src-all@freebsd.org Thu May 17 19:08:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75743EDDA41; Thu, 17 May 2018 19:08:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2320C71A17; Thu, 17 May 2018 19:08:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1A395801; Thu, 17 May 2018 19:08:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJ8SeX007827; Thu, 17 May 2018 19:08:28 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJ8SHO007826; Thu, 17 May 2018 19:08:28 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171908.w4HJ8SHO007826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 19:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333755 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:08:29 -0000 Author: mmacy Date: Thu May 17 19:08:28 2018 New Revision: 333755 URL: https://svnweb.freebsd.org/changeset/base/333755 Log: epoch(9): restore thread priority on exit if it was changed by a waiter Reported by: markj Approved by: sbruno Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 19:06:44 2018 (r333754) +++ head/sys/kern/subr_epoch.c Thu May 17 19:08:28 2018 (r333755) @@ -290,6 +290,7 @@ epoch_enter_internal(epoch_t epoch, struct thread *td) INIT_CHECK(epoch); critical_enter(); + td->td_pre_epoch_prio = td->td_priority; eps = epoch->e_pcpu[curcpu]; #ifdef INVARIANTS MPASS(td->td_epochnest < UCHAR_MAX - 2); @@ -326,6 +327,11 @@ epoch_exit_internal(epoch_t epoch, struct thread *td) TAILQ_REMOVE(&eps->eps_record.er_tdlist, td, td_epochq); eps->eps_record.er_gen++; sched_unpin(); + if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) { + thread_lock(td); + sched_prio(td, td->td_pre_epoch_prio); + thread_unlock(td); + } critical_exit(); } From owner-svn-src-all@freebsd.org Thu May 17 19:10:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC79EDDAF0; Thu, 17 May 2018 19:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A1A571B8C; Thu, 17 May 2018 19:10:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF5615806; Thu, 17 May 2018 19:10:13 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJADtP007966; Thu, 17 May 2018 19:10:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJADY8007965; Thu, 17 May 2018 19:10:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201805171910.w4HJADY8007965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 17 May 2018 19:10:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333756 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 333756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:10:14 -0000 Author: manu Date: Thu May 17 19:10:13 2018 New Revision: 333756 URL: https://svnweb.freebsd.org/changeset/base/333756 Log: release: rpi3: Copy the special rpi3 config.txt RPI* 32bits and RPI* 64bits have a different config.txt Copy to correct config.txt to the fat partition of the release image. Also copy pwm.dtbo as some people want to use it. Reviewed by: gjb Modified: head/release/arm64/RPI3.conf Modified: head/release/arm64/RPI3.conf ============================================================================== --- head/release/arm64/RPI3.conf Thu May 17 19:08:28 2018 (r333755) +++ head/release/arm64/RPI3.conf Thu May 17 19:10:13 2018 (r333756) @@ -16,14 +16,14 @@ KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 OL_DIR="${DTB_DIR}/overlays" -OVERLAYS="mmc.dtbo pi3-disable-bt.dtbo" +OVERLAYS="mmc.dtbo pwm.dtbo pi3-disable-bt.dtbo" PART_SCHEME="MBR" export BOARDNAME="RPI3" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi3" UBOOT_FILES="README u-boot.bin" - DTB_FILES="armstub8.bin bootcode.bin config.txt fixup_cd.dat \ + DTB_FILES="armstub8.bin bootcode.bin fixup_cd.dat \ fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \ start_cd.elf start_db.elf start_x.elf start.elf ${DTB}" FATMOUNT="${DESTDIR%${KERNEL}}fat" @@ -39,6 +39,8 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${DTB_DIR}/${_DF} \ ${FATMOUNT}/${_DF} done + chroot ${CHROOTDIR} cp -p ${DTB_DIR}/config_rpi3.txt \ + ${FATMOUNT}/config.txt chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/overlays for _OL in ${OVERLAYS}; do chroot ${CHROOTDIR} cp -p ${OL_DIR}/${_OL} \ From owner-svn-src-all@freebsd.org Thu May 17 19:12:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09416EDDD8F; Thu, 17 May 2018 19:12:28 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A945072057; Thu, 17 May 2018 19:12:27 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 74AAD14269; Thu, 17 May 2018 19:12:27 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f182.google.com with SMTP id z4-v6so3333367iof.5; Thu, 17 May 2018 12:12:27 -0700 (PDT) X-Gm-Message-State: ALKqPwfRapCOEcd0LqSqWCuabtTAjyvSQGonrjhhKSvJhSq9HC5iDgXa f0cSS0JhkgR6frGt2oZJ2mCBl3Z/QdRpfC1kvI8= X-Google-Smtp-Source: AB8JxZqaxVsMDcVzwSEWajETfQopQ+JIMLADPN5wR3e8ndPC1VQNkNhEZi9TV0COD9nyxsLOAPSb5CnmAny7qwHwsLg= X-Received: by 2002:a6b:c5a:: with SMTP id w87-v6mr7407306ioi.132.1526584346854; Thu, 17 May 2018 12:12:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3e4a:0:0:0:0:0 with HTTP; Thu, 17 May 2018 12:12:26 -0700 (PDT) In-Reply-To: <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> References: <201805171814.w4HIEA0F079835@repo.freebsd.org> <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> From: Matthew Macy Date: Thu, 17 May 2018 12:12:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src To: Emmanuel Vadot 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.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:12:28 -0000 How do I avoid problems while allowing timely updates? -M On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot wrote: > > Hi Matt, > > On Thu, 17 May 2018 18:14:10 +0000 (UTC) > Matt Macy wrote: > >> Author: mmacy >> Date: Thu May 17 18:14:10 2018 >> New Revision: 333745 >> URL: https://svnweb.freebsd.org/changeset/base/333745 >> >> Log: >> ck: add support for executing callbacks outside of main poll loop >> >> Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b >> >> | ck_epoch: introduce ck_epoch_deferred >> | >> | Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures). >> | >> >> Approved by: sbruno >> >> Modified: >> head/sys/contrib/ck/include/ck_epoch.h >> head/sys/contrib/ck/src/ck_epoch.c >> > > CK was imported in vendor-sys/ck, commiting directly into head will > cause some problems in the future. > > -- > Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu May 17 19:20:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68B5EDDF14 for ; Thu, 17 May 2018 19:20:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-3.consmr.mail.bf2.yahoo.com (sonic306-3.consmr.mail.bf2.yahoo.com [74.6.132.42]) (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 7B11B72280 for ; Thu, 17 May 2018 19:20:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1526584813; bh=cDy4lFHaB630pMiRtKqqG19bvFddnU+CuTXJGT9tci0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=R8Blzc68DXQiviAXzK7opr0nT8IFXpCnYeAzimtAfcJqS0rHHnPKqAUC3/yQOAIgseOa47MUt5f7ZoG4k90J8X67kaA3GhSxo2g4oZYE5J0ktg/fJWI84trCMRrysWcZs96i67Xbr6RIQ9hQDOAWmFTusY5yLNh/PWBxxcwEANnGTPt4L1tPNRZ7Ef0mMUAFXkm+thxIw4q0LJj7cXpyTpQOb73mUz4SSwUinPGvFDz9tnACBnn9pBVu7GieKs+0m6Xq1saK1maLtq0ATyT2XF0CNEI2s38jjlfswKmuX49lI1PDdRxKw+Oie6h2m03ID3RquSmBzxX1svvd6yXTqg== X-YMail-OSG: c7.DUIkVM1mjGzWnb5bRjSYO_gxc9tvEWVRu.iUv2HhBC8OhEYs4KyKNTab3Fyi zxX0yHAnIrxBPMVBa0hRddXNoNUhzMVthSlcMtgAbSTgiCxUKUZM6d3xzXxIsYwqxcVDtRnh9nOb yCUYkqS92hPF_MtNEF2mxJ1X98z7.LCYhWdn.GZsUb3HYRU1J.Tu_XDuyfwyWCnM9OZ7UtmTpqXD PkDmO_xD4zjIRMPWJJwa3MCeQLkEQFyNFi_3Le366VZmAXPneVlzi8A9u0.tmibtsTMw3yQgTrkz m4PX6KjLPthmeg.L94E20Cf7dnIqDZpkxK6u8HJ0guvSXQqtD_m59d8Dp0GMKHADT6TPUv8nfTzj u8yJE9voLrGtDYDDv3v6aWTSHiHvtImY9YwPfvdu7gGqTDBovS2LnL1ypqgtLUqbtjroNAjT7E23 PUccxORDLZn7u1aNya.kWQOQRzDoHtNY6MlphQm0xjBh9cFgnRji2RLbwe40Q7L2Pq9rQrHHMJ0t 8xVWIhXa6xlhvZtm4lp.W7g6MJ8PgSb4nkmFA6cH0bOsyZgSLf3KyjiArt3jp_yFlXWm8d2qRL9k X2EG6zYn3rzeFGKIUMzLWTgmoTeHB8nszeRabuHj6I7nw3.NqoD7.beOsKOx104Pqss8- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Thu, 17 May 2018 19:20:13 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp418.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e8e120e778f1abab8fa90e6115ebf9ff; Thu, 17 May 2018 19:20:08 +0000 (UTC) Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src To: Matthew Macy , Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805171814.w4HIEA0F079835@repo.freebsd.org> <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <17058056-6b70-e918-dab8-63951d1bfbbd@FreeBSD.org> Date: Thu, 17 May 2018 14:20:05 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:20:15 -0000 On 17/05/2018 14:12, Matthew Macy wrote: > How do I avoid problems while allowing timely updates? > > -M > > On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot wrote: >> Hi Matt, >> >> On Thu, 17 May 2018 18:14:10 +0000 (UTC) >> Matt Macy wrote: >> >>> Author: mmacy >>> Date: Thu May 17 18:14:10 2018 >>> New Revision: 333745 >>> URL: https://svnweb.freebsd.org/changeset/base/333745 >>> >>> Log: >>> ck: add support for executing callbacks outside of main poll loop >>> >>> Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b >>> >>> | ck_epoch: introduce ck_epoch_deferred >>> | >>> | Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures). >>> | >>> >>> Approved by: sbruno >>> >>> Modified: >>> head/sys/contrib/ck/include/ck_epoch.h >>> head/sys/contrib/ck/src/ck_epoch.c >>> >> CK was imported in vendor-sys/ck, commiting directly into head will >> cause some problems in the future. Actually ... committing to head is fine: some things just have to be fixed. We do ask you try to upstream the change and re-merge things when possible. Pedro. From owner-svn-src-all@freebsd.org Thu May 17 19:28:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A544EDE22F; Thu, 17 May 2018 19:28:00 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A2BF726E3; Thu, 17 May 2018 19:27:59 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id ca4806a5; Thu, 17 May 2018 21:27:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=IMTAe6POBlu0tktOk1Ju8+oVANc=; b=lCaTFJkKRQLg5f5F/ja4WqvPsJhO YeDnWm4IDZV+x3+sqtoQ4yFeR/xN+GYSbRUrcqzNdzcSq9OvqYW7tnSGCr8UVz1j w6LRXPIl+x7WkywZaGFUMjpDLAbM27RXyWUW4xWxmSKJKZXWDdqioNRolS98ubU3 YDkVkhk5p3qYblw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=GBpNpANPFo/WkI5sD4N/4QlDFFyKoSvC78g4rKuHbAt0pXUFSf/uyr/Y +O77+lRM7KO/pqw9itpU+ZoJ57mfQlxJ4v+Ct7PK6fcVSCbhI9D4y7OyLAlP8ZzC vCLDxRmmaL5h8VX0n9zoE2d8Dzfz27LXrIVAEn2epnzt6p4Pfmw= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 3910ed1d TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 17 May 2018 21:27:57 +0200 (CEST) Date: Thu, 17 May 2018 21:27:57 +0200 From: Emmanuel Vadot To: Pedro Giffuni Cc: Matthew Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src Message-Id: <20180517212757.84c7b02060ca8f86e56dbee9@bidouilliste.com> In-Reply-To: <17058056-6b70-e918-dab8-63951d1bfbbd@FreeBSD.org> References: <201805171814.w4HIEA0F079835@repo.freebsd.org> <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> <17058056-6b70-e918-dab8-63951d1bfbbd@FreeBSD.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:28:00 -0000 On Thu, 17 May 2018 14:20:05 -0500 Pedro Giffuni wrote: > > On 17/05/2018 14:12, Matthew Macy wrote: > > How do I avoid problems while allowing timely updates? > > > > -M > > > > On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot wrote: > >> Hi Matt, > >> > >> On Thu, 17 May 2018 18:14:10 +0000 (UTC) > >> Matt Macy wrote: > >> > >>> Author: mmacy > >>> Date: Thu May 17 18:14:10 2018 > >>> New Revision: 333745 > >>> URL: https://svnweb.freebsd.org/changeset/base/333745 > >>> > >>> Log: > >>> ck: add support for executing callbacks outside of main poll loop > >>> > >>> Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b > >>> > >>> | ck_epoch: introduce ck_epoch_deferred > >>> | > >>> | Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures). > >>> | > >>> > >>> Approved by: sbruno > >>> > >>> Modified: > >>> head/sys/contrib/ck/include/ck_epoch.h > >>> head/sys/contrib/ck/src/ck_epoch.c > >>> > >> CK was imported in vendor-sys/ck, commiting directly into head will > >> cause some problems in the future. > > Actually ... committing to head is fine: some things just have to be fixed. This is not true, it can cause a lot of problems with futures updates if the change isn't in the vendor repo. > We do ask you try to upstream the change and re-merge things when possible. This is already upstream, Matt is just updating CK with a patch he did ( see https://github.com/concurrencykit/ck/commit/deca119d14bfffd440770eb67cbdbeaf7b57eb7b) > Pedro. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu May 17 19:30:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC7F8EDE472; Thu, 17 May 2018 19:30:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93977729F3; Thu, 17 May 2018 19:30:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 736695B5E; Thu, 17 May 2018 19:30:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJUv8F018432; Thu, 17 May 2018 19:30:57 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJUvPm018431; Thu, 17 May 2018 19:30:57 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171930.w4HJUvPm018431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 19:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333757 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:30:58 -0000 Author: mmacy Date: Thu May 17 19:30:57 2018 New Revision: 333757 URL: https://svnweb.freebsd.org/changeset/base/333757 Log: epoch(9): missed add from r333755 Reported by: flo Approved by: sbruno Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu May 17 19:10:13 2018 (r333756) +++ head/sys/sys/proc.h Thu May 17 19:30:57 2018 (r333757) @@ -322,6 +322,7 @@ struct thread { u_char td_pri_class; /* (t) Scheduling class. */ u_char td_user_pri; /* (t) User pri from estcpu and nice. */ u_char td_base_user_pri; /* (t) Base user pri */ + u_char td_pre_epoch_prio; uintptr_t td_rb_list; /* (k) Robust list head. */ uintptr_t td_rbp_list; /* (k) Robust priv list head. */ uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ From owner-svn-src-all@freebsd.org Thu May 17 19:31:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D126DEDE543; Thu, 17 May 2018 19:31:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B3E72BED; Thu, 17 May 2018 19:31:56 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.180.90.29]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MBaDy-1fA4ba2Pqw-00AT5n; Thu, 17 May 2018 21:26:36 +0200 Date: Thu, 17 May 2018 21:26:01 +0200 From: "O. Hartmann" To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333755 - head/sys/kern Message-ID: <20180517212628.0ae99535@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201805171908.w4HJ8SHO007826@repo.freebsd.org> References: <201805171908.w4HJ8SHO007826@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:JWApOLi6p+1vlhDOLqBuc+DEwkZuV4JbSyJnr5Pw14ersDzgNOC SFGK+gzeruaxy5iTE4PEyKOL4iGA/Z2EBDCfC9fXX4OOoaFqhNe7wtNMg9og0uFJgIMfmMU 5iiA1iYrgi0hutMLqlCW5KPu41xM3PqIAdlI3Hva7jTc+6z5uQlZcfsSHo4UJ6ijdZetFO2 3UhLKM2t/gLKufzlPuT5Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:Dic6MgsvyB4=:srMW8dh8EVd7ZgndsobsKV IMkBtdaY5TzmST55pgljKGIKs/04VaRg/MAIu0d9YsfpH5xk3rT415gejfjjDdE7fsGbIqBcB fIvdnsp6b0qL4Y67E+jZ7sRXttW35tjm2fyr3Rs3Ld9+CXDLz2+Ci035XTLS0Mou9/wyx32oZ Zbf+zehctYfpm3Dc/Ol5TrOVT5EK3Z+S1P9Egj7OskYrVGd+cYnIXjtcSZlTgZb6CoyEQRAuQ KZ1OFDO/H8d8bg9V9Zs4ydCzlkJJ55ik+PvMII9PMlqh1DhMmZIXjPDWLStKFXLwvfFVeng9l +bmpR9lRBX/ZsFy6tlya3atF7ZaB/1rbSSB4rTyCHEoVeSuQuFL9Pijvx0AIJTCC15p8mWfNn axPv9YprVGyPPGK/J70gFkAwjtG2tNbP+oe7IFe85US0XjFBhdBO8fzvwdS/EtjvRSWgGwyEy tZ7awRwuBD3YJum5pRSankzv+ZFrTpsBxu2OfY/3iT5JkLZTrGaADgCzarZ0Z+/E3RNO5BgYX SVuxA2bCJ0DX7+e/UF+K5yQKFpJxr+BR/Ixd45qO98IXUUlHrOxsxskWS66zxebcV36AubRS7 Z/J8Tm0pXxGxcElQe/xnBatcmdf+MuXMeKj6zsVWuJmd6ne284Y0HbSy8Lg548RrmvveMAA6r HXUMEHrq/xbx3sBGOMP+e68WoePiNmEdMU9IeUZGe7eBtk83r1JuBkvMAvfI8WcBhD/WZlxYA sKzpq/VQGxtXZJFkpyp/Sj5bXSk5+DEMDPm6h93S9CtSfw+JbpxfWZfGNEdvsEH9D/+A+ytlD 6gr64cX X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:31:58 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFRo dSwgMTcgTWF5IDIwMTggMTk6MDg6MjggKzAwMDAgKFVUQykNCk1hdHQgTWFjeSA8bW1hY3lARnJl ZUJTRC5vcmc+IHNjaHJpZWI6DQoNCj4gQXV0aG9yOiBtbWFjeQ0KPiBEYXRlOiBUaHUgTWF5IDE3 IDE5OjA4OjI4IDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzM3NTUNCj4gVVJMOiBodHRwczovL3N2 bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzM3NTUNCj4gDQo+IExvZzoNCj4gICBl cG9jaCg5KTogcmVzdG9yZSB0aHJlYWQgcHJpb3JpdHkgb24gZXhpdCBpZiBpdCB3YXMgY2hhbmdl ZCBieSBhIHdhaXRlcg0KPiAgIA0KPiAgIFJlcG9ydGVkIGJ5OgltYXJrag0KPiAgIEFwcHJvdmVk IGJ5OglzYnJ1bm8NCj4gDQo+IE1vZGlmaWVkOg0KPiAgIGhlYWQvc3lzL2tlcm4vc3Vicl9lcG9j aC5jDQo+IA0KPiBNb2RpZmllZDogaGVhZC9zeXMva2Vybi9zdWJyX2Vwb2NoLmMNCj4gPT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N5cy9rZXJuL3N1YnJfZXBvY2guYwlUaHUgTWF5 IDE3IDE5OjA2OjQ0IDIwMTgJKHIzMzM3NTQpDQo+ICsrKyBoZWFkL3N5cy9rZXJuL3N1YnJfZXBv Y2guYwlUaHUgTWF5IDE3IDE5OjA4OjI4IDIwMTgJKHIzMzM3NTUpDQo+IEBAIC0yOTAsNiArMjkw LDcgQEAgZXBvY2hfZW50ZXJfaW50ZXJuYWwoZXBvY2hfdCBlcG9jaCwgc3RydWN0IHRocmVhZCAq dGQpDQo+ICANCj4gIAlJTklUX0NIRUNLKGVwb2NoKTsNCj4gIAljcml0aWNhbF9lbnRlcigpOw0K PiArCXRkLT50ZF9wcmVfZXBvY2hfcHJpbyA9IHRkLT50ZF9wcmlvcml0eTsNCj4gIAllcHMgPSBl cG9jaC0+ZV9wY3B1W2N1cmNwdV07DQo+ICAjaWZkZWYgSU5WQVJJQU5UUw0KPiAgCU1QQVNTKHRk LT50ZF9lcG9jaG5lc3QgPCBVQ0hBUl9NQVggLSAyKTsNCj4gQEAgLTMyNiw2ICszMjcsMTEgQEAg ZXBvY2hfZXhpdF9pbnRlcm5hbChlcG9jaF90IGVwb2NoLCBzdHJ1Y3QgdGhyZWFkICp0ZCkNCj4g IAlUQUlMUV9SRU1PVkUoJmVwcy0+ZXBzX3JlY29yZC5lcl90ZGxpc3QsIHRkLCB0ZF9lcG9jaHEp Ow0KPiAgCWVwcy0+ZXBzX3JlY29yZC5lcl9nZW4rKzsNCj4gIAlzY2hlZF91bnBpbigpOw0KPiAr CWlmIChfX3ByZWRpY3RfZmFsc2UodGQtPnRkX3ByZV9lcG9jaF9wcmlvICE9IHRkLT50ZF9wcmlv cml0eSkpIHsNCj4gKwkJdGhyZWFkX2xvY2sodGQpOw0KPiArCQlzY2hlZF9wcmlvKHRkLCB0ZC0+ dGRfcHJlX2Vwb2NoX3ByaW8pOw0KPiArCQl0aHJlYWRfdW5sb2NrKHRkKTsNCj4gKwl9DQo+ICAJ Y3JpdGljYWxfZXhpdCgpOw0KPiAgfQ0KPiAgDQo+IF9fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fDQo+IHN2bi1zcmMtaGVhZEBmcmVlYnNkLm9yZyBtYWlsaW5n IGxpc3QNCj4gaHR0cHM6Ly9saXN0cy5mcmVlYnNkLm9yZy9tYWlsbWFuL2xpc3RpbmZvL3N2bi1z cmMtaGVhZA0KPiBUbyB1bnN1YnNjcmliZSwgc2VuZCBhbnkgbWFpbCB0byAic3ZuLXNyYy1oZWFk LXVuc3Vic2NyaWJlQGZyZWVic2Qub3JnIg0KDQoNCkZhaWx1cmUgaW4gcmVjZW50IGtlcm5lbCBi dWlsZCBkdWUgdG86DQoNClsuLi5dDQo9PT0+IGFjcGkvYWlicyAoYWxsKQ0KLSAtLS0gc3Vicl9l cG9jaC5vIC0tLQ0KL3Vzci9zcmMvc3lzL2tlcm4vc3Vicl9lcG9jaC5jOjI5Mzo2OiBlcnJvcjog bm8gbWVtYmVyIG5hbWVkICd0ZF9wcmVfZXBvY2hfcHJpbycgaW4NCidzdHJ1Y3QgdGhyZWFkJyB0 ZC0+dGRfcHJlX2Vwb2NoX3ByaW8gPSB0ZC0+dGRfcHJpb3JpdHk7DQogICAgICAgIH5+ICBeDQov dXNyL3NyYy9zeXMva2Vybi9zdWJyX2Vwb2NoLmM6MzMwOjI2OiBlcnJvcjogbm8gbWVtYmVyIG5h bWVkICd0ZF9wcmVfZXBvY2hfcHJpbycgaW4NCidzdHJ1Y3QgdGhyZWFkJyBpZiAoX19wcmVkaWN0 X2ZhbHNlKHRkLT50ZF9wcmVfZXBvY2hfcHJpbyAhPSB0ZC0+dGRfcHJpb3JpdHkpKSB7DQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgfn4gIF4NCi91c3Ivc3JjL3N5cy9zeXMvY2RlZnMuaDo0 NTU6NTE6IG5vdGU6IGV4cGFuZGVkIGZyb20gbWFjcm8gJ19fcHJlZGljdF9mYWxzZScNCiNkZWZp bmUgX19wcmVkaWN0X2ZhbHNlKGV4cCkgICAgX19idWlsdGluX2V4cGVjdCgoZXhwKSwgMCkNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXn5+DQovdXNy L3NyYy9zeXMva2Vybi9zdWJyX2Vwb2NoLmM6MzMyOjIyOiBlcnJvcjogbm8gbWVtYmVyIG5hbWVk ICd0ZF9wcmVfZXBvY2hfcHJpbycgaW4NCidzdHJ1Y3QgdGhyZWFkJyBzY2hlZF9wcmlvKHRkLCB0 ZC0+dGRfcHJlX2Vwb2NoX3ByaW8pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH5+ ICBeDQozIGVycm9ycyBnZW5lcmF0ZWQuDQoqKiogW3N1YnJfZXBvY2gub10gRXJyb3IgY29kZSAx DQoNCg0KLSAtLSANCk8uIEhhcnRtYW5uDQoNCkljaCB3aWRlcnNwcmVjaGUgZGVyIE51dHp1bmcg b2RlciDDnGJlcm1pdHRsdW5nIG1laW5lciBEYXRlbiBmw7xyDQpXZXJiZXp3ZWNrZSBvZGVyIGbD vHIgZGllIE1hcmt0LSBvZGVyIE1laW51bmdzZm9yc2NodW5nICjCpyAyOCBBYnMuIDQgQkRTRyku DQotLS0tLUJFR0lOIFBHUCBTSUdOQVRVUkUtLS0tLQ0KDQppTFVFQVJNS0FCMFdJUVFaVlpNekF0 d0MyVC84NlRyUzUyOGZ5RmhZbEFVQ1d2M1haQUFLQ1JEUzUyOGZ5RmhZDQpsTVFQQWZrQlB3bXdk RDZ6TTVNTE5xOGdzWGxxbE5QQStqWEFuazVmQmwrOEdVWkROK0NNbkN3a1JaUmN1RWJvDQowYjRZ S0M5Vk5xWmpmRjlRTjV6dHlGTHhrd0ViQWY5Tk1DaTVtdllNYTJiQUZDQ2pmQ3RkQUJkWmhsb1Jl c2c3DQppNUJmdkpGNURWNFVETXl2UkllTVRDVXJYS0lSc3ZieWFUd1U3b1YxdFlncEwxTHF0Kzlw DQo9NU94WQ0KLS0tLS1FTkQgUEdQIFNJR05BVFVSRS0tLS0tDQo= From owner-svn-src-all@freebsd.org Thu May 17 19:33:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79482EDE61A for ; Thu, 17 May 2018 19:33:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic312-21.consmr.mail.bf2.yahoo.com (sonic312-21.consmr.mail.bf2.yahoo.com [74.6.128.83]) (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 1368772DEF for ; Thu, 17 May 2018 19:33:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1526585585; bh=BsIGUlxy1Ii976a9Rm46zhbkE+10byN4JHCPkbaq+NI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=acxoMpBdLoXD0egmOwCdloIi80+BjSJnxp5SfgTBw+IztvzkNy6RFz4doEloy7X41RZYKymF/f3GdzKqZx+baYdmPpXBanWq6ACUfNE4hdOVsNRT+g+qjrOVwQRcVnSDdKmxMuomdjUX+b4YaCQIC9h+ZyCY7lMVOZIf9GtEdGVSz/pr7ppBQ+3tdi1u419E6uuClacZ9uMUmjYIFc8NxYNDZ0i1imAflGVf25YbJk7oYjq8SvpHGjSU0GNilIVvo1xdBZ7XhN2N33KW+3B4+XuZ8HgiFQUSA6rIy0/KAQNLjslam2jnG0dV9000FE/Xag1rl1Lbo4HlgWqe4NxWog== X-YMail-OSG: iQwq2qQVM1nnwrjozr1fd4rVvLQjB1ls8jUx13vGybZE.daobceGt0HyfdcE4AH pzhbuC7IBRxxhdSizqzllLhEdk50dr5ZJRb4dkS6TdhTuF_ECYex4MVpahAgiXl.tkt0lxF285JW _tXftQBoO3taG03O4TuwhQuw5aHdMnTYqzrt65C6X4US0t1RJpHrwM8.jmn25qZFc3T9XmMmiP5O AFg_7JIbOoztdl_UkmHoBuhKQ92WdEPsBgflCT4lSS_OB0_DU2VmtezB_0UqkDT4BFFXTvjBWvoL FoWZVPtQH2JALx2atfsp79Sm5UFAqIaECntZllj2oz_INoo9STcK8p3g709HR6rS0qfFIz7fEx6y q9NxBPa4J9ZkcYmwmgejwnk17C4dGPv9vY8AxNxmlzTxlEpvgr1Oc2EANTHAFkg9136Buq3k6FZN Ly6V0w47RWzugCQvvpwDcEwOSX9ruug0ZSFEetBA4if7S5fpdJv0YktGmQ36eSPtkRCAB7AR_wSO 6AdudH30Gz8OkaiczSOH6qat9lxAkm47T_IbLgaOKJu664nbAnRJRQ1TcrZH.JkEg5EdRzDs3dCz 0e6c5gJenq7Pr_jH5d2u0DDWGxqU.aN33OTFspMs22YLJlox2z_bNJ81y5Kof3_yGl3A- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.bf2.yahoo.com with HTTP; Thu, 17 May 2018 19:33:05 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp423.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 59b9777c142b81727a93f8a784cb72d8; Thu, 17 May 2018 19:33:00 +0000 (UTC) Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src To: Emmanuel Vadot Cc: Matthew Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805171814.w4HIEA0F079835@repo.freebsd.org> <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> <17058056-6b70-e918-dab8-63951d1bfbbd@FreeBSD.org> <20180517212757.84c7b02060ca8f86e56dbee9@bidouilliste.com> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <11fb642a-d334-bd7d-be4f-b1aa181b8eb2@FreeBSD.org> Date: Thu, 17 May 2018 14:32:58 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180517212757.84c7b02060ca8f86e56dbee9@bidouilliste.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:33:12 -0000 On 17/05/2018 14:27, Emmanuel Vadot wrote: > On Thu, 17 May 2018 14:20:05 -0500 > Pedro Giffuni wrote: > >> On 17/05/2018 14:12, Matthew Macy wrote: >>> How do I avoid problems while allowing timely updates? >>> >>> -M >>> >>> On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot wrote: >>>> Hi Matt, >>>> >>>> On Thu, 17 May 2018 18:14:10 +0000 (UTC) >>>> Matt Macy wrote: >>>> >>>>> Author: mmacy >>>>> Date: Thu May 17 18:14:10 2018 >>>>> New Revision: 333745 >>>>> URL: https://svnweb.freebsd.org/changeset/base/333745 >>>>> >>>>> Log: >>>>> ck: add support for executing callbacks outside of main poll loop >>>>> >>>>> Pull in change from upstream deca119d14bfffd440770eb67cbdbeaf7b57eb7b >>>>> >>>>> | ck_epoch: introduce ck_epoch_deferred >>>>> | >>>>> | Allow for deferral to occur outside epoch poll critical loop (which may access per-CPU structures). >>>>> | >>>>> >>>>> Approved by: sbruno >>>>> >>>>> Modified: >>>>> head/sys/contrib/ck/include/ck_epoch.h >>>>> head/sys/contrib/ck/src/ck_epoch.c >>>>> >>>> CK was imported in vendor-sys/ck, commiting directly into head will >>>> cause some problems in the future. >> Actually ... committing to head is fine: some things just have to be fixed. > This is not true, it can cause a lot of problems with futures updates > if the change isn't in the vendor repo. OK ... I meant generally you can. The catch here is that the change was already upstream so it should have been done in the vendor area and then merged. It's best to fix this properly now. Sorry for misguiding. Pedro. >> We do ask you try to upstream the change and re-merge things when possible. > This is already upstream, Matt is just updating CK with a patch he did > ( see > https://github.com/concurrencykit/ck/commit/deca119d14bfffd440770eb67cbdbeaf7b57eb7b) > >> Pedro. From owner-svn-src-all@freebsd.org Thu May 17 19:35:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA996EDE746; Thu, 17 May 2018 19:35:03 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 936A472F94; Thu, 17 May 2018 19:35:03 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 5A9A314474; Thu, 17 May 2018 19:35:03 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f175.google.com with SMTP id e78-v6so3405687iod.0; Thu, 17 May 2018 12:35:03 -0700 (PDT) X-Gm-Message-State: ALKqPwdOe+hQymm5oc/wwsXLoR7IXSnT2np8Wl8xfWWu2UXqe3dBAI4p v73f6x7Ho/SJqcAeEliIF/2D5oVwCY/PXGNAExs= X-Google-Smtp-Source: AB8JxZpps82NW9t/pGQaAa3bDddA5j1YNCsS1mwYZ+9fVBsUw15eaVq+TocURHkxbKlCEAicHFOENnmdu0+VtT60Exo= X-Received: by 2002:a6b:a712:: with SMTP id q18-v6mr7039390ioe.237.1526585702878; Thu, 17 May 2018 12:35:02 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3e4a:0:0:0:0:0 with HTTP; Thu, 17 May 2018 12:35:02 -0700 (PDT) In-Reply-To: <11fb642a-d334-bd7d-be4f-b1aa181b8eb2@FreeBSD.org> References: <201805171814.w4HIEA0F079835@repo.freebsd.org> <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> <17058056-6b70-e918-dab8-63951d1bfbbd@FreeBSD.org> <20180517212757.84c7b02060ca8f86e56dbee9@bidouilliste.com> <11fb642a-d334-bd7d-be4f-b1aa181b8eb2@FreeBSD.org> From: Matthew Macy Date: Thu, 17 May 2018 12:35:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src To: Pedro Giffuni Cc: Emmanuel Vadot , 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.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:35:04 -0000 On Thu, May 17, 2018 at 12:32 PM, Pedro Giffuni wrote: > > > On 17/05/2018 14:27, Emmanuel Vadot wrote: >> >> On Thu, 17 May 2018 14:20:05 -0500 >> Pedro Giffuni wrote: >> >>> On 17/05/2018 14:12, Matthew Macy wrote: >>>> >>>> How do I avoid problems while allowing timely updates? >>>> >>>> -M >>>> >>>> On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot >>>> wrote: >>>>> >>>>> Hi Matt, >>>>> >>>>> On Thu, 17 May 2018 18:14:10 +0000 (UTC) >>>>> Matt Macy wrote: >>>>> >>>>>> Author: mmacy >>>>>> Date: Thu May 17 18:14:10 2018 >>>>>> New Revision: 333745 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/333745 >>>>>> >>>>>> Log: >>>>>> ck: add support for executing callbacks outside of main poll loop >>>>>> >>>>>> Pull in change from upstream >>>>>> deca119d14bfffd440770eb67cbdbeaf7b57eb7b >>>>>> >>>>>> | ck_epoch: introduce ck_epoch_deferred >>>>>> | >>>>>> | Allow for deferral to occur outside epoch poll critical loop >>>>>> (which may access per-CPU structures). >>>>>> | >>>>>> >>>>>> Approved by: sbruno >>>>>> >>>>>> Modified: >>>>>> head/sys/contrib/ck/include/ck_epoch.h >>>>>> head/sys/contrib/ck/src/ck_epoch.c >>>>>> >>>>> CK was imported in vendor-sys/ck, commiting directly into head will >>>>> cause some problems in the future. >>> >>> Actually ... committing to head is fine: some things just have to be >>> fixed. >> >> This is not true, it can cause a lot of problems with futures updates >> if the change isn't in the vendor repo. > > OK ... I meant generally you can. The catch here is that the change was > already upstream so it should have been done in the vendor area and then > merged. It's best to fix this properly now. > > Sorry for misguiding. > I'm happy to comply - just point me at the fine manual. -M From owner-svn-src-all@freebsd.org Thu May 17 19:40:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C552BEDE84D for ; Thu, 17 May 2018 19:40:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic311-14.consmr.mail.bf2.yahoo.com (sonic311-14.consmr.mail.bf2.yahoo.com [74.6.131.124]) (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 621507314D for ; Thu, 17 May 2018 19:40:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1526586020; bh=aZQsUn32Ow95ivXHER6K7AaNOefRqeayS5PLilWg3s0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=TNPKvcb1OTA2aIo52Wsur0FHrNHeve9P1EUnPeCMLui5QHMJkLWkKMrIkA4/yvo411q9Uzg9aM4HL3xOVEh8uMCJ3OwcmKuo8ccb3b3N4MuDZBwoB0gDA8opGaDYWCPI+SJGAVJKtrTesH5GAWvFvDxO1jZyeCnCa7VSGohBKCYoIKeR9hWeyhDWp14PFM4APXNUfjzWtdQS1trxjuqJEjtIN3xyd5RjzBLDVA9VQWMivx/d7hx/FfjIzy9lRN0896CbcCkxfZ0A80qljEvs3gk5o/Vr3S1wV+e8gEhwcOWnxnUyJUb5gpSk/PAyop2I1UMBH1jHGGQvUYdvlkqUHQ== X-YMail-OSG: sVlptcYVM1lT399iDWXf61R2kswt0rMVYpHwCGHBIduJKyakpyPVmoTuWkDdgwb pSRpVqtwComyLoPBqAGGILthUDRQDRcBPFvFaonoK8W8V1tt7jYb4k4wJ8_6AyMN64Coj7SyacTe pb0sAFB.FJpeGjXeJJlIkgedYqzXe3cmCcOp7Vdb4l39j8eoNlFacQU9mryO1WG7Jfq5ZQ1rgx_D KMxtJhqgHj.4jMaCHJ7HnDJh50g37s0hBsGywkEPnWalfJIzPmPrx8J_7erM6mlLSeeIBGfyBbqU bC2mYOqRwWbm65nwBIH5oM87KeZUMyweLkTwjdrUglpnHtsxR0kXf2rZTi5uw5TCGpjvjXuY9hHE kLMkFRpkkZQNGiRO1Yga1Kuhy3RyBVh68zPEsqXeHmfbsk1E2XPL8FubW8KtAPyLOHchpzJQRpEL 2OetcZSpNZVlPGt3xkhQXwgR2SuNt2pvX.6.OelTF7SputO7R7SgV6avwxqjOjJCd8fqgPNGyn1. 4O7Vb_C8mQvzbLydsjYibIPfMIobfkeqfWysrKHGTyvBz1efN7azedP_YbD3qFjquxpJpCEVwOiv 4lz4.CvHE3yYI9dN80guRlwVYkPyASOTS8CObVCDWYqrdfCMA0FpMmGkMc_bDdrGHY7U- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Thu, 17 May 2018 19:40:20 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp428.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 213f6f77bc66fac2f162937deaceb849; Thu, 17 May 2018 19:40:16 +0000 (UTC) Subject: Re: svn commit: r333745 - in head/sys/contrib/ck: include src To: Matthew Macy Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805171814.w4HIEA0F079835@repo.freebsd.org> <20180517203856.aa6b8b241e23b9c07483232b@bidouilliste.com> <17058056-6b70-e918-dab8-63951d1bfbbd@FreeBSD.org> <20180517212757.84c7b02060ca8f86e56dbee9@bidouilliste.com> <11fb642a-d334-bd7d-be4f-b1aa181b8eb2@FreeBSD.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <41ae57bd-2c49-97cd-1f46-2644519a95e6@FreeBSD.org> Date: Thu, 17 May 2018 14:40:13 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:40:27 -0000 On 17/05/2018 14:35, Matthew Macy wrote: > On Thu, May 17, 2018 at 12:32 PM, Pedro Giffuni wrote: >> >> On 17/05/2018 14:27, Emmanuel Vadot wrote: >>> On Thu, 17 May 2018 14:20:05 -0500 >>> Pedro Giffuni wrote: >>> >>>> On 17/05/2018 14:12, Matthew Macy wrote: >>>>> How do I avoid problems while allowing timely updates? >>>>> >>>>> -M >>>>> >>>>> On Thu, May 17, 2018 at 11:38 AM, Emmanuel Vadot >>>>> wrote: >>>>>> Hi Matt, >>>>>> >>>>>> On Thu, 17 May 2018 18:14:10 +0000 (UTC) >>>>>> Matt Macy wrote: >>>>>> >>>>>>> Author: mmacy >>>>>>> Date: Thu May 17 18:14:10 2018 >>>>>>> New Revision: 333745 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/333745 >>>>>>> >>>>>>> Log: >>>>>>> ck: add support for executing callbacks outside of main poll loop >>>>>>> >>>>>>> Pull in change from upstream >>>>>>> deca119d14bfffd440770eb67cbdbeaf7b57eb7b >>>>>>> >>>>>>> | ck_epoch: introduce ck_epoch_deferred >>>>>>> | >>>>>>> | Allow for deferral to occur outside epoch poll critical loop >>>>>>> (which may access per-CPU structures). >>>>>>> | >>>>>>> >>>>>>> Approved by: sbruno >>>>>>> >>>>>>> Modified: >>>>>>> head/sys/contrib/ck/include/ck_epoch.h >>>>>>> head/sys/contrib/ck/src/ck_epoch.c >>>>>>> >>>>>> CK was imported in vendor-sys/ck, commiting directly into head will >>>>>> cause some problems in the future. >>>> Actually ... committing to head is fine: some things just have to be >>>> fixed. >>> This is not true, it can cause a lot of problems with futures updates >>> if the change isn't in the vendor repo. >> OK ... I meant generally you can. The catch here is that the change was >> already upstream so it should have been done in the vendor area and then >> merged. It's best to fix this properly now. >> >> Sorry for misguiding. >> > I'm happy to comply - just point me at the fine manual. > https://www.freebsd.org/doc/en_US.ISO8859-1/articles/committers-guide/subversion-primer.html Section 5.4.4 (Vendor patches). Cheers, Pedro. From owner-svn-src-all@freebsd.org Thu May 17 19:41:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94AAEEDE907; Thu, 17 May 2018 19:41:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4706E734D0; Thu, 17 May 2018 19:41:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29ACB5E3B; Thu, 17 May 2018 19:41:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJfwOo027153; Thu, 17 May 2018 19:41:58 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJfwFC027152; Thu, 17 May 2018 19:41:58 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171941.w4HJfwFC027152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 19:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333758 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:41:59 -0000 Author: mmacy Date: Thu May 17 19:41:58 2018 New Revision: 333758 URL: https://svnweb.freebsd.org/changeset/base/333758 Log: epoch(9): fix potential deadlock Don't acquire a waiting thread's lock while holding our own Approved by: sbruno Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 19:30:57 2018 (r333757) +++ head/sys/kern/subr_epoch.c Thu May 17 19:41:58 2018 (r333758) @@ -407,9 +407,13 @@ epoch_block_handler(struct ck_epoch *global __unused, * restore on exit from epoch_wait(). */ if (!TD_IS_INHIBITED(tdwait) && tdwait->td_priority > td->td_priority) { + critical_enter(); + thread_unlock(td); thread_lock(tdwait); sched_prio(tdwait, td->td_priority); thread_unlock(tdwait); + thread_lock(td); + critical_exit(); } if (TD_IS_INHIBITED(tdwait) && TD_ON_LOCK(tdwait) && ((ts = tdwait->td_blocked) != NULL)) { From owner-svn-src-all@freebsd.org Thu May 17 19:50:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7BADEDEC8D; Thu, 17 May 2018 19:50:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5605973A88; Thu, 17 May 2018 19:50:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 384EF5E86; Thu, 17 May 2018 19:50:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJou3x029611; Thu, 17 May 2018 19:50:56 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJou5W029610; Thu, 17 May 2018 19:50:56 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171950.w4HJou5W029610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 19:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333759 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:50:56 -0000 Author: mmacy Date: Thu May 17 19:50:55 2018 New Revision: 333759 URL: https://svnweb.freebsd.org/changeset/base/333759 Log: epoch(9): eliminate the need to wait when polling for callbacks to run by using ck's own callback handling mechanism we can simply check which callbacks have had a grace period elapse Approved by: sbruno Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 19:41:58 2018 (r333758) +++ head/sys/kern/subr_epoch.c Thu May 17 19:50:55 2018 (r333759) @@ -64,6 +64,7 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re #endif CTASSERT(sizeof(epoch_section_t) == sizeof(ck_epoch_section_t)); +CTASSERT(sizeof(ck_epoch_entry_t) == sizeof(struct epoch_context)); SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW, 0, "epoch information"); SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW, 0, "epoch stats"); @@ -84,13 +85,11 @@ static counter_u64_t switch_count; SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, switches, CTLFLAG_RW, &switch_count, "# of times a thread voluntarily context switched in epoch_wait"); -typedef struct epoch_cb { - void (*ec_callback)(epoch_context_t); - STAILQ_ENTRY(epoch_cb) ec_link; -} *epoch_cb_t; - TAILQ_HEAD(threadlist, thread); +CK_STACK_CONTAINER(struct ck_epoch_entry, stack_entry, + ck_epoch_entry_container) + typedef struct epoch_record { ck_epoch_record_t er_record; volatile struct threadlist er_tdlist; @@ -100,7 +99,6 @@ typedef struct epoch_record { struct epoch_pcpu_state { struct epoch_record eps_record; - STAILQ_HEAD(, epoch_cb) eps_cblist; } __aligned(EPOCH_ALIGN); struct epoch { @@ -179,7 +177,6 @@ epoch_init_numa(epoch_t epoch) for (int i = 0; i < domcount[domain]; i++, eps++) { epoch->e_pcpu[cpu_offset + i] = eps; er = &eps->eps_record; - STAILQ_INIT(&eps->eps_cblist); ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = cpu_offset + i; @@ -200,7 +197,6 @@ epoch_init_legacy(epoch_t epoch) er = &eps->eps_record; ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); - STAILQ_INIT(&eps->eps_cblist); er->er_cpuid = i; } } @@ -525,25 +521,24 @@ void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)) { struct epoch_pcpu_state *eps; - epoch_cb_t cb; + ck_epoch_entry_t *cb; cb = (void *)ctx; MPASS(callback); /* too early in boot to have epoch set up */ - if (__predict_false(epoch == NULL)) { - callback(ctx); - return; - } - MPASS(cb->ec_callback == NULL); - MPASS(cb->ec_link.stqe_next == NULL); - cb->ec_callback = callback; + if (__predict_false(epoch == NULL)) + goto boottime; + counter_u64_add(epoch->e_frees, 1); critical_enter(); eps = epoch->e_pcpu[curcpu]; - STAILQ_INSERT_HEAD(&eps->eps_cblist, cb, ec_link); + ck_epoch_call(&eps->eps_record.er_record, cb, (ck_epoch_cb_t*)callback); critical_exit(); + return; + boottime: + callback(ctx); } static void @@ -551,28 +546,26 @@ epoch_call_task(void *context) { struct epoch_pcpu_state *eps; epoch_t epoch; - epoch_cb_t cb; struct thread *td; + ck_stack_entry_t *cursor; + ck_stack_t deferred; int cpu; - STAILQ_HEAD(, epoch_cb) tmp_head; epoch = context; - STAILQ_INIT(&tmp_head); td = curthread; + ck_stack_init(&deferred); thread_lock(td); CPU_FOREACH(cpu) { sched_bind(td, cpu); eps = epoch->e_pcpu[cpu]; - if (!STAILQ_EMPTY(&eps->eps_cblist)) - STAILQ_CONCAT(&tmp_head, &eps->eps_cblist); + ck_epoch_poll_deferred(&eps->eps_record.er_record, &deferred); } sched_unbind(td); thread_unlock(td); - epoch_wait(epoch); - - while ((cb = STAILQ_FIRST(&tmp_head)) != NULL) { - STAILQ_REMOVE_HEAD(&tmp_head, ec_link); - cb->ec_callback((void*)cb); + while((cursor = ck_stack_pop_npsc(&deferred)) != NULL) { + struct ck_epoch_entry *entry = + ck_epoch_entry_container(cursor); + entry->function(entry); } } From owner-svn-src-all@freebsd.org Thu May 17 19:54:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B953EDEEAC; Thu, 17 May 2018 19:54:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06C7D73E1D; Thu, 17 May 2018 19:54:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB3106009; Thu, 17 May 2018 19:54:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJsC22032752; Thu, 17 May 2018 19:54:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJsBHQ032745; Thu, 17 May 2018 19:54:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805171954.w4HJsBHQ032745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 17 May 2018 19:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333760 - in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/template sys/modules/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/template sys/modules/usb/template X-SVN-Commit-Revision: 333760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:54:13 -0000 Author: trasz Date: Thu May 17 19:54:11 2018 New Revision: 333760 URL: https://svnweb.freebsd.org/changeset/base/333760 Log: Add a "multifunction" device side USB template, which provides mass storage, CDC ACM (serial), and CDC ECM (ethernet) at the same time. It's quite similar in function to Linux' "g_multi" gadget. Reviewed by: hselasky@ MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Added: head/sys/dev/usb/template/usb_template_multi.c (contents, props changed) Modified: head/share/man/man4/usb_template.4 head/sys/conf/files head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/usb_ioctl.h head/sys/modules/usb/template/Makefile Modified: head/share/man/man4/usb_template.4 ============================================================================== --- head/share/man/man4/usb_template.4 Thu May 17 19:50:55 2018 (r333759) +++ head/share/man/man4/usb_template.4 Thu May 17 19:54:11 2018 (r333760) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 25, 2018 +.Dd May 17, 2018 .Dt USB_TEMPLATE 4 .Os . @@ -87,6 +87,7 @@ Available templates are: .It Dv 7 Ta USB phone .It Dv 8 Ta CDC Ethernet and serial port .It Dv 9 Ta USB MIDI +.It Dv 10 Ta CDC Ethernet, serial port, and storage .El . .Sh SYSCTL VARIABLES Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu May 17 19:50:55 2018 (r333759) +++ head/sys/conf/files Thu May 17 19:54:11 2018 (r333760) @@ -3410,6 +3410,7 @@ dev/usb/template/usb_template_mtp.c optional usb_templ dev/usb/template/usb_template_phone.c optional usb_template dev/usb/template/usb_template_serialnet.c optional usb_template dev/usb/template/usb_template_midi.c optional usb_template +dev/usb/template/usb_template_multi.c optional usb_template # # USB video drivers # Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Thu May 17 19:50:55 2018 (r333759) +++ head/sys/dev/usb/template/usb_template.c Thu May 17 19:54:11 2018 (r333760) @@ -1432,6 +1432,9 @@ usb_temp_setup_by_index(struct usb_device *udev, uint1 case USB_TEMP_MIDI: err = usb_temp_setup(udev, &usb_template_midi); break; + case USB_TEMP_MULTI: + err = usb_temp_setup(udev, &usb_template_multi); + break; default: return (USB_ERR_INVAL); } Modified: head/sys/dev/usb/template/usb_template.h ============================================================================== --- head/sys/dev/usb/template/usb_template.h Thu May 17 19:50:55 2018 (r333759) +++ head/sys/dev/usb/template/usb_template.h Thu May 17 19:54:11 2018 (r333760) @@ -110,6 +110,7 @@ extern struct usb_temp_device_desc usb_template_mtp; extern struct usb_temp_device_desc usb_template_phone; extern struct usb_temp_device_desc usb_template_serialnet; extern struct usb_temp_device_desc usb_template_midi; +extern struct usb_temp_device_desc usb_template_multi; void usb_decode_str_desc(struct usb_string_descriptor *sd, Added: head/sys/dev/usb/template/usb_template_multi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/template/usb_template_multi.c Thu May 17 19:54:11 2018 (r333760) @@ -0,0 +1,509 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2018 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 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. + */ +/* + * USB template for CDC ACM (serial), CDC ECM (network), and CDC MSC (storage). + */ + +#include +__FBSDID("$FreeBSD$"); + +#ifdef USB_GLOBAL_INCLUDE_FILE +#include USB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#endif /* USB_GLOBAL_INCLUDE_FILE */ + +#define MODEM_IFACE_0 0 +#define MODEM_IFACE_1 1 + +enum { + MULTI_LANG_INDEX, + MULTI_MODEM_INDEX, + MULTI_ETH_MAC_INDEX, + MULTI_ETH_CONTROL_INDEX, + MULTI_ETH_DATA_INDEX, + MULTI_STORAGE_INDEX, + MULTI_CONFIGURATION_INDEX, + MULTI_MANUFACTURER_INDEX, + MULTI_PRODUCT_INDEX, + MULTI_SERIAL_NUMBER_INDEX, + MULTI_MAX_INDEX, +}; + +#define MULTI_DEFAULT_MODEM "Virtual serial console" +#define MULTI_DEFAULT_ETH_MAC "2A02030405060789AB" +#define MULTI_DEFAULT_ETH_CONTROL "Ethernet Comm Interface" +#define MULTI_DEFAULT_ETH_DATA "Ethernet Data Interface" +#define MULTI_DEFAULT_STORAGE "Mass Storage Interface" +#define MULTI_DEFAULT_CONFIGURATION "Default configuration" +#define MULTI_DEFAULT_MANUFACTURER "The FreeBSD Project" +#define MULTI_DEFAULT_PRODUCT "Multifunction Device" +#define MULTI_DEFAULT_SERIAL_NUMBER "May 2018" + +static struct usb_string_descriptor multi_modem; +static struct usb_string_descriptor multi_eth_mac; +static struct usb_string_descriptor multi_eth_control; +static struct usb_string_descriptor multi_eth_data; +static struct usb_string_descriptor multi_storage; +static struct usb_string_descriptor multi_configuration; +static struct usb_string_descriptor multi_manufacturer; +static struct usb_string_descriptor multi_product; +static struct usb_string_descriptor multi_serial_number; + +static struct sysctl_ctx_list multi_ctx_list; + +/* prototypes */ + +static usb_temp_get_string_desc_t multi_get_string_desc; + +static const struct usb_cdc_union_descriptor eth_union_desc = { + .bLength = sizeof(eth_union_desc), + .bDescriptorType = UDESC_CS_INTERFACE, + .bDescriptorSubtype = UDESCSUB_CDC_UNION, + .bMasterInterface = 0, /* this is automatically updated */ + .bSlaveInterface[0] = 1, /* this is automatically updated */ +}; + +static const struct usb_cdc_header_descriptor eth_header_desc = { + .bLength = sizeof(eth_header_desc), + .bDescriptorType = UDESC_CS_INTERFACE, + .bDescriptorSubtype = UDESCSUB_CDC_HEADER, + .bcdCDC[0] = 0x10, + .bcdCDC[1] = 0x01, +}; + +static const struct usb_cdc_ethernet_descriptor eth_enf_desc = { + .bLength = sizeof(eth_enf_desc), + .bDescriptorType = UDESC_CS_INTERFACE, + .bDescriptorSubtype = UDESCSUB_CDC_ENF, + .iMacAddress = MULTI_ETH_MAC_INDEX, + .bmEthernetStatistics = {0, 0, 0, 0}, + .wMaxSegmentSize = {0xEA, 0x05},/* 1514 bytes */ + .wNumberMCFilters = {0, 0}, + .bNumberPowerFilters = 0, +}; + +static const void *eth_control_if_desc[] = { + ð_union_desc, + ð_header_desc, + ð_enf_desc, + NULL, +}; + +static const struct usb_temp_packet_size bulk_mps = { + .mps[USB_SPEED_FULL] = 64, + .mps[USB_SPEED_HIGH] = 512, +}; + +static const struct usb_temp_packet_size intr_mps = { + .mps[USB_SPEED_FULL] = 8, + .mps[USB_SPEED_HIGH] = 8, +}; + +static const struct usb_temp_endpoint_desc bulk_in_ep = { + .pPacketSize = &bulk_mps, +#ifdef USB_HIP_IN_EP_0 + .bEndpointAddress = USB_HIP_IN_EP_0, +#else + .bEndpointAddress = UE_DIR_IN, +#endif + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc bulk_out_ep = { + .pPacketSize = &bulk_mps, +#ifdef USB_HIP_OUT_EP_0 + .bEndpointAddress = USB_HIP_OUT_EP_0, +#else + .bEndpointAddress = UE_DIR_OUT, +#endif + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc intr_in_ep = { + .pPacketSize = &intr_mps, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc *eth_intr_endpoints[] = { + &intr_in_ep, + NULL, +}; + +static const struct usb_temp_interface_desc eth_control_interface = { + .ppEndpoints = eth_intr_endpoints, + .ppRawDesc = eth_control_if_desc, + .bInterfaceClass = UICLASS_CDC, + .bInterfaceSubClass = UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, + .bInterfaceProtocol = UIPROTO_CDC_NONE, + .iInterface = MULTI_ETH_CONTROL_INDEX, +}; + +static const struct usb_temp_endpoint_desc *eth_data_endpoints[] = { + &bulk_in_ep, + &bulk_out_ep, + NULL, +}; + +static const struct usb_temp_interface_desc eth_data_null_interface = { + .ppEndpoints = NULL, /* no endpoints */ + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, + .bInterfaceProtocol = 0, + .iInterface = MULTI_ETH_DATA_INDEX, +}; + +static const struct usb_temp_interface_desc eth_data_interface = { + .ppEndpoints = eth_data_endpoints, + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, + .bInterfaceProtocol = 0, + .iInterface = MULTI_ETH_DATA_INDEX, + .isAltInterface = 1, /* this is an alternate setting */ +}; + +static const struct usb_temp_packet_size modem_bulk_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 64, + .mps[USB_SPEED_HIGH] = 512, +}; + +static const struct usb_temp_packet_size modem_intr_mps = { + .mps[USB_SPEED_LOW] = 8, + .mps[USB_SPEED_FULL] = 8, + .mps[USB_SPEED_HIGH] = 8, +}; + +static const struct usb_temp_interval modem_intr_interval = { + .bInterval[USB_SPEED_LOW] = 8, /* 8ms */ + .bInterval[USB_SPEED_FULL] = 8, /* 8ms */ + .bInterval[USB_SPEED_HIGH] = 7, /* 8ms */ +}; + +static const struct usb_temp_endpoint_desc modem_ep_0 = { + .pPacketSize = &modem_intr_mps, + .pIntervals = &modem_intr_interval, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_INTERRUPT, +}; + +static const struct usb_temp_endpoint_desc modem_ep_1 = { + .pPacketSize = &modem_bulk_mps, + .bEndpointAddress = UE_DIR_OUT, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc modem_ep_2 = { + .pPacketSize = &modem_bulk_mps, + .bEndpointAddress = UE_DIR_IN, + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc *modem_iface_0_ep[] = { + &modem_ep_0, + NULL, +}; + +static const struct usb_temp_endpoint_desc *modem_iface_1_ep[] = { + &modem_ep_1, + &modem_ep_2, + NULL, +}; + +static const uint8_t modem_raw_desc_0[] = { + 0x05, 0x24, 0x00, 0x10, 0x01 +}; + +static const uint8_t modem_raw_desc_1[] = { + 0x05, 0x24, 0x06, MODEM_IFACE_0, MODEM_IFACE_1 +}; + +static const uint8_t modem_raw_desc_2[] = { + 0x05, 0x24, 0x01, 0x03, MODEM_IFACE_1 +}; + +static const uint8_t modem_raw_desc_3[] = { + 0x04, 0x24, 0x02, 0x07 +}; + +static const void *modem_iface_0_desc[] = { + &modem_raw_desc_0, + &modem_raw_desc_1, + &modem_raw_desc_2, + &modem_raw_desc_3, + NULL, +}; + +static const struct usb_temp_interface_desc modem_iface_0 = { + .ppRawDesc = modem_iface_0_desc, + .ppEndpoints = modem_iface_0_ep, + .bInterfaceClass = UICLASS_CDC, + .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, + .bInterfaceProtocol = UIPROTO_CDC_AT, + .iInterface = MULTI_MODEM_INDEX, +}; + +static const struct usb_temp_interface_desc modem_iface_1 = { + .ppEndpoints = modem_iface_1_ep, + .bInterfaceClass = UICLASS_CDC_DATA, + .bInterfaceSubClass = UISUBCLASS_DATA, + .bInterfaceProtocol = 0, + .iInterface = MULTI_MODEM_INDEX, +}; + +static const struct usb_temp_packet_size msc_bulk_mps = { + .mps[USB_SPEED_FULL] = 64, + .mps[USB_SPEED_HIGH] = 512, +}; + +static const struct usb_temp_endpoint_desc msc_bulk_in_ep = { + .pPacketSize = &msc_bulk_mps, +#ifdef USB_HIP_IN_EP_0 + .bEndpointAddress = USB_HIP_IN_EP_0, +#else + .bEndpointAddress = UE_DIR_IN, +#endif + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc msc_bulk_out_ep = { + .pPacketSize = &msc_bulk_mps, +#ifdef USB_HIP_OUT_EP_0 + .bEndpointAddress = USB_HIP_OUT_EP_0, +#else + .bEndpointAddress = UE_DIR_OUT, +#endif + .bmAttributes = UE_BULK, +}; + +static const struct usb_temp_endpoint_desc *msc_data_endpoints[] = { + &msc_bulk_in_ep, + &msc_bulk_out_ep, + NULL, +}; + +static const struct usb_temp_interface_desc msc_data_interface = { + .ppEndpoints = msc_data_endpoints, + .bInterfaceClass = UICLASS_MASS, + .bInterfaceSubClass = UISUBCLASS_SCSI, + .bInterfaceProtocol = UIPROTO_MASS_BBB, + .iInterface = MULTI_STORAGE_INDEX, +}; + +static const struct usb_temp_interface_desc *multi_interfaces[] = { + &modem_iface_0, + &modem_iface_1, + ð_control_interface, + ð_data_null_interface, + ð_data_interface, + &msc_data_interface, + NULL, +}; + +static const struct usb_temp_config_desc multi_config_desc = { + .ppIfaceDesc = multi_interfaces, + .bmAttributes = UC_BUS_POWERED, + .bMaxPower = 25, /* 50 mA */ + .iConfiguration = MULTI_CONFIGURATION_INDEX, +}; +static const struct usb_temp_config_desc *multi_configs[] = { + &multi_config_desc, + NULL, +}; + +struct usb_temp_device_desc usb_template_multi = { + .getStringDesc = &multi_get_string_desc, + .ppConfigDesc = multi_configs, + .idVendor = USB_TEMPLATE_VENDOR, + .idProduct = 0x0001, + .bcdDevice = 0x0100, + .bDeviceClass = UDCLASS_IN_INTERFACE, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .iManufacturer = MULTI_MANUFACTURER_INDEX, + .iProduct = MULTI_PRODUCT_INDEX, + .iSerialNumber = MULTI_SERIAL_NUMBER_INDEX, +}; + +/*------------------------------------------------------------------------* + * multi_get_string_desc + * + * Return values: + * NULL: Failure. No such string. + * Else: Success. Pointer to string descriptor is returned. + *------------------------------------------------------------------------*/ +static const void * +multi_get_string_desc(uint16_t lang_id, uint8_t string_index) +{ + static const void *ptr[MULTI_MAX_INDEX] = { + [MULTI_LANG_INDEX] = &usb_string_lang_en, + [MULTI_MODEM_INDEX] = &multi_modem, + [MULTI_ETH_MAC_INDEX] = &multi_eth_mac, + [MULTI_ETH_CONTROL_INDEX] = &multi_eth_control, + [MULTI_ETH_DATA_INDEX] = &multi_eth_data, + [MULTI_STORAGE_INDEX] = &multi_storage, + [MULTI_CONFIGURATION_INDEX] = &multi_configuration, + [MULTI_MANUFACTURER_INDEX] = &multi_manufacturer, + [MULTI_PRODUCT_INDEX] = &multi_product, + [MULTI_SERIAL_NUMBER_INDEX] = &multi_serial_number, + }; + + if (string_index == 0) { + return (&usb_string_lang_en); + } + if (lang_id != 0x0409) { + return (NULL); + } + if (string_index < MULTI_MAX_INDEX) { + return (ptr[string_index]); + } + return (NULL); +} + +static void +multi_init(void *arg __unused) +{ + struct sysctl_oid *parent; + char parent_name[3]; + + usb_make_str_desc(&multi_modem, sizeof(multi_modem), + MULTI_DEFAULT_MODEM); + usb_make_str_desc(&multi_eth_mac, sizeof(multi_eth_mac), + MULTI_DEFAULT_ETH_MAC); + usb_make_str_desc(&multi_eth_control, sizeof(multi_eth_control), + MULTI_DEFAULT_ETH_CONTROL); + usb_make_str_desc(&multi_eth_data, sizeof(multi_eth_data), + MULTI_DEFAULT_ETH_DATA); + usb_make_str_desc(&multi_storage, sizeof(multi_storage), + MULTI_DEFAULT_STORAGE); + usb_make_str_desc(&multi_configuration, sizeof(multi_configuration), + MULTI_DEFAULT_CONFIGURATION); + usb_make_str_desc(&multi_manufacturer, sizeof(multi_manufacturer), + MULTI_DEFAULT_MANUFACTURER); + usb_make_str_desc(&multi_product, sizeof(multi_product), + MULTI_DEFAULT_PRODUCT); + usb_make_str_desc(&multi_serial_number, sizeof(multi_serial_number), + MULTI_DEFAULT_SERIAL_NUMBER); + + snprintf(parent_name, sizeof(parent_name), "%d", USB_TEMP_MULTI); + sysctl_ctx_init(&multi_ctx_list); + + parent = SYSCTL_ADD_NODE(&multi_ctx_list, + SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO, + parent_name, CTLFLAG_RW, + 0, "USB Multifunction device side template"); + SYSCTL_ADD_U16(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "vendor_id", CTLFLAG_RWTUN, + &usb_template_multi.idVendor, 1, "Vendor identifier"); + SYSCTL_ADD_U16(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product_id", CTLFLAG_RWTUN, + &usb_template_multi.idProduct, 1, "Product identifier"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "eth_mac", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_eth_mac, sizeof(multi_eth_mac), usb_temp_sysctl, + "A", "Ethernet MAC address string"); +#if 0 + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "modem", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_modem, sizeof(multi_modem), usb_temp_sysctl, + "A", "Modem interface string"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "eth_control", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_eth_control, sizeof(multi_eth_data), usb_temp_sysctl, + "A", "Ethernet control interface string"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "eth_data", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_eth_data, sizeof(multi_eth_data), usb_temp_sysctl, + "A", "Ethernet data interface string"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "interface", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_storage, sizeof(multi_storage), usb_temp_sysctl, + "A", "Storage interface string"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "configuration", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_configuration, sizeof(multi_configuration), usb_temp_sysctl, + "A", "Configuration string"); +#endif + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "manufacturer", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_manufacturer, sizeof(multi_manufacturer), usb_temp_sysctl, + "A", "Manufacturer string"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "product", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_product, sizeof(multi_product), usb_temp_sysctl, + "A", "Product string"); + SYSCTL_ADD_PROC(&multi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO, + "serial_number", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &multi_serial_number, sizeof(multi_serial_number), usb_temp_sysctl, + "A", "Serial number string"); +} + +static void +multi_uninit(void *arg __unused) +{ + + sysctl_ctx_free(&multi_ctx_list); +} + +SYSINIT(multi_init, SI_SUB_LOCK, SI_ORDER_FIRST, multi_init, NULL); +SYSUNINIT(multi_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, multi_uninit, NULL); Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Thu May 17 19:50:55 2018 (r333759) +++ head/sys/dev/usb/usb_ioctl.h Thu May 17 19:54:11 2018 (r333760) @@ -69,6 +69,7 @@ enum { USB_TEMP_PHONE, /* USB Phone */ USB_TEMP_SERIALNET, /* USB CDC Ethernet and Modem */ USB_TEMP_MIDI, /* USB MIDI */ + USB_TEMP_MULTI, /* USB Ethernet, serial, and storage */ USB_TEMP_MAX, }; Modified: head/sys/modules/usb/template/Makefile ============================================================================== --- head/sys/modules/usb/template/Makefile Thu May 17 19:50:55 2018 (r333759) +++ head/sys/modules/usb/template/Makefile Thu May 17 19:54:11 2018 (r333760) @@ -41,6 +41,7 @@ SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if. usb_template_mtp.c \ usb_template_phone.c \ usb_template_serialnet.c \ - usb_template_midi.c + usb_template_midi.c \ + usb_template_multi.c .include From owner-svn-src-all@freebsd.org Thu May 17 19:57:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 230A8EDEF70; Thu, 17 May 2018 19:57:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A9474301; Thu, 17 May 2018 19:57:08 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5B556010; Thu, 17 May 2018 19:57:08 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HJv8g7032926; Thu, 17 May 2018 19:57:08 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HJv8aH032923; Thu, 17 May 2018 19:57:08 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805171957.w4HJv8aH032923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 19:57:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333761 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:57:09 -0000 Author: mmacy Date: Thu May 17 19:57:07 2018 New Revision: 333761 URL: https://svnweb.freebsd.org/changeset/base/333761 Log: epoch(9): schedule pcpu callback task in hardclock if there are callbacks pending Approved by: sbruno Modified: head/sys/kern/kern_clock.c head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu May 17 19:54:11 2018 (r333760) +++ head/sys/kern/kern_clock.c Thu May 17 19:57:07 2018 (r333761) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -467,6 +468,7 @@ hardclock_cpu(int usermode) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif callout_process(sbinuptime()); + epoch_pcpu_poll(); } /* @@ -572,6 +574,7 @@ hardclock_cnt(int cnt, int usermode) } if (curcpu == CPU_FIRST()) cpu_tick_calibration(); + epoch_pcpu_poll(); } void Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 19:54:11 2018 (r333760) +++ head/sys/kern/subr_epoch.c Thu May 17 19:57:07 2018 (r333761) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,8 +56,8 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re /* arbitrary --- needs benchmarking */ #define MAX_ADAPTIVE_SPIN 1000 +#define MAX_EPOCHS 64 -#define EPOCH_EXITING 0x1 #ifdef __amd64__ #define EPOCH_ALIGN CACHE_LINE_SIZE*2 #else @@ -68,9 +69,7 @@ CTASSERT(sizeof(ck_epoch_entry_t) == sizeof(struct epo SYSCTL_NODE(_kern, OID_AUTO, epoch, CTLFLAG_RW, 0, "epoch information"); SYSCTL_NODE(_kern_epoch, OID_AUTO, stats, CTLFLAG_RW, 0, "epoch stats"); -static int poll_intvl; -SYSCTL_INT(_kern_epoch, OID_AUTO, poll_intvl, CTLFLAG_RWTUN, - &poll_intvl, 0, "# of ticks to wait between garbage collecting deferred frees"); + /* Stats. */ static counter_u64_t block_count; SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, nblocked, CTLFLAG_RW, @@ -103,23 +102,26 @@ struct epoch_pcpu_state { struct epoch { struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); - struct grouptask e_gtask; - struct callout e_timer; - struct mtx e_lock; - int e_flags; - /* make sure that immutable data doesn't overlap with the gtask, callout, and mutex*/ struct epoch_pcpu_state *e_pcpu_dom[MAXMEMDOM] __aligned(EPOCH_ALIGN); counter_u64_t e_frees; uint64_t e_free_last; + int e_idx; struct epoch_pcpu_state *e_pcpu[0]; }; +epoch_t allepochs[MAX_EPOCHS]; + +static DPCPU_DEFINE(struct grouptask, cb_task); +static DPCPU_DEFINE(int, cb_count); + static __read_mostly int domcount[MAXMEMDOM]; static __read_mostly int domoffsets[MAXMEMDOM]; static __read_mostly int inited; +static __read_mostly int epoch_count; __read_mostly epoch_t global_epoch; +static __read_mostly epoch_t private_epoch; -static void epoch_call_task(void *context); +static void epoch_call_task(void *context __unused); #if defined(__powerpc64__) || defined(__powerpc__) || !defined(NUMA) static bool usedomains = false; @@ -129,11 +131,8 @@ static bool usedomains = true; static void epoch_init(void *arg __unused) { - int domain, count; + int domain, count, cpu; - if (poll_intvl == 0) - poll_intvl = hz; - block_count = counter_u64_alloc(M_WAITOK); migrate_count = counter_u64_alloc(M_WAITOK); turnstile_count = counter_u64_alloc(M_WAITOK); @@ -157,8 +156,13 @@ epoch_init(void *arg __unused) } } done: + CPU_FOREACH(cpu) { + GROUPTASK_INIT(DPCPU_ID_PTR(cpu, cb_task), 0, epoch_call_task, NULL); + taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, cb_task), NULL, cpu, -1, "epoch call task"); + } inited = 1; global_epoch = epoch_alloc(); + private_epoch = epoch_alloc(); } SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); @@ -201,23 +205,6 @@ epoch_init_legacy(epoch_t epoch) } } -static void -epoch_callout(void *arg) -{ - epoch_t epoch; - uint64_t frees; - - epoch = arg; - frees = counter_u64_fetch(epoch->e_frees); - /* pick some better value */ - if (frees - epoch->e_free_last > 10) { - GROUPTASK_ENQUEUE(&epoch->e_gtask); - epoch->e_free_last = frees; - } - if ((epoch->e_flags & EPOCH_EXITING) == 0) - callout_reset(&epoch->e_timer, poll_intvl, epoch_callout, epoch); -} - epoch_t epoch_alloc(void) { @@ -229,14 +216,13 @@ epoch_alloc(void) M_EPOCH, M_ZERO|M_WAITOK); ck_epoch_init(&epoch->e_epoch); epoch->e_frees = counter_u64_alloc(M_WAITOK); - mtx_init(&epoch->e_lock, "epoch callout", NULL, MTX_DEF); - callout_init_mtx(&epoch->e_timer, &epoch->e_lock, 0); - taskqgroup_config_gtask_init(epoch, &epoch->e_gtask, epoch_call_task, "epoch call task"); if (usedomains) epoch_init_numa(epoch); else epoch_init_legacy(epoch); - callout_reset(&epoch->e_timer, poll_intvl, epoch_callout, epoch); + MPASS(epoch_count < MAX_EPOCHS-2); + epoch->e_idx = epoch_count; + allepochs[epoch_count++] = epoch; return (epoch); } @@ -253,18 +239,12 @@ epoch_free(epoch_t epoch) MPASS(TAILQ_EMPTY(&eps->eps_record.er_tdlist)); } #endif - mtx_lock(&epoch->e_lock); - epoch->e_flags |= EPOCH_EXITING; - mtx_unlock(&epoch->e_lock); + allepochs[epoch->e_idx] = NULL; + epoch_wait(private_epoch); /* * Execute any lingering callbacks */ - GROUPTASK_ENQUEUE(&epoch->e_gtask); - gtaskqueue_drain(epoch->e_gtask.gt_taskqueue, &epoch->e_gtask.gt_task); - callout_drain(&epoch->e_timer); - mtx_destroy(&epoch->e_lock); counter_u64_free(epoch->e_frees); - taskqgroup_config_gtask_deinit(&epoch->e_gtask); if (usedomains) for (domain = 0; domain < vm_ndomains; domain++) free_domain(epoch->e_pcpu_dom[domain], M_EPOCH); @@ -308,12 +288,22 @@ epoch_enter_internal(epoch_t epoch, struct thread *td) critical_exit(); } + +static void +epoch_enter_private(ck_epoch_section_t *section) +{ + struct epoch_pcpu_state *eps; + + MPASS(curthread->td_critnest); + eps = private_epoch->e_pcpu[curcpu]; + ck_epoch_begin(&eps->eps_record.er_record, section); +} + void epoch_exit_internal(epoch_t epoch, struct thread *td) { struct epoch_pcpu_state *eps; - td = curthread; MPASS(td->td_epochnest == 0); INIT_CHECK(epoch); critical_enter(); @@ -331,6 +321,16 @@ epoch_exit_internal(epoch_t epoch, struct thread *td) critical_exit(); } +static void +epoch_exit_private(ck_epoch_section_t *section) +{ + struct epoch_pcpu_state *eps; + + MPASS(curthread->td_critnest); + eps = private_epoch->e_pcpu[curcpu]; + ck_epoch_end(&eps->eps_record.er_record, section); +} + /* * epoch_block_handler is a callback from the ck code when another thread is * currently in an epoch section. @@ -533,6 +533,7 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* counter_u64_add(epoch->e_frees, 1); critical_enter(); + *DPCPU_PTR(cb_count) += 1; eps = epoch->e_pcpu[curcpu]; ck_epoch_call(&eps->eps_record.er_record, cb, (ck_epoch_cb_t*)callback); critical_exit(); @@ -541,32 +542,48 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* callback(ctx); } + static void -epoch_call_task(void *context) +epoch_call_task(void *arg __unused) { - struct epoch_pcpu_state *eps; + ck_stack_entry_t *cursor, *head, *next; + ck_epoch_record_t *record; + ck_epoch_section_t section; epoch_t epoch; - struct thread *td; - ck_stack_entry_t *cursor; - ck_stack_t deferred; - int cpu; + ck_stack_t cb_stack; + int i, npending, total; - epoch = context; - td = curthread; - ck_stack_init(&deferred); - thread_lock(td); - CPU_FOREACH(cpu) { - sched_bind(td, cpu); - eps = epoch->e_pcpu[cpu]; - ck_epoch_poll_deferred(&eps->eps_record.er_record, &deferred); + ck_stack_init(&cb_stack); + critical_enter(); + epoch_enter_private(§ion); + for (total = i = 0; i < epoch_count; i++) { + if (__predict_false((epoch = allepochs[i]) == NULL)) + continue; + record = &epoch->e_pcpu[curcpu]->eps_record.er_record; + if ((npending = record->n_pending) == 0) + continue; + ck_epoch_poll_deferred(record, &cb_stack); + total += npending - record->n_pending; } - sched_unbind(td); - thread_unlock(td); - while((cursor = ck_stack_pop_npsc(&deferred)) != NULL) { + epoch_exit_private(§ion); + *DPCPU_PTR(cb_count) -= total; + critical_exit(); + + head = ck_stack_batch_pop_npsc(&cb_stack); + for (cursor = head; cursor != NULL; cursor = next) { struct ck_epoch_entry *entry = ck_epoch_entry_container(cursor); + next = CK_STACK_NEXT(cursor); entry->function(entry); } +} + +void +epoch_pcpu_poll(void) +{ + + if (DPCPU_GET(cb_count)) + GROUPTASK_ENQUEUE(DPCPU_PTR(cb_task)); } int Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Thu May 17 19:54:11 2018 (r333760) +++ head/sys/sys/epoch.h Thu May 17 19:57:07 2018 (r333761) @@ -49,6 +49,7 @@ void epoch_enter_internal(epoch_t epoch, struct thread void epoch_exit_internal(epoch_t epoch, struct thread *td); void epoch_wait(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); +void epoch_pcpu_poll(void); int in_epoch(void); static __inline void From owner-svn-src-all@freebsd.org Thu May 17 19:58:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ECD3EDEFE5 for ; Thu, 17 May 2018 19:58:17 +0000 (UTC) (envelope-from internationalloan@megapool-ca.com) Received: from gate.gau.hu (gate.gau.hu [IPv6:2001:738:5800:1903::65]) by mx1.freebsd.org (Postfix) with ESMTP id 088857446A for ; Thu, 17 May 2018 19:58:16 +0000 (UTC) (envelope-from internationalloan@megapool-ca.com) Received: from gate.gau.hu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 40n2D207y2zGsR2d for ; Thu, 17 May 2018 21:58:10 +0200 (CEST) Received: from atlas.szie.hu (atlas.szie.hu [192.188.242.79]) by gate.gau.hu (Postfix) with ESMTP id 40n2Cz3BC0zGsQn3 for ; Thu, 17 May 2018 21:58:07 +0200 (CEST) Received: from DESKTOP-BJA7SIO (8ta-229-3-19.telkomadsl.co.za [197.229.3.19]) by atlas.szie.hu (Sun Java System Messaging Server 6.2-8.02 (built Dec 21 2006)) with ESMTPA id <0P8V00CC5QPWB0S1@atlas.szie.hu> for svn-src-all@freebsd.org; Thu, 17 May 2018 18:10:13 +0200 (CEST) Date: Thu, 17 May 2018 18:08:57 +0200 From: Megapool Financial Service Subject: Personal Loan OFFER To: svn-src-all@freebsd.org Reply-to: apply-loan@megapool-ca.com Message-id: <4624732065784725@webmail.szie.hu> MIME-version: 1.0 X-PMX-Version: 6.4.3.2751440, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.17.194816, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.5.15.5491002 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 19:58:17 -0000 We offer three types of personal loans to suit your individual needs. You can rest easy knowing that your repayment amount is the same each month and comes with a fixed interest rate that protects you from interest hikes. Use your loan to build your home, pay for your education or to consolidate your debt. Contact us at: apply-loan@megapool-ca.com for a loan application. From owner-svn-src-all@freebsd.org Thu May 17 20:57:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBFAEE0392; Thu, 17 May 2018 20:57:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C57FE75D1A; Thu, 17 May 2018 20:57:30 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A27646A22; Thu, 17 May 2018 20:57:30 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HKvU1Y063258; Thu, 17 May 2018 20:57:30 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HKvUW0063256; Thu, 17 May 2018 20:57:30 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201805172057.w4HKvUW0063256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 17 May 2018 20:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333762 - in vendor-sys/ck/dist: include src X-SVN-Group: vendor-sys X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: in vendor-sys/ck/dist: include src X-SVN-Commit-Revision: 333762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 20:57:31 -0000 Author: cognet Date: Thu May 17 20:57:30 2018 New Revision: 333762 URL: https://svnweb.freebsd.org/changeset/base/333762 Log: Import CK as of commit deca119d14bfffd440770eb67cbdbeaf7b57eb7b This brings us ck_epoch_deferred, which is used by the new facility epoch(9). Modified: vendor-sys/ck/dist/include/ck_epoch.h vendor-sys/ck/dist/src/ck_epoch.c Modified: vendor-sys/ck/dist/include/ck_epoch.h ============================================================================== --- vendor-sys/ck/dist/include/ck_epoch.h Thu May 17 19:57:07 2018 (r333761) +++ vendor-sys/ck/dist/include/ck_epoch.h Thu May 17 20:57:30 2018 (r333762) @@ -266,6 +266,7 @@ void ck_epoch_register(ck_epoch_t *, ck_epoch_record_t void ck_epoch_unregister(ck_epoch_record_t *); bool ck_epoch_poll(ck_epoch_record_t *); +bool ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t *deferred); void ck_epoch_synchronize(ck_epoch_record_t *); void ck_epoch_synchronize_wait(ck_epoch_t *, ck_epoch_wait_cb_t *, void *); void ck_epoch_barrier(ck_epoch_record_t *); Modified: vendor-sys/ck/dist/src/ck_epoch.c ============================================================================== --- vendor-sys/ck/dist/src/ck_epoch.c Thu May 17 19:57:07 2018 (r333761) +++ vendor-sys/ck/dist/src/ck_epoch.c Thu May 17 20:57:30 2018 (r333762) @@ -349,7 +349,7 @@ ck_epoch_scan(struct ck_epoch *global, } static void -ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e) +ck_epoch_dispatch(struct ck_epoch_record *record, unsigned int e, ck_stack_t *deferred) { unsigned int epoch = e & (CK_EPOCH_LENGTH - 1); ck_stack_entry_t *head, *next, *cursor; @@ -362,7 +362,10 @@ ck_epoch_dispatch(struct ck_epoch_record *record, unsi ck_epoch_entry_container(cursor); next = CK_STACK_NEXT(cursor); - entry->function(entry); + if (deferred != NULL) + ck_stack_push_spnc(deferred, &entry->stack_entry); + else + entry->function(entry); i++; } @@ -390,7 +393,7 @@ ck_epoch_reclaim(struct ck_epoch_record *record) unsigned int epoch; for (epoch = 0; epoch < CK_EPOCH_LENGTH; epoch++) - ck_epoch_dispatch(record, epoch); + ck_epoch_dispatch(record, epoch, NULL); return; } @@ -551,7 +554,7 @@ ck_epoch_barrier_wait(struct ck_epoch_record *record, * is far from ideal too. */ bool -ck_epoch_poll(struct ck_epoch_record *record) +ck_epoch_poll_deferred(struct ck_epoch_record *record, ck_stack_t *deferred) { bool active; unsigned int epoch; @@ -572,7 +575,7 @@ ck_epoch_poll(struct ck_epoch_record *record) if (active == false) { record->epoch = epoch; for (epoch = 0; epoch < CK_EPOCH_LENGTH; epoch++) - ck_epoch_dispatch(record, epoch); + ck_epoch_dispatch(record, epoch, deferred); return true; } @@ -580,6 +583,13 @@ ck_epoch_poll(struct ck_epoch_record *record) /* If an active thread exists, rely on epoch observation. */ (void)ck_pr_cas_uint(&global->epoch, epoch, epoch + 1); - ck_epoch_dispatch(record, epoch + 1); + ck_epoch_dispatch(record, epoch + 1, deferred); return true; +} + +bool +ck_epoch_poll(struct ck_epoch_record *record) +{ + + return ck_epoch_poll_deferred(record, NULL); } From owner-svn-src-all@freebsd.org Thu May 17 20:59:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CF3EE0444; Thu, 17 May 2018 20:59:19 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3022A75E8D; Thu, 17 May 2018 20:59:19 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E80616A23; Thu, 17 May 2018 20:59:18 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HKxIgn063369; Thu, 17 May 2018 20:59:18 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HKxIW3063368; Thu, 17 May 2018 20:59:18 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201805172059.w4HKxIW3063368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 17 May 2018 20:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333763 - vendor-sys/ck/20180517 X-SVN-Group: vendor-sys X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: vendor-sys/ck/20180517 X-SVN-Commit-Revision: 333763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 20:59:19 -0000 Author: cognet Date: Thu May 17 20:59:18 2018 New Revision: 333763 URL: https://svnweb.freebsd.org/changeset/base/333763 Log: Tag import as of commit deca119d14bfffd440770eb67cbdbeaf7b57eb7b. Added: vendor-sys/ck/20180517/ - copied from r333762, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Thu May 17 21:03:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6CA0EE0670; Thu, 17 May 2018 21:03:37 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6099C76291; Thu, 17 May 2018 21:03:37 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22DE36BC9; Thu, 17 May 2018 21:03:37 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HL3bwr068006; Thu, 17 May 2018 21:03:37 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HL3bG4068005; Thu, 17 May 2018 21:03:37 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201805172103.w4HL3bG4068005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 17 May 2018 21:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333764 - head/sys/contrib/ck X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/contrib/ck X-SVN-Commit-Revision: 333764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:03:38 -0000 Author: cognet Date: Thu May 17 21:03:36 2018 New Revision: 333764 URL: https://svnweb.freebsd.org/changeset/base/333764 Log: Import CK as of commit deca119d14bfffd440770eb67cbdbeaf7b57eb7b. This is mostly a noop, for mergeinfo purpose, because the relevant changes were committed directly. Modified: Directory Properties: head/sys/contrib/ck/ (props changed) From owner-svn-src-all@freebsd.org Thu May 17 21:04:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC433EE06B7; Thu, 17 May 2018 21:04:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72861763C3; Thu, 17 May 2018 21:04:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53C076BCA; Thu, 17 May 2018 21:04:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HL4KkA068080; Thu, 17 May 2018 21:04:20 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HL4Kag068079; Thu, 17 May 2018 21:04:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805172104.w4HL4Kag068079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 21:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333765 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 333765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:04:20 -0000 Author: mmacy Date: Thu May 17 21:04:19 2018 New Revision: 333765 URL: https://svnweb.freebsd.org/changeset/base/333765 Log: powerpc: fix LINT build netmap currently doesn't build, take it out of LINT to prevent hiding regressions in universe Reviewed by: jhibbits Approved by: sbruno Modified: head/sys/conf/makeLINT.mk Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Thu May 17 21:03:36 2018 (r333764) +++ head/sys/conf/makeLINT.mk Thu May 17 21:04:19 2018 (r333765) @@ -53,6 +53,7 @@ LINT: ${NOTES} ${MAKELINT_SED} .if ${TARGET} == "powerpc" # cat is available, not sure if cp is? cat ${.TARGET} > ${.TARGET}64 + echo "nodevice netmap" >> ${.TARGET} echo "machine ${TARGET} powerpc" >> ${.TARGET} echo "machine ${TARGET} powerpc64" >> ${.TARGET}64 .endif From owner-svn-src-all@freebsd.org Thu May 17 21:17:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68EAEEE0B91; Thu, 17 May 2018 21:17:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E775769FB; Thu, 17 May 2018 21:17:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 008B26D61; Thu, 17 May 2018 21:17:21 +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 w4HLHKlS073219; Thu, 17 May 2018 21:17:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HLHKw2073218; Thu, 17 May 2018 21:17:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201805172117.w4HLHKw2073218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 17 May 2018 21:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333766 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 333766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:17:21 -0000 Author: rmacklem Date: Thu May 17 21:17:20 2018 New Revision: 333766 URL: https://svnweb.freebsd.org/changeset/base/333766 Log: Add a missing nfsrv_freesession() call for an unlikely failure case. Since NFSv4.1 clients normally create a single session which supports both fore and back channels, it is unlikely that a callback will fail due to a lack of a back channel. However, if this failure occurred, the session wasn't being dereferenced and would never be free'd. Found by inspection during pNFS server development. Tested by: andreas.nagy@frequentis.com MFC after: 2 months Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Thu May 17 21:04:19 2018 (r333765) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Thu May 17 21:17:20 2018 (r333766) @@ -4255,9 +4255,10 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, */ (void) newnfs_sndlock(&clp->lc_req.nr_lock); if (clp->lc_req.nr_client == NULL) { - if ((clp->lc_flags & LCL_NFSV41) != 0) + if ((clp->lc_flags & LCL_NFSV41) != 0) { error = ECONNREFUSED; - else if (nd->nd_procnum == NFSV4PROC_CBNULL) + nfsrv_freesession(sep, NULL); + } else if (nd->nd_procnum == NFSV4PROC_CBNULL) error = newnfs_connect(NULL, &clp->lc_req, cred, NULL, 1); else From owner-svn-src-all@freebsd.org Thu May 17 21:19:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 070A3EE0D3D; Thu, 17 May 2018 21:19:54 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (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 859BE76C28; Thu, 17 May 2018 21:19:53 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w4HL8ium024908 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 17 May 2018 14:08:45 -0700 Subject: Re: svn commit: r333765 - head/sys/conf To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805172104.w4HL4Kag068079@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <148f3ab2-e62f-61e5-9c5f-68c97881a9ee@freebsd.org> Date: Thu, 17 May 2018 14:08:44 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201805172104.w4HL4Kag068079@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVbRDMY4uWGMnadz9sjO+Tn/7D95h/6KuC8e4OM9zF08x/RfBncQntITUQvRxaMPTFBkbZix7jN9T7p6w6hu8XjggrywPl6MmHE= X-Sonic-ID: C;cvqoexZa6BGbWcURjESG/g== M;KkEifBZa6BGbWcURjESG/g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:19:54 -0000 On 05/17/18 14:04, Matt Macy wrote: > Author: mmacy > Date: Thu May 17 21:04:19 2018 > New Revision: 333765 > URL: https://svnweb.freebsd.org/changeset/base/333765 > > Log: > powerpc: fix LINT build > > netmap currently doesn't build, take it out of LINT to prevent > hiding regressions in universe > > Reviewed by: jhibbits > Approved by: sbruno > > Modified: > head/sys/conf/makeLINT.mk > > Modified: head/sys/conf/makeLINT.mk > ============================================================================== > --- head/sys/conf/makeLINT.mk Thu May 17 21:03:36 2018 (r333764) > +++ head/sys/conf/makeLINT.mk Thu May 17 21:04:19 2018 (r333765) > @@ -53,6 +53,7 @@ LINT: ${NOTES} ${MAKELINT_SED} > .if ${TARGET} == "powerpc" > # cat is available, not sure if cp is? > cat ${.TARGET} > ${.TARGET}64 > + echo "nodevice netmap" >> ${.TARGET} > echo "machine ${TARGET} powerpc" >> ${.TARGET} > echo "machine ${TARGET} powerpc64" >> ${.TARGET}64 > .endif > The build error is that it is broken on all 32-bit architectures because of some integer/pointer type confusion, not just (32-bit) PowerPC. So, if we aren't fixing it, it at least it should also be removed from ARM, i386, mips, etc. -Nathan From owner-svn-src-all@freebsd.org Thu May 17 21:22:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D363EE0FC9; Thu, 17 May 2018 21:22:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E3AC176FFB; Thu, 17 May 2018 21:22:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C66256EE6; Thu, 17 May 2018 21:22:19 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HLMJtx078174; Thu, 17 May 2018 21:22:19 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HLMJSW078172; Thu, 17 May 2018 21:22:19 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805172122.w4HLMJSW078172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 17 May 2018 21:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333767 - stable/11/sys/dev/sdhci X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/sdhci X-SVN-Commit-Revision: 333767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:22:20 -0000 Author: marius Date: Thu May 17 21:22:19 2018 New Revision: 333767 URL: https://svnweb.freebsd.org/changeset/base/333767 Log: MFC: r333613 The broken DDR52 support of Intel Bay Trail eMMC controllers rumored in the commit log of r321385 has been confirmed via the public VLI54 erratum. Thus, stop advertising DDR52 for these controllers. Note that this change should hardly make a difference in practice as eMMC chips from the same era as these SoCs most likely support HS200 at least, probably even up to HS400ES. Approved by: re (gjb, kib) Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c stable/11/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_acpi.c Thu May 17 21:17:20 2018 (r333766) +++ stable/11/sys/dev/sdhci/sdhci_acpi.c Thu May 17 21:22:19 2018 (r333767) @@ -60,7 +60,6 @@ static const struct sdhci_acpi_device { { "80860F14", 1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller", SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "80860F14", 3, "Intel Bay Trail/Braswell SDXC Controller", @@ -261,11 +260,16 @@ sdhci_acpi_attach(device_t dev) return (ENOMEM); } - /* Intel Braswell eMMC 4.5.1 controller quirk */ + /* + * Intel Bay Trail and Braswell eMMC controllers share the same IDs, + * but while with these former DDR52 is affected by the VLI54 erratum, + * these latter require the timeout clock to be hardcoded to 1 MHz. + */ if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; sc->quirks &= ~sdhci_quirk_clear; sc->quirks |= sdhci_quirk_set; sc->slot.quirks = sc->quirks; Modified: stable/11/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_pci.c Thu May 17 21:17:20 2018 (r333766) +++ stable/11/sys/dev/sdhci/sdhci_pci.c Thu May 17 21:22:19 2018 (r333767) @@ -104,18 +104,18 @@ static const struct sdhci_device { { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + /* DDR52 is supported but affected by the VLI54 erratum */ SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN}, { 0x0f158086, 0xffff, "Intel Bay Trail SDXC Controller", SDHCI_QUIRK_WAIT_WHILE_BUSY | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + /* DDR52 is supported but affected by the VLI54 erratum */ SDHCI_QUIRK_INTEL_POWER_UP_RESET | SDHCI_QUIRK_WAIT_WHILE_BUSY | - SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { 0x19db8086, 0xffff, "Intel Denverton eMMC 5.0 Controller", From owner-svn-src-all@freebsd.org Thu May 17 21:23:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BB16EE1039; Thu, 17 May 2018 21:23:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F09427715E; Thu, 17 May 2018 21:23:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D166B6EF3; Thu, 17 May 2018 21:23:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HLNEDr078252; Thu, 17 May 2018 21:23:14 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HLNEnk078251; Thu, 17 May 2018 21:23:14 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805172123.w4HLNEnk078251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 17 May 2018 21:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333768 - stable/11/sys/dev/mmc X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/11/sys/dev/mmc X-SVN-Commit-Revision: 333768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:23:15 -0000 Author: marius Date: Thu May 17 21:23:14 2018 New Revision: 333768 URL: https://svnweb.freebsd.org/changeset/base/333768 Log: MFC: r333614 Let mmcsd_ioctl() ensure appropriate privileges via priv_check(9). Approved by: re (gjb, kib) Modified: stable/11/sys/dev/mmc/mmcsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/11/sys/dev/mmc/mmcsd.c Thu May 17 21:22:19 2018 (r333767) +++ stable/11/sys/dev/mmc/mmcsd.c Thu May 17 21:23:14 2018 (r333768) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -177,7 +178,7 @@ static int mmcsd_bus_bit_width(device_t dev); static daddr_t mmcsd_delete(struct mmcsd_part *part, struct bio *bp); static const char *mmcsd_errmsg(int e); static int mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, - int fflag); + int fflag, struct thread *td); static int mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_ioc_cmd *mic, int fflag); static uintmax_t mmcsd_pretty_size(off_t size, char *unit); @@ -771,22 +772,23 @@ mmcsd_strategy(struct bio *bp) static int mmcsd_ioctl_rpmb(struct cdev *dev, u_long cmd, caddr_t data, - int fflag, struct thread *td __unused) + int fflag, struct thread *td) { - return (mmcsd_ioctl(dev->si_drv1, cmd, data, fflag)); + return (mmcsd_ioctl(dev->si_drv1, cmd, data, fflag, td)); } static int mmcsd_ioctl_disk(struct disk *disk, u_long cmd, void *data, int fflag, - struct thread *td __unused) + struct thread *td) { - return (mmcsd_ioctl(disk->d_drv1, cmd, data, fflag)); + return (mmcsd_ioctl(disk->d_drv1, cmd, data, fflag, td)); } static int -mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag) +mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void *data, int fflag, + struct thread *td) { struct mmc_ioc_cmd *mic; struct mmc_ioc_multi_cmd *mimc; @@ -795,6 +797,10 @@ mmcsd_ioctl(struct mmcsd_part *part, u_long cmd, void if ((fflag & FREAD) == 0) return (EBADF); + + err = priv_check(td, PRIV_DRIVER); + if (err != 0) + return (err); err = 0; switch (cmd) { From owner-svn-src-all@freebsd.org Thu May 17 21:39:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F6A7EE1326; Thu, 17 May 2018 21:39:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4561B77684; Thu, 17 May 2018 21:39:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 278FE7084; Thu, 17 May 2018 21:39:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HLdGaX083498; Thu, 17 May 2018 21:39:16 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HLdFc0083496; Thu, 17 May 2018 21:39:15 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805172139.w4HLdFc0083496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 17 May 2018 21:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333769 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:39:16 -0000 Author: mmacy Date: Thu May 17 21:39:15 2018 New Revision: 333769 URL: https://svnweb.freebsd.org/changeset/base/333769 Log: epoch: skip poll function call in hardclock unless there are callbacks pending Reported by: mjg Approved by: sbruno Modified: head/sys/kern/kern_clock.c head/sys/kern/subr_epoch.c head/sys/sys/epoch.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Thu May 17 21:23:14 2018 (r333768) +++ head/sys/kern/kern_clock.c Thu May 17 21:39:15 2018 (r333769) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -468,7 +469,8 @@ hardclock_cpu(int usermode) PMC_SOFT_CALL_TF( , , clock, hard, td->td_intr_frame); #endif callout_process(sbinuptime()); - epoch_pcpu_poll(); + if (__predict_false(DPCPU_GET(epoch_cb_count))) + GROUPTASK_ENQUEUE(DPCPU_PTR(epoch_cb_task)); } /* @@ -574,7 +576,8 @@ hardclock_cnt(int cnt, int usermode) } if (curcpu == CPU_FIRST()) cpu_tick_calibration(); - epoch_pcpu_poll(); + if (__predict_false(DPCPU_GET(epoch_cb_count))) + GROUPTASK_ENQUEUE(DPCPU_PTR(epoch_cb_task)); } void Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 21:23:14 2018 (r333768) +++ head/sys/kern/subr_epoch.c Thu May 17 21:39:15 2018 (r333769) @@ -111,8 +111,8 @@ struct epoch { epoch_t allepochs[MAX_EPOCHS]; -static DPCPU_DEFINE(struct grouptask, cb_task); -static DPCPU_DEFINE(int, cb_count); +DPCPU_DEFINE(struct grouptask, epoch_cb_task); +DPCPU_DEFINE(int, epoch_cb_count); static __read_mostly int domcount[MAXMEMDOM]; static __read_mostly int domoffsets[MAXMEMDOM]; @@ -157,8 +157,8 @@ epoch_init(void *arg __unused) } done: CPU_FOREACH(cpu) { - GROUPTASK_INIT(DPCPU_ID_PTR(cpu, cb_task), 0, epoch_call_task, NULL); - taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, cb_task), NULL, cpu, -1, "epoch call task"); + GROUPTASK_INIT(DPCPU_ID_PTR(cpu, epoch_cb_task), 0, epoch_call_task, NULL); + taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, "epoch call task"); } inited = 1; global_epoch = epoch_alloc(); @@ -533,7 +533,7 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* counter_u64_add(epoch->e_frees, 1); critical_enter(); - *DPCPU_PTR(cb_count) += 1; + *DPCPU_PTR(epoch_cb_count) += 1; eps = epoch->e_pcpu[curcpu]; ck_epoch_call(&eps->eps_record.er_record, cb, (ck_epoch_cb_t*)callback); critical_exit(); @@ -566,7 +566,7 @@ epoch_call_task(void *arg __unused) total += npending - record->n_pending; } epoch_exit_private(§ion); - *DPCPU_PTR(cb_count) -= total; + *DPCPU_PTR(epoch_cb_count) -= total; critical_exit(); head = ck_stack_batch_pop_npsc(&cb_stack); @@ -576,14 +576,6 @@ epoch_call_task(void *arg __unused) next = CK_STACK_NEXT(cursor); entry->function(entry); } -} - -void -epoch_pcpu_poll(void) -{ - - if (DPCPU_GET(cb_count)) - GROUPTASK_ENQUEUE(DPCPU_PTR(cb_task)); } int Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Thu May 17 21:23:14 2018 (r333768) +++ head/sys/sys/epoch.h Thu May 17 21:39:15 2018 (r333769) @@ -36,6 +36,8 @@ struct epoch; typedef struct epoch *epoch_t; extern epoch_t global_epoch; +DPCPU_DECLARE(int, epoch_cb_count); +DPCPU_DECLARE(struct grouptask, epoch_cb_task); struct epoch_context { void *data[2]; @@ -49,7 +51,6 @@ void epoch_enter_internal(epoch_t epoch, struct thread void epoch_exit_internal(epoch_t epoch, struct thread *td); void epoch_wait(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); -void epoch_pcpu_poll(void); int in_epoch(void); static __inline void From owner-svn-src-all@freebsd.org Thu May 17 21:41:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09EB4EE1425; Thu, 17 May 2018 21:41:54 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAD5A778D4; Thu, 17 May 2018 21:41:53 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 721CF15065; Thu, 17 May 2018 21:41:53 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f41.google.com with SMTP id n202-v6so10749719ita.1; Thu, 17 May 2018 14:41:53 -0700 (PDT) X-Gm-Message-State: ALKqPwdh9kFsDRYJFOxqkq0GnnJDU9aLEi8RgltEppiW1ayKjx12fKWr IOXeS4SQZZHyGr7J/CZVOdsuvyUowsNylgyweuM= X-Google-Smtp-Source: AB8JxZpu+g6UYC8TXuAybKIpLDEg066p4Dqg9MSie9YIHiaKnf5TPe5GLaNOXLXEqJgPRyFQhuScfi2n5PfV4TOB0G8= X-Received: by 2002:a24:5b54:: with SMTP id g81-v6mr4377599itb.7.1526593312750; Thu, 17 May 2018 14:41:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3e4a:0:0:0:0:0 with HTTP; Thu, 17 May 2018 14:41:52 -0700 (PDT) In-Reply-To: <148f3ab2-e62f-61e5-9c5f-68c97881a9ee@freebsd.org> References: <201805172104.w4HL4Kag068079@repo.freebsd.org> <148f3ab2-e62f-61e5-9c5f-68c97881a9ee@freebsd.org> From: Matthew Macy Date: Thu, 17 May 2018 14:41:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333765 - head/sys/conf To: Nathan Whitehorn 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.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:41:54 -0000 It's not breaking the build there, but I'd be fine with removing it more generally. -M On Thu, May 17, 2018 at 2:08 PM, Nathan Whitehorn wrote: > > > On 05/17/18 14:04, Matt Macy wrote: >> >> Author: mmacy >> Date: Thu May 17 21:04:19 2018 >> New Revision: 333765 >> URL: https://svnweb.freebsd.org/changeset/base/333765 >> >> Log: >> powerpc: fix LINT build >> netmap currently doesn't build, take it out of LINT to prevent >> hiding regressions in universe >> Reviewed by: jhibbits >> Approved by: sbruno >> >> Modified: >> head/sys/conf/makeLINT.mk >> >> Modified: head/sys/conf/makeLINT.mk >> >> ============================================================================== >> --- head/sys/conf/makeLINT.mk Thu May 17 21:03:36 2018 (r333764) >> +++ head/sys/conf/makeLINT.mk Thu May 17 21:04:19 2018 (r333765) >> @@ -53,6 +53,7 @@ LINT: ${NOTES} ${MAKELINT_SED} >> .if ${TARGET} == "powerpc" >> # cat is available, not sure if cp is? >> cat ${.TARGET} > ${.TARGET}64 >> + echo "nodevice netmap" >> ${.TARGET} >> echo "machine ${TARGET} powerpc" >> ${.TARGET} >> echo "machine ${TARGET} powerpc64" >> ${.TARGET}64 >> .endif >> > > The build error is that it is broken on all 32-bit architectures because of > some integer/pointer type confusion, not just (32-bit) PowerPC. So, if we > aren't fixing it, it at least it should also be removed from ARM, i386, > mips, etc. > -Nathan From owner-svn-src-all@freebsd.org Thu May 17 21:49:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C45C6EE1782; Thu, 17 May 2018 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7847C77F46; Thu, 17 May 2018 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55DDA7236; Thu, 17 May 2018 21:49:35 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HLnZnZ088710; Thu, 17 May 2018 21:49:35 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HLnYAw088707; Thu, 17 May 2018 21:49:34 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201805172149.w4HLnYAw088707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 17 May 2018 21:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333770 - in stable/11/contrib/elftoolchain: elfcopy readelf X-SVN-Group: stable-11 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/11/contrib/elftoolchain: elfcopy readelf X-SVN-Commit-Revision: 333770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 21:49:36 -0000 Author: marius Date: Thu May 17 21:49:34 2018 New Revision: 333770 URL: https://svnweb.freebsd.org/changeset/base/333770 Log: MFC: r333600 (phil) Handle thread-local storage (TLS) segments correctly when copying (objcopy) and displaying (readelf) them. PR: 227552 Submitted by: kaiw (maintainer) Approved by: re (gjb) Modified: stable/11/contrib/elftoolchain/elfcopy/elfcopy.h stable/11/contrib/elftoolchain/elfcopy/sections.c stable/11/contrib/elftoolchain/elfcopy/segments.c stable/11/contrib/elftoolchain/readelf/readelf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/elfcopy/elfcopy.h ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/elfcopy.h Thu May 17 21:39:15 2018 (r333769) +++ stable/11/contrib/elftoolchain/elfcopy/elfcopy.h Thu May 17 21:49:34 2018 (r333770) @@ -127,6 +127,7 @@ struct section { uint64_t cap; /* section capacity */ uint64_t align; /* section alignment */ uint64_t type; /* section type */ + uint64_t flags; /* section flags */ uint64_t vma; /* section virtual addr */ uint64_t lma; /* section load addr */ uint64_t pad_sz;/* section padding size */ Modified: stable/11/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/sections.c Thu May 17 21:39:15 2018 (r333769) +++ stable/11/contrib/elftoolchain/elfcopy/sections.c Thu May 17 21:49:34 2018 (r333770) @@ -411,6 +411,7 @@ create_scn(struct elfcopy *ecp) s->sz = ish.sh_size; s->align = ish.sh_addralign; s->type = ish.sh_type; + s->flags = ish.sh_flags; s->vma = ish.sh_addr; /* Modified: stable/11/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/segments.c Thu May 17 21:39:15 2018 (r333769) +++ stable/11/contrib/elftoolchain/elfcopy/segments.c Thu May 17 21:49:34 2018 (r333770) @@ -79,6 +79,8 @@ add_to_inseg_list(struct elfcopy *ecp, struct section continue; if (s->vma + s->sz > seg->vaddr + seg->msz) continue; + if (seg->type == PT_TLS && ((s->flags & SHF_TLS) == 0)) + continue; insert_to_inseg_list(seg, s); if (seg->type == PT_LOAD) Modified: stable/11/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/11/contrib/elftoolchain/readelf/readelf.c Thu May 17 21:39:15 2018 (r333769) +++ stable/11/contrib/elftoolchain/readelf/readelf.c Thu May 17 21:49:34 2018 (r333770) @@ -2377,11 +2377,22 @@ dump_phdr(struct readelf *re) } printf(" %2.2d ", i); /* skip NULL section. */ - for (j = 1; (size_t)j < re->shnum; j++) - if (re->sl[j].addr >= phdr.p_vaddr && - re->sl[j].addr + re->sl[j].sz <= + for (j = 1; (size_t)j < re->shnum; j++) { + if (re->sl[j].off < phdr.p_offset) + continue; + if (re->sl[j].off + re->sl[j].sz > + phdr.p_offset + phdr.p_filesz && + re->sl[j].type != SHT_NOBITS) + continue; + if (re->sl[j].addr < phdr.p_vaddr || + re->sl[j].addr + re->sl[j].sz > phdr.p_vaddr + phdr.p_memsz) - printf("%s ", re->sl[j].name); + continue; + if (phdr.p_type == PT_TLS && + (re->sl[j].flags & SHF_TLS) == 0) + continue; + printf("%s ", re->sl[j].name); + } printf("\n"); } #undef PH_HDR From owner-svn-src-all@freebsd.org Thu May 17 22:38:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAC0FEE240F; Thu, 17 May 2018 22:38:17 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0F179C3B; Thu, 17 May 2018 22:38:17 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A5777A2D; Thu, 17 May 2018 22:38:17 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HMcHlQ013765; Thu, 17 May 2018 22:38:17 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HMcHd5013764; Thu, 17 May 2018 22:38:17 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201805172238.w4HMcHd5013764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 17 May 2018 22:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333771 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 333771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 22:38:17 -0000 Author: cognet Date: Thu May 17 22:38:16 2018 New Revision: 333771 URL: https://svnweb.freebsd.org/changeset/base/333771 Log: In vfp_save_state(), don't bother trying to save the VFP registers if the provided PCB doesn't have a pcb_fpusaved. All PCBs associated to a thread should have one, but the dumppcb used when panic'ing doesn't. Modified: head/sys/arm64/arm64/vfp.c Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Thu May 17 21:49:34 2018 (r333770) +++ head/sys/arm64/arm64/vfp.c Thu May 17 22:38:16 2018 (r333771) @@ -170,6 +170,15 @@ vfp_save_state(struct thread *td, struct pcb *pcb) KASSERT(pcb != NULL, ("NULL vfp pcb")); KASSERT(td == NULL || td->td_pcb == pcb, ("Invalid vfp pcb")); + /* + * savectx() will be called on panic with dumppcb as an argument, + * dumppcb doesn't have pcb_fpusaved set so don't make any attempt + * to store the VFP registers in it, we probably don't care much + * at that point, anyway. + */ + if (pcb->pcb_fpusaved == NULL) + return; + if (td == NULL) td = curthread; From owner-svn-src-all@freebsd.org Thu May 17 22:40:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0635EEE257F; Thu, 17 May 2018 22:40:23 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC48979E37; Thu, 17 May 2018 22:40:22 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D6617A37; Thu, 17 May 2018 22:40:22 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HMeMfR013919; Thu, 17 May 2018 22:40:22 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HMeM3S013918; Thu, 17 May 2018 22:40:22 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201805172240.w4HMeM3S013918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 17 May 2018 22:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333772 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 333772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 22:40:23 -0000 Author: cognet Date: Thu May 17 22:40:22 2018 New Revision: 333772 URL: https://svnweb.freebsd.org/changeset/base/333772 Log: In pmap_get_tables(), check that the L2 is indeed a table before attempting to get the l3. Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu May 17 22:38:16 2018 (r333771) +++ head/sys/arm64/arm64/pmap.c Thu May 17 22:40:22 2018 (r333772) @@ -487,6 +487,9 @@ pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_ return (true); } + if ((pmap_load(l2p) & ATTR_DESCR_MASK) != L2_TABLE) + return (false); + *l3 = pmap_l2_to_l3(l2p, va); return (true); From owner-svn-src-all@freebsd.org Thu May 17 23:07:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8411CEE2D5E; Thu, 17 May 2018 23:07:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 372C57AAF1; Thu, 17 May 2018 23:07:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15D727EFC; Thu, 17 May 2018 23:07:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HN7poL028518; Thu, 17 May 2018 23:07:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HN7pw8028517; Thu, 17 May 2018 23:07:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201805172307.w4HN7pw8028517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 17 May 2018 23:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333773 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 23:07:52 -0000 Author: brooks Date: Thu May 17 23:07:51 2018 New Revision: 333773 URL: https://svnweb.freebsd.org/changeset/base/333773 Log: Use strsep() to parse init_path in start_init(). This simplifies the use of the path variable by making it NUL terminated. This is a prerequisite for further cleanups. Reviewed by: imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15467 Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Thu May 17 22:40:22 2018 (r333772) +++ head/sys/kern/init_main.c Thu May 17 23:07:51 2018 (r333773) @@ -698,7 +698,9 @@ start_init(void *dummy) vm_offset_t addr; struct execve_args args; int options, error; - char *var, *path, *next, *s; + size_t pathlen; + char *var, *path; + char *free_init_path, *tmp_init_path; char *ucp, **uap, *arg0, *arg1; struct thread *td; struct proc *p; @@ -727,17 +729,12 @@ start_init(void *dummy) strlcpy(init_path, var, sizeof(init_path)); freeenv(var); } + free_init_path = tmp_init_path = strdup(init_path, M_TEMP); - for (path = init_path; *path != '\0'; path = next) { - while (*path == ':') - path++; - if (*path == '\0') - break; - for (next = path; *next != '\0' && *next != ':'; next++) - /* nothing */ ; + while ((path = strsep(&tmp_init_path, ":")) != NULL) { + pathlen = strlen(path) + 1; if (bootverbose) - printf("start_init: trying %.*s\n", (int)(next - path), - path); + printf("start_init: trying %s\n", path); /* * Move out the boot flag argument. @@ -769,9 +766,8 @@ start_init(void *dummy) /* * Move out the file name (also arg 0). */ - (void)subyte(--ucp, 0); - for (s = next - 1; s >= path; s--) - (void)subyte(--ucp, *s); + ucp -= pathlen; + copyout(path, ucp, pathlen); arg0 = ucp; /* @@ -797,13 +793,14 @@ start_init(void *dummy) * to user mode as init! */ if ((error = sys_execve(td, &args)) == EJUSTRETURN) { + free(free_init_path, M_TEMP); TSEXIT(); return; } if (error != ENOENT) - printf("exec %.*s: error %d\n", (int)(next - path), - path, error); + printf("exec %s: error %d\n", path, error); } + free(free_init_path, M_TEMP); printf("init: not found in path %s\n", init_path); panic("no init"); } From owner-svn-src-all@freebsd.org Thu May 17 23:59:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81977EE3C90; Thu, 17 May 2018 23:59:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20EFA7BFB1; Thu, 17 May 2018 23:59:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7C301070A; Thu, 17 May 2018 23:59:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4HNxu59053679; Thu, 17 May 2018 23:59:56 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4HNxuN4053678; Thu, 17 May 2018 23:59:56 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805172359.w4HNxuN4053678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 17 May 2018 23:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333774 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 333774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 23:59:57 -0000 Author: gjb Date: Thu May 17 23:59:56 2018 New Revision: 333774 URL: https://svnweb.freebsd.org/changeset/base/333774 Log: Update stable/11 to BETA2 as part of the 11.2-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu May 17 23:07:51 2018 (r333773) +++ stable/11/sys/conf/newvers.sh Thu May 17 23:59:56 2018 (r333774) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="BETA1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 18 01:52:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3DEEEE5D73; Fri, 18 May 2018 01:52:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77BB67EF8A; Fri, 18 May 2018 01:52:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59E7011A64; Fri, 18 May 2018 01:52:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I1qqhs013918; Fri, 18 May 2018 01:52:52 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I1qpxs013915; Fri, 18 May 2018 01:52:51 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805180152.w4I1qpxs013915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 01:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333775 - in head/sys: kern net sys tests/epoch X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern net sys tests/epoch X-SVN-Commit-Revision: 333775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 01:52:53 -0000 Author: mmacy Date: Fri May 18 01:52:51 2018 New Revision: 333775 URL: https://svnweb.freebsd.org/changeset/base/333775 Log: epoch: add non-preemptible "critical" variant adds: - epoch_enter_critical() - can be called inside a different epoch, starts a section that will acquire any MTX_DEF mutexes or do anything that might sleep. - epoch_exit_critical() - corresponding exit call - epoch_wait_critical() - wait variant that is guaranteed that any threads in a section are running. - epoch_global_critical - an epoch_wait_critical safe epoch instance Requested by: markj Approved by: sbruno Modified: head/sys/kern/subr_epoch.c head/sys/net/if.c head/sys/sys/epoch.h head/sys/tests/epoch/epoch_test.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Thu May 17 23:59:56 2018 (r333774) +++ head/sys/kern/subr_epoch.c Fri May 18 01:52:51 2018 (r333775) @@ -83,6 +83,12 @@ SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, nconte static counter_u64_t switch_count; SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, switches, CTLFLAG_RW, &switch_count, "# of times a thread voluntarily context switched in epoch_wait"); +static counter_u64_t epoch_call_count; +SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, epoch_calls, CTLFLAG_RW, + &epoch_call_count, "# of times a callback was deferred"); +static counter_u64_t epoch_call_task_count; +SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, epoch_call_tasks, CTLFLAG_RW, + &epoch_call_task_count, "# of times a callback task was run"); TAILQ_HEAD(threadlist, thread); @@ -103,9 +109,8 @@ struct epoch_pcpu_state { struct epoch { struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); struct epoch_pcpu_state *e_pcpu_dom[MAXMEMDOM] __aligned(EPOCH_ALIGN); - counter_u64_t e_frees; - uint64_t e_free_last; int e_idx; + int e_flags; struct epoch_pcpu_state *e_pcpu[0]; }; @@ -119,7 +124,7 @@ static __read_mostly int domoffsets[MAXMEMDOM]; static __read_mostly int inited; static __read_mostly int epoch_count; __read_mostly epoch_t global_epoch; -static __read_mostly epoch_t private_epoch; +__read_mostly epoch_t global_epoch_critical; static void epoch_call_task(void *context __unused); @@ -161,8 +166,8 @@ epoch_init(void *arg __unused) taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, "epoch call task"); } inited = 1; - global_epoch = epoch_alloc(); - private_epoch = epoch_alloc(); + global_epoch = epoch_alloc(0); + global_epoch_critical = epoch_alloc(EPOCH_CRITICAL); } SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); @@ -206,7 +211,7 @@ epoch_init_legacy(epoch_t epoch) } epoch_t -epoch_alloc(void) +epoch_alloc(int flags) { epoch_t epoch; @@ -215,12 +220,12 @@ epoch_alloc(void) epoch = malloc(sizeof(struct epoch) + mp_ncpus*sizeof(void*), M_EPOCH, M_ZERO|M_WAITOK); ck_epoch_init(&epoch->e_epoch); - epoch->e_frees = counter_u64_alloc(M_WAITOK); if (usedomains) epoch_init_numa(epoch); else epoch_init_legacy(epoch); MPASS(epoch_count < MAX_EPOCHS-2); + epoch->e_flags = flags; epoch->e_idx = epoch_count; allepochs[epoch_count++] = epoch; return (epoch); @@ -240,11 +245,7 @@ epoch_free(epoch_t epoch) } #endif allepochs[epoch->e_idx] = NULL; - epoch_wait(private_epoch); - /* - * Execute any lingering callbacks - */ - counter_u64_free(epoch->e_frees); + epoch_wait_critical(global_epoch_critical); if (usedomains) for (domain = 0; domain < vm_ndomains; domain++) free_domain(epoch->e_pcpu_dom[domain], M_EPOCH); @@ -289,14 +290,21 @@ epoch_enter_internal(epoch_t epoch, struct thread *td) } -static void -epoch_enter_private(ck_epoch_section_t *section) +void +epoch_enter_critical(epoch_t epoch) { - struct epoch_pcpu_state *eps; + ck_epoch_record_t *record; + ck_epoch_section_t *section; + struct thread *td; - MPASS(curthread->td_critnest); - eps = private_epoch->e_pcpu[curcpu]; - ck_epoch_begin(&eps->eps_record.er_record, section); + section = NULL; + td = curthread; + critical_enter(); + if (__predict_true(td->td_epochnest++ == 0)) + section = (ck_epoch_section_t*)&td->td_epoch_section; + + record = &epoch->e_pcpu[curcpu]->eps_record.er_record; + ck_epoch_begin(record, section); } void @@ -321,14 +329,21 @@ epoch_exit_internal(epoch_t epoch, struct thread *td) critical_exit(); } -static void -epoch_exit_private(ck_epoch_section_t *section) +void +epoch_exit_critical(epoch_t epoch) { - struct epoch_pcpu_state *eps; + ck_epoch_record_t *record; + ck_epoch_section_t *section; + struct thread *td; - MPASS(curthread->td_critnest); - eps = private_epoch->e_pcpu[curcpu]; - ck_epoch_end(&eps->eps_record.er_record, section); + section = NULL; + td = curthread; + MPASS(td->td_critnest); + if (__predict_true(td->td_epochnest-- == 1)) + section = (ck_epoch_section_t*)&td->td_epoch_section; + record = &epoch->e_pcpu[curcpu]->eps_record.er_record; + ck_epoch_end(record, section); + critical_exit(); } /* @@ -517,7 +532,24 @@ epoch_wait(epoch_t epoch) ("%d residual locks held", td->td_locks - locks)); } +static void +epoch_block_handler_critical(struct ck_epoch *g __unused, ck_epoch_record_t *c __unused, + void *arg __unused) +{ + cpu_spinwait(); +} + void +epoch_wait_critical(epoch_t epoch) +{ + + MPASS(epoch->e_flags & EPOCH_CRITICAL); + critical_enter(); + ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_critical, NULL); + critical_exit(); +} + +void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)) { struct epoch_pcpu_state *eps; @@ -530,8 +562,6 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* if (__predict_false(epoch == NULL)) goto boottime; - counter_u64_add(epoch->e_frees, 1); - critical_enter(); *DPCPU_PTR(epoch_cb_count) += 1; eps = epoch->e_pcpu[curcpu]; @@ -542,20 +572,18 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* callback(ctx); } - static void epoch_call_task(void *arg __unused) { ck_stack_entry_t *cursor, *head, *next; ck_epoch_record_t *record; - ck_epoch_section_t section; epoch_t epoch; ck_stack_t cb_stack; int i, npending, total; ck_stack_init(&cb_stack); critical_enter(); - epoch_enter_private(§ion); + epoch_enter_critical(global_epoch_critical); for (total = i = 0; i < epoch_count; i++) { if (__predict_false((epoch = allepochs[i]) == NULL)) continue; @@ -565,9 +593,12 @@ epoch_call_task(void *arg __unused) ck_epoch_poll_deferred(record, &cb_stack); total += npending - record->n_pending; } - epoch_exit_private(§ion); + epoch_exit_critical(global_epoch_critical); *DPCPU_PTR(epoch_cb_count) -= total; critical_exit(); + + counter_u64_add(epoch_call_count, total); + counter_u64_add(epoch_call_task_count, 1); head = ck_stack_batch_pop_npsc(&cb_stack); for (cursor = head; cursor != NULL; cursor = next) { Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu May 17 23:59:56 2018 (r333774) +++ head/sys/net/if.c Fri May 18 01:52:51 2018 (r333775) @@ -903,7 +903,7 @@ if_attachdomain(void *dummy) { struct ifnet *ifp; - net_epoch = epoch_alloc(); + net_epoch = epoch_alloc(0); TAILQ_FOREACH(ifp, &V_ifnet, if_link) if_attachdomain1(ifp); } Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Thu May 17 23:59:56 2018 (r333774) +++ head/sys/sys/epoch.h Fri May 18 01:52:51 2018 (r333775) @@ -35,7 +35,10 @@ struct epoch; typedef struct epoch *epoch_t; +#define EPOCH_CRITICAL 0x1 + extern epoch_t global_epoch; +extern epoch_t global_epoch_critical; DPCPU_DECLARE(int, epoch_cb_count); DPCPU_DECLARE(struct grouptask, epoch_cb_task); @@ -45,11 +48,14 @@ struct epoch_context { typedef struct epoch_context *epoch_context_t; -epoch_t epoch_alloc(void); +epoch_t epoch_alloc(int flags); void epoch_free(epoch_t epoch); +void epoch_enter_critical(epoch_t epoch); void epoch_enter_internal(epoch_t epoch, struct thread *td); +void epoch_exit_critical(epoch_t epoch); void epoch_exit_internal(epoch_t epoch, struct thread *td); void epoch_wait(epoch_t epoch); +void epoch_wait_critical(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(void); Modified: head/sys/tests/epoch/epoch_test.c ============================================================================== --- head/sys/tests/epoch/epoch_test.c Thu May 17 23:59:56 2018 (r333774) +++ head/sys/tests/epoch/epoch_test.c Fri May 18 01:52:51 2018 (r333775) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -138,7 +139,7 @@ test_modinit(void) int i, error, pri_range, pri_off; pri_range = PRI_MIN_TIMESHARE - PRI_MIN_REALTIME; - test_epoch = epoch_alloc(); + test_epoch = epoch_alloc(0); for (i = 0; i < mp_ncpus*2; i++) { etilist[i].threadid = i; error = kthread_add(testloop, &etilist[i], NULL, &testthreads[i], From owner-svn-src-all@freebsd.org Fri May 18 01:54:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E02D1EE5E30; Fri, 18 May 2018 01:54:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92A967F0FC; Fri, 18 May 2018 01:54:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 5341716A4F; Fri, 18 May 2018 01:54:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f169.google.com with SMTP id g14-v6so4363334ioc.7; Thu, 17 May 2018 18:54:19 -0700 (PDT) X-Gm-Message-State: ALKqPwdz/YEG53aUJ3xMxiL7uETeo3BUbmVmnDemfb5OuX7rEX170duO XgrpRa3Z0y49OIg6L4PUAuzPEWV3sbITT9eUGZg= X-Google-Smtp-Source: AB8JxZplrnEWBgJ8TM4UrgldaRRy+OpZRvBS+esodLfEsRDtoKOxZLVec6OtGvXfi1DNHV11kIWZSgkQ4DdK0iAn66s= X-Received: by 2002:a6b:3b42:: with SMTP id i63-v6mr8409355ioa.133.1526608458621; Thu, 17 May 2018 18:54:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3e4a:0:0:0:0:0 with HTTP; Thu, 17 May 2018 18:54:18 -0700 (PDT) In-Reply-To: <201805180152.w4I1qpxs013915@repo.freebsd.org> References: <201805180152.w4I1qpxs013915@repo.freebsd.org> From: Matthew Macy Date: Thu, 17 May 2018 18:54:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333775 - in head/sys: kern net sys tests/epoch To: 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 01:54:20 -0000 > - epoch_enter_critical() - can be called inside a different epoch, > starts a section that will acquire any MTX_DEF mutexes or do > anything that might sleep. Should read will _not_ acquire ... > - epoch_exit_critical() - corresponding exit call > - epoch_wait_critical() - wait variant that is guaranteed that any > threads in a section are running. > - epoch_global_critical - an epoch_wait_critical safe epoch instance > > Requested by: markj > Approved by: sbruno > > Modified: > head/sys/kern/subr_epoch.c > head/sys/net/if.c > head/sys/sys/epoch.h > head/sys/tests/epoch/epoch_test.c > > Modified: head/sys/kern/subr_epoch.c > ============================================================================== > --- head/sys/kern/subr_epoch.c Thu May 17 23:59:56 2018 (r333774) > +++ head/sys/kern/subr_epoch.c Fri May 18 01:52:51 2018 (r333775) > @@ -83,6 +83,12 @@ SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, nconte > static counter_u64_t switch_count; > SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, switches, CTLFLAG_RW, > &switch_count, "# of times a thread voluntarily context switched in epoch_wait"); > +static counter_u64_t epoch_call_count; > +SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, epoch_calls, CTLFLAG_RW, > + &epoch_call_count, "# of times a callback was deferred"); > +static counter_u64_t epoch_call_task_count; > +SYSCTL_COUNTER_U64(_kern_epoch_stats, OID_AUTO, epoch_call_tasks, CTLFLAG_RW, > + &epoch_call_task_count, "# of times a callback task was run"); > > TAILQ_HEAD(threadlist, thread); > > @@ -103,9 +109,8 @@ struct epoch_pcpu_state { > struct epoch { > struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); > struct epoch_pcpu_state *e_pcpu_dom[MAXMEMDOM] __aligned(EPOCH_ALIGN); > - counter_u64_t e_frees; > - uint64_t e_free_last; > int e_idx; > + int e_flags; > struct epoch_pcpu_state *e_pcpu[0]; > }; > > @@ -119,7 +124,7 @@ static __read_mostly int domoffsets[MAXMEMDOM]; > static __read_mostly int inited; > static __read_mostly int epoch_count; > __read_mostly epoch_t global_epoch; > -static __read_mostly epoch_t private_epoch; > +__read_mostly epoch_t global_epoch_critical; > > static void epoch_call_task(void *context __unused); > > @@ -161,8 +166,8 @@ epoch_init(void *arg __unused) > taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, "epoch call task"); > } > inited = 1; > - global_epoch = epoch_alloc(); > - private_epoch = epoch_alloc(); > + global_epoch = epoch_alloc(0); > + global_epoch_critical = epoch_alloc(EPOCH_CRITICAL); > } > SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); > > @@ -206,7 +211,7 @@ epoch_init_legacy(epoch_t epoch) > } > > epoch_t > -epoch_alloc(void) > +epoch_alloc(int flags) > { > epoch_t epoch; > > @@ -215,12 +220,12 @@ epoch_alloc(void) > epoch = malloc(sizeof(struct epoch) + mp_ncpus*sizeof(void*), > M_EPOCH, M_ZERO|M_WAITOK); > ck_epoch_init(&epoch->e_epoch); > - epoch->e_frees = counter_u64_alloc(M_WAITOK); > if (usedomains) > epoch_init_numa(epoch); > else > epoch_init_legacy(epoch); > MPASS(epoch_count < MAX_EPOCHS-2); > + epoch->e_flags = flags; > epoch->e_idx = epoch_count; > allepochs[epoch_count++] = epoch; > return (epoch); > @@ -240,11 +245,7 @@ epoch_free(epoch_t epoch) > } > #endif > allepochs[epoch->e_idx] = NULL; > - epoch_wait(private_epoch); > - /* > - * Execute any lingering callbacks > - */ > - counter_u64_free(epoch->e_frees); > + epoch_wait_critical(global_epoch_critical); > if (usedomains) > for (domain = 0; domain < vm_ndomains; domain++) > free_domain(epoch->e_pcpu_dom[domain], M_EPOCH); > @@ -289,14 +290,21 @@ epoch_enter_internal(epoch_t epoch, struct thread *td) > } > > > -static void > -epoch_enter_private(ck_epoch_section_t *section) > +void > +epoch_enter_critical(epoch_t epoch) > { > - struct epoch_pcpu_state *eps; > + ck_epoch_record_t *record; > + ck_epoch_section_t *section; > + struct thread *td; > > - MPASS(curthread->td_critnest); > - eps = private_epoch->e_pcpu[curcpu]; > - ck_epoch_begin(&eps->eps_record.er_record, section); > + section = NULL; > + td = curthread; > + critical_enter(); > + if (__predict_true(td->td_epochnest++ == 0)) > + section = (ck_epoch_section_t*)&td->td_epoch_section; > + > + record = &epoch->e_pcpu[curcpu]->eps_record.er_record; > + ck_epoch_begin(record, section); > } > > void > @@ -321,14 +329,21 @@ epoch_exit_internal(epoch_t epoch, struct thread *td) > critical_exit(); > } > > -static void > -epoch_exit_private(ck_epoch_section_t *section) > +void > +epoch_exit_critical(epoch_t epoch) > { > - struct epoch_pcpu_state *eps; > + ck_epoch_record_t *record; > + ck_epoch_section_t *section; > + struct thread *td; > > - MPASS(curthread->td_critnest); > - eps = private_epoch->e_pcpu[curcpu]; > - ck_epoch_end(&eps->eps_record.er_record, section); > + section = NULL; > + td = curthread; > + MPASS(td->td_critnest); > + if (__predict_true(td->td_epochnest-- == 1)) > + section = (ck_epoch_section_t*)&td->td_epoch_section; > + record = &epoch->e_pcpu[curcpu]->eps_record.er_record; > + ck_epoch_end(record, section); > + critical_exit(); > } > > /* > @@ -517,7 +532,24 @@ epoch_wait(epoch_t epoch) > ("%d residual locks held", td->td_locks - locks)); > } > > +static void > +epoch_block_handler_critical(struct ck_epoch *g __unused, ck_epoch_record_t *c __unused, > + void *arg __unused) > +{ > + cpu_spinwait(); > +} > + > void > +epoch_wait_critical(epoch_t epoch) > +{ > + > + MPASS(epoch->e_flags & EPOCH_CRITICAL); > + critical_enter(); > + ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_critical, NULL); > + critical_exit(); > +} > + > +void > epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)) > { > struct epoch_pcpu_state *eps; > @@ -530,8 +562,6 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* > if (__predict_false(epoch == NULL)) > goto boottime; > > - counter_u64_add(epoch->e_frees, 1); > - > critical_enter(); > *DPCPU_PTR(epoch_cb_count) += 1; > eps = epoch->e_pcpu[curcpu]; > @@ -542,20 +572,18 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* > callback(ctx); > } > > - > static void > epoch_call_task(void *arg __unused) > { > ck_stack_entry_t *cursor, *head, *next; > ck_epoch_record_t *record; > - ck_epoch_section_t section; > epoch_t epoch; > ck_stack_t cb_stack; > int i, npending, total; > > ck_stack_init(&cb_stack); > critical_enter(); > - epoch_enter_private(§ion); > + epoch_enter_critical(global_epoch_critical); > for (total = i = 0; i < epoch_count; i++) { > if (__predict_false((epoch = allepochs[i]) == NULL)) > continue; > @@ -565,9 +593,12 @@ epoch_call_task(void *arg __unused) > ck_epoch_poll_deferred(record, &cb_stack); > total += npending - record->n_pending; > } > - epoch_exit_private(§ion); > + epoch_exit_critical(global_epoch_critical); > *DPCPU_PTR(epoch_cb_count) -= total; > critical_exit(); > + > + counter_u64_add(epoch_call_count, total); > + counter_u64_add(epoch_call_task_count, 1); > > head = ck_stack_batch_pop_npsc(&cb_stack); > for (cursor = head; cursor != NULL; cursor = next) { > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Thu May 17 23:59:56 2018 (r333774) > +++ head/sys/net/if.c Fri May 18 01:52:51 2018 (r333775) > @@ -903,7 +903,7 @@ if_attachdomain(void *dummy) > { > struct ifnet *ifp; > > - net_epoch = epoch_alloc(); > + net_epoch = epoch_alloc(0); > TAILQ_FOREACH(ifp, &V_ifnet, if_link) > if_attachdomain1(ifp); > } > > Modified: head/sys/sys/epoch.h > ============================================================================== > --- head/sys/sys/epoch.h Thu May 17 23:59:56 2018 (r333774) > +++ head/sys/sys/epoch.h Fri May 18 01:52:51 2018 (r333775) > @@ -35,7 +35,10 @@ > struct epoch; > typedef struct epoch *epoch_t; > > +#define EPOCH_CRITICAL 0x1 > + > extern epoch_t global_epoch; > +extern epoch_t global_epoch_critical; > DPCPU_DECLARE(int, epoch_cb_count); > DPCPU_DECLARE(struct grouptask, epoch_cb_task); > > @@ -45,11 +48,14 @@ struct epoch_context { > > typedef struct epoch_context *epoch_context_t; > > -epoch_t epoch_alloc(void); > +epoch_t epoch_alloc(int flags); > void epoch_free(epoch_t epoch); > +void epoch_enter_critical(epoch_t epoch); > void epoch_enter_internal(epoch_t epoch, struct thread *td); > +void epoch_exit_critical(epoch_t epoch); > void epoch_exit_internal(epoch_t epoch, struct thread *td); > void epoch_wait(epoch_t epoch); > +void epoch_wait_critical(epoch_t epoch); > void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); > int in_epoch(void); > > > Modified: head/sys/tests/epoch/epoch_test.c > ============================================================================== > --- head/sys/tests/epoch/epoch_test.c Thu May 17 23:59:56 2018 (r333774) > +++ head/sys/tests/epoch/epoch_test.c Fri May 18 01:52:51 2018 (r333775) > @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); > > #include > #include > +#include > #include > #include > #include > @@ -138,7 +139,7 @@ test_modinit(void) > int i, error, pri_range, pri_off; > > pri_range = PRI_MIN_TIMESHARE - PRI_MIN_REALTIME; > - test_epoch = epoch_alloc(); > + test_epoch = epoch_alloc(0); > for (i = 0; i < mp_ncpus*2; i++) { > etilist[i].threadid = i; > error = kthread_add(testloop, &etilist[i], NULL, &testthreads[i], > From owner-svn-src-all@freebsd.org Fri May 18 02:57:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10110EE7097; Fri, 18 May 2018 02:57:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC1480ECB; Fri, 18 May 2018 02:57:39 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EDC612411; Fri, 18 May 2018 02:57:39 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I2vdXT044088; Fri, 18 May 2018 02:57:39 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I2vd8x044087; Fri, 18 May 2018 02:57:39 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805180257.w4I2vd8x044087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 02:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333776 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 02:57:40 -0000 Author: mmacy Date: Fri May 18 02:57:39 2018 New Revision: 333776 URL: https://svnweb.freebsd.org/changeset/base/333776 Log: epoch: actually allocate the counters we've assigned sysctls too Approved by: sbruno Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri May 18 01:52:51 2018 (r333775) +++ head/sys/kern/subr_epoch.c Fri May 18 02:57:39 2018 (r333776) @@ -142,6 +142,8 @@ epoch_init(void *arg __unused) migrate_count = counter_u64_alloc(M_WAITOK); turnstile_count = counter_u64_alloc(M_WAITOK); switch_count = counter_u64_alloc(M_WAITOK); + epoch_call_count = counter_u64_alloc(M_WAITOK); + epoch_call_task_count = counter_u64_alloc(M_WAITOK); if (usedomains == false) goto done; count = domain = 0; From owner-svn-src-all@freebsd.org Fri May 18 02:58:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0F8EE7135; Fri, 18 May 2018 02:58:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DAC881010; Fri, 18 May 2018 02:58:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EC5A12413; Fri, 18 May 2018 02:58:27 +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 w4I2wQ4k044160; Fri, 18 May 2018 02:58:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I2wQ3j044159; Fri, 18 May 2018 02:58:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805180258.w4I2wQ3j044159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 May 2018 02:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333777 - head/sys/dev/vt/hw/vga X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/vt/hw/vga X-SVN-Commit-Revision: 333777 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 02:58:28 -0000 Author: emaste Date: Fri May 18 02:58:26 2018 New Revision: 333777 URL: https://svnweb.freebsd.org/changeset/base/333777 Log: vt: add more cp437 mappings for vga textmode In UTF-8 locales mandoc uses a number of characters outside of the Basic Latin group, e.g. from general punctuation or miscellaneous mathematical symbols, and these rendered as ? in text mode. This change adds (char, replacement, code point, description): ¦ | U+00A6 Broken bar ✓ √ U+2713 Checkmark Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/hw/vga/vt_vga.c Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Fri May 18 02:57:39 2018 (r333776) +++ head/sys/dev/vt/hw/vga/vt_vga.c Fri May 18 02:58:26 2018 (r333777) @@ -205,6 +205,7 @@ static const struct unicp437 cp437table[] = { { 0x0020, 0x20, 0x5e }, { 0x00a0, 0x20, 0x00 }, { 0x00a1, 0xad, 0x00 }, { 0x00a2, 0x9b, 0x00 }, { 0x00a3, 0x9c, 0x00 }, { 0x00a5, 0x9d, 0x00 }, + { 0x00a6, 0x7c, 0x00 }, { 0x00a7, 0x15, 0x00 }, { 0x00aa, 0xa6, 0x00 }, { 0x00ab, 0xae, 0x00 }, { 0x00ac, 0xaa, 0x00 }, { 0x00b0, 0xf8, 0x00 }, { 0x00b1, 0xf1, 0x00 }, @@ -287,8 +288,8 @@ static const struct unicp437 cp437table[] = { { 0x2640, 0x0c, 0x00 }, { 0x2642, 0x0b, 0x00 }, { 0x2660, 0x06, 0x00 }, { 0x2663, 0x05, 0x00 }, { 0x2665, 0x03, 0x01 }, { 0x266a, 0x0d, 0x00 }, - { 0x266c, 0x0e, 0x00 }, { 0x27e8, 0x3c, 0x00 }, - { 0x27e9, 0x3e, 0x00 }, + { 0x266c, 0x0e, 0x00 }, { 0x2713, 0xfb, 0x00 }, + { 0x27e8, 0x3c, 0x00 }, { 0x27e9, 0x3e, 0x00 }, }; static uint8_t From owner-svn-src-all@freebsd.org Fri May 18 03:38:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41949EE81A4; Fri, 18 May 2018 03:38:20 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E199082FE9; Fri, 18 May 2018 03:38:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A86A212B1E; Fri, 18 May 2018 03:38:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I3cJq7065231; Fri, 18 May 2018 03:38:19 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I3cHln065221; Fri, 18 May 2018 03:38:17 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805180338.w4I3cHln065221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 03:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333778 - in head/sys: conf dev/netmap X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf dev/netmap X-SVN-Commit-Revision: 333778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 03:38:20 -0000 Author: mmacy Date: Fri May 18 03:38:17 2018 New Revision: 333778 URL: https://svnweb.freebsd.org/changeset/base/333778 Log: netmap: pull fix for 32-bit support from upstream Approved by: sbruno Modified: head/sys/conf/makeLINT.mk head/sys/dev/netmap/if_ptnet.c head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/netmap/netmap_legacy.c head/sys/dev/netmap/netmap_mem2.c head/sys/dev/netmap/netmap_monitor.c head/sys/dev/netmap/netmap_pipe.c head/sys/dev/netmap/netmap_pt.c head/sys/dev/netmap/netmap_vale.c Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Fri May 18 02:58:26 2018 (r333777) +++ head/sys/conf/makeLINT.mk Fri May 18 03:38:17 2018 (r333778) @@ -53,7 +53,6 @@ LINT: ${NOTES} ${MAKELINT_SED} .if ${TARGET} == "powerpc" # cat is available, not sure if cp is? cat ${.TARGET} > ${.TARGET}64 - echo "nodevice netmap" >> ${.TARGET} echo "machine ${TARGET} powerpc" >> ${.TARGET} echo "machine ${TARGET} powerpc64" >> ${.TARGET}64 .endif Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/if_ptnet.c Fri May 18 03:38:17 2018 (r333778) @@ -210,7 +210,7 @@ static int ptnet_irqs_init(struct ptnet_softc *sc); static void ptnet_irqs_fini(struct ptnet_softc *sc); static uint32_t ptnet_nm_ptctl(if_t ifp, uint32_t cmd); -static int ptnet_nm_config(struct netmap_adapter *na, +static int ptnet_nm_config(struct netmap_adapter *na, struct nm_config_info *info); static void ptnet_update_vnet_hdr(struct ptnet_softc *sc); static int ptnet_nm_register(struct netmap_adapter *na, int onoff); Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap.c Fri May 18 03:38:17 2018 (r333778) @@ -536,35 +536,35 @@ SYSBEGIN(main_init); SYSCTL_DECL(_dev_netmap); SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, - CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); + CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, - CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); + CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, - 0, "Always look for new received packets."); + 0, "Always look for new received packets."); SYSCTL_INT(_dev_netmap, OID_AUTO, txsync_retry, CTLFLAG_RW, - &netmap_txsync_retry, 0, "Number of txsync loops in bridge's flush."); + &netmap_txsync_retry, 0, "Number of txsync loops in bridge's flush."); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0, - "Force NR_FORWARD mode"); + "Force NR_FORWARD mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, admode, CTLFLAG_RW, &netmap_admode, 0, - "Adapter mode. 0 selects the best option available," - "1 forces native adapter, 2 forces emulated adapter"); + "Adapter mode. 0 selects the best option available," + "1 forces native adapter, 2 forces emulated adapter"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_mit, CTLFLAG_RW, &netmap_generic_mit, - 0, "RX notification interval in nanoseconds"); + 0, "RX notification interval in nanoseconds"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, - &netmap_generic_ringsize, 0, - "Number of per-ring slots for emulated netmap mode"); + &netmap_generic_ringsize, 0, + "Number of per-ring slots for emulated netmap mode"); SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, - &netmap_generic_rings, 0, - "Number of TX/RX queues for emulated netmap adapters"); + &netmap_generic_rings, 0, + "Number of TX/RX queues for emulated netmap adapters"); #ifdef linux SYSCTL_INT(_dev_netmap, OID_AUTO, generic_txqdisc, CTLFLAG_RW, - &netmap_generic_txqdisc, 0, "Use qdisc for generic adapters"); + &netmap_generic_txqdisc, 0, "Use qdisc for generic adapters"); #endif SYSCTL_INT(_dev_netmap, OID_AUTO, ptnet_vnet_hdr, CTLFLAG_RW, &ptnet_vnet_hdr, - 0, "Allow ptnet devices to use virtio-net headers"); + 0, "Allow ptnet devices to use virtio-net headers"); SYSCTL_INT(_dev_netmap, OID_AUTO, ptnetmap_tx_workers, CTLFLAG_RW, - &ptnetmap_tx_workers, 0, "Use worker threads for pnetmap TX processing"); + &ptnetmap_tx_workers, 0, "Use worker threads for pnetmap TX processing"); SYSEND; @@ -765,15 +765,15 @@ netmap_update_config(struct netmap_adapter *na) na->rx_buf_maxsize == info.rx_buf_maxsize) return 0; /* nothing changed */ if (na->active_fds == 0) { - D("configuration changed for %s: txring %d x %d, " - "rxring %d x %d, rxbufsz %d", - na->name, na->num_tx_rings, na->num_tx_desc, - na->num_rx_rings, na->num_rx_desc, na->rx_buf_maxsize); na->num_tx_rings = info.num_tx_rings; na->num_tx_desc = info.num_tx_descs; na->num_rx_rings = info.num_rx_rings; na->num_rx_desc = info.num_rx_descs; na->rx_buf_maxsize = info.rx_buf_maxsize; + D("configuration changed for %s: txring %d x %d, " + "rxring %d x %d, rxbufsz %d", + na->name, na->num_tx_rings, na->num_tx_desc, + na->num_rx_rings, na->num_rx_desc, na->rx_buf_maxsize); return 0; } D("WARNING: configuration changed for %s while active: " @@ -830,7 +830,7 @@ netmap_krings_create(struct netmap_adapter *na, u_int n[NR_TX] = na->num_tx_rings + 1; n[NR_RX] = na->num_rx_rings + 1; - len = (n[NR_TX] + n[NR_RX]) * + len = (n[NR_TX] + n[NR_RX]) * (sizeof(struct netmap_kring) + sizeof(struct netmap_kring *)) + tailroom; @@ -841,7 +841,7 @@ netmap_krings_create(struct netmap_adapter *na, u_int } na->rx_rings = na->tx_rings + n[NR_TX]; na->tailroom = na->rx_rings + n[NR_RX]; - + /* link the krings in the krings array */ kring = (struct netmap_kring *)((char *)na->tailroom + tailroom); for (i = 0; i < n[NR_TX] + n[NR_RX]; i++) { @@ -1006,9 +1006,9 @@ netmap_do_unregif(struct netmap_priv_d *priv) if (netmap_verbose) D("deleting last instance for %s", na->name); - if (nm_netmap_on(na)) { - D("BUG: netmap on while going to delete the krings"); - } + if (nm_netmap_on(na)) { + D("BUG: netmap on while going to delete the krings"); + } na->nm_krings_delete(na); } @@ -1324,7 +1324,7 @@ netmap_rxsync_from_host(struct netmap_kring *kring, in m_copydata(m, 0, len, NMB(na, slot)); ND("nm %d len %d", nm_i, len); if (netmap_verbose) - D("%s", nm_dump_buf(NMB(na, slot),len, 128, NULL)); + D("%s", nm_dump_buf(NMB(na, slot),len, 128, NULL)); slot->len = len; slot->flags = 0; @@ -1476,7 +1476,7 @@ netmap_get_na(struct nmreq_header *hdr, struct netmap_adapter **na, struct ifnet **ifp, struct netmap_mem_d *nmd, int create) { - struct nmreq_register *req = (struct nmreq_register *)hdr->nr_body; + struct nmreq_register *req = (struct nmreq_register *)(uintptr_t)hdr->nr_body; int error = 0; struct netmap_adapter *ret = NULL; int nmd_ref = 0; @@ -2091,9 +2091,6 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net NMG_LOCK_ASSERT(); priv->np_na = na; /* store the reference */ - error = netmap_set_ringid(priv, nr_mode, nr_ringid, nr_flags); - if (error) - goto err; error = netmap_mem_finalize(na->nm_mem, na); if (error) goto err; @@ -2109,7 +2106,14 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net /* ring configuration may have changed, fetch from the card */ netmap_update_config(na); + } + /* compute the range of tx and rx rings to monitor */ + error = netmap_set_ringid(priv, nr_mode, nr_ringid, nr_flags); + if (error) + goto err_put_lut; + + if (na->active_fds == 0) { /* * If this is the first registration of the adapter, * perform sanity checks and create the in-kernel view @@ -2117,12 +2121,18 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net */ if (na->ifp && nm_priv_rx_enabled(priv)) { /* This netmap adapter is attached to an ifnet. */ - unsigned nbs = netmap_mem_bufsize(na->nm_mem); + unsigned nbs = NETMAP_BUF_SIZE(na); unsigned mtu = nm_os_ifnet_mtu(na->ifp); - ND("mtu %d rx_buf_maxsize %d netmap_buf_size %d", - mtu, na->rx_buf_maxsize, nbs); + ND("%s: mtu %d rx_buf_maxsize %d netmap_buf_size %d", + na->name, mtu, na->rx_buf_maxsize, nbs); + if (na->rx_buf_maxsize == 0) { + D("%s: error: rx_buf_maxsize == 0", na->name); + error = EIO; + goto err_drop_mem; + } + if (mtu <= na->rx_buf_maxsize) { /* The MTU fits a single NIC slot. We only * Need to check that netmap buffers are @@ -2191,7 +2201,7 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net nifp = netmap_mem_if_new(na, priv); if (nifp == NULL) { error = ENOMEM; - goto err_del_rings; + goto err_rel_excl; } if (nm_kring_pending(priv)) { @@ -2217,10 +2227,9 @@ netmap_do_regif(struct netmap_priv_d *priv, struct net err_del_if: netmap_mem_if_delete(na, nifp); -err_del_rings: - netmap_mem_rings_delete(na); err_rel_excl: netmap_krings_put(priv); + netmap_mem_rings_delete(na); err_del_krings: if (na->active_fds == 0) na->nm_krings_delete(na); @@ -2313,8 +2322,8 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c * For convenince, the nr_body pointer and the pointers * in the options list will be replaced with their * kernel-space counterparts. The original pointers are - * saved internally and later restored by nmreq_copyout - */ + * saved internally and later restored by nmreq_copyout + */ error = nmreq_copyin(hdr, nr_body_is_user); if (error) { return error; @@ -2326,7 +2335,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c switch (hdr->nr_reqtype) { case NETMAP_REQ_REGISTER: { struct nmreq_register *req = - (struct nmreq_register *)hdr->nr_body; + (struct nmreq_register *)(uintptr_t)hdr->nr_body; /* Protect access to priv from concurrent requests. */ NMG_LOCK(); do { @@ -2341,7 +2350,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } #ifdef WITH_EXTMEM - opt = nmreq_findoption((struct nmreq_option *)hdr->nr_options, + opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)hdr->nr_options, NETMAP_REQ_OPT_EXTMEM); if (opt != NULL) { struct nmreq_opt_extmem *e = @@ -2444,7 +2453,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c case NETMAP_REQ_PORT_INFO_GET: { struct nmreq_port_info_get *req = - (struct nmreq_port_info_get *)hdr->nr_body; + (struct nmreq_port_info_get *)(uintptr_t)hdr->nr_body; NMG_LOCK(); do { @@ -2463,10 +2472,10 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c /* get a refcount */ hdr->nr_reqtype = NETMAP_REQ_REGISTER; - hdr->nr_body = (uint64_t)®req; + hdr->nr_body = (uintptr_t)®req; error = netmap_get_na(hdr, &na, &ifp, NULL, 1 /* create */); hdr->nr_reqtype = NETMAP_REQ_PORT_INFO_GET; /* reset type */ - hdr->nr_body = (uint64_t)req; /* reset nr_body */ + hdr->nr_body = (uintptr_t)req; /* reset nr_body */ if (error) { na = NULL; ifp = NULL; @@ -2517,7 +2526,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c case NETMAP_REQ_PORT_HDR_SET: { struct nmreq_port_hdr *req = - (struct nmreq_port_hdr *)hdr->nr_body; + (struct nmreq_port_hdr *)(uintptr_t)hdr->nr_body; /* Build a nmreq_register out of the nmreq_port_hdr, * so that we can call netmap_get_bdg_na(). */ struct nmreq_register regreq; @@ -2533,10 +2542,10 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c } NMG_LOCK(); hdr->nr_reqtype = NETMAP_REQ_REGISTER; - hdr->nr_body = (uint64_t)®req; + hdr->nr_body = (uintptr_t)®req; error = netmap_get_bdg_na(hdr, &na, NULL, 0); hdr->nr_reqtype = NETMAP_REQ_PORT_HDR_SET; - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; if (na && !error) { struct netmap_vp_adapter *vpna = (struct netmap_vp_adapter *)na; @@ -2556,7 +2565,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c case NETMAP_REQ_PORT_HDR_GET: { /* Get vnet-header length for this netmap port */ struct nmreq_port_hdr *req = - (struct nmreq_port_hdr *)hdr->nr_body; + (struct nmreq_port_hdr *)(uintptr_t)hdr->nr_body; /* Build a nmreq_register out of the nmreq_port_hdr, * so that we can call netmap_get_bdg_na(). */ struct nmreq_register regreq; @@ -2565,10 +2574,10 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c bzero(®req, sizeof(regreq)); NMG_LOCK(); hdr->nr_reqtype = NETMAP_REQ_REGISTER; - hdr->nr_body = (uint64_t)®req; + hdr->nr_body = (uintptr_t)®req; error = netmap_get_na(hdr, &na, &ifp, NULL, 0); hdr->nr_reqtype = NETMAP_REQ_PORT_HDR_GET; - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; if (na && !error) { req->nr_hdr_len = na->virt_hdr_len; } @@ -2595,7 +2604,7 @@ netmap_ioctl(struct netmap_priv_d *priv, u_long cmd, c #endif /* WITH_VALE */ case NETMAP_REQ_POOLS_INFO_GET: { struct nmreq_pools_info *req = - (struct nmreq_pools_info *)hdr->nr_body; + (struct nmreq_pools_info *)(uintptr_t)hdr->nr_body; /* Get information from the memory allocator. This * netmap device must already be bound to a port. * Note that hdr->nr_name is ignored. */ @@ -2774,8 +2783,8 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ error = EMSGSIZE; goto out_err; } - if ((rqsz && hdr->nr_body == (uint64_t)NULL) || - (!rqsz && hdr->nr_body != (uint64_t)NULL)) { + if ((rqsz && hdr->nr_body == (uintptr_t)NULL) || + (!rqsz && hdr->nr_body != (uintptr_t)NULL)) { /* Request body expected, but not found; or * request body found but unexpected. */ error = EINVAL; @@ -2784,8 +2793,8 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ bufsz = 2 * sizeof(void *) + rqsz; optsz = 0; - for (src = (struct nmreq_option *)hdr->nr_options; src; - src = (struct nmreq_option *)buf.nro_next) + for (src = (struct nmreq_option *)(uintptr_t)hdr->nr_options; src; + src = (struct nmreq_option *)(uintptr_t)buf.nro_next) { error = copyin(src, &buf, sizeof(*src)); if (error) @@ -2813,11 +2822,11 @@ nmreq_copyin(struct nmreq_header *hdr, int nr_body_is_ p = (char *)ptrs; /* copy the body */ - error = copyin((void *)hdr->nr_body, p, rqsz); + error = copyin((void *)(uintptr_t)hdr->nr_body, p, rqsz); if (error) goto out_restore; /* overwrite the user pointer with the in-kernel one */ - hdr->nr_body = (uint64_t)p; + hdr->nr_body = (uintptr_t)p; p += rqsz; /* copy the options */ @@ -2874,7 +2883,7 @@ static int nmreq_copyout(struct nmreq_header *hdr, int rerror) { struct nmreq_option *src, *dst; - void *ker = (void *)hdr->nr_body, *bufstart; + void *ker = (void *)(uintptr_t)hdr->nr_body, *bufstart; uint64_t *ptrs; size_t bodysz; int error; @@ -2886,13 +2895,13 @@ nmreq_copyout(struct nmreq_header *hdr, int rerror) ptrs = (uint64_t *)ker - 2; bufstart = ptrs; hdr->nr_body = *ptrs++; - src = (struct nmreq_option *)hdr->nr_options; + src = (struct nmreq_option *)(uintptr_t)hdr->nr_options; hdr->nr_options = *ptrs; if (!rerror) { /* copy the body */ bodysz = nmreq_size_by_type(hdr->nr_reqtype); - error = copyout(ker, (void *)hdr->nr_body, bodysz); + error = copyout(ker, (void *)(uintptr_t)hdr->nr_body, bodysz); if (error) { rerror = error; goto out; @@ -2900,7 +2909,7 @@ nmreq_copyout(struct nmreq_header *hdr, int rerror) } /* copy the options */ - dst = (struct nmreq_option *)hdr->nr_options; + dst = (struct nmreq_option *)(uintptr_t)hdr->nr_options; while (src) { size_t optsz; uint64_t next; @@ -2916,7 +2925,7 @@ nmreq_copyout(struct nmreq_header *hdr, int rerror) rerror = error; goto out; } - + /* copy the option body only if there was no error */ if (!rerror && !src->nro_status) { optsz = nmreq_opt_size_by_type(src->nro_reqtype); @@ -2928,8 +2937,8 @@ nmreq_copyout(struct nmreq_header *hdr, int rerror) } } } - src = (struct nmreq_option *)next; - dst = (struct nmreq_option *)*ptrs; + src = (struct nmreq_option *)(uintptr_t)next; + dst = (struct nmreq_option *)(uintptr_t)*ptrs; } @@ -2942,7 +2951,7 @@ out: struct nmreq_option * nmreq_findoption(struct nmreq_option *opt, uint16_t reqtype) { - for ( ; opt; opt = (struct nmreq_option *)opt->nro_next) + for ( ; opt; opt = (struct nmreq_option *)(uintptr_t)opt->nro_next) if (opt->nro_reqtype == reqtype) return opt; return NULL; @@ -2953,7 +2962,7 @@ nmreq_checkduplicate(struct nmreq_option *opt) { uint16_t type = opt->nro_reqtype; int dup = 0; - while ((opt = nmreq_findoption((struct nmreq_option *)opt->nro_next, + while ((opt = nmreq_findoption((struct nmreq_option *)(uintptr_t)opt->nro_next, type))) { dup++; opt->nro_status = EINVAL; @@ -2969,8 +2978,8 @@ nmreq_checkoptions(struct nmreq_header *hdr) * marked as not supported */ - for (opt = (struct nmreq_option *)hdr->nr_options; opt; - opt = (struct nmreq_option *)opt->nro_next) + for (opt = (struct nmreq_option *)(uintptr_t)hdr->nr_options; opt; + opt = (struct nmreq_option *)(uintptr_t)opt->nro_next) if (opt->nro_status == EOPNOTSUPP) return EOPNOTSUPP; @@ -3643,9 +3652,9 @@ netmap_transmit(struct ifnet *ifp, struct mbuf *m) */ mbq_lock(q); - busy = kring->nr_hwtail - kring->nr_hwcur; - if (busy < 0) - busy += kring->nkr_num_slots; + busy = kring->nr_hwtail - kring->nr_hwcur; + if (busy < 0) + busy += kring->nkr_num_slots; if (busy + mbq_len(q) >= kring->nkr_num_slots - 1) { RD(2, "%s full hwcur %d hwtail %d qlen %d", na->name, kring->nr_hwcur, kring->nr_hwtail, mbq_len(q)); Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap_freebsd.c Fri May 18 03:38:17 2018 (r333778) @@ -138,13 +138,13 @@ nm_os_put_module(void) static void netmap_ifnet_arrival_handler(void *arg __unused, struct ifnet *ifp) { - netmap_undo_zombie(ifp); + netmap_undo_zombie(ifp); } static void netmap_ifnet_departure_handler(void *arg __unused, struct ifnet *ifp) { - netmap_make_zombie(ifp); + netmap_make_zombie(ifp); } static eventhandler_tag nm_ifnet_ah_tag; @@ -153,33 +153,33 @@ static eventhandler_tag nm_ifnet_dh_tag; int nm_os_ifnet_init(void) { - nm_ifnet_ah_tag = - EVENTHANDLER_REGISTER(ifnet_arrival_event, - netmap_ifnet_arrival_handler, - NULL, EVENTHANDLER_PRI_ANY); - nm_ifnet_dh_tag = - EVENTHANDLER_REGISTER(ifnet_departure_event, - netmap_ifnet_departure_handler, - NULL, EVENTHANDLER_PRI_ANY); - return 0; + nm_ifnet_ah_tag = + EVENTHANDLER_REGISTER(ifnet_arrival_event, + netmap_ifnet_arrival_handler, + NULL, EVENTHANDLER_PRI_ANY); + nm_ifnet_dh_tag = + EVENTHANDLER_REGISTER(ifnet_departure_event, + netmap_ifnet_departure_handler, + NULL, EVENTHANDLER_PRI_ANY); + return 0; } void nm_os_ifnet_fini(void) { - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, - nm_ifnet_ah_tag); - EVENTHANDLER_DEREGISTER(ifnet_departure_event, - nm_ifnet_dh_tag); + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, + nm_ifnet_ah_tag); + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + nm_ifnet_dh_tag); } unsigned nm_os_ifnet_mtu(struct ifnet *ifp) { #if __FreeBSD_version < 1100030 - return ifp->if_data.ifi_mtu; + return ifp->if_data.ifi_mtu; #else /* __FreeBSD_version >= 1100030 */ - return ifp->if_mtu; + return ifp->if_mtu; #endif } @@ -625,14 +625,14 @@ nm_os_vi_detach(struct ifnet *ifp) struct nm_os_extmem { vm_object_t obj; vm_offset_t kva; - vm_offset_t size; - vm_pindex_t scan; + vm_offset_t size; + uintptr_t scan; }; void nm_os_extmem_delete(struct nm_os_extmem *e) { - D("freeing %zx bytes", (size_t)e->size); + D("freeing %jx bytes", (uintmax_t)e->size); vm_map_remove(kernel_map, e->kva, e->kva + e->size); nm_os_free(e); } @@ -701,7 +701,7 @@ nm_os_extmem_create(unsigned long p, struct nmreq_pool VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE, 0); if (rv != KERN_SUCCESS) { - D("vm_map_find(%zx) failed", (size_t)e->size); + D("vm_map_find(%jx) failed", (uintmax_t)e->size); goto out_rel; } rv = vm_map_wire(kernel_map, e->kva, e->kva + e->size, @@ -942,7 +942,7 @@ struct netmap_vm_handle_t { static int netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred, u_short *color) + vm_ooffset_t foff, struct ucred *cred, u_short *color) { struct netmap_vm_handle_t *vmh = handle; @@ -1519,7 +1519,7 @@ freebsd_netmap_poll(struct cdev *cdevi __unused, int e static int freebsd_netmap_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, - int ffla __unused, struct thread *td) + int ffla __unused, struct thread *td) { int error; struct netmap_priv_d *priv; Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap_generic.c Fri May 18 03:38:17 2018 (r333778) @@ -235,14 +235,14 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) for ((_k)=*(_karr), (_i) = 0; (_i) < (_n); (_i)++, (_k) = (_karr)[(_i)]) #define for_each_tx_kring(_i, _k, _na) \ - for_each_kring_n(_i, _k, (_na)->tx_rings, (_na)->num_tx_rings) + for_each_kring_n(_i, _k, (_na)->tx_rings, (_na)->num_tx_rings) #define for_each_tx_kring_h(_i, _k, _na) \ - for_each_kring_n(_i, _k, (_na)->tx_rings, (_na)->num_tx_rings + 1) + for_each_kring_n(_i, _k, (_na)->tx_rings, (_na)->num_tx_rings + 1) #define for_each_rx_kring(_i, _k, _na) \ - for_each_kring_n(_i, _k, (_na)->rx_rings, (_na)->num_rx_rings) + for_each_kring_n(_i, _k, (_na)->rx_rings, (_na)->num_rx_rings) #define for_each_rx_kring_h(_i, _k, _na) \ - for_each_kring_n(_i, _k, (_na)->rx_rings, (_na)->num_rx_rings + 1) + for_each_kring_n(_i, _k, (_na)->rx_rings, (_na)->num_rx_rings + 1) /* ======================== PERFORMANCE STATISTICS =========================== */ @@ -297,12 +297,12 @@ static struct rate_context rate_ctx; void generic_rate(int txp, int txs, int txi, int rxp, int rxs, int rxi) { - if (txp) rate_ctx.new.txpkt++; - if (txs) rate_ctx.new.txsync++; - if (txi) rate_ctx.new.txirq++; - if (rxp) rate_ctx.new.rxpkt++; - if (rxs) rate_ctx.new.rxsync++; - if (rxi) rate_ctx.new.rxirq++; + if (txp) rate_ctx.new.txpkt++; + if (txs) rate_ctx.new.txsync++; + if (txi) rate_ctx.new.txirq++; + if (rxp) rate_ctx.new.rxpkt++; + if (rxs) rate_ctx.new.rxsync++; + if (rxi) rate_ctx.new.rxirq++; } #else /* !RATE */ @@ -586,7 +586,7 @@ generic_mbuf_destructor(struct mbuf *m) * MBUF_TXQ(m) under our feet. If the match is not found * on 'r', we try to see if it belongs to some other ring. */ - for (;;) { + for (;;) { bool match = false; kring = na->tx_rings[r]; Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap_kern.h Fri May 18 03:38:17 2018 (r333778) @@ -450,7 +450,7 @@ struct netmap_kring { /* the adapter the owns this kring */ struct netmap_adapter *na; - + /* the adapter that wants to be notified when this kring has * new slots avaialable. This is usually the same as the above, * but wrappers may let it point to themselves @@ -1528,7 +1528,7 @@ int netmap_get_monitor_na(struct nmreq_header *hdr, st void netmap_monitor_stop(struct netmap_adapter *na); #else #define netmap_get_monitor_na(hdr, _2, _3, _4) \ - (((struct nmreq_register *)hdr->nr_body)->nr_flags & (NR_MONITOR_TX | NR_MONITOR_RX) ? EOPNOTSUPP : 0) + (((struct nmreq_register *)(uintptr_t)hdr->nr_body)->nr_flags & (NR_MONITOR_TX | NR_MONITOR_RX) ? EOPNOTSUPP : 0) #endif #ifdef CONFIG_NET_NS @@ -1823,7 +1823,7 @@ struct lut_entry { }; #else /* linux & _WIN32 */ /* dma-mapping in linux can assign a buffer a different address - * depending on the device, so we need to have a separate + * depending on the device, so we need to have a separate * physical-address look-up table for each na. * We can still share the vaddrs, though, therefore we split * the lut_entry structure. @@ -2177,7 +2177,7 @@ nm_ptnetmap_host_on(struct netmap_adapter *na) } #else /* !WITH_PTNETMAP_HOST */ #define netmap_get_pt_host_na(hdr, _2, _3, _4) \ - (((struct nmreq_register *)hdr->nr_body)->nr_flags & (NR_PTNETMAP_HOST) ? EOPNOTSUPP : 0) + (((struct nmreq_register *)(uintptr_t)hdr->nr_body)->nr_flags & (NR_PTNETMAP_HOST) ? EOPNOTSUPP : 0) #define ptnetmap_ctl(_1, _2, _3) EINVAL #define nm_ptnetmap_host_on(_1) EINVAL #endif /* !WITH_PTNETMAP_HOST */ Modified: head/sys/dev/netmap/netmap_legacy.c ============================================================================== --- head/sys/dev/netmap/netmap_legacy.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap_legacy.c Fri May 18 03:38:17 2018 (r333778) @@ -132,8 +132,8 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) /* First prepare the request header. */ hdr->nr_version = NETMAP_API; /* new API */ strncpy(hdr->nr_name, nmr->nr_name, sizeof(nmr->nr_name)); - hdr->nr_options = (uint64_t)NULL; - hdr->nr_body = (uint64_t)NULL; + hdr->nr_options = (uintptr_t)NULL; + hdr->nr_body = (uintptr_t)NULL; switch (ioctl_cmd) { case NIOCREGIF: { @@ -142,7 +142,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) /* Regular NIOCREGIF operation. */ struct nmreq_register *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = NETMAP_REQ_REGISTER; if (nmreq_register_from_legacy(nmr, hdr, req)) { goto oom; @@ -152,7 +152,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) case NETMAP_BDG_ATTACH: { struct nmreq_vale_attach *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = NETMAP_REQ_VALE_ATTACH; if (nmreq_register_from_legacy(nmr, hdr, &req->reg)) { goto oom; @@ -167,14 +167,14 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) } case NETMAP_BDG_DETACH: { hdr->nr_reqtype = NETMAP_REQ_VALE_DETACH; - hdr->nr_body = (uint64_t)nm_os_malloc(sizeof(struct nmreq_vale_detach)); + hdr->nr_body = (uintptr_t)nm_os_malloc(sizeof(struct nmreq_vale_detach)); break; } case NETMAP_BDG_VNET_HDR: case NETMAP_VNET_HDR_GET: { struct nmreq_port_hdr *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = (nmr->nr_cmd == NETMAP_BDG_VNET_HDR) ? NETMAP_REQ_PORT_HDR_SET : NETMAP_REQ_PORT_HDR_GET; req->nr_hdr_len = nmr->nr_arg1; @@ -183,7 +183,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) case NETMAP_BDG_NEWIF : { struct nmreq_vale_newif *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = NETMAP_REQ_VALE_NEWIF; req->nr_tx_slots = nmr->nr_tx_slots; req->nr_rx_slots = nmr->nr_rx_slots; @@ -200,7 +200,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) case NETMAP_BDG_POLLING_OFF: { struct nmreq_vale_polling *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = (nmr->nr_cmd == NETMAP_BDG_POLLING_ON) ? NETMAP_REQ_VALE_POLLING_ENABLE : NETMAP_REQ_VALE_POLLING_DISABLE; @@ -232,7 +232,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) if (nmr->nr_cmd == NETMAP_BDG_LIST) { struct nmreq_vale_list *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = NETMAP_REQ_VALE_LIST; req->nr_bridge_idx = nmr->nr_arg1; req->nr_port_idx = nmr->nr_arg2; @@ -240,7 +240,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) /* Regular NIOCGINFO. */ struct nmreq_port_info_get *req = nm_os_malloc(sizeof(*req)); if (!req) { goto oom; } - hdr->nr_body = (uint64_t)req; + hdr->nr_body = (uintptr_t)req; hdr->nr_reqtype = NETMAP_REQ_PORT_INFO_GET; req->nr_offset = nmr->nr_offset; req->nr_memsize = nmr->nr_memsize; @@ -258,7 +258,7 @@ nmreq_from_legacy(struct nmreq *nmr, u_long ioctl_cmd) oom: if (hdr) { if (hdr->nr_body) { - nm_os_free((void *)hdr->nr_body); + nm_os_free((void *)(uintptr_t)hdr->nr_body); } nm_os_free(hdr); } @@ -293,13 +293,13 @@ nmreq_to_legacy(struct nmreq_header *hdr, struct nmreq switch (hdr->nr_reqtype) { case NETMAP_REQ_REGISTER: { struct nmreq_register *req = - (struct nmreq_register *)hdr->nr_body; + (struct nmreq_register *)(uintptr_t)hdr->nr_body; nmreq_register_to_legacy(req, nmr); break; } case NETMAP_REQ_PORT_INFO_GET: { struct nmreq_port_info_get *req = - (struct nmreq_port_info_get *)hdr->nr_body; + (struct nmreq_port_info_get *)(uintptr_t)hdr->nr_body; nmr->nr_offset = req->nr_offset; nmr->nr_memsize = req->nr_memsize; nmr->nr_tx_slots = req->nr_tx_slots; @@ -311,7 +311,7 @@ nmreq_to_legacy(struct nmreq_header *hdr, struct nmreq } case NETMAP_REQ_VALE_ATTACH: { struct nmreq_vale_attach *req = - (struct nmreq_vale_attach *)hdr->nr_body; + (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body; nmreq_register_to_legacy(&req->reg, nmr); break; } @@ -320,7 +320,7 @@ nmreq_to_legacy(struct nmreq_header *hdr, struct nmreq } case NETMAP_REQ_VALE_LIST: { struct nmreq_vale_list *req = - (struct nmreq_vale_list *)hdr->nr_body; + (struct nmreq_vale_list *)(uintptr_t)hdr->nr_body; strncpy(nmr->nr_name, hdr->nr_name, sizeof(nmr->nr_name)); nmr->nr_arg1 = req->nr_bridge_idx; nmr->nr_arg2 = req->nr_port_idx; @@ -329,13 +329,13 @@ nmreq_to_legacy(struct nmreq_header *hdr, struct nmreq case NETMAP_REQ_PORT_HDR_SET: case NETMAP_REQ_PORT_HDR_GET: { struct nmreq_port_hdr *req = - (struct nmreq_port_hdr *)hdr->nr_body; + (struct nmreq_port_hdr *)(uintptr_t)hdr->nr_body; nmr->nr_arg1 = req->nr_hdr_len; break; } case NETMAP_REQ_VALE_NEWIF: { struct nmreq_vale_newif *req = - (struct nmreq_vale_newif *)hdr->nr_body; + (struct nmreq_vale_newif *)(uintptr_t)hdr->nr_body; nmr->nr_tx_slots = req->nr_tx_slots; nmr->nr_rx_slots = req->nr_rx_slots; nmr->nr_tx_rings = req->nr_tx_rings; @@ -375,7 +375,7 @@ netmap_ioctl_legacy(struct netmap_priv_d *priv, u_long nmreq_to_legacy(hdr, nmr); } if (hdr->nr_body) { - nm_os_free((void *)hdr->nr_body); + nm_os_free((void *)(uintptr_t)hdr->nr_body); } nm_os_free(hdr); break; Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap_mem2.c Fri May 18 03:38:17 2018 (r333778) @@ -673,10 +673,10 @@ nm_mem_assign_id_locked(struct netmap_mem_d *nmd) static int nm_mem_assign_id(struct netmap_mem_d *nmd) { - int ret; + int ret; NM_MTX_LOCK(nm_mem_list_lock); - ret = nm_mem_assign_id_locked(nmd); + ret = nm_mem_assign_id_locked(nmd); NM_MTX_UNLOCK(nm_mem_list_lock); return ret; @@ -1143,7 +1143,7 @@ netmap_extra_alloc(struct netmap_adapter *na, uint32_t static void netmap_extra_free(struct netmap_adapter *na, uint32_t head) { - struct lut_entry *lut = na->na_lut.lut; + struct lut_entry *lut = na->na_lut.lut; struct netmap_mem_d *nmd = na->nm_mem; struct netmap_obj_pool *p = &nmd->pools[NETMAP_BUF_POOL]; uint32_t i, cur, *buf; @@ -1516,10 +1516,11 @@ netmap_mem_unmap(struct netmap_obj_pool *p, struct net return 0; #if defined(__FreeBSD__) + /* On FreeBSD mapping and unmapping is performed by the txsync + * and rxsync routine, packet by packet. */ (void)i; (void)lim; (void)lut; - D("unsupported on FreeBSD"); #elif defined(_WIN32) (void)i; (void)lim; @@ -1551,10 +1552,11 @@ netmap_mem_map(struct netmap_obj_pool *p, struct netma return 0; #if defined(__FreeBSD__) + /* On FreeBSD mapping and unmapping is performed by the txsync + * and rxsync routine, packet by packet. */ (void)i; (void)lim; (void)lut; - D("unsupported on FreeBSD"); #elif defined(_WIN32) (void)i; (void)lim; @@ -1572,7 +1574,7 @@ netmap_mem_map(struct netmap_obj_pool *p, struct netma if (lut->plut == NULL) { D("Failed to allocate physical lut for %s", na->name); return ENOMEM; - } + } for (i = 0; i < lim; i += p->_clustentries) { lut->plut[i].paddr = 0; @@ -1644,7 +1646,7 @@ error: * allocator for private memory */ static void * -_netmap_mem_private_new(size_t size, struct netmap_obj_params *p, +_netmap_mem_private_new(size_t size, struct netmap_obj_params *p, struct netmap_mem_ops *ops, int *perr) { struct netmap_mem_d *d = NULL; @@ -1722,16 +1724,16 @@ netmap_mem_private_new(u_int txr, u_int txd, u_int rxr if (p[NETMAP_RING_POOL].size < v) p[NETMAP_RING_POOL].size = v; /* each pipe endpoint needs two tx rings (1 normal + 1 host, fake) - * and two rx rings (again, 1 normal and 1 fake host) - */ + * and two rx rings (again, 1 normal and 1 fake host) + */ v = txr + rxr + 8 * npipes; if (p[NETMAP_RING_POOL].num < v) p[NETMAP_RING_POOL].num = v; /* for each pipe we only need the buffers for the 4 "real" rings. - * On the other end, the pipe ring dimension may be different from - * the parent port ring dimension. As a compromise, we allocate twice the - * space actually needed if the pipe rings were the same size as the parent rings - */ + * On the other end, the pipe ring dimension may be different from + * the parent port ring dimension. As a compromise, we allocate twice the + * space actually needed if the pipe rings were the same size as the parent rings + */ v = (4 * npipes + rxr) * rxd + (4 * npipes + txr) * txd + 2 + extra_bufs; /* the +2 is for the tx and rx fake buffers (indices 0 and 1) */ if (p[NETMAP_BUF_POOL].num < v) @@ -1942,7 +1944,11 @@ netmap_mem2_rings_create(struct netmap_adapter *na) return 0; cleanup: - netmap_free_rings(na); + /* we cannot actually cleanup here, since we don't own kring->users + * and kring->nr_klags & NKR_NEEDRING. The caller must decrement + * the first or zero-out the second, then call netmap_free_rings() + * to do the cleanup + */ return ENOMEM; } @@ -2155,7 +2161,7 @@ netmap_mem_ext_delete(struct netmap_mem_d *d) for (i = 0; i < NETMAP_POOLS_NR; i++) { struct netmap_obj_pool *p = &d->pools[i]; - + if (p->lut) { nm_free_lut(p->lut, p->objtotal); p->lut = NULL; @@ -2215,7 +2221,7 @@ netmap_mem_ext_create(uint64_t usrptr, struct nmreq_po pi->nr_if_pool_objtotal, pi->nr_if_pool_objsize, pi->nr_ring_pool_objtotal, pi->nr_ring_pool_objsize, pi->nr_buf_pool_objtotal, pi->nr_buf_pool_objsize); - + os = nm_os_extmem_create(usrptr, pi, &error); if (os == NULL) { D("os extmem creation failed"); @@ -2238,7 +2244,7 @@ netmap_mem_ext_create(uint64_t usrptr, struct nmreq_po &error); if (nme == NULL) goto out_unmap; - + nr_pages = nm_os_extmem_nr_pages(os); /* from now on pages will be released by nme destructor; @@ -2262,7 +2268,7 @@ netmap_mem_ext_create(uint64_t usrptr, struct nmreq_po error = ENOMEM; goto out_delete; } - + p->bitmap_slots = (o->num + sizeof(uint32_t) - 1) / sizeof(uint32_t); p->invalid_bitmap = nm_os_malloc(sizeof(uint32_t) * p->bitmap_slots); if (p->invalid_bitmap == NULL) { @@ -2515,11 +2521,11 @@ netmap_mem_pt_guest_finalize(struct netmap_mem_d *nmd) if (error) goto out; - /* Initialize the lut using the information contained in the + /* Initialize the lut using the information contained in the * ptnetmap memory device. */ - bufsize = nm_os_pt_memdev_ioread(ptnmd->ptn_dev, + bufsize = nm_os_pt_memdev_ioread(ptnmd->ptn_dev, PTNET_MDEV_IO_BUF_POOL_OBJSZ); - nbuffers = nm_os_pt_memdev_ioread(ptnmd->ptn_dev, + nbuffers = nm_os_pt_memdev_ioread(ptnmd->ptn_dev, PTNET_MDEV_IO_BUF_POOL_OBJNUM); /* allocate the lut */ @@ -2740,7 +2746,7 @@ netmap_mem_pt_guest_create(nm_memid_t mem_id) ptnmd->host_mem_id = mem_id; ptnmd->pt_ifs = NULL; - /* Assign new id in the guest (We have the lock) */ + /* Assign new id in the guest (We have the lock) */ err = nm_mem_assign_id_locked(&ptnmd->up); if (err) goto error; Modified: head/sys/dev/netmap/netmap_monitor.c ============================================================================== --- head/sys/dev/netmap/netmap_monitor.c Fri May 18 02:58:26 2018 (r333777) +++ head/sys/dev/netmap/netmap_monitor.c Fri May 18 03:38:17 2018 (r333778) @@ -139,7 +139,7 @@ nm_is_zmon(struct netmap_adapter *na) static int netmap_monitor_txsync(struct netmap_kring *kring, int flags) { - RD(1, "%s %x", kring->name, flags); + RD(1, "%s %x", kring->name, flags); return EIO; } @@ -152,10 +152,10 @@ netmap_monitor_txsync(struct netmap_kring *kring, int static int netmap_monitor_rxsync(struct netmap_kring *kring, int flags) { - ND("%s %x", kring->name, flags); + ND("%s %x", kring->name, flags); kring->nr_hwcur = kring->rhead; mb(); - return 0; + return 0; } /* nm_krings_create callbacks for monitors. @@ -198,7 +198,7 @@ nm_monitor_alloc(struct netmap_kring *kring, u_int n) return 0; old_len = sizeof(struct netmap_kring *)*kring->max_monitors; - len = sizeof(struct netmap_kring *) * n; + len = sizeof(struct netmap_kring *) * n; nm = nm_os_realloc(kring->monitors, len, old_len); if (nm == NULL) return ENOMEM; @@ -621,14 +621,14 @@ out_rxsync: static int netmap_zmon_parent_txsync(struct netmap_kring *kring, int flags) { - return netmap_zmon_parent_sync(kring, flags, NR_TX); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 18 04:06:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF959EE8BAE; Fri, 18 May 2018 04:06:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8083A84509; Fri, 18 May 2018 04:06:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6181C1304B; Fri, 18 May 2018 04:06:36 +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 w4I46akH080893; Fri, 18 May 2018 04:06:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I46ZlL080890; Fri, 18 May 2018 04:06:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201805180406.w4I46ZlL080890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 18 May 2018 04:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333779 - in vendor/xz/dist: . src/common src/liblzma/api src/liblzma/api/lzma src/liblzma/common src/liblzma/lzma src/liblzma/rangecoder src/xz src/xzdec X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in vendor/xz/dist: . src/common src/liblzma/api src/liblzma/api/lzma src/liblzma/common src/liblzma/lzma src/liblzma/rangecoder src/xz src/xzdec X-SVN-Commit-Revision: 333779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 04:06:37 -0000 Author: delphij Date: Fri May 18 04:06:35 2018 New Revision: 333779 URL: https://svnweb.freebsd.org/changeset/base/333779 Log: Vendor import of xz-5.2.4 (trimmed). Modified: vendor/xz/dist/COPYING vendor/xz/dist/ChangeLog vendor/xz/dist/README vendor/xz/dist/THANKS vendor/xz/dist/src/common/tuklib_integer.h vendor/xz/dist/src/liblzma/api/lzma.h vendor/xz/dist/src/liblzma/api/lzma/base.h vendor/xz/dist/src/liblzma/api/lzma/container.h vendor/xz/dist/src/liblzma/api/lzma/index.h vendor/xz/dist/src/liblzma/api/lzma/version.h vendor/xz/dist/src/liblzma/common/alone_decoder.c vendor/xz/dist/src/liblzma/common/auto_decoder.c vendor/xz/dist/src/liblzma/common/common.c vendor/xz/dist/src/liblzma/common/index_decoder.c vendor/xz/dist/src/liblzma/common/stream_decoder.c vendor/xz/dist/src/liblzma/lzma/lzma_decoder.c vendor/xz/dist/src/liblzma/rangecoder/range_common.h vendor/xz/dist/src/xz/file_io.c vendor/xz/dist/src/xz/list.c vendor/xz/dist/src/xz/xz.1 vendor/xz/dist/src/xzdec/xzdec.1 Modified: vendor/xz/dist/COPYING ============================================================================== --- vendor/xz/dist/COPYING Fri May 18 03:38:17 2018 (r333778) +++ vendor/xz/dist/COPYING Fri May 18 04:06:35 2018 (r333779) @@ -47,7 +47,7 @@ XZ Utils Licensing naturally it is not legally required. Here is an example of a good notice to put into "about box" or into documentation: - This software includes code from XZ Utils . + This software includes code from XZ Utils . The following license texts are included in the following files: - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 Modified: vendor/xz/dist/ChangeLog ============================================================================== --- vendor/xz/dist/ChangeLog Fri May 18 03:38:17 2018 (r333778) +++ vendor/xz/dist/ChangeLog Fri May 18 04:06:35 2018 (r333779) @@ -1,3 +1,284 @@ +commit b5be61cc06088bb07f488f9baf7d447ff47b37c1 +Author: Lasse Collin +Date: 2018-04-29 19:00:06 +0300 + + Bump version and soname for 5.2.4. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c47fa6d06745bb2e99866e76b81ac7a9c5a8bfec +Author: Lasse Collin +Date: 2018-04-29 18:48:00 +0300 + + extra/scanlzma: Fix compiler warnings. + + extra/scanlzma/scanlzma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 7b350fe21aa4fd6495a3b6188a40e3f1ae7c0edf +Author: Lasse Collin +Date: 2018-04-29 18:15:37 +0300 + + Add NEWS for 5.2.4. + + NEWS | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 5801591162a280aa52d156dfde42c531ec7fd8b6 +Author: Lasse Collin +Date: 2018-02-06 19:36:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit c4a616f4536146f8906e1b4412eefeec07b28fae +Author: Ben Boeckel +Date: 2018-01-29 13:58:18 -0500 + + nothrow: use noexcept for C++11 and newer + + In C++11, the `throw()` specifier is deprecated and `noexcept` is + preffered instead. + + src/liblzma/api/lzma.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 0b8947782ff3c5ef830a7f85412e44dcf3cdeb77 +Author: Lasse Collin +Date: 2018-02-06 18:02:48 +0200 + + liblzma: Remove incorrect #ifdef from range_common.h. + + In most cases it was harmless but it could affect some + custom build systems. + + Thanks to Pippijn van Steenhoven. + + src/liblzma/rangecoder/range_common.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 48f3b9f73ffea7f55d5678997aba0e79d2e82168 +Author: Lasse Collin +Date: 2018-01-10 22:10:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a3ce3e902342be37c626a561ce3d9ffcf27d0f94 +Author: Lasse Collin +Date: 2018-01-10 21:54:27 +0200 + + tuklib_integer: New Intel C compiler needs immintrin.h. + + Thanks to Melanie Blower (Intel) for the patch. + + src/common/tuklib_integer.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 4505ca483985f88c6923c05a43b4327feaab83b1 +Author: Lasse Collin +Date: 2017-09-24 20:04:24 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1ef3cc226e3ce173575c218238b71a4eecabc470 +Author: Lasse Collin +Date: 2017-09-16 20:36:20 +0300 + + Windows: Fix paths in VS project files. + + Some paths use slashes instead of backslashes as directory + separators... now it should work (I tested VS2013 version). + + windows/vs2013/liblzma.vcxproj | 12 ++++++------ + windows/vs2013/liblzma_dll.vcxproj | 24 ++++++++++++------------ + windows/vs2017/liblzma.vcxproj | 12 ++++++------ + windows/vs2017/liblzma_dll.vcxproj | 24 ++++++++++++------------ + 4 files changed, 36 insertions(+), 36 deletions(-) + +commit e775d2a8189d24f60470e6e49d8af881df3a1680 +Author: Lasse Collin +Date: 2017-09-16 12:54:23 +0300 + + Windows: Add project files for VS2017. + + These files match the v5.2 branch (no file info decoder). + + windows/vs2017/config.h | 148 ++++++++++++++ + windows/vs2017/liblzma.vcxproj | 355 ++++++++++++++++++++++++++++++++++ + windows/vs2017/liblzma_dll.vcxproj | 384 +++++++++++++++++++++++++++++++++++++ + windows/vs2017/xz_win.sln | 48 +++++ + 4 files changed, 935 insertions(+) + +commit 10e02e0fbb6e2173f8b41f6e39b7b570f47dd74d +Author: Lasse Collin +Date: 2017-09-16 12:39:43 +0300 + + Windows: Move VS2013 files into windows/vs2013 directory. + + windows/{ => vs2013}/config.h | 0 + windows/{ => vs2013}/liblzma.vcxproj | 278 +++++++++++++++--------------- + windows/{ => vs2013}/liblzma_dll.vcxproj | 280 +++++++++++++++---------------- + windows/{ => vs2013}/xz_win.sln | 0 + 4 files changed, 279 insertions(+), 279 deletions(-) + +commit 06eebd4543196ded36fa9b8b9544195b38b24ef2 +Author: Lasse Collin +Date: 2017-08-14 20:08:33 +0300 + + Fix or hide warnings from GCC 7's -Wimplicit-fallthrough. + + src/liblzma/lzma/lzma_decoder.c | 6 ++++++ + src/xz/list.c | 2 ++ + 2 files changed, 8 insertions(+) + +commit ea4ea1dffafebaa8b2770bf3eca46900e4dd22dc +Author: Alexey Tourbin +Date: 2017-05-16 23:56:35 +0300 + + Docs: Fix a typo in a comment in doc/examples/02_decompress.c. + + doc/examples/02_decompress.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb2ef4c79bf405ea0d215f3b1df3d0eaf5e1d27b +Author: Lasse Collin +Date: 2017-05-23 18:34:43 +0300 + + xz: Fix "xz --list --robot missing_or_bad_file.xz". + + It ended up printing an uninitialized char-array when trying to + print the check names (column 7) on the "totals" line. + + This also changes the column 12 (minimum xz version) to + 50000002 (xz 5.0.0) instead of 0 when there are no valid + input files. + + Thanks to kidmin for the bug report. + + src/xz/list.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 3ea5dbd9b0d79048e336e40cef3b6d814fb74e13 +Author: Lasse Collin +Date: 2017-04-24 19:48:47 +0300 + + Build: Omit pre-5.0.0 entries from the generated ChangeLog. + + It makes ChangeLog significantly smaller. + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit bae24675936df99064de1502593c006bd902594b +Author: Lasse Collin +Date: 2017-04-24 19:30:22 +0300 + + Update the Git repository URL to HTTPS in ChangeLog. + + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 70f479211973b5361f4d7cb08ba5be69b4266e7a +Author: Lasse Collin +Date: 2017-04-19 22:17:35 +0300 + + Update the home page URLs to HTTPS. + + COPYING | 2 +- + README | 2 +- + configure.ac | 2 +- + doc/faq.txt | 4 ++-- + dos/config.h | 2 +- + src/common/common_w32res.rc | 2 +- + src/xz/xz.1 | 6 +++--- + src/xzdec/xzdec.1 | 4 ++-- + windows/README-Windows.txt | 2 +- + windows/config.h | 2 +- + 10 files changed, 14 insertions(+), 14 deletions(-) + +commit 2a4b2fa75d06a097261a02ecd3cf2b6d449bf754 +Author: Lasse Collin +Date: 2017-03-30 22:01:54 +0300 + + xz: Use POSIX_FADV_RANDOM for in "xz --list" mode. + + xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly + wrong. + + src/xz/file_io.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit eb25743ade39170cffd9566a1aae272098cce216 +Author: Lasse Collin +Date: 2017-03-30 19:47:45 +0300 + + liblzma: Fix lzma_memlimit_set(strm, 0). + + The 0 got treated specially in a buggy way and as a result + the function did nothing. The API doc said that 0 was supposed + to return LZMA_PROG_ERROR but it didn't. + + Now 0 is treated as if 1 had been specified. This is done because + 0 is already used to indicate an error from lzma_memlimit_get() + and lzma_memusage(). + + In addition, lzma_memlimit_set() no longer checks that the new + limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive + for the Index decoder and was actually needed only by the + auto decoder. Auto decoder has now been modified to check for + LZMA_MEMUSAGE_BASE. + + src/liblzma/api/lzma/base.h | 7 ++++++- + src/liblzma/common/auto_decoder.c | 3 +++ + src/liblzma/common/common.c | 6 ++++-- + 3 files changed, 13 insertions(+), 3 deletions(-) + +commit ef36c6362f3f3853f21b8a6359bcd06576ebf207 +Author: Lasse Collin +Date: 2017-03-30 19:16:55 +0300 + + liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + src/liblzma/common/alone_decoder.c | 5 +---- + src/liblzma/common/auto_decoder.c | 5 +---- + src/liblzma/common/stream_decoder.c | 5 +---- + 4 files changed, 20 insertions(+), 16 deletions(-) + +commit 57616032650f03840480b696d7878acdd2065521 +Author: Lasse Collin +Date: 2017-03-30 18:58:18 +0300 + + liblzma: Fix handling of memlimit == 0 in lzma_index_decoder(). + + It returned LZMA_PROG_ERROR, which was done to avoid zero as + the limit (because it's a special value elsewhere), but using + LZMA_PROG_ERROR is simply inconvenient and can cause bugs. + + The fix/workaround is to treat 0 as if it were 1 byte. It's + effectively the same thing. The only weird consequence is + that then lzma_memlimit_get() will return 1 even when 0 was + specified as the limit. + + This fixes a very rare corner case in xz --list where a specific + memory usage limit and a multi-stream file could print the + error message "Internal error (bug)" instead of saying that + the memory usage limit is too low. + + src/liblzma/api/lzma/index.h | 18 +++++++++++------- + src/liblzma/common/index_decoder.c | 4 ++-- + 2 files changed, 13 insertions(+), 9 deletions(-) + commit 3d566cd519017eee1a400e7961ff14058dfaf33c Author: Lasse Collin Date: 2016-12-30 13:26:36 +0200 @@ -5332,10037 +5613,3 @@ Date: 2010-10-23 14:02:53 +0300 src/liblzma/Makefile.am | 2 +- src/liblzma/api/lzma/version.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) - -commit 8c947e9291691629714dafb4536c718b6cc24fbd -Author: Lasse Collin -Date: 2010-10-23 12:30:54 +0300 - - liblzma: Make lzma_code() check the reserved members in lzma_stream. - - If any of the reserved members in lzma_stream are non-zero - or non-NULL, LZMA_OPTIONS_ERROR is returned. It is possible - that a new feature in the future is indicated by just setting - a reserved member to some other value, so the old liblzma - version need to catch it as an unsupported feature. - - src/liblzma/common/common.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -commit e61d85e082743ebd2dd0ff28fc0a82482ede0538 -Author: Lasse Collin -Date: 2010-10-23 12:26:33 +0300 - - Windows: Use MinGW's stdio functions. - - The non-standard ones from msvcrt.dll appear to work - most of the time with XZ Utils, but there are some - corner cases where things may go very wrong. So it's - good to use the better replacements provided by - MinGW(-w64) runtime. - - src/common/sysdefs.h | 5 +++++ - 1 file changed, 5 insertions(+) - -commit 23e23f1dc029146714c9a98313ab3ea93d71a2fc -Author: Lasse Collin -Date: 2010-10-23 12:21:32 +0300 - - liblzma: Use 512 as INDEX_GROUP_SIZE. - - This lets compiler use shifting instead of 64-bit division. - - src/liblzma/common/index.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 613939fc82603b75b59eee840871a05bc8dd08e0 -Author: Lasse Collin -Date: 2010-10-23 12:20:11 +0300 - - liblzma: A few ABI tweaks to reserve space in structures. - - src/liblzma/api/lzma/base.h | 7 ++++++- - src/liblzma/api/lzma/lzma.h | 4 ++-- - src/liblzma/api/lzma/stream_flags.h | 4 ---- - 3 files changed, 8 insertions(+), 7 deletions(-) - -commit 68b83f252df3d27480a9f6f03445d16f6506fef1 -Author: Lasse Collin -Date: 2010-10-21 23:16:11 +0300 - - xz: Make sure that message_strm() can never return NULL. - - src/xz/message.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -commit d09c5753e33ff96ee57edb6d1e98e34041203695 -Author: Lasse Collin -Date: 2010-10-21 23:06:31 +0300 - - liblzma: Update the comments in the API headers. - - Adding support for LZMA_FINISH for Index encoding and - decoding needed tiny additions to the relevant .c files too. - - src/liblzma/api/lzma.h | 4 +-- - src/liblzma/api/lzma/base.h | 38 +++++++++++++-------------- - src/liblzma/api/lzma/bcj.h | 4 +-- - src/liblzma/api/lzma/block.h | 4 +-- - src/liblzma/api/lzma/container.h | 26 ++++++++++++------- - src/liblzma/api/lzma/filter.h | 51 ++++++++++++++++++------------------- - src/liblzma/api/lzma/hardware.h | 3 +-- - src/liblzma/api/lzma/index.h | 28 ++++++++++++-------- - src/liblzma/api/lzma/index_hash.h | 2 +- - src/liblzma/api/lzma/lzma.h | 46 ++++++++++++++++++++++----------- - src/liblzma/api/lzma/stream_flags.h | 4 +-- - src/liblzma/api/lzma/vli.h | 31 +++++++++++----------- - src/liblzma/common/index_decoder.c | 1 + - src/liblzma/common/index_encoder.c | 1 + - 14 files changed, 136 insertions(+), 107 deletions(-) - -commit 33c1c0e102eb529588503b8beea0903a45488fad -Author: Lasse Collin -Date: 2010-10-19 12:08:30 +0300 - - Update INSTALL.generic. - - INSTALL.generic | 99 ++++++++++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 81 insertions(+), 18 deletions(-) - -commit 0076e03641f201c4b77dddd5a6db5880be19a78c -Author: Lasse Collin -Date: 2010-10-19 11:44:37 +0300 - - Clean up a few FIXMEs and TODOs. - - lzma_chunk_size() was commented out because it is - currently useless. - - src/liblzma/common/filter_encoder.c | 2 ++ - src/liblzma/common/filter_encoder.h | 4 ++-- - src/liblzma/lzma/lzma2_decoder.c | 1 - - src/liblzma/lzma/lzma_decoder.c | 4 ++-- - src/liblzma/lzma/lzma_encoder.c | 2 +- - src/xz/message.h | 2 +- - 6 files changed, 8 insertions(+), 7 deletions(-) - -commit ce34ec4f54ff8b753da236f371ad8dd23c8135c9 -Author: Lasse Collin -Date: 2010-10-19 10:21:08 +0300 - - Update docs. - - INSTALL | 192 +++++++++++++++++++++++++++++++++++++++++-------------------- - PACKAGERS | 104 +++++++++------------------------ - TODO | 17 ++++-- - dos/README | 2 +- - 4 files changed, 172 insertions(+), 143 deletions(-) - -commit f0fa880d247e73264d2c04fe31fb3412318a0026 -Author: Lasse Collin -Date: 2010-10-12 15:13:30 +0300 - - xz: Avoid raise() also on OpenVMS. - - This is similar to DOS/DJGPP that killing the program - with a signal will print a backtrace or a similar message. - - src/xz/signals.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit ac462b1c47c451f5c62e428306314c4bdad8ae7f -Author: Lasse Collin -Date: 2010-10-11 21:26:19 +0300 - - xz: Avoid SA_RESTART for portability reasons. - - SA_RESTART is not as portable as I had hoped. It's missing - at least from OpenVMS, QNX, and DJGPP). Luckily we can do - fine without SA_RESTART. - - src/xz/message.c | 38 +++++++++++++++----------------------- - src/xz/message.h | 4 ++++ - src/xz/signals.c | 6 ++++++ - 3 files changed, 25 insertions(+), 23 deletions(-) - -commit d52b411716a614c202e89ba732492efb9916cd3f -Author: Lasse Collin -Date: 2010-10-10 17:58:58 +0300 - - xz: Use "%"PRIu32 instead of "%d" in a format string. - - src/xz/message.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit ae74d1bdeb075c3beefe76e1136c5741804e7e91 -Author: Lasse Collin -Date: 2010-10-10 17:43:26 +0300 - - test_files.sh: Fix the first line. - - For some reason this prevented running the test only - on OS/2 and even on that it broke only recently. - - Thanks to Elbert Pol. - - tests/test_files.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit d492b80ddd6f9a13419de6d102df7374d8f448e8 -Author: Lasse Collin -Date: 2010-10-10 16:49:01 +0300 - - lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 825e859a9054bd91202e5723c41a17e72f63040a -Author: Lasse Collin -Date: 2010-10-10 16:47:01 +0300 - - lzmainfo: Use fileno(stdin) instead of STDIN_FILENO. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit acbc4cdecbeec2a4dfaac04f185ece49b2ff17c8 -Author: Lasse Collin -Date: 2010-10-09 23:20:51 +0300 - - lzmainfo: Use setmode() on DOS-like systems. - - src/lzmainfo/lzmainfo.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -commit ef364d3abc5647111c5424ea0d83a567e184a23b -Author: Lasse Collin -Date: 2010-10-09 21:51:03 +0300 - - OS/2 and DOS: Be less verbose on signals. - - Calling raise() to kill xz when user has pressed C-c - is a bit verbose on OS/2 and DOS/DJGPP. Instead of - calling raise(), set only the exit status to 1. - - src/xz/signals.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -commit 5629c4be07b6c67e79842b2569da1cedc9c0d69a -Author: Lasse Collin -Date: 2010-10-09 19:28:49 +0300 - - DOS: Update the Makefile, config.h and README. - - This is now simpler and builds only xz.exe. - - dos/Makefile | 211 +++++++++++++++-------------------------------------------- - dos/README | 73 +++++++-------------- - dos/config.h | 45 ++++--------- - 3 files changed, 86 insertions(+), 243 deletions(-) - -commit f25a77e6b9bc48a243ddfbbd755b7960eec7e0ac -Author: Lasse Collin -Date: 2010-10-09 18:57:55 +0300 - - Windows: Put some license info into README-Windows.txt. - - windows/README-Windows.txt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -commit e75100f549f85d231df25c07aa94d63e78e2d668 -Author: Lasse Collin -Date: 2010-10-09 18:57:04 +0300 - - Windows: Fix a diagnostics bug in build.bash. - - windows/build.bash | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit efeb998a2b1025df1c1d202cc7d21d866cd1c336 -Author: Lasse Collin -Date: 2010-10-09 13:02:15 +0300 - - lzmainfo: Add Windows resource file. - - src/lzmainfo/Makefile.am | 9 +++++++++ - src/lzmainfo/lzmainfo_w32res.rc | 12 ++++++++++++ - 2 files changed, 21 insertions(+) - -commit 389d418445f1623593dfdbba55d52fbb6d1205f5 -Author: Lasse Collin -Date: 2010-10-09 12:57:25 +0300 - - Add missing public domain notice to lzmadec_w32res.rc. - - src/xzdec/lzmadec_w32res.rc | 7 +++++++ - 1 file changed, 7 insertions(+) - -commit 6389c773a4912dd9f111256d74ba1605230a7957 -Author: Lasse Collin -Date: 2010-10-09 12:52:12 +0300 - - Windows: Update common_w32res.rc. - - src/common/common_w32res.rc | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -commit 71275457ca24c9b01721f5cfc3638cf094daf454 -Author: Lasse Collin -Date: 2010-10-09 12:27:08 +0300 - - Windows: Make build.bash prefer MinGW-w32 over MinGW. - - This is simply for licensing reasons. The 64-bit version - will be built with MinGW-w64 anyway (at least for now), - so using it also for 32-bit build allows using the same - copyright notice about the MinGW-w64/w32 runtime. - - Note that using MinGW would require a copyright notice too, - because its runtime is not in the public domain either even - though MinGW's home page claims that it is public domain. - See . - - windows/build.bash | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -commit 3ac35719d8433af937af6491383d4a50e343099b -Author: Lasse Collin -Date: 2010-10-09 11:33:21 +0300 - - Windows: Copy COPYING-Windows.txt (if it exists) to the package. - - Also, put README-Windows.txt to the doc directory like - the other documentation files. - - windows/build.bash | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -commit 7b5db576fd7a4a67813b8437a9ccd4dbc94bbaae -Author: Lasse Collin -Date: 2010-10-08 21:42:37 +0300 - - Windows: Fix build.bash again. - - 630a8beda34af0ac153c8051b1bf01230558e422 wasn't good. - - windows/build.bash | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -commit d3cd7abe85ec7c2f46cf198b15c00d5d119df3dd -Author: Lasse Collin -Date: 2010-10-08 16:53:20 +0300 - - Use LZMA_VERSION_STRING instead of PACKAGE_VERSION. - - Those are the same thing, and the former makes it a bit - easier to build the code with other build systems, because - one doesn't need to update the version number into custom - config.h. - - This change affects only lzmainfo. Other tools were already - using LZMA_VERSION_STRING. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 084c60d318f2dbaef4078d9b100b4a373d0c3a7f -Author: Lasse Collin -Date: 2010-10-08 15:59:25 +0300 - - configure.ac: Remove two unused defines. - - configure.ac | 4 ---- - 1 file changed, 4 deletions(-) - -commit 11f51b6714357cb67ec7e56ed9575c199b5581fe -Author: Lasse Collin -Date: 2010-10-08 15:32:29 +0300 - - Make tests accommodate missing xz or xzdec. - - tests/test_compress.sh | 47 ++++++++++++++++++++++++++++++----------------- - tests/test_files.sh | 28 ++++++++++++++++++++++++++-- - 2 files changed, 56 insertions(+), 19 deletions(-) - -commit b1c7368f95e93ccdefdd0748e04398c26766f47f -Author: Lasse Collin -Date: 2010-10-08 15:25:45 +0300 - - Build: Add options to disable individual command line tools. - - configure.ac | 38 ++++++++++++++++++++++++++++++ - src/Makefile.am | 15 +++++++++++- - src/scripts/Makefile.am | 62 +++++++++++++++++++++---------------------------- - src/xz/Makefile.am | 6 ++++- - src/xzdec/Makefile.am | 12 ++++++++-- - 5 files changed, 93 insertions(+), 40 deletions(-) - -commit 630a8beda34af0ac153c8051b1bf01230558e422 -Author: Lasse Collin -Date: 2010-10-07 00:44:53 +0300 - - Windows: Make build.bash work without --enable-dynamic=no. - - windows/build.bash | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -commit f9907503f882a745dce9d84c2968f6c175ba966a -Author: Lasse Collin -Date: 2010-10-05 14:13:16 +0300 - - Build: Remove the static/dynamic tricks. - - Most distros want xz linked against shared liblzma, so - it doesn't help much to require --enable-dynamic for that. - Those who want to avoid PIC on x86-32 to get better - performance, can still do it e.g. by using --disable-shared - to compile xz and then another pass to compile shared liblzma. - - Part of these static/dynamic tricks were needed for Windows - in the past. Nowadays we rely on GCC and binutils to do the - right thing with auto-import. If the Autotooled build system - needs to support some other toolchain on Windows in the future, - this may need some rethinking. - - configure.ac | 74 ------------------------------------------------ - debug/Makefile.am | 5 +--- - src/lzmainfo/Makefile.am | 4 +-- - src/xz/Makefile.am | 4 +-- - src/xzdec/Makefile.am | 4 +-- - tests/Makefile.am | 5 +--- - 6 files changed, 5 insertions(+), 91 deletions(-) - -commit fda4724d8114fccfa31c1839c15479f350c2fb4c -Author: Lasse Collin -Date: 2010-10-05 12:18:58 +0300 - - configure.ac: Silence a warning from Autoconf 2.68. - - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 80b5675fa62c87426fe86f8fcd20feeabc4361b9 -Author: Lasse Collin -Date: 2010-10-04 19:43:01 +0300 - - A few more languages files to the xz man page. - - Thanks to Jonathan Nieder. - - src/xz/xz.1 | 45 ++++++++++++++++++++++++--------------------- - 1 file changed, 24 insertions(+), 21 deletions(-) - -commit f9722dbeca4dc4c43cfd15d122dafaac50b0a0bb -Author: Lasse Collin -Date: 2010-10-02 12:07:33 +0300 - - Update the FAQ. - - doc/faq.txt | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 100 insertions(+), 4 deletions(-) - -commit 61ae593661e8dc402394e84d567ca2044a51572b -Author: Lasse Collin -Date: 2010-10-02 11:38:20 +0300 - - liblzma: Small fixes to comments in the API headers. - - src/liblzma/api/lzma/lzma.h | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -commit 9166682dc601fd42c1b9510572e3f917d18de504 -Author: Lasse Collin -Date: 2010-09-28 11:40:12 +0300 - - Create the PDF versions of the man pages better. - - Makefile.am | 14 +++++++------ - build-aux/manconv.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 66 insertions(+), 6 deletions(-) - -commit 17d3c61edd35de8fa884944fc70d1db86daa5dd8 -Author: Lasse Collin -Date: 2010-09-28 10:59:53 +0300 - - Move version.sh to build-aux. - - Makefile.am | 4 ++-- - version.sh => build-aux/version.sh | 0 - configure.ac | 2 +- - windows/build.bash | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -commit 84af9d8770451339a692e9b70f96cf56156a6069 -Author: Lasse Collin -Date: 2010-09-28 10:53:02 +0300 - - Update .gitignore. - - .gitignore | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -commit 31575a449ac64c523da3bab8d0c0b522cdc7c780 -Author: Lasse Collin -Date: 2010-09-28 01:17:14 +0300 - - Fix accomodate -> accommodate on the xz man page. - - src/xz/xz.1 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit cec0ddc8ec4ce81685a51998b978e22167e461f9 -Author: Lasse Collin -Date: 2010-09-27 23:29:34 +0300 - - Major man page updates. - - Lots of content was updated on the xz man page. - - Technical improvements: - - Start a new sentence on a new line. - - Use fairly short lines. - - Use constant-width font for examples (where supported). - - Some minor cleanups. - - Thanks to Jonathan Nieder for some language fixes. - - src/lzmainfo/lzmainfo.1 | 25 +- - src/scripts/xzdiff.1 | 15 +- - src/scripts/xzgrep.1 | 11 +- - src/scripts/xzless.1 | 13 +- - src/scripts/xzmore.1 | 9 +- - src/xz/xz.1 | 1964 ++++++++++++++++++++++++++++++++--------------- - src/xzdec/xzdec.1 | 39 +- - 7 files changed, 1435 insertions(+), 641 deletions(-) - -commit 075257ab0416a0603be930082e31a5703e4ba345 -Author: Lasse Collin -Date: 2010-09-26 18:10:31 +0300 - - Fix the preset -3e. - - depth=0 was missing. - - src/liblzma/lzma/lzma_encoder_presets.c | 1 + - 1 file changed, 1 insertion(+) - -commit 2577da9ebdba13fbe99ae5ee8bde35f7ed60f6d1 -Author: Lasse Collin -Date: 2010-09-23 14:03:10 +0300 - - Add translations.bash and translation notes to README. - - translations.bash prints some messages from xz, which - hopefully makes it a bit easier to test translations. - - README | 96 +++++++++++++++++++++++++++++++++++++++++++++-- - debug/translation.bash | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 192 insertions(+), 4 deletions(-) - -commit a3c5997c57e5b1a20aae6d1071b584b4f17d0b23 -Author: Lasse Collin -Date: 2010-09-17 22:14:30 +0300 - - xz: Update the Czech translation. - - Thanks to Marek ÄŒernocký. - - po/cs.po | 202 +++++++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 131 insertions(+), 71 deletions(-) - -commit a1766af582dc23fddd9da1eeb4b9d61e3eb4c2e6 -Author: Lasse Collin -Date: 2010-09-16 23:40:41 +0300 - - xz: Add Italian translation. - - Thanks to Milo Casagrande and Lorenzo De Liso. - - THANKS | 2 + - po/LINGUAS | 1 + - po/it.po | 902 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 905 insertions(+) - -commit 21088018554e2b0e02914205377ceb6e34a090bd -Author: Lasse Collin -Date: 2010-09-15 00:34:13 +0300 - - xz: Edit a translators comment. - - src/xz/list.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit be16e28ece1b492b8f93382b7fa1cc4da23c6ff6 -Author: Lasse Collin -Date: 2010-09-14 22:47:14 +0300 - - xz: Add German translation. - - Thanks to Andre Noll. - - THANKS | 1 + - po/LINGUAS | 1 + - po/de.po | 903 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 905 insertions(+) - -commit e23ea74f3240e6b69683f9e69d1716e0f9e9092b -Author: Lasse Collin -Date: 2010-09-10 14:30:25 +0300 - - Updated README. - - README | 2 -- - 1 file changed, 2 deletions(-) - -commit 8dad2fd69336985adb9f774fa96dc9c0efcb5a71 -Author: Lasse Collin -Date: 2010-09-10 14:30:07 +0300 - - Updated INSTALL. - - INSTALL | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -commit 0b5f07fe3728c27cce416ddc40f7e4803ae96ac2 -Author: Lasse Collin -Date: 2010-09-10 14:26:20 +0300 - - Updated the git repository address in ChangeLog. - - ChangeLog | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit a8760203f93a69bc39fd14520a6e9e7b7d70be06 -Author: Lasse Collin -Date: 2010-09-10 14:09:33 +0300 - - xz: Add a comment to translators about "literal context bits". - - src/xz/message.c | 4 ++++ - 1 file changed, 4 insertions(+) - -commit bb0b1004f83cdc4d309e1471c2ecaf9f95ce60c5 -Author: Lasse Collin -Date: 2010-09-10 10:30:33 +0300 - - xz: Multiple fixes. - - The code assumed that printing numbers with thousand separators - and decimal points would always produce only US-ASCII characters. - This was used for buffer sizes (with snprintf(), no overflows) - and aligning columns of the progress indicator and --list. That - assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so - multibyte character support was added in this commit. The old - way is used if the operating system doesn't have enough multibyte - support (e.g. lacks wcwidth()). - - The sizes of buffers were increased to accomodate multibyte - characters. I don't know how big they should be exactly, but - they aren't used for anything critical, so it's not too bad. - If they still aren't big enough, I hopefully get a bug report. - snprintf() takes care of avoiding buffer overflows. - - Some static buffers were replaced with buffers allocated on - stack. double_to_str() was removed. uint64_to_str() and - uint64_to_nicestr() now share the static buffer and test - for thousand separator support. - - Integrity check names "None" and "Unknown-N" (2 <= N <= 15) - were marked to be translated. I had forgot these, plus they - wouldn't have worked correctly anyway before this commit, - because printing tables with multibyte strings didn't work. - - Thanks to Marek ÄŒernocký for reporting the bug about - misaligned table columns in --list output. - - configure.ac | 1 + - m4/tuklib_mbstr.m4 | 30 ++++++ - src/common/tuklib_mbstr.h | 66 +++++++++++++ - src/common/tuklib_mbstr_fw.c | 31 ++++++ - src/common/tuklib_mbstr_width.c | 64 +++++++++++++ - src/xz/Makefile.am | 4 +- - src/xz/list.c | 205 +++++++++++++++++++++++++++------------- - src/xz/message.c | 56 +++++++---- - src/xz/message.h | 10 +- - src/xz/private.h | 1 + - src/xz/util.c | 136 +++++++++----------------- - src/xz/util.h | 7 -- - 12 files changed, 424 insertions(+), 187 deletions(-) - -commit 639f8e2af33cf8a184d59ba56b6df7c098679d61 -Author: Lasse Collin -Date: 2010-09-08 08:49:22 +0300 - - Update the Czech translation. - - Thanks to Marek ÄŒernocký. - - po/cs.po | 655 +++++++++++++++++++++++++++++++++++++++++++-------------------- - 1 file changed, 454 insertions(+), 201 deletions(-) - -commit 41bc9956ebfd7c86777d33676acf34c45e7ca7c7 -Author: Lasse Collin -Date: 2010-09-07 12:31:40 +0300 - - xz: Add a note to translators. - - src/xz/hardware.c | 2 ++ - 1 file changed, 2 insertions(+) - -commit 77a7746616e555fc08028e883a56d06bf0088b81 -Author: Lasse Collin -Date: 2010-09-07 10:42:13 +0300 - - Fix use of N_() and ngettext(). - - I had somehow thought that N_() is usually used - as shorthand for ngettext(). - - This also fixes a missing \n from a call to ngettext(). - - src/common/tuklib_gettext.h | 4 ++-- - src/xz/list.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -commit e6ad39335842343e622ab51207d1d3cb9caad801 -Author: Lasse Collin -Date: 2010-09-06 19:43:12 +0300 - - Add missing files to POTFILES.in. - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 18 04:13:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F995EE8F42; Fri, 18 May 2018 04:13:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FE5184AED; Fri, 18 May 2018 04:13:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC28A131DD; Fri, 18 May 2018 04:13:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I4DwlN086095; Fri, 18 May 2018 04:13:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I4DwnV086094; Fri, 18 May 2018 04:13:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201805180413.w4I4DwnV086094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 18 May 2018 04:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333780 - vendor/xz/5.2.4 X-SVN-Group: vendor X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: vendor/xz/5.2.4 X-SVN-Commit-Revision: 333780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 04:13:59 -0000 Author: delphij Date: Fri May 18 04:13:58 2018 New Revision: 333780 URL: https://svnweb.freebsd.org/changeset/base/333780 Log: Tag xz 5.2.4. Added: vendor/xz/5.2.4/ - copied from r333779, vendor/xz/dist/ From owner-svn-src-all@freebsd.org Fri May 18 04:13:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91134EE8F43; Fri, 18 May 2018 04:13:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4473F84AEE; Fri, 18 May 2018 04:13:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D144131DE; Fri, 18 May 2018 04:13:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I4DwG3086097; Fri, 18 May 2018 04:13:58 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I4DwNZ086096; Fri, 18 May 2018 04:13:58 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805180413.w4I4DwNZ086096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 04:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333781 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 333781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 04:13:59 -0000 Author: mmacy Date: Fri May 18 04:13:58 2018 New Revision: 333781 URL: https://svnweb.freebsd.org/changeset/base/333781 Log: epoch(9): fix error in example and update API reference Submitted by: hps Approved by: sbruno Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Fri May 18 04:13:58 2018 (r333780) +++ head/share/man/man9/epoch.9 Fri May 18 04:13:58 2018 (r333781) @@ -45,14 +45,20 @@ .In sys/proc.h .In sys/epoch.h .Ft epoch_t -.Fn epoch_alloc "void" +.Fn epoch_alloc "int flags" .Ft void .Fn epoch_enter "epoch_t epoch" .Ft void +.Fn epoch_enter_critical "epoch_t epoch" +.Ft void .Fn epoch_exit "epoch_t epoch" .Ft void +.Fn epoch_exit_critical "epoch_t epoch" +.Ft void .Fn epoch_wait "epoch_t epoch" .Ft void +.Fn epoch_wait_critical "epoch_t epoch" +.Ft void .Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)" .Ft int .Fn in_epoch "void" @@ -66,14 +72,24 @@ Epochs are allocated with .Fn epoch_alloc and freed with .Fn epoch_free . +The flags passed to epoch_alloc determine whether preemption is +allowed during a section (the default) or not, as specified by +EPOCH_CRITICAL. Threads indicate the start of an epoch critical section by calling .Fn epoch_enter . The end of a critical section is indicated by calling .Fn epoch_exit . +The _critical variants can be used around code in which it is safe +to have preemption disable. A thread can wait until a grace period has elapsed since any threads have entered the epoch by calling .Fn epoch_wait . +The use of a EPOCH_CRITICAL epoch type allows one to use +.Fn epoch_wait_critical +which is guaranteed to have much shorter completion times since +we know that none of the threads in an epoch section will be preempted +before completing its section. If the thread can't sleep or is otherwise in a performance sensitive path it can ensure that a grace period has elapsed by calling .Fn epoch_call @@ -106,8 +122,12 @@ Async free example: Thread 1: .Bd -literal +int +in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_laddr *laddr, + struct ucred *cred) { - epoch_enter(net_epoch); + /* ... */ + epoch_enter(net_epoch); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sa = ifa->ifa_addr; if (sa->sa_family != AF_INET) @@ -119,6 +139,7 @@ Thread 1: } } epoch_exit(net_epoch); + /* ... */ } .Ed Thread 2: @@ -131,12 +152,13 @@ ifa_free(struct ifaddr *ifa) epoch_call(net_epoch, &ifa->ifa_epoch_ctx, ifa_destroy); } +void +if_purgeaddrs(struct ifnet *ifp) { + /* .... */ IF_ADDR_WLOCK(ifp); CK_STAILQ_REMOVE(&ifp->if_addrhead, ifa, ifaddr, ifa_link); - /* mark as unlinked */ - ifa->ifa_addr->sa_family = AF_UNSPEC; IF_ADDR_WUNLOCK(ifp); ifa_free(ifa); } From owner-svn-src-all@freebsd.org Fri May 18 05:07:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C761CEEA01E for ; Fri, 18 May 2018 05:07:23 +0000 (UTC) (envelope-from as@talestogrow.com) Received: from relay03.clubedashistorias.com (ip15.ip-51-38-85.eu [51.38.85.15]) by mx1.freebsd.org (Postfix) with ESMTP id 69CB2864D3 for ; Fri, 18 May 2018 05:07:21 +0000 (UTC) (envelope-from as@talestogrow.com) Received: from localhost.localdomain (455862189uuo.maya-dns.net [45.58.62.189]) by relay03.clubedashistorias.com (Postfix) with ESMTP id AC60F2921F14 for ; Fri, 18 May 2018 05:07:11 +0000 (UTC) Date: Fri, 18 May 2018 06:07:13 +0100 To: svn-src-all@freebsd.org From: Stories for Everyone - AS8 Reply-to: Stories for Everyone - AS8 Subject: Joy of Reading - Last Invitation Message-ID: X-Priority: 3 X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net) MIME-Version: 1.0 Content-Type: text/plain; charset = "iso-8859-1" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 05:07:26 -0000  _____________________________________ Pedagogical Project “The Joy of Reading” ______________________________________ You are invited to visit our Blog   JOY OF READING   Dear Sir/Madam,   The team responsible for the Project "Joy of Reading" consists of a group of people dedicated to raise the joy of reading stories. For some years now, the team involved in the project has worked together with schools, libraries, and foster centres, as well as other places, to encourage the love of reading among people of all ages and to promote literacy. So we decided to share stories via email on a weekly basis with everyone who is interested in receiving them. The project consists of 2 weekly stories, sent by e-mail – one for a young and adult audience and another one shorter and more suitable for early ages. Each story is about values such as peace, solidarity, respect, gentleness, and responsibility, among others, while also working as a reflection on the fundamental ethical principles of the world we all live in. Below you can read 2 stories and take your time to enjoy them or you can read them in the PDF attachment where they are written in colourful fonts and with pictures. If you are interested in receiving 2 stories every week in your email, you will have to subscribe to it by replying to this email saying “I would like to subscribe to the Joy of Reading Project”. If you don’t subscribe this week, you will stop receiving the story. The subscription is totally free of charge and you can unsubscribe when you want to. We also assure you that your email address will remain strictly confidential.  The Joy of Reading team   If you are interested in receiving the weekly story, click here. If you don’t want to receive the weekly story, click here.   If you prefer, you can reply to this email or to stories4ev@gmail.com with the following sentence on the subject line: “I am interested in receiving the weekly story”. _____________________________________ This week’s stories with PDF attachments: - THE ROYAL BEE - ZIGZAG _________________________________________ THE ROYAL BEE AUTHORS' NOTE The Royal Bee was inspired by the true story of our grandfather; Hong Seung Han, when he was an illiterate boy in late nineteenth-century Korea. Too poor to attend school, he would eavesdrop at the door of the rich children's schoolhouse until he was eventually allowed to attend. After he won a national academic contest, the Governor of his province invited him to reside in the palace. There, he tutored the Governor's young son while continuing his education. Years later our grandfather attended seminary in Pyongyang under the teachings of an American missionary and became a prominent church minister. In 1905 he wed our grandmother; Pang Seung Hwa. Together they became missionaries in China. ***   In the days when kings ruled Korea, only the privileged yangban children went to school. They wore fine clothing and carried handsome books. They competed in The Royal Bee at the Governor's palace. They grew up to be scholars and noblemen. Song-ho was not among the privileged. He was a sangmin boy dressed in rags. But the distant sound of a school bell made him dream of the day when he could read books and write poetry. Song-ho watched his mother wash her tired face in a bowl of water as the meager dawn light worked its way into their small hut. She stood over Song-ho and murmured, "Be good today." "I will do all my chores," Song-ho promised. Then she was off into the autumn cornfields. Song-ho's father had been a fisherman, but he died at sea years ago. Song-ho's mother worked as a farmhand harvesting whatever crop was in season to put food on the table. If she was lucky, she would bring home an armload of wilted fruits or vegetables. Song-ho began his morning chores. He swept the hut, soaked soybeans for supper, and washed rags in the mountain stream. As Song-ho squeezed the last rag in the stream, the sound of a bell rang deep in the valley where many yangbans lived. Ding dong, ding dong. This was the sound of the school bell from The Sodang School! Ding dong, ding dong, the school bell rang as Song-ho carried the wet rags back to the hut. Ding dong, ding dong, the sound echoed in his ears. As if the bell were calling him, Song-ho followed it deep into the valley. At last he came upon The Sodang School, surrounded by golden rain trees. The school was more beautiful than he ever imagined. The bell was now still and silent for study time. Song-ho tiptoed toward the rice-paper door. The shadow of a master giving instruction to a roomful of yangban pupils rose before him. Suddenly, the door slid open. The master towered over Song-ho in the doorway. He stroked his long, silvery beard. "I am Master Min. What brings you here, child?" "I am Song-ho. May I be your pupil?" the boy eagerly inquired. Master Min looked down at Song-ho in his rags and frowned. "No, that is not possible." "How can I grow up to earn a good living for my mother when I cannot read or write?" Song-ho begged for an answer. The boy's bravery brought a lump to Master Min's throat. But rules were rules, and sangmins were not allowed to attend The Sodang School. "Go home, Song-ho," Master Min said, sliding the door closed. But Song-ho did not budge. He kept his ear to the door and listened to Master Min's lesson. Little did Song-ho know that Master Min could see his small, huddling shadow through the door! But Master Min was a man with a kind heart. He took pity on Song-ho and allowed him to stay outside during the lesson. Song-ho learned about ancient kingdoms and great leaders. He learned about The Royal Bee, which was held every spring in The Great Hall at the Governor's palace. Only one pupil from each school across the land would be chosen to compete in this contest of knowledge. That evening Song-ho spooned soybean soup into a bowl for his mother. She ate her soup as the steam warmed her weary face. "My poor Song-ho! How I wish I could give you more in this world than spotted ears of corn." Song-ho did not tell his mother about his adventure at The Sodang School. Someday he would surprise her with all that he had learned. Later Song-ho shucked the spotted ears of corn, thinking: If I learn how to read and write, I will give my mother golden ears of corn. Every day Song-ho returned to The Sodang School, following the sound of the bell deep into the valley. He would hide behind a golden rain tree until all the finely dressed yangban pupils were inside, until the school bell grew still and silent. Every day the sight of Song-ho's shadow at the door brought a tear to Master Min's eye. Every day he delivered his lesson loud and clear. Winter arrived. Icicles hung from the bare branches of the golden rain trees at The Sodang School. Song-ho huddled by the door, bent and shivering. His ears were so frozen, he could hardly hear Master Min's lesson. Suddenly, the door slid open. "Come in, Song-ho," Master Min commanded him. Song-ho stepped into a roomful of yangban pupils. They gasped at the sight of the boy in rags. "Song-ho has been very sneaky," Master Min explained. "He has been listening to our lessons. We must put his eavesdropping to a test." "Who was the father of our alphabet?" one yangban pupil questioned Song-ho. "King Sejong," Song-ho answered. "What is the largest island of our country?" another yangban pupil asked. "Cheju Island," Song-ho replied. After each yangban pupil in the classroom had tested Song-ho, Master Min spoke: "Welcome to The Sodang School, Song-ho." The yangban pupils respectfully bowed their heads and chorused, "Welcome to The Sodang School." That evening Song-ho spooned soybean soup into a bowl for his mother. She had spent her whole day collecting chestnuts from the ground. Now she drooped with despair. "My poor Song-ho! How I wish I could give you more in this world than cracked chestnuts." Later Song-ho roasted a pan of cracked chestnuts, thinking: If I learn how to read and write, I will give my mother perfect chestnuts!   Spring arrived. As the golden rain trees bloomed gracefully at The Sodang School, Song-ho learned how to read books from cover to cover. He learned how to dip a delicate paintbrush into a black ink stone and write beautiful poetry on white scroll paper. Song-ho became a prize pupil. One morning Master Min asked Song-ho to stand before the class. "You have been chosen by your classmates to represent The Sodang School in The Royal Bee," Master Min announced. Song-ho could not believe his ears! Master Min proudly presented Song-ho with a bundle of silk. "A gift from your classmates." "A gift to wear to The Royal Bee!" hailed the yangban classmates. "A gift of good luck'" Song-ho slowly untied the bundle. Out tumbled a colorful ceremonial costume, sparkling like a mountain of jewels. Song-ho bowed his head in thanks. That evening Song-ho spooned soybean soup into a bowl for his mother. She had just returned from a long day in the melon fields. "My poor Song-ho! How I wish I could give you more in this world than bruised melons." Later Song-ho sliced the bruised melons, thinking: If I win The Royal Bee, I will give my mother sweet melons! The morning of The Royal Bee arrived! The Governor's palace stood among mountains that touched the sky. In his ceremonial costume of deep green and shimmering pink, Song-ho walked with Master Min through the iron gates. They entered The Great Hall. Master Min escorted Song-ho to a large gathering of yangban pupils who stood before a panel of judges. Then Master Min took his place in the audience. A hush came over the palace as the Governor made his entrance with the help of a pearl-studded cane. From his royal seat he proclaimed: "Welcome to The Royal Bee! The judges will test you from their Book of Knowledge. A wrong answer and you will fall out of the contest. When The Royal Bee is over, only one pupil will remain standing ‑ the number one pupil in the land!" One by one the pupils were asked questions by the panel of judges. One by one the pupils began to fall out of The Royal Bee. Hours later, only two pupils remained. One of the pupils was Song-ho! "What mountain has twelve thousand rocky peaks?" one judge questioned Song-ho. "Diamond Mountain," Song-ho answered. "What Far East country borders Korea?" another judge asked the yangban pupil. "China," the yangban pupil replied. The Royal Bee went on and on. Darkness fell over the palace. The audience grew restless, and the judges ran out of questions. Finally, the Governor stood up and spoke: "There is only one way to decide the winner of The Royal Bee. Each of you must answer this question: What does winning The Royal Bee mean to you? When the moon shines into The Great Hall, you must deliver your answer." When the moon shone in The Great Hall, the yangban pupil stepped forward. "I have studied all year long to compete in The Royal Bee, Great Governor. If I win I will follow in my ancestors' footsteps. I will attend the finest schools and grow up to be a famous scholar'" The audience clapped politely. Now it was Song-ho's turn. He took a nervous step forward and began to speak: My mother works in the fields Every day from dawn to dusk, Knowing in her heart there is No hope for people like us. Then Master Min took me in And broke the honored rule. He let a sangmin boy like me Attend The Sodang School. He taught me how to read and write And I am at The Royal Bee! The gift of hope has now been won For my poor mother and me. Like the full moon, silence filled The Great Hall. Then the audience rose to its feet and clapped so thunderously that The Great Hall seemed to shake! Master Min shed tears of joy as the Governor declared Song-ho the winner of The Royal Bee. "You have shown great courage by speaking the truth, Song-ho," the Governor stated. A royal ceremony followed. The Governor presented Song-ho with a prize cow draped with silk and a necklace of glittery gold coins. The hour was late when Song-ho made his journey home with his prize cow. Across the mountains he could hear his mother calling him. "Song-ho! Song-ho! Where are you?" Tonight Song-ho would surprise his mother with all that he had learned at The Sodang School. And how he had won The Royal Bee! And a prize cow! And silk! And gold coins! Just then the sound of a bell rang deep in the valley. Ding dong, ding dong. This was the sound of the school bell from The Sodang School. In honor of Song-ho! Ding dong, ding dong, the school bell rang as Song-ho hurried back to the hut. Ding dong, ding dong, the sound echoed in his ears. Frances Park, Ginger Park and Christopher Zhong-Yuan Zhang The royal bee Pennsylvania, Boyds Mills Press, 2000 ______________________________________   ZIGZAG   “I’ll name you Zigzag,” said the dollmaker, as she finished sewing her new doll’s mouth. He was made of scraps. He was odd-looking, with spiky hair, patchwork clothes and tiny wings. His zigzag mouth made him look sad, but something about him made the dollmaker smile. The dollmaker put Zigzag on a shelf with the other dolls. “Some child will love you,” she told him. Then she put out the lights and closed her shop for the night. That night the toys woke and stared at the strange new doll. “What mother would buy that awful thing for her child?” wondered the lion. The penguin agreed, “He’d give a little boy or girl nightmares.” “I’m just special,” Zigzag insisted. “You’re just ugly,” the elephant snorted. The other dolls began to laugh. “Ha! Ha! Ho! Ho!” “Hee-hee-hee!” they roared, “You are so very UG-ly!” The bunnies began to chant, “Squeeze him out! Squeeze him out! Squeeze him out!” All the dolls helped the bunnies push Zigzag off the shelf. As Zigzag fell, he tumbled past the stuffed satin pots thumpty-thump right into the wastebasket. When the dollmaker opened her shop the next morning, all the dolls sat silently as if nothing had happened. Then she emptied the wastebasket into the dustbin behind her shop. That night, Zigzag struggled out of the dustbin. Some child will love me, he told himself, remembering what the dollmaker had said. While crossing the park, he heard, “Who? Who? Who?” from a treetop. “I’m Zigzag,” he answered. A hunting owl swooped down and carried Zigzag high into the sky, thinking he might make a good dinner. But when he realized Zigzag was a doll, he let him go. Zigzag fell into a meadow of thick, soft grass. As he brushed himself off, whispery voices asked, “Who are you?” “I’m Zigzag,” he said. Three field mice crept out of the grass. “Why are you here?” they asked. “I’m looking for a child to love me,” he said. The mice took him to wise Papa Mouse. “I want to find a child to love me,” Zigzag told him. “Our cousins live in a house nearby,” said Papa. “The little girl there feeds them bread and cheese.” “She sounds just like the kind of child I’m looking for,” said Zigzag. “My children will take you there,” said Papa Mouse. “But watch out for the hungry owl.” So off they went. Suddenly the owl flew down to see what made the meadow grass move. Up jumped Zigzag, shouting, “Remember me?” “Silly doll,” the owl screeched. And he flew away without ever seeing the little mice. The windows of the little girl’s house were dark. Everyone was asleep. With the mice’s help, Zigzag climbed the steps to the front porch. “Do you think the little girl will like me?” he asked. “She will love you,” the mice promised. The next morning, the little girl found Zigzag sitting on her porch. She hugged him and took him to her room. There she sat him at a toy table, served him cups of tea and told him funny stories. I’ve finally found someone to love me, Zigzag thought. And his sad-looking zigzag mouth turned into a smile of joy.     Robert San Souci; Stefan Czernecki Zig Zag London, Tradewind Books Limited, 2005   ______________________________________   You can visit us on Facebook and on Slideshare where you can find more interesting stories about several different topics.   Stories for Everyone – stories on Slideshare Stories for Everyone – stories on Facebook   as@talestogrow.com stories4ev@gmail.com If you wish to remove your email from our mailling list please click Here.     From owner-svn-src-all@freebsd.org Fri May 18 06:09:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93535EEB6DA; Fri, 18 May 2018 06:09:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3023D6848D; Fri, 18 May 2018 06:09:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CA2B1437C; Fri, 18 May 2018 06:09:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I69GTm042509; Fri, 18 May 2018 06:09:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I69GsS042506; Fri, 18 May 2018 06:09:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805180609.w4I69GsS042506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 18 May 2018 06:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333782 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 333782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 06:09:17 -0000 Author: np Date: Fri May 18 06:09:15 2018 New Revision: 333782 URL: https://svnweb.freebsd.org/changeset/base/333782 Log: cxgbe(4): Implement ifnet callbacks that deal with send tags. An etid (ethoffload tid) is allocated for a send tag and it acquires a reference on the traffic class that matches the send parameters associated with the tag. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri May 18 04:13:58 2018 (r333781) +++ head/sys/dev/cxgbe/adapter.h Fri May 18 06:09:15 2018 (r333782) @@ -1236,6 +1236,15 @@ int t4_free_tx_sched(struct adapter *); void t4_update_tx_sched(struct adapter *); int t4_reserve_cl_rl_kbps(struct adapter *, int, u_int, int *); void t4_release_cl_rl_kbps(struct adapter *, int, int); +#ifdef RATELIMIT +void t4_init_etid_table(struct adapter *); +void t4_free_etid_table(struct adapter *); +int cxgbe_snd_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, + struct m_snd_tag **); +int cxgbe_snd_tag_modify(struct m_snd_tag *, union if_snd_tag_modify_params *); +int cxgbe_snd_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); +void cxgbe_snd_tag_free(struct m_snd_tag *); +#endif /* t4_filter.c */ int get_filter_mode(struct adapter *, uint32_t *); Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Fri May 18 04:13:58 2018 (r333781) +++ head/sys/dev/cxgbe/offload.h Fri May 18 06:09:15 2018 (r333782) @@ -79,6 +79,38 @@ union aopen_entry { union aopen_entry *next; }; +struct cxgbe_snd_tag { + struct m_snd_tag com; + struct adapter *adapter; + u_int flags; + struct mtx lock; + int port_id; + int etid; + struct sge_wrq *eo_txq; + uint16_t iqid; + int8_t schedcl; + uint64_t max_rate; /* in bytes/s */ + int8_t next_credits; /* need these many tx credits next */ + uint8_t next_nsegs; /* next WR will have these many GL segs total */ + uint8_t next_msegs; /* max segs for a single mbuf in next chain */ + uint8_t tx_total; /* total tx WR credits (in 16B units) */ + uint8_t tx_credits; /* tx WR credits (in 16B units) available */ + uint8_t tx_nocompl; /* tx WR credits since last compl request */ + uint8_t ncompl; /* # of completions outstanding. */ +}; + +static inline struct cxgbe_snd_tag * +mst_to_cst(struct m_snd_tag *t) +{ + + return (__containerof(t, struct cxgbe_snd_tag, com)); +} + +union etid_entry { + struct cxgbe_snd_tag *cst; + union etid_entry *next; +}; + /* * Holds the size, base address, free list start, etc of the TID, server TID, * and active-open TID tables. The tables themselves are allocated dynamically. @@ -98,8 +130,8 @@ struct tid_info { struct mtx atid_lock __aligned(CACHE_LINE_SIZE); union aopen_entry *atid_tab; - u_int natids; union aopen_entry *afree; + u_int natids; u_int atids_in_use; struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); @@ -115,9 +147,11 @@ struct tid_info { /* ntids, tids_in_use */ struct mtx etid_lock __aligned(CACHE_LINE_SIZE); - struct etid_entry *etid_tab; + union etid_entry *etid_tab; + union etid_entry *efree; u_int netids; u_int etid_base; + u_int etids_in_use; }; struct t4_range { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri May 18 04:13:58 2018 (r333781) +++ head/sys/dev/cxgbe/t4_main.c Fri May 18 06:09:15 2018 (r333782) @@ -1105,6 +1105,9 @@ t4_attach(device_t dev) t4_init_l2t(sc, M_WAITOK); t4_init_tx_sched(sc); +#ifdef RATELIMIT + t4_init_etid_table(sc); +#endif /* * Second pass over the ports. This time we know the number of rx and @@ -1375,6 +1378,9 @@ t4_detach_common(device_t dev) if (sc->l2t) t4_free_l2t(sc->l2t); +#ifdef RATELIMIT + t4_free_etid_table(sc); +#endif #if defined(TCP_OFFLOAD) || defined(RATELIMIT) free(sc->sge.ofld_txq, M_CXGBE); @@ -1486,6 +1492,12 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_transmit = cxgbe_transmit; ifp->if_qflush = cxgbe_qflush; ifp->if_get_counter = cxgbe_get_counter; +#ifdef RATELIMIT + ifp->if_snd_tag_alloc = cxgbe_snd_tag_alloc; + ifp->if_snd_tag_modify = cxgbe_snd_tag_modify; + ifp->if_snd_tag_query = cxgbe_snd_tag_query; + ifp->if_snd_tag_free = cxgbe_snd_tag_free; +#endif ifp->if_capabilities = T4_CAP; #ifdef TCP_OFFLOAD @@ -7928,8 +7940,8 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) } if (t->netids) { - sbuf_printf(sb, "ETID range: %u-%u\n", t->etid_base, - t->etid_base + t->netids - 1); + sbuf_printf(sb, "ETID range: %u-%u, in use: %u\n", t->etid_base, + t->etid_base + t->netids - 1, t->etids_in_use); } sbuf_printf(sb, "HW TID usage: %u IP users, %u IPv6 users", Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Fri May 18 04:13:58 2018 (r333781) +++ head/sys/dev/cxgbe/t4_sched.c Fri May 18 06:09:15 2018 (r333782) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ratelimit.h" #include #include @@ -463,3 +464,197 @@ t4_release_cl_rl_kbps(struct adapter *sc, int port_id, tc->refcount--; mtx_unlock(&sc->tc_lock); } + +#ifdef RATELIMIT +void +t4_init_etid_table(struct adapter *sc) +{ + int i; + struct tid_info *t; + + if (!is_ethoffload(sc)) + return; + + t = &sc->tids; + MPASS(t->netids > 0); + + mtx_init(&t->etid_lock, "etid lock", NULL, MTX_DEF); + t->etid_tab = malloc(sizeof(*t->etid_tab) * t->netids, M_CXGBE, + M_ZERO | M_WAITOK); + t->efree = t->etid_tab; + t->etids_in_use = 0; + for (i = 1; i < t->netids; i++) + t->etid_tab[i - 1].next = &t->etid_tab[i]; + t->etid_tab[t->netids - 1].next = NULL; +} + +void +t4_free_etid_table(struct adapter *sc) +{ + struct tid_info *t; + + if (!is_ethoffload(sc)) + return; + + t = &sc->tids; + MPASS(t->netids > 0); + + free(t->etid_tab, M_CXGBE); + t->etid_tab = NULL; + + if (mtx_initialized(&t->etid_lock)) + mtx_destroy(&t->etid_lock); +} + +/* etid services */ +static int alloc_etid(struct adapter *, struct cxgbe_snd_tag *); +static void free_etid(struct adapter *, int); + +static int +alloc_etid(struct adapter *sc, struct cxgbe_snd_tag *cst) +{ + struct tid_info *t = &sc->tids; + int etid = -1; + + mtx_lock(&t->etid_lock); + if (t->efree) { + union etid_entry *p = t->efree; + + etid = p - t->etid_tab + t->etid_base; + t->efree = p->next; + p->cst = cst; + t->etids_in_use++; + } + mtx_unlock(&t->etid_lock); + return (etid); +} + +#ifdef notyet +struct cxgbe_snd_tag * +lookup_etid(struct adapter *sc, int etid) +{ + struct tid_info *t = &sc->tids; + + return (t->etid_tab[etid - t->etid_base].cst); +} +#endif + +static void +free_etid(struct adapter *sc, int etid) +{ + struct tid_info *t = &sc->tids; + union etid_entry *p = &t->etid_tab[etid - t->etid_base]; + + mtx_lock(&t->etid_lock); + p->next = t->efree; + t->efree = p; + t->etids_in_use--; + mtx_unlock(&t->etid_lock); +} + +int +cxgbe_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, + struct m_snd_tag **pt) +{ + int rc, schedcl; + struct vi_info *vi = ifp->if_softc; + struct port_info *pi = vi->pi; + struct adapter *sc = pi->adapter; + struct cxgbe_snd_tag *cst; + + if (params->hdr.type != IF_SND_TAG_TYPE_RATE_LIMIT) + return (ENOTSUP); + + rc = t4_reserve_cl_rl_kbps(sc, pi->port_id, + (params->rate_limit.max_rate * 8ULL / 1000), &schedcl); + if (rc != 0) + return (rc); + MPASS(schedcl >= 0 && schedcl < sc->chip_params->nsched_cls); + + cst = malloc(sizeof(*cst), M_CXGBE, M_ZERO | M_NOWAIT); + if (cst == NULL) { +failed: + t4_release_cl_rl_kbps(sc, pi->port_id, schedcl); + return (ENOMEM); + } + + cst->etid = alloc_etid(sc, cst); + if (cst->etid < 0) { + free(cst, M_CXGBE); + goto failed; + } + + mtx_init(&cst->lock, "cst_lock", NULL, MTX_DEF); + cst->com.ifp = ifp; + cst->adapter = sc; + cst->port_id = pi->port_id; + cst->schedcl = schedcl; + cst->max_rate = params->rate_limit.max_rate; + cst->next_credits = -1; + cst->tx_credits = sc->params.ofldq_wr_cred; + cst->tx_total = cst->tx_credits; + + /* + * Queues will be selected later when the connection flowid is available. + */ + + *pt = &cst->com; + return (0); +} + +/* + * Change in parameters, no change in ifp. + */ +int +cxgbe_snd_tag_modify(struct m_snd_tag *mst, + union if_snd_tag_modify_params *params) +{ + int rc, schedcl; + struct cxgbe_snd_tag *cst = mst_to_cst(mst); + struct adapter *sc = cst->adapter; + + /* XXX: is schedcl -1 ok here? */ + MPASS(cst->schedcl >= 0 && cst->schedcl < sc->chip_params->nsched_cls); + + rc = t4_reserve_cl_rl_kbps(sc, cst->port_id, + (params->rate_limit.max_rate * 8ULL / 1000), &schedcl); + if (rc != 0) + return (rc); + MPASS(schedcl >= 0 && schedcl < sc->chip_params->nsched_cls); + t4_release_cl_rl_kbps(sc, cst->port_id, cst->schedcl); + cst->schedcl = schedcl; + cst->max_rate = params->rate_limit.max_rate; + + return (0); +} + +int +cxgbe_snd_tag_query(struct m_snd_tag *mst, + union if_snd_tag_query_params *params) +{ + struct cxgbe_snd_tag *cst = mst_to_cst(mst); + + params->rate_limit.max_rate = cst->max_rate; + +#define CST_TO_MST_QLEVEL_SCALE (IF_SND_QUEUE_LEVEL_MAX / cst->tx_total) + params->rate_limit.queue_level = + (cst->tx_total - cst->tx_credits) * CST_TO_MST_QLEVEL_SCALE; + + return (0); +} + +void +cxgbe_snd_tag_free(struct m_snd_tag *mst) +{ + struct cxgbe_snd_tag *cst = mst_to_cst(mst); + struct adapter *sc = cst->adapter; + + if (cst->etid >= 0) + free_etid(sc, cst->etid); + if (cst->schedcl != -1) + t4_release_cl_rl_kbps(sc, cst->port_id, cst->schedcl); + if (mtx_initialized(&cst->lock)) + mtx_destroy(&cst->lock); + free(cst, M_CXGBE); +} +#endif From owner-svn-src-all@freebsd.org Fri May 18 06:10:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0395EEB73A; Fri, 18 May 2018 06:10:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74F33685CC; Fri, 18 May 2018 06:10:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55B0314381; Fri, 18 May 2018 06:10:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I6AHIV042627; Fri, 18 May 2018 06:10:17 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I6AGn6042623; Fri, 18 May 2018 06:10:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201805180610.w4I6AGn6042623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 18 May 2018 06:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333783 - in head: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/lzma contrib/xz/src/l... X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/common contrib/xz/src/liblzma/lzma contrib/xz/src/liblzma/rangecoder contrib... X-SVN-Commit-Revision: 333783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 06:10:18 -0000 Author: delphij Date: Fri May 18 06:10:16 2018 New Revision: 333783 URL: https://svnweb.freebsd.org/changeset/base/333783 Log: MFV r333779: xz 5.2.4. MFC after: 2 weeks Modified: head/contrib/xz/COPYING head/contrib/xz/ChangeLog head/contrib/xz/README head/contrib/xz/THANKS head/contrib/xz/src/common/tuklib_integer.h head/contrib/xz/src/liblzma/api/lzma.h head/contrib/xz/src/liblzma/api/lzma/base.h head/contrib/xz/src/liblzma/api/lzma/container.h head/contrib/xz/src/liblzma/api/lzma/index.h head/contrib/xz/src/liblzma/api/lzma/version.h head/contrib/xz/src/liblzma/common/alone_decoder.c head/contrib/xz/src/liblzma/common/auto_decoder.c head/contrib/xz/src/liblzma/common/common.c head/contrib/xz/src/liblzma/common/index_decoder.c head/contrib/xz/src/liblzma/common/stream_decoder.c head/contrib/xz/src/liblzma/lzma/lzma_decoder.c head/contrib/xz/src/liblzma/rangecoder/range_common.h head/contrib/xz/src/xz/file_io.c head/contrib/xz/src/xz/list.c head/contrib/xz/src/xz/xz.1 head/contrib/xz/src/xzdec/xzdec.1 head/lib/liblzma/config.h Directory Properties: head/contrib/xz/ (props changed) Modified: head/contrib/xz/COPYING ============================================================================== --- head/contrib/xz/COPYING Fri May 18 06:09:15 2018 (r333782) +++ head/contrib/xz/COPYING Fri May 18 06:10:16 2018 (r333783) @@ -47,7 +47,7 @@ XZ Utils Licensing naturally it is not legally required. Here is an example of a good notice to put into "about box" or into documentation: - This software includes code from XZ Utils . + This software includes code from XZ Utils . The following license texts are included in the following files: - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 Modified: head/contrib/xz/ChangeLog ============================================================================== --- head/contrib/xz/ChangeLog Fri May 18 06:09:15 2018 (r333782) +++ head/contrib/xz/ChangeLog Fri May 18 06:10:16 2018 (r333783) @@ -1,3 +1,284 @@ +commit b5be61cc06088bb07f488f9baf7d447ff47b37c1 +Author: Lasse Collin +Date: 2018-04-29 19:00:06 +0300 + + Bump version and soname for 5.2.4. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit c47fa6d06745bb2e99866e76b81ac7a9c5a8bfec +Author: Lasse Collin +Date: 2018-04-29 18:48:00 +0300 + + extra/scanlzma: Fix compiler warnings. + + extra/scanlzma/scanlzma.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 7b350fe21aa4fd6495a3b6188a40e3f1ae7c0edf +Author: Lasse Collin +Date: 2018-04-29 18:15:37 +0300 + + Add NEWS for 5.2.4. + + NEWS | 27 +++++++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + +commit 5801591162a280aa52d156dfde42c531ec7fd8b6 +Author: Lasse Collin +Date: 2018-02-06 19:36:30 +0200 + + Update THANKS. + + THANKS | 2 ++ + 1 file changed, 2 insertions(+) + +commit c4a616f4536146f8906e1b4412eefeec07b28fae +Author: Ben Boeckel +Date: 2018-01-29 13:58:18 -0500 + + nothrow: use noexcept for C++11 and newer + + In C++11, the `throw()` specifier is deprecated and `noexcept` is + preffered instead. + + src/liblzma/api/lzma.h | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 0b8947782ff3c5ef830a7f85412e44dcf3cdeb77 +Author: Lasse Collin +Date: 2018-02-06 18:02:48 +0200 + + liblzma: Remove incorrect #ifdef from range_common.h. + + In most cases it was harmless but it could affect some + custom build systems. + + Thanks to Pippijn van Steenhoven. + + src/liblzma/rangecoder/range_common.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +commit 48f3b9f73ffea7f55d5678997aba0e79d2e82168 +Author: Lasse Collin +Date: 2018-01-10 22:10:39 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit a3ce3e902342be37c626a561ce3d9ffcf27d0f94 +Author: Lasse Collin +Date: 2018-01-10 21:54:27 +0200 + + tuklib_integer: New Intel C compiler needs immintrin.h. + + Thanks to Melanie Blower (Intel) for the patch. + + src/common/tuklib_integer.h | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +commit 4505ca483985f88c6923c05a43b4327feaab83b1 +Author: Lasse Collin +Date: 2017-09-24 20:04:24 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 1ef3cc226e3ce173575c218238b71a4eecabc470 +Author: Lasse Collin +Date: 2017-09-16 20:36:20 +0300 + + Windows: Fix paths in VS project files. + + Some paths use slashes instead of backslashes as directory + separators... now it should work (I tested VS2013 version). + + windows/vs2013/liblzma.vcxproj | 12 ++++++------ + windows/vs2013/liblzma_dll.vcxproj | 24 ++++++++++++------------ + windows/vs2017/liblzma.vcxproj | 12 ++++++------ + windows/vs2017/liblzma_dll.vcxproj | 24 ++++++++++++------------ + 4 files changed, 36 insertions(+), 36 deletions(-) + +commit e775d2a8189d24f60470e6e49d8af881df3a1680 +Author: Lasse Collin +Date: 2017-09-16 12:54:23 +0300 + + Windows: Add project files for VS2017. + + These files match the v5.2 branch (no file info decoder). + + windows/vs2017/config.h | 148 ++++++++++++++ + windows/vs2017/liblzma.vcxproj | 355 ++++++++++++++++++++++++++++++++++ + windows/vs2017/liblzma_dll.vcxproj | 384 +++++++++++++++++++++++++++++++++++++ + windows/vs2017/xz_win.sln | 48 +++++ + 4 files changed, 935 insertions(+) + +commit 10e02e0fbb6e2173f8b41f6e39b7b570f47dd74d +Author: Lasse Collin +Date: 2017-09-16 12:39:43 +0300 + + Windows: Move VS2013 files into windows/vs2013 directory. + + windows/{ => vs2013}/config.h | 0 + windows/{ => vs2013}/liblzma.vcxproj | 278 +++++++++++++++--------------- + windows/{ => vs2013}/liblzma_dll.vcxproj | 280 +++++++++++++++---------------- + windows/{ => vs2013}/xz_win.sln | 0 + 4 files changed, 279 insertions(+), 279 deletions(-) + +commit 06eebd4543196ded36fa9b8b9544195b38b24ef2 +Author: Lasse Collin +Date: 2017-08-14 20:08:33 +0300 + + Fix or hide warnings from GCC 7's -Wimplicit-fallthrough. + + src/liblzma/lzma/lzma_decoder.c | 6 ++++++ + src/xz/list.c | 2 ++ + 2 files changed, 8 insertions(+) + +commit ea4ea1dffafebaa8b2770bf3eca46900e4dd22dc +Author: Alexey Tourbin +Date: 2017-05-16 23:56:35 +0300 + + Docs: Fix a typo in a comment in doc/examples/02_decompress.c. + + doc/examples/02_decompress.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit eb2ef4c79bf405ea0d215f3b1df3d0eaf5e1d27b +Author: Lasse Collin +Date: 2017-05-23 18:34:43 +0300 + + xz: Fix "xz --list --robot missing_or_bad_file.xz". + + It ended up printing an uninitialized char-array when trying to + print the check names (column 7) on the "totals" line. + + This also changes the column 12 (minimum xz version) to + 50000002 (xz 5.0.0) instead of 0 when there are no valid + input files. + + Thanks to kidmin for the bug report. + + src/xz/list.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +commit 3ea5dbd9b0d79048e336e40cef3b6d814fb74e13 +Author: Lasse Collin +Date: 2017-04-24 19:48:47 +0300 + + Build: Omit pre-5.0.0 entries from the generated ChangeLog. + + It makes ChangeLog significantly smaller. + + Makefile.am | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit bae24675936df99064de1502593c006bd902594b +Author: Lasse Collin +Date: 2017-04-24 19:30:22 +0300 + + Update the Git repository URL to HTTPS in ChangeLog. + + ChangeLog | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 70f479211973b5361f4d7cb08ba5be69b4266e7a +Author: Lasse Collin +Date: 2017-04-19 22:17:35 +0300 + + Update the home page URLs to HTTPS. + + COPYING | 2 +- + README | 2 +- + configure.ac | 2 +- + doc/faq.txt | 4 ++-- + dos/config.h | 2 +- + src/common/common_w32res.rc | 2 +- + src/xz/xz.1 | 6 +++--- + src/xzdec/xzdec.1 | 4 ++-- + windows/README-Windows.txt | 2 +- + windows/config.h | 2 +- + 10 files changed, 14 insertions(+), 14 deletions(-) + +commit 2a4b2fa75d06a097261a02ecd3cf2b6d449bf754 +Author: Lasse Collin +Date: 2017-03-30 22:01:54 +0300 + + xz: Use POSIX_FADV_RANDOM for in "xz --list" mode. + + xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly + wrong. + + src/xz/file_io.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +commit eb25743ade39170cffd9566a1aae272098cce216 +Author: Lasse Collin +Date: 2017-03-30 19:47:45 +0300 + + liblzma: Fix lzma_memlimit_set(strm, 0). + + The 0 got treated specially in a buggy way and as a result + the function did nothing. The API doc said that 0 was supposed + to return LZMA_PROG_ERROR but it didn't. + + Now 0 is treated as if 1 had been specified. This is done because + 0 is already used to indicate an error from lzma_memlimit_get() + and lzma_memusage(). + + In addition, lzma_memlimit_set() no longer checks that the new + limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive + for the Index decoder and was actually needed only by the + auto decoder. Auto decoder has now been modified to check for + LZMA_MEMUSAGE_BASE. + + src/liblzma/api/lzma/base.h | 7 ++++++- + src/liblzma/common/auto_decoder.c | 3 +++ + src/liblzma/common/common.c | 6 ++++-- + 3 files changed, 13 insertions(+), 3 deletions(-) + +commit ef36c6362f3f3853f21b8a6359bcd06576ebf207 +Author: Lasse Collin +Date: 2017-03-30 19:16:55 +0300 + + liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. + + src/liblzma/api/lzma/container.h | 21 +++++++++++++++++---- + src/liblzma/common/alone_decoder.c | 5 +---- + src/liblzma/common/auto_decoder.c | 5 +---- + src/liblzma/common/stream_decoder.c | 5 +---- + 4 files changed, 20 insertions(+), 16 deletions(-) + +commit 57616032650f03840480b696d7878acdd2065521 +Author: Lasse Collin +Date: 2017-03-30 18:58:18 +0300 + + liblzma: Fix handling of memlimit == 0 in lzma_index_decoder(). + + It returned LZMA_PROG_ERROR, which was done to avoid zero as + the limit (because it's a special value elsewhere), but using + LZMA_PROG_ERROR is simply inconvenient and can cause bugs. + + The fix/workaround is to treat 0 as if it were 1 byte. It's + effectively the same thing. The only weird consequence is + that then lzma_memlimit_get() will return 1 even when 0 was + specified as the limit. + + This fixes a very rare corner case in xz --list where a specific + memory usage limit and a multi-stream file could print the + error message "Internal error (bug)" instead of saying that + the memory usage limit is too low. + + src/liblzma/api/lzma/index.h | 18 +++++++++++------- + src/liblzma/common/index_decoder.c | 4 ++-- + 2 files changed, 13 insertions(+), 9 deletions(-) + commit 3d566cd519017eee1a400e7961ff14058dfaf33c Author: Lasse Collin Date: 2016-12-30 13:26:36 +0200 @@ -5332,10037 +5613,3 @@ Date: 2010-10-23 14:02:53 +0300 src/liblzma/Makefile.am | 2 +- src/liblzma/api/lzma/version.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) - -commit 8c947e9291691629714dafb4536c718b6cc24fbd -Author: Lasse Collin -Date: 2010-10-23 12:30:54 +0300 - - liblzma: Make lzma_code() check the reserved members in lzma_stream. - - If any of the reserved members in lzma_stream are non-zero - or non-NULL, LZMA_OPTIONS_ERROR is returned. It is possible - that a new feature in the future is indicated by just setting - a reserved member to some other value, so the old liblzma - version need to catch it as an unsupported feature. - - src/liblzma/common/common.c | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -commit e61d85e082743ebd2dd0ff28fc0a82482ede0538 -Author: Lasse Collin -Date: 2010-10-23 12:26:33 +0300 - - Windows: Use MinGW's stdio functions. - - The non-standard ones from msvcrt.dll appear to work - most of the time with XZ Utils, but there are some - corner cases where things may go very wrong. So it's - good to use the better replacements provided by - MinGW(-w64) runtime. - - src/common/sysdefs.h | 5 +++++ - 1 file changed, 5 insertions(+) - -commit 23e23f1dc029146714c9a98313ab3ea93d71a2fc -Author: Lasse Collin -Date: 2010-10-23 12:21:32 +0300 - - liblzma: Use 512 as INDEX_GROUP_SIZE. - - This lets compiler use shifting instead of 64-bit division. - - src/liblzma/common/index.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 613939fc82603b75b59eee840871a05bc8dd08e0 -Author: Lasse Collin -Date: 2010-10-23 12:20:11 +0300 - - liblzma: A few ABI tweaks to reserve space in structures. - - src/liblzma/api/lzma/base.h | 7 ++++++- - src/liblzma/api/lzma/lzma.h | 4 ++-- - src/liblzma/api/lzma/stream_flags.h | 4 ---- - 3 files changed, 8 insertions(+), 7 deletions(-) - -commit 68b83f252df3d27480a9f6f03445d16f6506fef1 -Author: Lasse Collin -Date: 2010-10-21 23:16:11 +0300 - - xz: Make sure that message_strm() can never return NULL. - - src/xz/message.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -commit d09c5753e33ff96ee57edb6d1e98e34041203695 -Author: Lasse Collin -Date: 2010-10-21 23:06:31 +0300 - - liblzma: Update the comments in the API headers. - - Adding support for LZMA_FINISH for Index encoding and - decoding needed tiny additions to the relevant .c files too. - - src/liblzma/api/lzma.h | 4 +-- - src/liblzma/api/lzma/base.h | 38 +++++++++++++-------------- - src/liblzma/api/lzma/bcj.h | 4 +-- - src/liblzma/api/lzma/block.h | 4 +-- - src/liblzma/api/lzma/container.h | 26 ++++++++++++------- - src/liblzma/api/lzma/filter.h | 51 ++++++++++++++++++------------------- - src/liblzma/api/lzma/hardware.h | 3 +-- - src/liblzma/api/lzma/index.h | 28 ++++++++++++-------- - src/liblzma/api/lzma/index_hash.h | 2 +- - src/liblzma/api/lzma/lzma.h | 46 ++++++++++++++++++++++----------- - src/liblzma/api/lzma/stream_flags.h | 4 +-- - src/liblzma/api/lzma/vli.h | 31 +++++++++++----------- - src/liblzma/common/index_decoder.c | 1 + - src/liblzma/common/index_encoder.c | 1 + - 14 files changed, 136 insertions(+), 107 deletions(-) - -commit 33c1c0e102eb529588503b8beea0903a45488fad -Author: Lasse Collin -Date: 2010-10-19 12:08:30 +0300 - - Update INSTALL.generic. - - INSTALL.generic | 99 ++++++++++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 81 insertions(+), 18 deletions(-) - -commit 0076e03641f201c4b77dddd5a6db5880be19a78c -Author: Lasse Collin -Date: 2010-10-19 11:44:37 +0300 - - Clean up a few FIXMEs and TODOs. - - lzma_chunk_size() was commented out because it is - currently useless. - - src/liblzma/common/filter_encoder.c | 2 ++ - src/liblzma/common/filter_encoder.h | 4 ++-- - src/liblzma/lzma/lzma2_decoder.c | 1 - - src/liblzma/lzma/lzma_decoder.c | 4 ++-- - src/liblzma/lzma/lzma_encoder.c | 2 +- - src/xz/message.h | 2 +- - 6 files changed, 8 insertions(+), 7 deletions(-) - -commit ce34ec4f54ff8b753da236f371ad8dd23c8135c9 -Author: Lasse Collin -Date: 2010-10-19 10:21:08 +0300 - - Update docs. - - INSTALL | 192 +++++++++++++++++++++++++++++++++++++++++-------------------- - PACKAGERS | 104 +++++++++------------------------ - TODO | 17 ++++-- - dos/README | 2 +- - 4 files changed, 172 insertions(+), 143 deletions(-) - -commit f0fa880d247e73264d2c04fe31fb3412318a0026 -Author: Lasse Collin -Date: 2010-10-12 15:13:30 +0300 - - xz: Avoid raise() also on OpenVMS. - - This is similar to DOS/DJGPP that killing the program - with a signal will print a backtrace or a similar message. - - src/xz/signals.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit ac462b1c47c451f5c62e428306314c4bdad8ae7f -Author: Lasse Collin -Date: 2010-10-11 21:26:19 +0300 - - xz: Avoid SA_RESTART for portability reasons. - - SA_RESTART is not as portable as I had hoped. It's missing - at least from OpenVMS, QNX, and DJGPP). Luckily we can do - fine without SA_RESTART. - - src/xz/message.c | 38 +++++++++++++++----------------------- - src/xz/message.h | 4 ++++ - src/xz/signals.c | 6 ++++++ - 3 files changed, 25 insertions(+), 23 deletions(-) - -commit d52b411716a614c202e89ba732492efb9916cd3f -Author: Lasse Collin -Date: 2010-10-10 17:58:58 +0300 - - xz: Use "%"PRIu32 instead of "%d" in a format string. - - src/xz/message.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit ae74d1bdeb075c3beefe76e1136c5741804e7e91 -Author: Lasse Collin -Date: 2010-10-10 17:43:26 +0300 - - test_files.sh: Fix the first line. - - For some reason this prevented running the test only - on OS/2 and even on that it broke only recently. - - Thanks to Elbert Pol. - - tests/test_files.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit d492b80ddd6f9a13419de6d102df7374d8f448e8 -Author: Lasse Collin -Date: 2010-10-10 16:49:01 +0300 - - lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 825e859a9054bd91202e5723c41a17e72f63040a -Author: Lasse Collin -Date: 2010-10-10 16:47:01 +0300 - - lzmainfo: Use fileno(stdin) instead of STDIN_FILENO. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit acbc4cdecbeec2a4dfaac04f185ece49b2ff17c8 -Author: Lasse Collin -Date: 2010-10-09 23:20:51 +0300 - - lzmainfo: Use setmode() on DOS-like systems. - - src/lzmainfo/lzmainfo.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -commit ef364d3abc5647111c5424ea0d83a567e184a23b -Author: Lasse Collin -Date: 2010-10-09 21:51:03 +0300 - - OS/2 and DOS: Be less verbose on signals. - - Calling raise() to kill xz when user has pressed C-c - is a bit verbose on OS/2 and DOS/DJGPP. Instead of - calling raise(), set only the exit status to 1. - - src/xz/signals.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -commit 5629c4be07b6c67e79842b2569da1cedc9c0d69a -Author: Lasse Collin -Date: 2010-10-09 19:28:49 +0300 - - DOS: Update the Makefile, config.h and README. - - This is now simpler and builds only xz.exe. - - dos/Makefile | 211 +++++++++++++++-------------------------------------------- - dos/README | 73 +++++++-------------- - dos/config.h | 45 ++++--------- - 3 files changed, 86 insertions(+), 243 deletions(-) - -commit f25a77e6b9bc48a243ddfbbd755b7960eec7e0ac -Author: Lasse Collin -Date: 2010-10-09 18:57:55 +0300 - - Windows: Put some license info into README-Windows.txt. - - windows/README-Windows.txt | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -commit e75100f549f85d231df25c07aa94d63e78e2d668 -Author: Lasse Collin -Date: 2010-10-09 18:57:04 +0300 - - Windows: Fix a diagnostics bug in build.bash. - - windows/build.bash | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit efeb998a2b1025df1c1d202cc7d21d866cd1c336 -Author: Lasse Collin -Date: 2010-10-09 13:02:15 +0300 - - lzmainfo: Add Windows resource file. - - src/lzmainfo/Makefile.am | 9 +++++++++ - src/lzmainfo/lzmainfo_w32res.rc | 12 ++++++++++++ - 2 files changed, 21 insertions(+) - -commit 389d418445f1623593dfdbba55d52fbb6d1205f5 -Author: Lasse Collin -Date: 2010-10-09 12:57:25 +0300 - - Add missing public domain notice to lzmadec_w32res.rc. - - src/xzdec/lzmadec_w32res.rc | 7 +++++++ - 1 file changed, 7 insertions(+) - -commit 6389c773a4912dd9f111256d74ba1605230a7957 -Author: Lasse Collin -Date: 2010-10-09 12:52:12 +0300 - - Windows: Update common_w32res.rc. - - src/common/common_w32res.rc | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -commit 71275457ca24c9b01721f5cfc3638cf094daf454 -Author: Lasse Collin -Date: 2010-10-09 12:27:08 +0300 - - Windows: Make build.bash prefer MinGW-w32 over MinGW. - - This is simply for licensing reasons. The 64-bit version - will be built with MinGW-w64 anyway (at least for now), - so using it also for 32-bit build allows using the same - copyright notice about the MinGW-w64/w32 runtime. - - Note that using MinGW would require a copyright notice too, - because its runtime is not in the public domain either even - though MinGW's home page claims that it is public domain. - See . - - windows/build.bash | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -commit 3ac35719d8433af937af6491383d4a50e343099b -Author: Lasse Collin -Date: 2010-10-09 11:33:21 +0300 - - Windows: Copy COPYING-Windows.txt (if it exists) to the package. - - Also, put README-Windows.txt to the doc directory like - the other documentation files. - - windows/build.bash | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -commit 7b5db576fd7a4a67813b8437a9ccd4dbc94bbaae -Author: Lasse Collin -Date: 2010-10-08 21:42:37 +0300 - - Windows: Fix build.bash again. - - 630a8beda34af0ac153c8051b1bf01230558e422 wasn't good. - - windows/build.bash | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -commit d3cd7abe85ec7c2f46cf198b15c00d5d119df3dd -Author: Lasse Collin -Date: 2010-10-08 16:53:20 +0300 - - Use LZMA_VERSION_STRING instead of PACKAGE_VERSION. - - Those are the same thing, and the former makes it a bit - easier to build the code with other build systems, because - one doesn't need to update the version number into custom - config.h. - - This change affects only lzmainfo. Other tools were already - using LZMA_VERSION_STRING. - - src/lzmainfo/lzmainfo.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 084c60d318f2dbaef4078d9b100b4a373d0c3a7f -Author: Lasse Collin -Date: 2010-10-08 15:59:25 +0300 - - configure.ac: Remove two unused defines. - - configure.ac | 4 ---- - 1 file changed, 4 deletions(-) - -commit 11f51b6714357cb67ec7e56ed9575c199b5581fe -Author: Lasse Collin -Date: 2010-10-08 15:32:29 +0300 - - Make tests accommodate missing xz or xzdec. - - tests/test_compress.sh | 47 ++++++++++++++++++++++++++++++----------------- - tests/test_files.sh | 28 ++++++++++++++++++++++++++-- - 2 files changed, 56 insertions(+), 19 deletions(-) - -commit b1c7368f95e93ccdefdd0748e04398c26766f47f -Author: Lasse Collin -Date: 2010-10-08 15:25:45 +0300 - - Build: Add options to disable individual command line tools. - - configure.ac | 38 ++++++++++++++++++++++++++++++ - src/Makefile.am | 15 +++++++++++- - src/scripts/Makefile.am | 62 +++++++++++++++++++++---------------------------- - src/xz/Makefile.am | 6 ++++- - src/xzdec/Makefile.am | 12 ++++++++-- - 5 files changed, 93 insertions(+), 40 deletions(-) - -commit 630a8beda34af0ac153c8051b1bf01230558e422 -Author: Lasse Collin -Date: 2010-10-07 00:44:53 +0300 - - Windows: Make build.bash work without --enable-dynamic=no. - - windows/build.bash | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -commit f9907503f882a745dce9d84c2968f6c175ba966a -Author: Lasse Collin -Date: 2010-10-05 14:13:16 +0300 - - Build: Remove the static/dynamic tricks. - - Most distros want xz linked against shared liblzma, so - it doesn't help much to require --enable-dynamic for that. - Those who want to avoid PIC on x86-32 to get better - performance, can still do it e.g. by using --disable-shared - to compile xz and then another pass to compile shared liblzma. - - Part of these static/dynamic tricks were needed for Windows - in the past. Nowadays we rely on GCC and binutils to do the - right thing with auto-import. If the Autotooled build system - needs to support some other toolchain on Windows in the future, - this may need some rethinking. - - configure.ac | 74 ------------------------------------------------ - debug/Makefile.am | 5 +--- - src/lzmainfo/Makefile.am | 4 +-- - src/xz/Makefile.am | 4 +-- - src/xzdec/Makefile.am | 4 +-- - tests/Makefile.am | 5 +--- - 6 files changed, 5 insertions(+), 91 deletions(-) - -commit fda4724d8114fccfa31c1839c15479f350c2fb4c -Author: Lasse Collin -Date: 2010-10-05 12:18:58 +0300 - - configure.ac: Silence a warning from Autoconf 2.68. - - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit 80b5675fa62c87426fe86f8fcd20feeabc4361b9 -Author: Lasse Collin -Date: 2010-10-04 19:43:01 +0300 - - A few more languages files to the xz man page. - - Thanks to Jonathan Nieder. - - src/xz/xz.1 | 45 ++++++++++++++++++++++++--------------------- - 1 file changed, 24 insertions(+), 21 deletions(-) - -commit f9722dbeca4dc4c43cfd15d122dafaac50b0a0bb -Author: Lasse Collin -Date: 2010-10-02 12:07:33 +0300 - - Update the FAQ. - - doc/faq.txt | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 100 insertions(+), 4 deletions(-) - -commit 61ae593661e8dc402394e84d567ca2044a51572b -Author: Lasse Collin -Date: 2010-10-02 11:38:20 +0300 - - liblzma: Small fixes to comments in the API headers. - - src/liblzma/api/lzma/lzma.h | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -commit 9166682dc601fd42c1b9510572e3f917d18de504 -Author: Lasse Collin -Date: 2010-09-28 11:40:12 +0300 - - Create the PDF versions of the man pages better. - - Makefile.am | 14 +++++++------ - build-aux/manconv.sh | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 66 insertions(+), 6 deletions(-) - -commit 17d3c61edd35de8fa884944fc70d1db86daa5dd8 -Author: Lasse Collin -Date: 2010-09-28 10:59:53 +0300 - - Move version.sh to build-aux. - - Makefile.am | 4 ++-- - version.sh => build-aux/version.sh | 0 - configure.ac | 2 +- - windows/build.bash | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -commit 84af9d8770451339a692e9b70f96cf56156a6069 -Author: Lasse Collin -Date: 2010-09-28 10:53:02 +0300 - - Update .gitignore. - - .gitignore | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -commit 31575a449ac64c523da3bab8d0c0b522cdc7c780 -Author: Lasse Collin -Date: 2010-09-28 01:17:14 +0300 - - Fix accomodate -> accommodate on the xz man page. - - src/xz/xz.1 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit cec0ddc8ec4ce81685a51998b978e22167e461f9 -Author: Lasse Collin -Date: 2010-09-27 23:29:34 +0300 - - Major man page updates. - - Lots of content was updated on the xz man page. - - Technical improvements: - - Start a new sentence on a new line. - - Use fairly short lines. - - Use constant-width font for examples (where supported). - - Some minor cleanups. - - Thanks to Jonathan Nieder for some language fixes. - - src/lzmainfo/lzmainfo.1 | 25 +- - src/scripts/xzdiff.1 | 15 +- - src/scripts/xzgrep.1 | 11 +- - src/scripts/xzless.1 | 13 +- - src/scripts/xzmore.1 | 9 +- - src/xz/xz.1 | 1964 ++++++++++++++++++++++++++++++++--------------- - src/xzdec/xzdec.1 | 39 +- - 7 files changed, 1435 insertions(+), 641 deletions(-) - -commit 075257ab0416a0603be930082e31a5703e4ba345 -Author: Lasse Collin -Date: 2010-09-26 18:10:31 +0300 - - Fix the preset -3e. - - depth=0 was missing. - - src/liblzma/lzma/lzma_encoder_presets.c | 1 + - 1 file changed, 1 insertion(+) - -commit 2577da9ebdba13fbe99ae5ee8bde35f7ed60f6d1 -Author: Lasse Collin -Date: 2010-09-23 14:03:10 +0300 - - Add translations.bash and translation notes to README. - - translations.bash prints some messages from xz, which - hopefully makes it a bit easier to test translations. - - README | 96 +++++++++++++++++++++++++++++++++++++++++++++-- - debug/translation.bash | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 192 insertions(+), 4 deletions(-) - -commit a3c5997c57e5b1a20aae6d1071b584b4f17d0b23 -Author: Lasse Collin -Date: 2010-09-17 22:14:30 +0300 - - xz: Update the Czech translation. - - Thanks to Marek ÄŒernocký. - - po/cs.po | 202 +++++++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 131 insertions(+), 71 deletions(-) - -commit a1766af582dc23fddd9da1eeb4b9d61e3eb4c2e6 -Author: Lasse Collin -Date: 2010-09-16 23:40:41 +0300 - - xz: Add Italian translation. - - Thanks to Milo Casagrande and Lorenzo De Liso. - - THANKS | 2 + - po/LINGUAS | 1 + - po/it.po | 902 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 905 insertions(+) - -commit 21088018554e2b0e02914205377ceb6e34a090bd -Author: Lasse Collin -Date: 2010-09-15 00:34:13 +0300 - - xz: Edit a translators comment. - - src/xz/list.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit be16e28ece1b492b8f93382b7fa1cc4da23c6ff6 -Author: Lasse Collin -Date: 2010-09-14 22:47:14 +0300 - - xz: Add German translation. - - Thanks to Andre Noll. - - THANKS | 1 + - po/LINGUAS | 1 + - po/de.po | 903 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 905 insertions(+) - -commit e23ea74f3240e6b69683f9e69d1716e0f9e9092b -Author: Lasse Collin -Date: 2010-09-10 14:30:25 +0300 - - Updated README. - - README | 2 -- - 1 file changed, 2 deletions(-) - -commit 8dad2fd69336985adb9f774fa96dc9c0efcb5a71 -Author: Lasse Collin -Date: 2010-09-10 14:30:07 +0300 - - Updated INSTALL. - - INSTALL | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -commit 0b5f07fe3728c27cce416ddc40f7e4803ae96ac2 -Author: Lasse Collin -Date: 2010-09-10 14:26:20 +0300 - - Updated the git repository address in ChangeLog. - - ChangeLog | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -commit a8760203f93a69bc39fd14520a6e9e7b7d70be06 -Author: Lasse Collin -Date: 2010-09-10 14:09:33 +0300 - - xz: Add a comment to translators about "literal context bits". - - src/xz/message.c | 4 ++++ - 1 file changed, 4 insertions(+) - -commit bb0b1004f83cdc4d309e1471c2ecaf9f95ce60c5 -Author: Lasse Collin -Date: 2010-09-10 10:30:33 +0300 - - xz: Multiple fixes. - - The code assumed that printing numbers with thousand separators - and decimal points would always produce only US-ASCII characters. - This was used for buffer sizes (with snprintf(), no overflows) - and aligning columns of the progress indicator and --list. That - assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so - multibyte character support was added in this commit. The old - way is used if the operating system doesn't have enough multibyte - support (e.g. lacks wcwidth()). - - The sizes of buffers were increased to accomodate multibyte - characters. I don't know how big they should be exactly, but - they aren't used for anything critical, so it's not too bad. - If they still aren't big enough, I hopefully get a bug report. - snprintf() takes care of avoiding buffer overflows. - - Some static buffers were replaced with buffers allocated on - stack. double_to_str() was removed. uint64_to_str() and - uint64_to_nicestr() now share the static buffer and test - for thousand separator support. - - Integrity check names "None" and "Unknown-N" (2 <= N <= 15) - were marked to be translated. I had forgot these, plus they - wouldn't have worked correctly anyway before this commit, - because printing tables with multibyte strings didn't work. - - Thanks to Marek ÄŒernocký for reporting the bug about - misaligned table columns in --list output. - - configure.ac | 1 + - m4/tuklib_mbstr.m4 | 30 ++++++ - src/common/tuklib_mbstr.h | 66 +++++++++++++ - src/common/tuklib_mbstr_fw.c | 31 ++++++ - src/common/tuklib_mbstr_width.c | 64 +++++++++++++ - src/xz/Makefile.am | 4 +- - src/xz/list.c | 205 +++++++++++++++++++++++++++------------- - src/xz/message.c | 56 +++++++---- - src/xz/message.h | 10 +- - src/xz/private.h | 1 + - src/xz/util.c | 136 +++++++++----------------- - src/xz/util.h | 7 -- - 12 files changed, 424 insertions(+), 187 deletions(-) - -commit 639f8e2af33cf8a184d59ba56b6df7c098679d61 -Author: Lasse Collin -Date: 2010-09-08 08:49:22 +0300 - - Update the Czech translation. - - Thanks to Marek ÄŒernocký. - - po/cs.po | 655 +++++++++++++++++++++++++++++++++++++++++++-------------------- - 1 file changed, 454 insertions(+), 201 deletions(-) - -commit 41bc9956ebfd7c86777d33676acf34c45e7ca7c7 -Author: Lasse Collin -Date: 2010-09-07 12:31:40 +0300 - - xz: Add a note to translators. - - src/xz/hardware.c | 2 ++ - 1 file changed, 2 insertions(+) - -commit 77a7746616e555fc08028e883a56d06bf0088b81 -Author: Lasse Collin -Date: 2010-09-07 10:42:13 +0300 - - Fix use of N_() and ngettext(). - - I had somehow thought that N_() is usually used - as shorthand for ngettext(). - - This also fixes a missing \n from a call to ngettext(). - - src/common/tuklib_gettext.h | 4 ++-- - src/xz/list.c | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -commit e6ad39335842343e622ab51207d1d3cb9caad801 -Author: Lasse Collin -Date: 2010-09-06 19:43:12 +0300 - - Add missing files to POTFILES.in. - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 18 07:31:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D729CEED1CC; Fri, 18 May 2018 07:31:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89AE66ABD7; Fri, 18 May 2018 07:31:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AB33150E9; Fri, 18 May 2018 07:31:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4I7VQct083275; Fri, 18 May 2018 07:31:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4I7VQ9l083274; Fri, 18 May 2018 07:31:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201805180731.w4I7VQ9l083274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 18 May 2018 07:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333784 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 333784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 07:31:27 -0000 Author: mjg Date: Fri May 18 07:31:26 2018 New Revision: 333784 URL: https://svnweb.freebsd.org/changeset/base/333784 Log: amd64: tweak the read_frequently section 1. align to 128 bytes to avoid possible waste from the preceeding section 2. sort entries by alignment SORT_BY_ALIGNMENT, plugging the holes (most entries are one byte in size, but they got interleaved with bigger ones) Interestingly I was looking for a feature of the sort earlier and failed to find it. It turns out the script was already utilizing sorting in other places, so shame on me. Thanks for Travis Geiselbrecht for pointing me at the feature. Modified: head/sys/conf/ldscript.amd64 Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Fri May 18 06:10:16 2018 (r333783) +++ head/sys/conf/ldscript.amd64 Fri May 18 07:31:26 2018 (r333784) @@ -146,10 +146,10 @@ SECTIONS .got : { *(.got) } . = DATA_SEGMENT_RELRO_END (24, .); .got.plt : { *(.got.plt) } - . = ALIGN(64); + . = ALIGN(128); .data.read_frequently : { - *(.data.read_frequently) + *(SORT_BY_ALIGNMENT(.data.read_frequently)) } .data.read_mostly : { From owner-svn-src-all@freebsd.org Fri May 18 10:17:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F275EF0732; Fri, 18 May 2018 10:17:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5B86FCF9; Fri, 18 May 2018 10:17:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC25316BD9; Fri, 18 May 2018 10:17:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IAHDoi069045; Fri, 18 May 2018 10:17:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IAHDjs069044; Fri, 18 May 2018 10:17:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201805181017.w4IAHDjs069044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 18 May 2018 10:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333785 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 333785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 10:17:14 -0000 Author: ae Date: Fri May 18 10:17:13 2018 New Revision: 333785 URL: https://svnweb.freebsd.org/changeset/base/333785 Log: MFC r333497: Apply the change from r272770 to if_ipsec(4) interface. It is guaranteed that if_ipsec(4) interface is used only for tunnel mode IPsec, i.e. decrypted and decapsulated packet has its own IP header. Thus we can consider it as new packet and clear the protocols flags. This allows ICMP/ICMPv6 properly handle errors that may cause this packet. PR: 228108 Approved by: re (kib) Modified: stable/11/sys/net/if_ipsec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_ipsec.c ============================================================================== --- stable/11/sys/net/if_ipsec.c Fri May 18 07:31:26 2018 (r333784) +++ stable/11/sys/net/if_ipsec.c Fri May 18 10:17:13 2018 (r333785) @@ -434,7 +434,7 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u m->m_pkthdr.rcvif = ifp; IPSEC_SC_RUNLOCK(); - /* m_clrprotoflags(m); */ + m_clrprotoflags(m); M_SETFIB(m, ifp->if_fib); BPF_MTAP2(ifp, &af, sizeof(af), m); if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); From owner-svn-src-all@freebsd.org Fri May 18 11:32:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88AC4EF240E; Fri, 18 May 2018 11:32:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 380EA7209C; Fri, 18 May 2018 11:32:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1900E17903; Fri, 18 May 2018 11:32:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IBWmtW009488; Fri, 18 May 2018 11:32:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IBWmxB009487; Fri, 18 May 2018 11:32:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201805181132.w4IBWmxB009487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 18 May 2018 11:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333786 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 333786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 11:32:49 -0000 Author: andrew Date: Fri May 18 11:32:48 2018 New Revision: 333786 URL: https://svnweb.freebsd.org/changeset/base/333786 Log: Enable the Qualcomm MSM UART driver. This is needed for some Qualcomm Snapdragon SoCs. Obtained from: ABT Systems Ltd Sponsored by: Turing Robotic Industries Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri May 18 10:17:13 2018 (r333785) +++ head/sys/arm64/conf/GENERIC Fri May 18 11:32:48 2018 (r333786) @@ -158,6 +158,7 @@ device dwmmc # Serial (COM) ports device uart # Generic UART driver +device uart_msm # Qualcomm MSM UART driver device uart_mvebu # Armada 3700 UART driver device uart_ns8250 # ns8250-type UART driver device uart_snps From owner-svn-src-all@freebsd.org Fri May 18 12:12:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54AA6EF397C; Fri, 18 May 2018 12:12:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1AE273618; Fri, 18 May 2018 12:12:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D284C17F67; Fri, 18 May 2018 12:12:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4ICCOJb026881; Fri, 18 May 2018 12:12:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4ICCORl026880; Fri, 18 May 2018 12:12:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201805181212.w4ICCORl026880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 18 May 2018 12:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333787 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 333787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 12:12:25 -0000 Author: ae Date: Fri May 18 12:12:24 2018 New Revision: 333787 URL: https://svnweb.freebsd.org/changeset/base/333787 Log: Make the name of option that toggles IFCAP_HWRXTSTMP capability to match the name of this capability. It was added recently and is not merged to stable branch, so I hope it is not too late to change the name. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D15475 Modified: head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Fri May 18 11:32:48 2018 (r333786) +++ head/sbin/ifconfig/ifconfig.c Fri May 18 12:12:24 2018 (r333787) @@ -1487,8 +1487,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-wol_magic", -IFCAP_WOL_MAGIC, setifcap), DEF_CMD("txrtlmt", IFCAP_TXRTLMT, setifcap), DEF_CMD("-txrtlmt", -IFCAP_TXRTLMT, setifcap), - DEF_CMD("hwrxtsmp", IFCAP_HWRXTSTMP, setifcap), - DEF_CMD("-hwrxtsmp", -IFCAP_HWRXTSTMP, setifcap), + DEF_CMD("hwrxtstmp", IFCAP_HWRXTSTMP, setifcap), + DEF_CMD("-hwrxtstmp", -IFCAP_HWRXTSTMP, setifcap), DEF_CMD("normal", -IFF_LINK0, setifflags), DEF_CMD("compress", IFF_LINK0, setifflags), DEF_CMD("noicmp", IFF_LINK1, setifflags), From owner-svn-src-all@freebsd.org Fri May 18 12:21:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1BBAEF3EE5; Fri, 18 May 2018 12:21:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8319473AEF; Fri, 18 May 2018 12:21:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B1A717FDD; Fri, 18 May 2018 12:21:20 +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 w4ICLKnd034048; Fri, 18 May 2018 12:21:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4ICLKfl034045; Fri, 18 May 2018 12:21:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201805181221.w4ICLKfl034045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 18 May 2018 12:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333789 - in vendor/libpcap/dist: . SUNOS4 Win32/Include Win32/Prj bpf cmake cmake/Modules config missing msdos pcap tests X-SVN-Group: vendor X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in vendor/libpcap/dist: . SUNOS4 Win32/Include Win32/Prj bpf cmake cmake/Modules config missing msdos pcap tests X-SVN-Commit-Revision: 333789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 12:21:21 -0000 Author: hselasky Date: Fri May 18 12:21:19 2018 New Revision: 333789 URL: https://svnweb.freebsd.org/changeset/base/333789 Log: Import vendor revision 77da77c36e5d958f9b8d6729876a33f670de031f from: https://github.com/the-tcpdump-group/libpcap.git This among other minor fixes adds support for sniffing RDMA devices. Sponsored by: Mellanox Technologies Added: vendor/libpcap/dist/CONTRIBUTING vendor/libpcap/dist/README.macos vendor/libpcap/dist/bpf_filter.c (contents, props changed) vendor/libpcap/dist/cmake/Modules/ vendor/libpcap/dist/cmake/Modules/FindDAG.cmake vendor/libpcap/dist/cmake/Modules/FindFseeko.cmake vendor/libpcap/dist/cmake/Modules/FindLFS.cmake vendor/libpcap/dist/cmake/Modules/FindPacket.cmake vendor/libpcap/dist/cmake/Modules/FindPthreads-w32.cmake vendor/libpcap/dist/cmake/Modules/FindSNF.cmake vendor/libpcap/dist/cmake/Modules/FindTC.cmake vendor/libpcap/dist/cmake/have_siocglifconf.c (contents, props changed) vendor/libpcap/dist/cmake_uninstall.cmake.in (contents, props changed) vendor/libpcap/dist/diag-control.h (contents, props changed) vendor/libpcap/dist/fmtutils.c (contents, props changed) vendor/libpcap/dist/fmtutils.h (contents, props changed) vendor/libpcap/dist/ftmacros.h (contents, props changed) vendor/libpcap/dist/libpcap.pc.in (contents, props changed) vendor/libpcap/dist/nomkdep vendor/libpcap/dist/optimize.h (contents, props changed) vendor/libpcap/dist/pcap-dll.rc vendor/libpcap/dist/pcap-netmap.c (contents, props changed) vendor/libpcap/dist/pcap-netmap.h (contents, props changed) vendor/libpcap/dist/pcap-npf.c (contents, props changed) vendor/libpcap/dist/pcap-rdmasniff.c (contents, props changed) vendor/libpcap/dist/pcap-rdmasniff.h (contents, props changed) vendor/libpcap/dist/pcap-rpcap-int.h (contents, props changed) vendor/libpcap/dist/pcap-types.h (contents, props changed) vendor/libpcap/dist/pcap/compiler-tests.h (contents, props changed) vendor/libpcap/dist/pcap/funcattrs.h (contents, props changed) vendor/libpcap/dist/pcap/pcap-inttypes.h (contents, props changed) vendor/libpcap/dist/pcap_get_required_select_timeout.3pcap vendor/libpcap/dist/pcap_set_protocol.3pcap vendor/libpcap/dist/rpcap-protocol.c (contents, props changed) vendor/libpcap/dist/rpcap-protocol.h (contents, props changed) vendor/libpcap/dist/sf-pcapng.c (contents, props changed) vendor/libpcap/dist/sf-pcapng.h (contents, props changed) vendor/libpcap/dist/tests/shb-option-too-long.pcapng (contents, props changed) vendor/libpcap/dist/varattrs.h (contents, props changed) Deleted: vendor/libpcap/dist/GenVersion.bat vendor/libpcap/dist/README.macosx vendor/libpcap/dist/SUNOS4/ vendor/libpcap/dist/Win32/Include/ vendor/libpcap/dist/bpf/ vendor/libpcap/dist/cmake/preconfigure.cmake vendor/libpcap/dist/config/ vendor/libpcap/dist/fad-helpers.c vendor/libpcap/dist/gen_version_c.sh vendor/libpcap/dist/gen_version_header.sh vendor/libpcap/dist/inet.c vendor/libpcap/dist/msdos/common.dj vendor/libpcap/dist/msdos/ndis2.c vendor/libpcap/dist/msdos/ndis2.h vendor/libpcap/dist/msdos/ndis_0.asm vendor/libpcap/dist/pcap-stdinc.h vendor/libpcap/dist/pcap-win32.c vendor/libpcap/dist/pcap/export-defs.h vendor/libpcap/dist/pcap_version.h.in vendor/libpcap/dist/remote-ext.h vendor/libpcap/dist/sf-pcap-ng.c vendor/libpcap/dist/sf-pcap-ng.h vendor/libpcap/dist/tests/CMakeLists.txt vendor/libpcap/dist/tests/can_set_rfmon_test.c vendor/libpcap/dist/tests/capturetest.c vendor/libpcap/dist/tests/filtertest.c vendor/libpcap/dist/tests/findalldevstest.c vendor/libpcap/dist/tests/opentest.c vendor/libpcap/dist/tests/reactivatetest.c vendor/libpcap/dist/tests/selpolltest.c vendor/libpcap/dist/tests/valgrindtest.c Modified: vendor/libpcap/dist/CHANGES vendor/libpcap/dist/CMakeLists.txt vendor/libpcap/dist/CREDITS vendor/libpcap/dist/INSTALL.txt vendor/libpcap/dist/Makefile.in vendor/libpcap/dist/README vendor/libpcap/dist/README.septel vendor/libpcap/dist/README.sita vendor/libpcap/dist/VERSION vendor/libpcap/dist/Win32/Prj/wpcap.vcxproj vendor/libpcap/dist/Win32/Prj/wpcap.vcxproj.filters vendor/libpcap/dist/aclocal.m4 vendor/libpcap/dist/bpf_dump.c vendor/libpcap/dist/bpf_image.c vendor/libpcap/dist/chmod_bpf vendor/libpcap/dist/cmakeconfig.h.in vendor/libpcap/dist/config.h.in vendor/libpcap/dist/configure vendor/libpcap/dist/configure.ac vendor/libpcap/dist/dlpisubs.c vendor/libpcap/dist/etherent.c vendor/libpcap/dist/extract.h vendor/libpcap/dist/fad-getad.c vendor/libpcap/dist/fad-gifc.c vendor/libpcap/dist/fad-glifc.c vendor/libpcap/dist/gencode.c vendor/libpcap/dist/gencode.h vendor/libpcap/dist/grammar.y vendor/libpcap/dist/missing/getopt.c vendor/libpcap/dist/missing/getopt.h vendor/libpcap/dist/missing/strtok_r.c vendor/libpcap/dist/msdos/makefile vendor/libpcap/dist/msdos/makefile.dj vendor/libpcap/dist/msdos/makefile.wc vendor/libpcap/dist/nametoaddr.c vendor/libpcap/dist/optimize.c vendor/libpcap/dist/pcap-bpf.c vendor/libpcap/dist/pcap-bt-linux.c vendor/libpcap/dist/pcap-bt-linux.h vendor/libpcap/dist/pcap-bt-monitor-linux.c vendor/libpcap/dist/pcap-bt-monitor-linux.h vendor/libpcap/dist/pcap-common.c vendor/libpcap/dist/pcap-common.h vendor/libpcap/dist/pcap-config.in vendor/libpcap/dist/pcap-dag.c vendor/libpcap/dist/pcap-dag.h vendor/libpcap/dist/pcap-dbus.c vendor/libpcap/dist/pcap-dbus.h vendor/libpcap/dist/pcap-dlpi.c vendor/libpcap/dist/pcap-dos.c vendor/libpcap/dist/pcap-enet.c vendor/libpcap/dist/pcap-filter.manmisc.in vendor/libpcap/dist/pcap-int.h vendor/libpcap/dist/pcap-libdlpi.c vendor/libpcap/dist/pcap-linux.c vendor/libpcap/dist/pcap-netfilter-linux.c vendor/libpcap/dist/pcap-netfilter-linux.h vendor/libpcap/dist/pcap-new.c vendor/libpcap/dist/pcap-nit.c vendor/libpcap/dist/pcap-null.c vendor/libpcap/dist/pcap-pf.c vendor/libpcap/dist/pcap-rpcap.c vendor/libpcap/dist/pcap-rpcap.h vendor/libpcap/dist/pcap-septel.c vendor/libpcap/dist/pcap-septel.h vendor/libpcap/dist/pcap-sita.c vendor/libpcap/dist/pcap-snf.c vendor/libpcap/dist/pcap-snf.h vendor/libpcap/dist/pcap-snit.c vendor/libpcap/dist/pcap-snoop.c vendor/libpcap/dist/pcap-tc.c vendor/libpcap/dist/pcap-tc.h vendor/libpcap/dist/pcap-tstamp.manmisc.in vendor/libpcap/dist/pcap-usb-linux.c vendor/libpcap/dist/pcap-usb-linux.h vendor/libpcap/dist/pcap.3pcap.in vendor/libpcap/dist/pcap.c vendor/libpcap/dist/pcap/bluetooth.h vendor/libpcap/dist/pcap/bpf.h vendor/libpcap/dist/pcap/can_socketcan.h vendor/libpcap/dist/pcap/dlt.h vendor/libpcap/dist/pcap/namedb.h vendor/libpcap/dist/pcap/nflog.h vendor/libpcap/dist/pcap/pcap.h vendor/libpcap/dist/pcap/sll.h vendor/libpcap/dist/pcap/usb.h vendor/libpcap/dist/pcap/vlan.h vendor/libpcap/dist/pcap_breakloop.3pcap vendor/libpcap/dist/pcap_compile.3pcap.in vendor/libpcap/dist/pcap_dump_ftell.3pcap vendor/libpcap/dist/pcap_dump_open.3pcap.in vendor/libpcap/dist/pcap_fileno.3pcap vendor/libpcap/dist/pcap_findalldevs.3pcap vendor/libpcap/dist/pcap_get_selectable_fd.3pcap vendor/libpcap/dist/pcap_lookupdev.3pcap vendor/libpcap/dist/pcap_loop.3pcap vendor/libpcap/dist/pcap_major_version.3pcap vendor/libpcap/dist/pcap_next_ex.3pcap vendor/libpcap/dist/pcap_open_dead.3pcap.in vendor/libpcap/dist/pcap_open_live.3pcap vendor/libpcap/dist/pcap_open_offline.3pcap.in vendor/libpcap/dist/pcap_set_timeout.3pcap vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in vendor/libpcap/dist/portability.h vendor/libpcap/dist/savefile.c vendor/libpcap/dist/scanner.l vendor/libpcap/dist/sf-pcap.c vendor/libpcap/dist/sockutils.c vendor/libpcap/dist/sockutils.h Modified: vendor/libpcap/dist/CHANGES ============================================================================== --- vendor/libpcap/dist/CHANGES Fri May 18 12:13:44 2018 (r333788) +++ vendor/libpcap/dist/CHANGES Fri May 18 12:21:19 2018 (r333789) @@ -1,3 +1,30 @@ +Wednesday, Jan. 25, 2017 guy@alum.mit.edu + Summary for 1.9.0 libpcap release + Man page improvements + Fix Linux cooked mode userspace filtering (GitHub pull request #429) + Fix compilation if IPv6 support not enabled + Fix some Linux memory-mapped capture buffer size issues + Don't fail if kernel filter can't be set on Linux (GitHub issue + #549) + Improve sorting of interfaces for pcap_findalldevs() + Don't list Linux usbmon devices if usbmon module isn't loaded + Report PCAP_ERROR_PERM_DENIED if no permission to open Linux usbmon + devices + Fix DLT_ type for Solaris IPNET devices + Always return an error message for errors finding DAG or Myricom + devices + If possible, don't require that a device be openable when + enumerating them for pcap_findalldevs() + Don't put incompletely-initialized addresses in the address list for + When finding Myricom devices, update description for regular + interfaces that are Myricom devices and handle SNF_FLAGS=0x2(port + aggregation enabled) + Fix compilation error in DAG support + Fix issues with CMake configuration + Add support for stream buffers larger than 2GB on newer DAG cards + Remove support for building against DAG versions without STREAMS + support (before dag-3.0.0 2007) + Tuesday, Oct. 25, 2016 mcr@sandelman.ca Summary for 1.8.1 libpcap release Add a target in Makefile.in for Exuberant Ctags use: 'extags'. Modified: vendor/libpcap/dist/CMakeLists.txt ============================================================================== --- vendor/libpcap/dist/CMakeLists.txt Fri May 18 12:13:44 2018 (r333788) +++ vendor/libpcap/dist/CMakeLists.txt Fri May 18 12:21:19 2018 (r333789) @@ -1,272 +1,1186 @@ -cmake_minimum_required( VERSION 2.8.8 ) +cmake_minimum_required(VERSION 2.8.6) -project( pcap ) # -# Call the library "wpcap" on Windows, for backwards compatibility. +# Apple doesn't build with an install_name starting with @rpath, and +# neither do we with autotools; don't do so with CMake, either, and +# suppress warnings about that. # -if( WIN32 ) - set( LIBRARY_NAME wpcap ) -else() - set( LIBRARY_NAME pcap ) +if(POLICY CMP0042) + cmake_policy(SET CMP0042 OLD) endif() +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) + +project(pcap) + +# +# Try to enable as many C99 features as we can. +# At minimum, we want C++/C99-style // comments. +# +# Newer versions of compilers might default to supporting C99, but older +# versions may require a special flag. +# +# Prior to CMake 3.1, setting CMAKE_C_STANDARD will not have any effect, +# so, unless and until we require CMake 3.1 or later, we have to do it +# ourselves on pre-3.1 CMake, so we just do it ourselves on all versions +# of CMake. +# +# Note: with CMake 3.1 through 3.5, the only compilers for which CMake +# handles CMAKE_C_STANDARD are GCC and Clang. 3.6 adds support only +# for Intel C; 3.9 adds support for PGI C, Sun C, and IBM XL C, and +# 3.10 adds support for Cray C and IAR C, but no version of CMake has +# support for HP C. Therefore, even if we use CMAKE_C_STANDARD with +# compilers for which CMake supports it, we may still have to do it +# ourselves on other compilers. +# +# See the CMake documentation for the CMAKE__COMPILER_ID variables +# for a list of compiler IDs. +# +# We don't worry about MSVC; it doesn't have such a flag - either it +# doesn't support the C99 features we need at all, or it supports them +# regardless of the compiler flag. +# +# XXX - this just tests whether the option works and adds it if it does. +# We don't test whether it's necessary in order to get the C99 features +# that we use; if we ever have a user who tries to compile with a compiler +# that can't be made to support those features, we can add a test to make +# sure we actually *have* C99 support. +# +include(CheckCCompilerFlag) +macro(check_and_add_compiler_option _option) + message(STATUS "Checking C compiler flag ${_option}") + string(REPLACE "=" "-" _temp_option_variable ${_option}) + string(REGEX REPLACE "^-" "" _option_variable ${_temp_option_variable}) + check_c_compiler_flag("${_option}" ${_option_variable}) + if(${${_option_variable}}) + set(C_ADDITIONAL_FLAGS "${C_ADDITIONAL_FLAGS} ${_option}") + endif() +endmacro() + +set(C_ADDITIONAL_FLAGS "") +if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR + CMAKE_C_COMPILER_ID MATCHES "Clang") + check_and_add_compiler_option("-std=gnu99") +elseif(CMAKE_C_COMPILER_ID MATCHES "XL") + # + # We want support for extensions picked up for GNU C compatibility, + # so we use -qlanglvl=extc99. + # + check_and_add_compiler_option("-qlanglvl=extc99") +elseif(CMAKE_C_COMPILER_ID MATCHES "HP") + check_and_add_compiler_option("-AC99") +elseif(CMAKE_C_COMPILER_ID MATCHES "Sun") + check_and_add_compiler_option("-xc99") +elseif(CMAKE_C_COMPILER_ID MATCHES "Intel") + check_and_add_compiler_option("-c99") +endif() + +# +# Build all runtimes in the top-level binary directory; that way, +# on Windows, the executables will be in the same directory as +# the DLLs, so the system will find pcap.dll when any of the +# executables are run. +# +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/run) + ################################################################### # Parameters ################################################################### -option (INET6 "Enable IPv6" ON) -if( MSVC ) - option (USE_STATIC_RT "Use static Runtime" ON) -endif( MSVC ) -option (BUILD_SHARED_LIBS "Build shared libraries" ON) -if( WIN32 ) +if(WIN32) + # + # On Windows, allow the library name to be overridden, for the + # benefit of projects that combine libpcap with their own + # kernel-mode code to support capturing. + # + set(LIBRARY_NAME pcap CACHE STRING "Library name") +else() + # + # On UN*X, it's always been libpcap. + # + set(LIBRARY_NAME pcap) +endif() + +option(INET6 "Enable IPv6" ON) +if(WIN32) + option(USE_STATIC_RT "Use static Runtime" ON) +endif(WIN32) +option(BUILD_SHARED_LIBS "Build shared libraries" ON) +if(WIN32) set(PACKET_DLL_DIR "" CACHE PATH "Path to directory with include and lib subdirectories for packet.dll") -endif( WIN32 ) +endif(WIN32) +# To pacify those who hate the protochain instruction +option(NO_PROTOCHAIN "Disable protochain instruction" OFF) + # -# XXX - this should be an option, defaulting to "yes" for Windows and to -# "no", for now, on UN*X. +# Start out with the capture mechanism type unspecified; the user +# can explicitly specify it and, if they don't, we'll pick an +# appropriate one. # -if( WIN32 ) - set( HAVE_REMOTE 1 ) -endif( WIN32 ) +set(PCAP_TYPE "" CACHE STRING "Packet capture type") +# +# Default to having remote capture support on Windows and, for now, to +# not having it on UN*X. +# +if(WIN32) + option(ENABLE_REMOTE "Enable remote capture" ON) +else() + option(ENABLE_REMOTE "Enable remote capture" OFF) +endif(WIN32) + +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + option(PCAP_SUPPORT_PACKET_RING "Enable Linux packet ring support" ON) + option(BUILD_WITH_LIBNL "Build with libnl" ON) +endif() + +# +# By default, build universal with the appropriate set of architectures +# for the OS on which we're doing the build. +# +if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "") + # + # Get the major version of Darwin. + # + string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MAJOR "${CMAKE_SYSTEM_VERSION}") + + if(SYSTEM_VERSION_MAJOR LESS 8) + # + # Pre-Tiger. Build only for 32-bit PowerPC. + # + set(CMAKE_OSX_ARCHITECTURES "ppc") + elseif(SYSTEM_VERSION_MAJOR EQUAL 8) + # + # Tiger. Is this prior to, or with, Intel support? + # + # Get the minor version of Darwin. + # + string(REPLACE "${SYSTEM_VERSION_MAJOR}." "" SYSTEM_MINOR_AND_PATCH_VERSION ${CMAKE_SYSTEM_VERSION}) + string(REGEX MATCH "^([0-9]+)" SYSTEM_VERSION_MINOR "${SYSTEM_MINOR_AND_PATCH_VERSION}") + if(SYSTEM_VERSION_MINOR LESS 4) + # + # Prior to Intel support. Build for 32-bit + # PowerPC and 64-bit PowerPC, with 32-bit PowerPC + # first. (I'm guessing that's what Apple does.) + # + set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64") + elseif(SYSTEM_VERSION_MINOR LESS 7) + # + # With Intel support but prior to x86-64 support. + # Build for 32-bit PowerPC, 64-bit PowerPC, and x86, + # with 32-bit PowerPC first. + # (I'm guessing that's what Apple does.) + # + set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386") + else() + # + # With Intel support including x86-64 support. + # Build for 32-bit PowerPC, 64-bit PowerPC, x86, + # and x86-64, with 32-bit PowerPC first. + # (I'm guessing that's what Apple does.) + # + set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64") + endif() + elseif(SYSTEM_VERSION_MAJOR EQUAL 9) + # + # Leopard. Build for 32-bit PowerPC, 64-bit + # PowerPC, x86, and x86-64, with 32-bit PowerPC + # first. (That's what Apple does.) + # + set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64;i386;x86_64") + elseif(SYSTEM_VERSION_MAJOR EQUAL 10) + # + # Snow Leopard. Build for x86-64, x86, and + # 32-bit PowerPC, with x86-64 first. (That's + # what Apple does, even though Snow Leopard + # doesn't run on PPC, so PPC libpcap runs under + # Rosetta, and Rosetta doesn't support BPF + # ioctls, so PPC programs can't do live + # captures.) + # + set(CMAKE_OSX_ARCHITECTURES "x86_64;i386;ppc") + else() + # + # Post-Snow Leopard. Build for x86-64 and + # x86, with x86-64 first. (That's probably what + # Apple does, given that Rosetta is gone.) + # XXX - update if and when Apple drops support + # for 32-bit x86 code. + # + set(CMAKE_OSX_ARCHITECTURES "x86_64;i386") + endif() +endif() + +# +# Additional capture modules. +# +option(DISABLE_USB "Disable USB sniffing support" OFF) +option(DISABLE_BLUETOOTH "Disable Bluetooth sniffing support" OFF) +option(DISABLE_NETMAP "Disable netmap support" OFF) +# +# We don't support D-Bus sniffing on macOS; see +# +# https://bugs.freedesktop.org/show_bug.cgi?id=74029 +# +if(APPLE) + option(DISABLE_DBUS "Disable D-Bus sniffing support" ON) +else(APPLE) + option(DISABLE_DBUS "Disable D-Bus sniffing support" OFF) +endif(APPLE) +option(DISABLE_RDMA "Disable RDMA sniffing support" OFF) + +option(DISABLE_DAG "Disable Endace DAG card support" OFF) + +option(DISABLE_SEPTEL "Disable Septel card support" OFF) +set(SEPTEL_ROOT "${CMAKE_SOURCE_DIR}/../septel" CACHE PATH "Path to directory with include and lib subdirectories for Septel API") + +option(DISABLE_SNF "Disable Myricom SNF support" OFF) + +option(DISABLE_TC "Disable Riverbed TurboCap support" OFF) + +# +# Debugging options. +# +option(BDEBUG "Build optimizer debugging code" OFF) +option(YYDEBUG "Build parser debugging code" OFF) + +################################################################### +# Versioning +################################################################### + +# Get, parse, format and set pcap's version string from [pcap_root]/VERSION +# for later use. + +# Get MAJOR, MINOR, PATCH & SUFFIX +file(STRINGS ${pcap_SOURCE_DIR}/VERSION + PACKAGE_VERSION + LIMIT_COUNT 1 # Read only the first line +) + +# Get "just" MAJOR +string(REGEX MATCH "^([0-9]+)" PACKAGE_VERSION_MAJOR "${PACKAGE_VERSION}") + +# Get MAJOR, MINOR & PATCH +string(REGEX MATCH "^([0-9]+.)?([0-9]+.)?([0-9]+)" PACKAGE_VERSION_NOSUFFIX "${PACKAGE_VERSION}") + +if(WIN32) + # Convert PCAP_VERSION_NOSUFFIX to Windows preferred version format + string(REPLACE "." "," PACKAGE_VERSION_PREDLL ${PACKAGE_VERSION_NOSUFFIX}) + + # Append NANO (used for Windows internal versioning) to PCAP_VERSION_PREDLL + # 0 means unused. + set(PACKAGE_VERSION_DLL ${PACKAGE_VERSION_PREDLL},0) +endif(WIN32) + +set(PACKAGE_NAME "${LIBRARY_NAME}") +set(PACKAGE_STRING "${LIBRARY_NAME} ${PACKAGE_VERSION}") + ###################################### # Project settings ###################################### -add_definitions( -DHAVE_CONFIG_H ) +add_definitions(-DHAVE_CONFIG_H) include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${pcap_SOURCE_DIR} ) -if( WIN32 ) - if( NOT "${PACKET_DLL_DIR}" STREQUAL "" ) - include_directories("${PACKET_DLL_DIR}/Include") - if( CMAKE_CL_64 ) - link_directories("${PACKET_DLL_DIR}/Lib/x64") - else( CMAKE_CL_64 ) - link_directories("${PACKET_DLL_DIR}/Lib") - endif( CMAKE_CL_64 ) - endif() - include_directories( - ../Common/ - Win32/Include - ) -endif( WIN32) +include(CheckFunctionExists) +include(CMakePushCheckState) -add_definitions( -DBUILDING_PCAP ) +if(WIN32) -if( MSVC ) - add_definitions( -D__STDC__ ) - add_definitions( -D_CRT_SECURE_NO_WARNINGS ) - add_definitions( "-D_U_=" ) -elseif( CMAKE_COMPILER_IS_GNUCXX ) - add_definitions( "-D_U_=__attribute__((unused))" ) -else(MSVC) - add_definitions( "-D_U_=" ) -endif( MSVC ) + if(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common) + include_directories(${CMAKE_HOME_DIRECTORY}/../../Common) + endif(IS_DIRECTORY ${CMAKE_HOME_DIRECTORY}/../../Common) -if( MSVC ) - if (USE_STATIC_RT) - MESSAGE( STATUS "Use STATIC runtime" ) - set(NAME_RT MT) - set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MT") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") + find_package(Packet) + if(PACKET_FOUND) + set(HAVE_PACKET32 TRUE) + include_directories(${PACKET_INCLUDE_DIRS}) + # + # Check whether we have the NPcap PacketIsLoopbackAdapter() + # function. + # + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES ${PACKET_LIBRARIES}) + check_function_exists(PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER) + cmake_pop_check_state() + endif(PACKET_FOUND) - set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MT") - set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MT") - set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") - set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") - else (USE_STATIC_RT) - MESSAGE( STATUS "Use DYNAMIC runtime" ) - set(NAME_RT MD) - set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD") - set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") +endif(WIN32) - set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD") - set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD") - set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD") - set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd") - endif (USE_STATIC_RT) -endif( MSVC ) +if(MSVC) + add_definitions(-D__STDC__) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif(MSVC) +if(USE_STATIC_RT) + message(STATUS "Use STATIC runtime") + if(MSVC) + foreach(RT_FLAG + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + string(REGEX REPLACE "/MD" "/MT" ${RT_FLAG} "${${RT_FLAG}}") + endforeach(RT_FLAG) + elseif(MINGW) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc") + endif() +else (USE_STATIC_RT) + message(STATUS "Use DYNAMIC runtime") +endif(USE_STATIC_RT) + ################################################################### # Detect available platform features ################################################################### include(CheckIncludeFile) -include(CheckFunctionExists) +include(CheckIncludeFiles) include(CheckStructHasMember) include(CheckTypeSize) # # Header files. # -check_include_file( inttypes.h HAVE_INTTYPES_H ) -check_include_file( stdint.h HAVE_STDINT_H ) -check_include_file( unistd.h HAVE_UNISTD_H ) -if( NOT HAVE_UNISTD_H ) - add_definitions( -DYY_NO_UNISTD_H ) -endif( NOT HAVE_UNISTD_H ) -check_include_file( bitypes.h HAVE_SYS_BITYPES_H ) -check_include_file( limits.h HAVE_LIMITS_H ) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(stdint.h HAVE_STDINT_H) +check_include_file(unistd.h HAVE_UNISTD_H) +if(NOT HAVE_UNISTD_H) + add_definitions(-DYY_NO_UNISTD_H) +endif(NOT HAVE_UNISTD_H) +check_include_file(bitypes.h HAVE_SYS_BITYPES_H) +if(NOT WIN32) + check_include_file(sys/ioccom.h HAVE_SYS_IOCCOM_H) + check_include_file(sys/sockio.h HAVE_SYS_SOCKIO_H) + check_include_file(sys/select.h HAVE_SYS_SELECT_H) +endif(NOT WIN32) +check_include_file(limits.h HAVE_LIMITS_H) +if(NOT WIN32) + check_include_file(netpacket/packet.h HAVE_NETPACKET_PACKET_H) + check_include_files("sys/types.h;sys/socket.h;net/if.h;net/pfvar.h" HAVE_NET_PFVAR_H) + if(HAVE_NET_PFVAR_H) + # + # Check for various PF actions. + # + check_c_source_compiles( +"#include +#include +#include +#include +int +main(void) +{ + return PF_NAT+PF_NONAT+PF_BINAT+PF_NOBINAT+PF_RDR+PF_NORDR; +} +" + HAVE_PF_NAT_THROUGH_PF_NORDR) + endif(HAVE_NET_PFVAR_H) + check_include_file(netinet/if_ether.h HAVE_NETINET_IF_ETHER_H) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + check_include_file(linux/sockios.h HAVE_LINUX_SOCKIOS_H) + # + # linux/if_bonding.h requires sys/socket.h. + # + check_include_files("sys/socket.h;linux/if_bonding.h" HAVE_LINUX_IF_BONDING_H) + endif() +endif(NOT WIN32) + # # Functions. # -check_function_exists( strerror HAVE_STRERROR ) -check_function_exists( strlcpy HAVE_STRLCPY ) -check_function_exists( snprintf HAVE_SNPRINTF ) -check_function_exists( vsnprintf HAVE_VSNPRINTF ) -check_function_exists( strtok_r HAVE_STRTOK_R ) +check_function_exists(strerror HAVE_STRERROR) +check_function_exists(strerror_r HAVE_STRERROR_R) +check_function_exists(strerror_s HAVE_STRERROR_S) +check_function_exists(strlcpy HAVE_STRLCPY) +check_function_exists(strlcat HAVE_STRLCAT) +check_function_exists(snprintf HAVE_SNPRINTF) +check_function_exists(vsnprintf HAVE_VSNPRINTF) +check_function_exists(strtok_r HAVE_STRTOK_R) -if (WIN32) +# +# These tests are for network applications that need socket functions +# and getaddrinfo()/getnameinfo()-ish functions. We now require +# getaddrinfo() and getnameinfo(). On UN*X systems, we also prefer +# versions of recvmsg() that conform to the Single UNIX Specification, +# so that we can check whether a datagram received with recvmsg() was +# truncated when received due to the buffer being too small. +# +# On Windows, getaddrinfo() is in the ws2_32 library. + +# On most UN*X systems, they're available in the system library. +# +# Under Solaris, we need to link with libsocket and libnsl to get +# getaddrinfo() and getnameinfo() and, if we have libxnet, we need to +# link with libxnet before libsocket to get a version of recvmsg() +# that conforms to the Single UNIX Specification. +# +# We use getaddrinfo() because we want a portable thread-safe way +# of getting information for a host name or port; there exist _r +# versions of gethostbyname() and getservbyname() on some platforms, +# but not on all platforms. +# +# NOTE: if you hand check_library_exists as its last argument a variable +# that's been set, it skips the test, so we need different variables. +# +set(PCAP_LINK_LIBRARIES "") +include(CheckLibraryExists) +include(CheckSymbolExists) +if(WIN32) # - # Check for Windows-only functions, such as packet.dll functions. + # We need winsock2.h and ws2tcpip.h. # - check_function_exists( PacketIsLoopbackAdapter HAVE_PACKET_IS_LOOPBACK_ADAPTER ) -endif() + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES ws2_32) + check_symbol_exists(getaddrinfo "winsock2.h;ws2tcpip.h" LIBWS2_32_HAS_GETADDRINFO) + cmake_pop_check_state() + if(LIBWS2_32_HAS_GETADDRINFO) + set(PCAP_LINK_LIBRARIES ws2_32 ${PCAP_LINK_LIBRARIES}) + else(LIBWS2_32_HAS_GETADDRINFO) + message(FATAL_ERROR "getaddrinfo is required, but wasn't found") + endif(LIBWS2_32_HAS_GETADDRINFO) +else(WIN32) + # + # UN*X. First try the system libraries, then try the libraries + # for Solaris and possibly other systems that picked up the + # System V library split. + # + check_function_exists(getaddrinfo STDLIBS_HAVE_GETADDRINFO) + if(NOT STDLIBS_HAVE_GETADDRINFO) + # + # Not found in the standard system libraries. + # Try libsocket, which requires libnsl. + # + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES nsl) + check_library_exists(socket getaddrinfo "" LIBSOCKET_HAS_GETADDRINFO) + cmake_pop_check_state() + if(LIBSOCKET_HAS_GETADDRINFO) + # + # OK, we found it in libsocket. + # + set(PCAP_LINK_LIBRARIES socket nsl ${PCAP_LINK_LIBRARIES}) + else(LIBSOCKET_HAS_GETADDRINFO) + # + # We didn't find it. + # + message(FATAL_ERROR "getaddrinfo is required, but wasn't found") + endif(LIBSOCKET_HAS_GETADDRINFO) + # + # OK, do we have recvmsg() in libxnet? + # We also link with libsocket and libnsl. + # + cmake_push_check_state() + set(CMAKE_REQUIRED_LIBRARIES socket nsl) + check_library_exists(xnet recvmsg "" LIBXNET_HAS_RECVMSG) + cmake_pop_check_state() + if(LIBXNET_HAS_RECVMSG) + # + # Yes - link with it as well. + # + set(PCAP_LINK_LIBRARIES xnet ${PCAP_LINK_LIBRARIES}) + endif(LIBXNET_HAS_RECVMSG) + endif(NOT STDLIBS_HAVE_GETADDRINFO) + + # DLPI needs putmsg under HPUX so test for -lstr while we're at it + check_function_exists(putmsg STDLIBS_HAVE_PUTMSG) + if(NOT STDLIBS_HAVE_PUTMSG) + check_library_exists(str putmsg "" LIBSTR_HAS_PUTMSG) + if(LIBSTR_HAS_PUTMSG) + set(PCAP_LINK_LIBRARIES str ${PCAP_LINK_LIBRARIES}) + endif(LIBSTR_HAS_PUTMSG) + endif(NOT STDLIBS_HAVE_PUTMSG) +endif(WIN32) + # +# Check for reentrant versions of getnetbyname_r(), as provided by +# Linux (glibc), Solaris/IRIX, and AIX (with three different APIs!). +# If we don't find one, we just use getnetbyname(), which uses +# thread-specific data on many platforms, but doesn't use it on +# NetBSD or OpenBSD, and may not use it on older versions of other +# platforms. +# +# Only do the check if we have a declaration of getnetbyname_r(); +# without it, we can't check which API it has. (We assume that +# if there's a declaration, it has a prototype, so that the API +# can be checked.) +# +cmake_push_check_state() +set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LINK_LIBRARIES}) +check_symbol_exists(getnetbyname_r netdb.h NETDB_H_DECLARES_GETNETBYNAME_R) +if(NETDB_H_DECLARES_GETNETBYNAME_R) + check_c_source_compiles( +"#include + +int +main(void) +{ + struct netent netent_buf; + char buf[1024]; + struct netent *resultp; + int h_errnoval; + + return getnetbyname_r((const char *)0, &netent_buf, buf, sizeof buf, &resultp, &h_errnoval); +} +" + HAVE_LINUX_GETNETBYNAME_R) + if(NOT HAVE_LINUX_GETNETBYNAME_R) + check_c_source_compiles( +"#include + +int +main(void) +{ + struct netent netent_buf; + char buf[1024]; + + return getnetbyname_r((const char *)0, &netent_buf, buf, (int)sizeof buf) != NULL; +} +" + HAVE_SOLARIS_IRIX_GETNETBYNAME_R) + if(NOT HAVE_SOLARIS_IRIX_GETNETBYNAME_R) + check_c_source_compiles( +"#include + +int +main(void) +{ + struct netent netent_buf; + struct netent_data net_data; + + return getnetbyname_r((const char *)0, &netent_buf, &net_data); +} +" + HAVE_AIX_GETNETBYNAME_R) + endif(NOT HAVE_SOLARIS_IRIX_GETNETBYNAME_R) + endif(NOT HAVE_LINUX_GETNETBYNAME_R) +endif(NETDB_H_DECLARES_GETNETBYNAME_R) +cmake_pop_check_state() + +# +# Check for reentrant versions of getprotobyname_r(), as provided by +# Linux (glibc), Solaris/IRIX, and AIX (with three different APIs!). +# If we don't find one, we just use getprotobyname(), which uses +# thread-specific data on many platforms, but doesn't use it on +# NetBSD or OpenBSD, and may not use it on older versions of other +# platforms. +# +# Only do the check if we have a declaration of getprotobyname_r(); +# without it, we can't check which API it has. (We assume that +# if there's a declaration, it has a prototype, so that the API +# can be checked.) +# +cmake_push_check_state() +set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LINK_LIBRARIES}) +check_symbol_exists(getprotobyname_r netdb.h NETDB_H_DECLARES_GETPROTOBYNAME_R) +if(NETDB_H_DECLARES_GETPROTOBYNAME_R) + check_c_source_compiles( +"#include + +int +main(void) +{ + struct protoent protoent_buf; + char buf[1024]; + struct protoent *resultp; + + return getprotobyname_r((const char *)0, &protoent_buf, buf, sizeof buf, &resultp); +} +" + HAVE_LINUX_GETPROTOBYNAME_R) + if(NOT HAVE_LINUX_GETPROTOBYNAME_R) + check_c_source_compiles( +"#include + +int +main(void) +{ + struct protoent protoent_buf; + char buf[1024]; + + return getprotobyname_r((const char *)0, &protoent_buf, buf, (int)sizeof buf) != NULL; +} +" + HAVE_SOLARIS_IRIX_GETPROTOBYNAME_R) + if(NOT HAVE_SOLARIS_IRIX_GETPROTOBYNAME_R) + check_c_source_compiles( +"#include + +int +main(void) +{ + struct protoent protoent_buf; + struct protoent_data proto_data; + + return getprotobyname_r((const char *)0, &protoent_buf, &proto_data); +} +" + HAVE_AIX_GETPROTOBYNAME_R) + endif(NOT HAVE_SOLARIS_IRIX_GETPROTOBYNAME_R) + endif(NOT HAVE_LINUX_GETPROTOBYNAME_R) +endif(NETDB_H_DECLARES_GETPROTOBYNAME_R) +cmake_pop_check_state() + +# # Data types. # -# XXX - there's no check_struct() macro that's like check_struct_has_member() +# XXX - there's no check_type() macro that's like check_type_size() # except that it only checks for the existence of the structure type, -# so we use check_struct_has_member() and look for ss_family. +# so we use check_type_size() and ignore the size. # -check_struct_has_member("struct sockaddr_storage" ss_family sys/socket.h HAVE_SOCKADDR_STORAGE) -set(CMAKE_EXTRA_INCLUDE_FILES unistd.h sys/socket.h) +cmake_push_check_state() +if(WIN32) + set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h) +else(WIN32) + set(CMAKE_EXTRA_INCLUDE_FILES unistd.h sys/socket.h) +endif(WIN32) +check_type_size("struct sockaddr_storage" STRUCT_SOCKADDR_STORAGE) check_type_size("socklen_t" SOCKLEN_T) -set(CMAKE_EXTRA_INCLUDE_FILES unistd.h) +cmake_pop_check_state() # # Structure fields. # -check_struct_has_member("struct sockaddr" sa_len sys/socket.h HAVE_SOCKADDR_SA_LEN ) +if(WIN32) + check_struct_has_member("struct sockaddr" sa_len winsock2.h HAVE_STRUCT_SOCKADDR_SA_LEN) +else(WIN32) + check_struct_has_member("struct sockaddr" sa_len sys/socket.h HAVE_STRUCT_SOCKADDR_SA_LEN) +endif(WIN32) -if( INET6 ) - MESSAGE( STATUS "Use IPv6" ) -endif( INET6 ) +# +# Do we have ffs(), and is it declared in ? +# +check_function_exists(ffs HAVE_FFS) +if(HAVE_FFS) + # + # OK, we have ffs(). Is it declared in ? + # + # This test fails if we don't have or if we do + # but it doesn't declare ffs(). + # + check_symbol_exists(ffs strings.h STRINGS_H_DECLARES_FFS) +endif() -if( WIN32 ) - add_definitions( -DHAVE_ADDRINFO ) -endif( WIN32 ) +# +# This requires the libraries that we require, as ether_hostton might be +# in one of those libraries. That means we have to do this after +# we check for those libraries. +# +# You are in a twisty little maze of UN*Xes, all different. +# Some might not have ether_hostton(). +# Some might have it and declare it in . +# Some might have it and declare it in +# Some might have it and declare it in . +# Some might have it and declare it in . +# Some might have it and declare it in . +# Some might have it and not declare it in any header file. +# +# Before you is a C compiler. +# +cmake_push_check_state() +set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LINK_LIBRARIES}) +check_function_exists(ether_hostton HAVE_ETHER_HOSTTON) +if(HAVE_ETHER_HOSTTON) + # + # OK, we have ether_hostton(). Is it declared in ? + # + # This test fails if we don't have or if we do + # but it doesn't declare ether_hostton(). + # + check_symbol_exists(ether_hostton net/ethernet.h NET_ETHERNET_H_DECLARES_ETHER_HOSTTON) + if(NET_ETHERNET_H_DECLARES_ETHER_HOSTTON) + # + # Yes - we have it declared. + # + set(HAVE_DECL_ETHER_HOSTTON TRUE) + endif() + # + # Did that succeed? + # + if(NOT HAVE_DECL_ETHER_HOSTTON) + # + # No - how about , as on Linux? + # + # This test fails if we don't have + # or if we do but it doesn't declare ether_hostton(). + # + check_symbol_exists(ether_hostton netinet/ether.h NETINET_ETHER_H_DECLARES_ETHER_HOSTTON) + if(NETINET_ETHER_H_DECLARES_ETHER_HOSTTON) + # + # Yes - we have it declared. + # + set(HAVE_DECL_ETHER_HOSTTON TRUE) + endif() + endif() + # + # Did that succeed? + # + if(NOT HAVE_DECL_ETHER_HOSTTON) + # + # No - how about , as on Solaris 10 and later? + # + # This test fails if we don't have + # or if we do but it doesn't declare ether_hostton(). + # + check_symbol_exists(ether_hostton sys/ethernet.h SYS_ETHERNET_H_DECLARES_ETHER_HOSTTON) + if(SYS_ETHERNET_H_DECLARES_ETHER_HOSTTON) + # + # Yes - we have it declared. + # + set(HAVE_DECL_ETHER_HOSTTON TRUE) + endif() + endif() + # + # Did that succeed? + # + if(NOT HAVE_DECL_ETHER_HOSTTON) + # + # No, how about , as on AIX? + # + # This test fails if we don't have + # or if we do but it doesn't declare ether_hostton(). + # + check_symbol_exists(ether_hostton arpa/inet.h ARPA_INET_H_DECLARES_ETHER_HOSTTON) + if(ARPA_INET_H_DECLARES_ETHER_HOSTTON) + # + # Yes - we have it declared. + # + set(HAVE_DECL_ETHER_HOSTTON TRUE) + endif() + endif() + # + # Did that succeed? + # + if(NOT HAVE_DECL_ETHER_HOSTTON) + # + # No, how about ? + # On some platforms, it requires and + # , and we always include it with + # both of them, so test it with both of them. + # + # This test fails if we don't have + # and the headers we include before it, or if we do but + # doesn't declare ether_hostton(). + # + check_symbol_exists(ether_hostton "sys/types.h;sys/socket.h;net/if.h;netinet/in.h;netinet/if_ether.h" NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON) + if(NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON) + # + # Yes - we have it declared. + # + set(HAVE_DECL_ETHER_HOSTTON TRUE) + endif() + endif() + # + # After all that, is ether_hostton() declared? + # + if(NOT HAVE_DECL_ETHER_HOSTTON) + # + # No, we'll have to declare it ourselves. + # Do we have "struct ether_addr" if we include ? + # + # XXX - there's no check_type() macro that's like check_type_size() + # except that it only checks for the existence of the structure type, + # so we use check_type_size() and ignore the size. + # + cmake_push_check_state() + set(CMAKE_EXTRA_INCLUDE_FILES sys/types.h sys/socket.h net/if.h netinet/in.h netinet/if_ether.h) + check_type_size("struct ether_addr" STRUCT_ETHER_ADDR) + cmake_pop_check_state() + endif() +endif() +cmake_pop_check_state() -###################################### -# External dependencies -###################################### +# +# Large file support on UN*X, a/k/a LFS. +# +if(NOT WIN32) + include(FindLFS) + if(LFS_FOUND) + # + # Add the required #defines. + # + add_definitions(${LFS_DEFINITIONS}) + endif() + # + # Check for fseeko as well. + # + include(FindFseeko) + if(FSEEKO_FOUND) + set(HAVE_FSEEKO ON) + + # + # Add the required #defines. + # + add_definitions(${FSEEKO_DEFINITIONS}) + endif() +endif() + +if(INET6) + message(STATUS "Support IPv6") +endif(INET6) + +# +# Pthreads. +# We might need them, because some libraries we use might use them, +# but we don't necessarily need them. +# That's only on UN*X; on Windows, if they use threads, we assume +# they're native Windows threads. +# +if(NOT WIN32) + set(CMAKE_THREAD_PREFER_PTHREAD ON) + find_package(Threads) + if(NOT CMAKE_USE_PTHREADS_INIT) + # + # If it's not pthreads, we won't use it; we use it for libraries + # that require it. + # + set(CMAKE_THREAD_LIBS_INIT "") + endif(NOT CMAKE_USE_PTHREADS_INIT) +endif(NOT WIN32) + ###################################### # Input files ###################################### set(PROJECT_SOURCE_LIST_C bpf_dump.c + bpf_filter.c bpf_image.c etherent.c - fad-helpers.c + fmtutils.c gencode.c - inet.c nametoaddr.c optimize.c pcap-common.c *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 18 13:03:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E192CEF4924; Fri, 18 May 2018 13:03:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A5F274D1B; Fri, 18 May 2018 13:03:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55EE7187A2; Fri, 18 May 2018 13:03:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4ID35ho056517; Fri, 18 May 2018 13:03:05 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4ID35Pv056516; Fri, 18 May 2018 13:03:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805181303.w4ID35Pv056516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 18 May 2018 13:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r333790 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 333790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 13:03:06 -0000 Author: sbruno Date: Fri May 18 13:03:04 2018 New Revision: 333790 URL: https://svnweb.freebsd.org/changeset/base/333790 Log: Release mmacy from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri May 18 12:21:19 2018 (r333789) +++ svnadmin/conf/mentors Fri May 18 13:03:04 2018 (r333790) @@ -26,7 +26,6 @@ jwd rmacklem kadesai ken Co-mentor: scottl, ambrisko mahrens mckusick mjoras rstone -mmacy sbruno peterj jhb Co-mentor: grog ram ken Co-mentor: mav rgrimes phk Co-mentor: bde From owner-svn-src-all@freebsd.org Fri May 18 13:28:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E26E5EA8134; Fri, 18 May 2018 13:28:02 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93F1375C30; Fri, 18 May 2018 13:28:02 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75BE318B43; Fri, 18 May 2018 13:28:02 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IDS2I1067008; Fri, 18 May 2018 13:28:02 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IDS2er067007; Fri, 18 May 2018 13:28:02 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201805181328.w4IDS2er067007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Fri, 18 May 2018 13:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333791 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: cognet X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 333791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 13:28:03 -0000 Author: cognet Date: Fri May 18 13:28:02 2018 New Revision: 333791 URL: https://svnweb.freebsd.org/changeset/base/333791 Log: Instead of ignoring the VFP registers, set the dumppcb's pcb_fpusaved field, so that they are saved, as they may be used in the kernel, in the EFI and the crypto code. Reviewed by: andrew Modified: head/sys/arm64/arm64/vfp.c Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Fri May 18 13:03:04 2018 (r333790) +++ head/sys/arm64/arm64/vfp.c Fri May 18 13:28:02 2018 (r333791) @@ -172,12 +172,11 @@ vfp_save_state(struct thread *td, struct pcb *pcb) /* * savectx() will be called on panic with dumppcb as an argument, - * dumppcb doesn't have pcb_fpusaved set so don't make any attempt - * to store the VFP registers in it, we probably don't care much - * at that point, anyway. + * dumppcb doesn't have pcb_fpusaved set, so set it to save + * the VFP registers. */ if (pcb->pcb_fpusaved == NULL) - return; + pcb->pcb_fpusaved = &pcb->pcb_fpustate; if (td == NULL) td = curthread; From owner-svn-src-all@freebsd.org Fri May 18 13:49:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F02BFEA8CCF; Fri, 18 May 2018 13:49:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0319769A7; Fri, 18 May 2018 13:49:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8144318E8E; Fri, 18 May 2018 13:49:12 +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 w4IDnCfW077356; Fri, 18 May 2018 13:49:12 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IDnCRX077355; Fri, 18 May 2018 13:49:12 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805181349.w4IDnCRX077355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 18 May 2018 13:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333792 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 333792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 13:49:13 -0000 Author: sbruno Date: Fri May 18 13:49:12 2018 New Revision: 333792 URL: https://svnweb.freebsd.org/changeset/base/333792 Log: bnxt(4) - Fix HWRM warning message during HW LRO configuration. Submitted by: bhargava.marreddy@broadcom.com MFC after: 1 week Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D15466 Modified: head/sys/dev/bnxt/bnxt_hwrm.c Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Fri May 18 13:28:02 2018 (r333791) +++ head/sys/dev/bnxt/bnxt_hwrm.c Fri May 18 13:49:12 2018 (r333792) @@ -1017,6 +1017,10 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc) struct hwrm_vnic_tpa_cfg_input req = {0}; uint32_t flags; + if (softc->vnic_info.id == (uint16_t) HWRM_NA_SIGNATURE) { + return 0; + } + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG); if (softc->hw_lro.enable) { From owner-svn-src-all@freebsd.org Fri May 18 14:14:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A46EA9762; Fri, 18 May 2018 14:14:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D4C777C3E; Fri, 18 May 2018 14:14:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1EB9719373; Fri, 18 May 2018 14:14:05 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IEE55s092667; Fri, 18 May 2018 14:14:05 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IEE5YW092666; Fri, 18 May 2018 14:14:05 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201805181414.w4IEE5YW092666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 18 May 2018 14:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333793 - head/usr.sbin/pmcannotate X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/usr.sbin/pmcannotate X-SVN-Commit-Revision: 333793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:14:05 -0000 Author: gallatin Date: Fri May 18 14:14:04 2018 New Revision: 333793 URL: https://svnweb.freebsd.org/changeset/base/333793 Log: Teach pmcannotate about $TMPDIR and _PATH_TMP Convert pmcannotate to using $TMPDIR and _PATH_TMP rather than hard coding /tmp for temporary files. Pmcannotate sometimes needs quite a lot of space to store the output from objdump, and will fail in odd ways if that output is truncated due to lack of space in /tmp. Reviewed by: jtl Sponsored by: Netflix Modified: head/usr.sbin/pmcannotate/pmcannotate.c Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Fri May 18 13:49:12 2018 (r333792) +++ head/usr.sbin/pmcannotate/pmcannotate.c Fri May 18 14:14:04 2018 (r333793) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,7 +48,7 @@ __FBSDID("$FreeBSD$"); #define FNBUFF 512 #define LNBUFF 512 -#define TMPPATH "/tmp/pmcannotate.XXXXXX" +#define TMPNAME "pmcannotate.XXXXXX" #define FATAL(ptr, x ...) do { \ fqueue_deleteall(); \ @@ -671,7 +672,8 @@ usage(const char *progname) int main(int argc, char *argv[]) { - char buffer[LNBUFF], fname[FNBUFF], tbfl[] = TMPPATH, tofl[] = TMPPATH; + char buffer[LNBUFF], fname[FNBUFF]; + char *tbfl, *tofl, *tmpdir; char tmpf[MAXPATHLEN * 2 + 50]; float limit; char *bin, *exec, *kfile, *ofile; @@ -721,6 +723,17 @@ main(int argc, char *argv[]) exec); bzero(tmpf, sizeof(tmpf)); + tmpdir = getenv("TMPDIR"); + if (tmpdir == NULL) { + asprintf(&tbfl, "%s/%s", _PATH_TMP, TMPNAME); + asprintf(&tofl, "%s/%s", _PATH_TMP, TMPNAME); + } else { + asprintf(&tbfl, "%s/%s", tmpdir, TMPNAME); + asprintf(&tofl, "%s/%s", tmpdir, TMPNAME); + } + if (tofl == NULL || tbfl == NULL) + FATAL(exec, "%s: Cannot create tempfile templates\n", + exec); if (mkstemp(tofl) == -1) FATAL(exec, "%s: Impossible to create the tmp file\n", exec); From owner-svn-src-all@freebsd.org Fri May 18 14:21:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97769EA9CE6; Fri, 18 May 2018 14:21:41 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "david.siemens.de", Issuer "Siemens Issuing CA Internet Server 2017" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14536783C2; Fri, 18 May 2018 14:21:40 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w4IEHquq007265 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 May 2018 16:17:52 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w4IEHqqi014986; Fri, 18 May 2018 16:17:52 +0200 Received: (from user@localhost) by curry.mchp.siemens.de (8.15.2/8.15.2) id w4IEHqcs029708; Date: Fri, 18 May 2018 16:17:52 +0200 From: Andre Albsmeier To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r333673 - in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 Message-ID: <20180518141752.GA6250@bali> References: <201805161318.w4GDIcpx086341@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805161318.w4GDIcpx086341@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:21:41 -0000 On Wed, 16-May-2018 at 13:18:38 +0000, Warner Losh wrote: > Author: imp > Date: Wed May 16 13:18:37 2018 > New Revision: 333673 > URL: https://svnweb.freebsd.org/changeset/base/333673 > > Log: > MFC r333436: only launch getty if underlying device exists Can the onifexists thing work under 11? I had problems with my ttys until I switched back to "on". I also can't find an MFC of r315733 which apparently implemented this in HEAD... From owner-svn-src-all@freebsd.org Fri May 18 14:30:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E63BCEAA02F; Fri, 18 May 2018 14:30:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 936DC7870B; Fri, 18 May 2018 14:30:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 745CE19554; Fri, 18 May 2018 14:30:46 +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 w4IEUkpC097662; Fri, 18 May 2018 14:30:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IEUkSr097660; Fri, 18 May 2018 14:30:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805181430.w4IEUkSr097660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 May 2018 14:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333794 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 333794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:30:47 -0000 Author: emaste Date: Fri May 18 14:30:45 2018 New Revision: 333794 URL: https://svnweb.freebsd.org/changeset/base/333794 Log: muge(4): sync register names with Microchip's lan7800.h Microchip provided a permissively-licensed lan78xx header, which has an 'ETH_' prefix on most definitions. Follow suit in our driver. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/net/if_muge.c head/sys/dev/usb/net/if_mugereg.h Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Fri May 18 14:14:04 2018 (r333793) +++ head/sys/dev/usb/net/if_muge.c Fri May 18 14:30:45 2018 (r333794) @@ -171,7 +171,7 @@ struct muge_softc { uint32_t sc_rfe_ctl; uint32_t sc_mdix_ctl; uint32_t sc_rev_id; - uint32_t sc_mchash_table[DP_SEL_VHF_HASH_LEN]; + uint32_t sc_mchash_table[ETH_DP_SEL_VHF_HASH_LEN]; uint32_t sc_pfilter_table[MUGE_NUM_PFILTER_ADDRS_][2]; uint32_t sc_flags; @@ -385,13 +385,13 @@ lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_ if (!locked) MUGE_LOCK(sc); - err = lan78xx_read_reg(sc, HW_CFG, &val); + err = lan78xx_read_reg(sc, ETH_HW_CFG, &val); saved = val; - val &= ~(HW_CFG_LEDO_EN_ | HW_CFG_LED1_EN_); - err = lan78xx_write_reg(sc, HW_CFG, val); + val &= ~(ETH_HW_CFG_LEDO_EN_ | ETH_HW_CFG_LED1_EN_); + err = lan78xx_write_reg(sc, ETH_HW_CFG, val); - err = lan78xx_wait_for_bits(sc, E2P_CMD, E2P_CMD_BUSY_); + err = lan78xx_wait_for_bits(sc, ETH_E2P_CMD, ETH_E2P_CMD_BUSY_); if (err != 0) { muge_warn_printf(sc, "eeprom busy, failed to read data\n"); goto done; @@ -399,28 +399,30 @@ lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_ /* Start reading the bytes, one at a time. */ for (i = 0; i < buflen; i++) { - val = E2P_CMD_BUSY_ | E2P_CMD_READ_; - val |= (E2P_CMD_ADDR_MASK_ & (off + i)); - if ((err = lan78xx_write_reg(sc, E2P_CMD, val)) != 0) + val = ETH_E2P_CMD_BUSY_ | ETH_E2P_CMD_READ_; + val |= (ETH_E2P_CMD_ADDR_MASK_ & (off + i)); + if ((err = lan78xx_write_reg(sc, ETH_E2P_CMD, val)) != 0) goto done; start_ticks = (usb_ticks_t)ticks; do { - if ((err = lan78xx_read_reg(sc, E2P_CMD, &val)) != 0) + if ((err = lan78xx_read_reg(sc, ETH_E2P_CMD, &val)) != + 0) goto done; - if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_)) + if (!(val & ETH_E2P_CMD_BUSY_) || + (val & ETH_E2P_CMD_TIMEOUT_)) break; uether_pause(&sc->sc_ue, hz / 100); } while (((usb_ticks_t)(ticks - start_ticks)) < max_ticks); - if (val & (E2P_CMD_BUSY_ | E2P_CMD_TIMEOUT_)) { + if (val & (ETH_E2P_CMD_BUSY_ | ETH_E2P_CMD_TIMEOUT_)) { muge_warn_printf(sc, "eeprom command failed\n"); err = USB_ERR_IOERROR; break; } - if ((err = lan78xx_read_reg(sc, E2P_DATA, &val)) != 0) + if ((err = lan78xx_read_reg(sc, ETH_E2P_DATA, &val)) != 0) goto done; buf[i] = (val & 0xff); @@ -429,7 +431,7 @@ lan78xx_eeprom_read_raw(struct muge_softc *sc, uint16_ done: if (!locked) MUGE_UNLOCK(sc); - lan78xx_write_reg(sc, HW_CFG, saved); + lan78xx_write_reg(sc, ETH_HW_CFG, saved); return (err); } @@ -450,8 +452,8 @@ lan78xx_eeprom_read(struct muge_softc *sc, uint16_t of uint8_t sig; int ret; - ret = lan78xx_eeprom_read_raw(sc, E2P_INDICATOR_OFFSET, &sig, 1); - if ((ret == 0) && (sig == E2P_INDICATOR)) { + ret = lan78xx_eeprom_read_raw(sc, ETH_E2P_INDICATOR_OFFSET, &sig, 1); + if ((ret == 0) && (sig == ETH_E2P_INDICATOR)) { ret = lan78xx_eeprom_read_raw(sc, off, buf, buflen); muge_dbg_printf(sc, "EEPROM present\n"); } else { @@ -587,11 +589,11 @@ lan78xx_setmacaddress(struct muge_softc *sc, const uin MUGE_LOCK_ASSERT(sc, MA_OWNED); val = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0]; - if ((err = lan78xx_write_reg(sc, RX_ADDRL, val)) != 0) + if ((err = lan78xx_write_reg(sc, ETH_RX_ADDRL, val)) != 0) goto done; val = (addr[5] << 8) | addr[4]; - err = lan78xx_write_reg(sc, RX_ADDRH, val); + err = lan78xx_write_reg(sc, ETH_RX_ADDRH, val); done: return (err); @@ -617,26 +619,26 @@ lan78xx_set_rx_max_frame_length(struct muge_softc *sc, /* first we have to disable rx before changing the length */ - err = lan78xx_read_reg(sc, MAC_RX, &buf); - rxenabled = ((buf & MAC_RX_EN_) != 0); + err = lan78xx_read_reg(sc, ETH_MAC_RX, &buf); + rxenabled = ((buf & ETH_MAC_RX_EN_) != 0); if (rxenabled) { - buf &= ~MAC_RX_EN_; - err = lan78xx_write_reg(sc, MAC_RX, buf); + buf &= ~ETH_MAC_RX_EN_; + err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); } /* setting max frame length */ - buf &= ~MAC_RX_MAX_FR_SIZE_MASK_; - buf |= (((size + 4) << MAC_RX_MAX_FR_SIZE_SHIFT_) & - MAC_RX_MAX_FR_SIZE_MASK_); - err = lan78xx_write_reg(sc, MAC_RX, buf); + buf &= ~ETH_MAC_RX_MAX_FR_SIZE_MASK_; + buf |= (((size + 4) << ETH_MAC_RX_MAX_FR_SIZE_SHIFT_) & + ETH_MAC_RX_MAX_FR_SIZE_MASK_); + err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); /* If it were enabled before, we enable it back. */ if (rxenabled) { - buf |= MAC_RX_EN_; - err = lan78xx_write_reg(sc, MAC_RX, buf); + buf |= ETH_MAC_RX_EN_; + err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); } return 0; @@ -667,20 +669,23 @@ lan78xx_miibus_readreg(device_t dev, int phy, int reg) if (!locked) MUGE_LOCK(sc); - if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) { + if (lan78xx_wait_for_bits(sc, ETH_MII_ACC, ETH_MII_ACC_MII_BUSY_) != + 0) { muge_warn_printf(sc, "MII is busy\n"); goto done; } - addr = (phy << 11) | (reg << 6) | MII_READ_ | MII_BUSY_; - lan78xx_write_reg(sc, MII_ACCESS, addr); + addr = (phy << 11) | (reg << 6) | + ETH_MII_ACC_MII_READ_ | ETH_MII_ACC_MII_BUSY_; + lan78xx_write_reg(sc, ETH_MII_ACC, addr); - if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) { + if (lan78xx_wait_for_bits(sc, ETH_MII_ACC, ETH_MII_ACC_MII_BUSY_) != + 0) { muge_warn_printf(sc, "MII read timeout\n"); goto done; } - lan78xx_read_reg(sc, MII_DATA, &val); + lan78xx_read_reg(sc, ETH_MII_DATA, &val); val = le32toh(val); done: @@ -719,18 +724,19 @@ lan78xx_miibus_writereg(device_t dev, int phy, int reg if (!locked) MUGE_LOCK(sc); - if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) { + if (lan78xx_wait_for_bits(sc, ETH_MII_ACC, ETH_MII_ACC_MII_BUSY_) != + 0) { muge_warn_printf(sc, "MII is busy\n"); goto done; } val = htole32(val); - lan78xx_write_reg(sc, MII_DATA, val); + lan78xx_write_reg(sc, ETH_MII_DATA, val); - addr = (phy << 11) | (reg << 6) | MII_WRITE_ | MII_BUSY_; - lan78xx_write_reg(sc, MII_ACCESS, addr); + addr = (phy << 11) | (reg << 6) | ETH_MII_ACC_MII_WRITE_ | ETH_MII_ACC_MII_BUSY_; + lan78xx_write_reg(sc, ETH_MII_ACC, addr); - if (lan78xx_wait_for_bits(sc, MII_ACCESS, MII_BUSY_) != 0) + if (lan78xx_wait_for_bits(sc, ETH_MII_ACC, ETH_MII_ACC_MII_BUSY_) != 0) muge_warn_printf(sc, "MII write timeout\n"); done: @@ -794,7 +800,7 @@ lan78xx_miibus_statchg(device_t dev) goto done; } - err = lan78xx_read_reg(sc, FCT_FLOW, &fct_flow); + err = lan78xx_read_reg(sc, ETH_FCT_FLOW, &fct_flow); if (err) { muge_warn_printf(sc, "failed to read initial flow control thresholds, error %d\n", @@ -808,10 +814,10 @@ lan78xx_miibus_statchg(device_t dev) /* enable transmit MAC flow control function */ if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) - flow |= FLOW_CR_TX_FCEN_ | 0xFFFF; + flow |= ETH_FLOW_CR_TX_FCEN_ | 0xFFFF; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) - flow |= FLOW_CR_RX_FCEN_; + flow |= ETH_FLOW_CR_RX_FCEN_; } switch(usbd_get_speed(sc->sc_ue.ue_udev)) { @@ -825,8 +831,8 @@ lan78xx_miibus_statchg(device_t dev) break; } - err += lan78xx_write_reg(sc, FLOW, flow); - err += lan78xx_write_reg(sc, FCT_FLOW, fct_flow); + err += lan78xx_write_reg(sc, ETH_FLOW, flow); + err += lan78xx_write_reg(sc, ETH_FCT_FLOW, fct_flow); if (err) muge_warn_printf(sc, "media change failed, error %d\n", err); @@ -955,9 +961,10 @@ lan78xx_chip_init(struct muge_softc *sc) MUGE_LOCK(sc); /* Enter H/W config mode */ - lan78xx_write_reg(sc, HW_CFG, HW_CFG_LRST_); + lan78xx_write_reg(sc, ETH_HW_CFG, ETH_HW_CFG_LRST_); - if ((err = lan78xx_wait_for_bits(sc, HW_CFG, HW_CFG_LRST_)) != 0) { + if ((err = lan78xx_wait_for_bits(sc, ETH_HW_CFG, ETH_HW_CFG_LRST_)) != + 0) { muge_warn_printf(sc, "timed-out waiting for lite reset to complete\n"); goto init_failed; @@ -970,22 +977,23 @@ lan78xx_chip_init(struct muge_softc *sc) } /* Read and display the revision register */ - if ((err = lan78xx_read_reg(sc, ID_REV, &sc->sc_rev_id)) < 0) { - muge_warn_printf(sc, "failed to read ID_REV (err = %d)\n", err); + if ((err = lan78xx_read_reg(sc, ETH_ID_REV, &sc->sc_rev_id)) < 0) { + muge_warn_printf(sc, "failed to read ETH_ID_REV (err = %d)\n", + err); goto init_failed; } device_printf(sc->sc_ue.ue_dev, "chip 0x%04lx, rev. %04lx\n", - (sc->sc_rev_id & ID_REV_CHIP_ID_MASK_) >> 16, - (sc->sc_rev_id & ID_REV_CHIP_REV_MASK_)); + (sc->sc_rev_id & ETH_ID_REV_CHIP_ID_MASK_) >> 16, + (sc->sc_rev_id & ETH_ID_REV_CHIP_REV_MASK_)); /* Respond to BULK-IN tokens with a NAK when RX FIFO is empty. */ - if ((err = lan78xx_read_reg(sc, USB_CFG0, &buf)) != 0) { - muge_warn_printf(sc, "failed to read USB_CFG0: %d\n", err); + if ((err = lan78xx_read_reg(sc, ETH_USB_CFG0, &buf)) != 0) { + muge_warn_printf(sc, "failed to read ETH_USB_CFG0 (err=%d)\n", err); goto init_failed; } - buf |= USB_CFG_BIR_; - lan78xx_write_reg(sc, USB_CFG0, buf); + buf |= ETH_USB_CFG_BIR_; + lan78xx_write_reg(sc, ETH_USB_CFG0, buf); /* * LTM support will go here. @@ -1003,24 +1011,24 @@ lan78xx_chip_init(struct muge_softc *sc) burst_cap = MUGE_DEFAULT_BURST_CAP_SIZE/MUGE_FS_USB_PKT_SIZE; } - lan78xx_write_reg(sc, BURST_CAP, burst_cap); + lan78xx_write_reg(sc, ETH_BURST_CAP, burst_cap); /* Set the default bulk in delay (same value from Linux driver) */ - lan78xx_write_reg(sc, BULK_IN_DLY, MUGE_DEFAULT_BULK_IN_DELAY); + lan78xx_write_reg(sc, ETH_BULK_IN_DLY, MUGE_DEFAULT_BULK_IN_DELAY); /* Multiple ethernet frames per USB packets */ - err = lan78xx_read_reg(sc, HW_CFG, &buf); - buf |= HW_CFG_MEF_; - err = lan78xx_write_reg(sc, HW_CFG, buf); + err = lan78xx_read_reg(sc, ETH_HW_CFG, &buf); + buf |= ETH_HW_CFG_MEF_; + err = lan78xx_write_reg(sc, ETH_HW_CFG, buf); /* Enable burst cap. */ - if ((err = lan78xx_read_reg(sc, USB_CFG0, &buf)) < 0) { - muge_warn_printf(sc, "failed to read USB_CFG0: (err = %d)\n", + if ((err = lan78xx_read_reg(sc, ETH_USB_CFG0, &buf)) < 0) { + muge_warn_printf(sc, "failed to read ETH_USB_CFG0 (err=%d)\n", err); goto init_failed; } - buf |= USB_CFG_BCE_; - err = lan78xx_write_reg(sc, USB_CFG0, buf); + buf |= ETH_USB_CFG_BCE_; + err = lan78xx_write_reg(sc, ETH_USB_CFG0, buf); /* * Set FCL's RX and TX FIFO sizes: according to data sheet this is @@ -1030,28 +1038,28 @@ lan78xx_chip_init(struct muge_softc *sc) */ buf = (MUGE_MAX_RX_FIFO_SIZE - 512) / 512; - err = lan78xx_write_reg(sc, FCT_RX_FIFO_END, buf); + err = lan78xx_write_reg(sc, ETH_FCT_RX_FIFO_END, buf); buf = (MUGE_MAX_TX_FIFO_SIZE - 512) / 512; - err = lan78xx_write_reg(sc, FCT_TX_FIFO_END, buf); + err = lan78xx_write_reg(sc, ETH_FCT_TX_FIFO_END, buf); /* Enabling interrupts. (Not using them for now) */ - err = lan78xx_write_reg(sc, INT_STS, INT_STS_CLEAR_ALL_); + err = lan78xx_write_reg(sc, ETH_INT_STS, ETH_INT_STS_CLEAR_ALL_); /* * Initializing flow control registers to 0. These registers are * properly set is handled in link-reset function in the Linux driver. */ - err = lan78xx_write_reg(sc, FLOW, 0); - err = lan78xx_write_reg(sc, FCT_FLOW, 0); + err = lan78xx_write_reg(sc, ETH_FLOW, 0); + err = lan78xx_write_reg(sc, ETH_FCT_FLOW, 0); /* * Settings for the RFE, we enable broadcast and destination address * perfect filtering. */ - err = lan78xx_read_reg(sc, RFE_CTL, &buf); - buf |= RFE_CTL_BCAST_EN_ | RFE_CTL_DA_PERFECT_; - err = lan78xx_write_reg(sc, RFE_CTL, buf); + err = lan78xx_read_reg(sc, ETH_RFE_CTL, &buf); + buf |= ETH_RFE_CTL_BCAST_EN_ | ETH_RFE_CTL_DA_PERFECT_; + err = lan78xx_write_reg(sc, ETH_RFE_CTL, buf); /* * At this point the Linux driver writes multicast tables, and enables @@ -1060,41 +1068,42 @@ lan78xx_chip_init(struct muge_softc *sc) */ /* Reset the PHY. */ - lan78xx_write_reg(sc, PMT_CTL, PMT_CTL_PHY_RST_); - if ((err = lan78xx_wait_for_bits(sc, PMT_CTL, PMT_CTL_PHY_RST_)) != 0) { + lan78xx_write_reg(sc, ETH_PMT_CTL, ETH_PMT_CTL_PHY_RST_); + if ((err = lan78xx_wait_for_bits(sc, ETH_PMT_CTL, + ETH_PMT_CTL_PHY_RST_)) != 0) { muge_warn_printf(sc, "timed-out waiting for phy reset to complete\n"); goto init_failed; } /* Enable automatic duplex detection and automatic speed detection. */ - err = lan78xx_read_reg(sc, MAC_CR, &buf); - buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; - err = lan78xx_write_reg(sc, MAC_CR, buf); + err = lan78xx_read_reg(sc, ETH_MAC_CR, &buf); + buf |= ETH_MAC_CR_AUTO_DUPLEX_ | ETH_MAC_CR_AUTO_SPEED_; + err = lan78xx_write_reg(sc, ETH_MAC_CR, buf); /* * Enable PHY interrupts (Not really getting used for now) - * INT_EP_CTL: interrupt endpoint control register + * ETH_INT_EP_CTL: interrupt endpoint control register * phy events cause interrupts to be issued */ - err = lan78xx_read_reg(sc, INT_EP_CTL, &buf); - buf |= INT_ENP_PHY_INT; - err = lan78xx_write_reg(sc, INT_EP_CTL, buf); + err = lan78xx_read_reg(sc, ETH_INT_EP_CTL, &buf); + buf |= ETH_INT_ENP_PHY_INT; + err = lan78xx_write_reg(sc, ETH_INT_EP_CTL, buf); /* * Enables mac's transmitter. It will transmit frames from the buffer * onto the cable. */ - err = lan78xx_read_reg(sc, MAC_TX, &buf); - buf |= MAC_TX_TXEN_; - err = lan78xx_write_reg(sc, MAC_TX, buf); + err = lan78xx_read_reg(sc, ETH_MAC_TX, &buf); + buf |= ETH_MAC_TX_TXEN_; + err = lan78xx_write_reg(sc, ETH_MAC_TX, buf); /* * FIFO is capable of transmitting frames to MAC. */ - err = lan78xx_read_reg(sc, FCT_TX_CTL, &buf); - buf |= FCT_TX_CTL_EN_; - err = lan78xx_write_reg(sc, FCT_TX_CTL, buf); + err = lan78xx_read_reg(sc, ETH_FCT_TX_CTL, &buf); + buf |= ETH_FCT_TX_CTL_EN_; + err = lan78xx_write_reg(sc, ETH_FCT_TX_CTL, buf); /* * Set max frame length. In linux this is dev->mtu (which by default @@ -1111,16 +1120,16 @@ lan78xx_chip_init(struct muge_softc *sc) /* * enable MAC RX */ - err = lan78xx_read_reg(sc, MAC_RX, &buf); - buf |= MAC_RX_EN_; - err = lan78xx_write_reg(sc, MAC_RX, buf); + err = lan78xx_read_reg(sc, ETH_MAC_RX, &buf); + buf |= ETH_MAC_RX_EN_; + err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); /* * enable FIFO controller RX */ - err = lan78xx_read_reg(sc, FCT_RX_CTL, &buf); - buf |= FCT_TX_CTL_EN_; - err = lan78xx_write_reg(sc, FCT_RX_CTL, buf); + err = lan78xx_read_reg(sc, ETH_FCT_RX_CTL, &buf); + buf |= ETH_FCT_TX_CTL_EN_; + err = lan78xx_write_reg(sc, ETH_FCT_RX_CTL, buf); return 0; @@ -1459,8 +1468,8 @@ muge_attach_post(struct usb_ether *ue) lan78xx_read_reg(sc, 0, &val); /* Check if there is already a MAC address in the register */ - if ((lan78xx_read_reg(sc, RX_ADDRL, &mac_l) == 0) && - (lan78xx_read_reg(sc, RX_ADDRH, &mac_h) == 0)) { + if ((lan78xx_read_reg(sc, ETH_RX_ADDRL, &mac_l) == 0) && + (lan78xx_read_reg(sc, ETH_RX_ADDRH, &mac_h) == 0)) { sc->sc_ue.ue_eaddr[5] = (uint8_t)((mac_h >> 8) & 0xff); sc->sc_ue.ue_eaddr[4] = (uint8_t)((mac_h) & 0xff); sc->sc_ue.ue_eaddr[3] = (uint8_t)((mac_l >> 24) & 0xff); @@ -1474,7 +1483,7 @@ muge_attach_post(struct usb_ether *ue) * generate a random MAC address. */ if (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { - if ((lan78xx_eeprom_read(sc, E2P_MAC_OFFSET, + if ((lan78xx_eeprom_read(sc, ETH_E2P_MAC_OFFSET, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0) || (lan78xx_otp_read(sc, OTP_MAC_OFFSET, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0)) { @@ -1688,7 +1697,7 @@ muge_set_addr_filter(struct muge_softc *sc, int index, sc->sc_pfilter_table[index][1] = tmp; tmp = addr[5]; tmp |= addr[4] | (tmp << 8); - tmp |= PFILTER_ADDR_VALID_ | PFILTER_ADDR_TYPE_DST_; + tmp |= ETH_MAF_HI_VALID_ | ETH_MAF_HI_TYPE_DST_; sc->sc_pfilter_table[index][0] = tmp; } } @@ -1713,22 +1722,22 @@ lan78xx_dataport_write(struct muge_softc *sc, uint32_t int i, ret; MUGE_LOCK_ASSERT(sc, MA_OWNED); - ret = lan78xx_wait_for_bits(sc, DP_SEL, DP_SEL_DPRDY_); + ret = lan78xx_wait_for_bits(sc, ETH_DP_SEL, ETH_DP_SEL_DPRDY_); if (ret < 0) goto done; - ret = lan78xx_read_reg(sc, DP_SEL, &dp_sel); + ret = lan78xx_read_reg(sc, ETH_DP_SEL, &dp_sel); - dp_sel &= ~DP_SEL_RSEL_MASK_; + dp_sel &= ~ETH_DP_SEL_RSEL_MASK_; dp_sel |= ram_select; - ret = lan78xx_write_reg(sc, DP_SEL, dp_sel); + ret = lan78xx_write_reg(sc, ETH_DP_SEL, dp_sel); for (i = 0; i < length; i++) { - ret = lan78xx_write_reg(sc, DP_ADDR, addr + i); - ret = lan78xx_write_reg(sc, DP_DATA, buf[i]); - ret = lan78xx_write_reg(sc, DP_CMD, DP_CMD_WRITE_); - ret = lan78xx_wait_for_bits(sc, DP_SEL, DP_SEL_DPRDY_); + ret = lan78xx_write_reg(sc, ETH_DP_ADDR, addr + i); + ret = lan78xx_write_reg(sc, ETH_DP_DATA, buf[i]); + ret = lan78xx_write_reg(sc, ETH_DP_CMD, ETH_DP_CMD_WRITE_); + ret = lan78xx_wait_for_bits(sc, ETH_DP_SEL, ETH_DP_SEL_DPRDY_); if (ret != 0) goto done; } @@ -1749,8 +1758,9 @@ static void muge_multicast_write(struct muge_softc *sc) { int i, ret; - lan78xx_dataport_write(sc, DP_SEL_RSEL_VLAN_DA_, DP_SEL_VHF_VLAN_LEN, - DP_SEL_VHF_HASH_LEN, sc->sc_mchash_table); + lan78xx_dataport_write(sc, ETH_DP_SEL_RSEL_VLAN_DA_, + ETH_DP_SEL_VHF_VLAN_LEN, ETH_DP_SEL_VHF_HASH_LEN, + sc->sc_mchash_table); for (i = 1; i < MUGE_NUM_PFILTER_ADDRS_; i++) { ret = lan78xx_write_reg(sc, PFILTER_HI(i), 0); @@ -1798,11 +1808,11 @@ muge_setmulti(struct usb_ether *ue) MUGE_LOCK_ASSERT(sc, MA_OWNED); - sc->sc_rfe_ctl &= ~(RFE_CTL_UCAST_EN_ | RFE_CTL_MCAST_EN_ | - RFE_CTL_DA_PERFECT_ | RFE_CTL_MCAST_HASH_); + sc->sc_rfe_ctl &= ~(ETH_RFE_CTL_UCAST_EN_ | ETH_RFE_CTL_MCAST_EN_ | + ETH_RFE_CTL_DA_PERFECT_ | ETH_RFE_CTL_MCAST_HASH_); /* Initializing hash filter table */ - for (i = 0; i < DP_SEL_VHF_HASH_LEN; i++) + for (i = 0; i < ETH_DP_SEL_VHF_HASH_LEN; i++) sc->sc_mchash_table[i] = 0; /* Initializing perfect filter table */ @@ -1811,14 +1821,14 @@ muge_setmulti(struct usb_ether *ue) sc->sc_pfilter_table[i][1] = 0; } - sc->sc_rfe_ctl |= RFE_CTL_BCAST_EN_; + sc->sc_rfe_ctl |= ETH_RFE_CTL_BCAST_EN_; if (ifp->if_flags & IFF_PROMISC) { muge_dbg_printf(sc, "promiscuous mode enabled\n"); - sc->sc_rfe_ctl |= RFE_CTL_MCAST_EN_ | RFE_CTL_UCAST_EN_; + sc->sc_rfe_ctl |= ETH_RFE_CTL_MCAST_EN_ | ETH_RFE_CTL_UCAST_EN_; } else if (ifp->if_flags & IFF_ALLMULTI){ muge_dbg_printf(sc, "receive all multicast enabled\n"); - sc->sc_rfe_ctl |= RFE_CTL_MCAST_EN_; + sc->sc_rfe_ctl |= ETH_RFE_CTL_MCAST_EN_; } else { /* * Take the lock of the mac address list before hashing each of @@ -1840,7 +1850,8 @@ muge_setmulti(struct usb_ether *ue) uint32_t bitnum = muge_hash(addr); sc->sc_mchash_table[bitnum / 32] |= (1 << (bitnum % 32)); - sc->sc_rfe_ctl |= RFE_CTL_MCAST_HASH_; + sc->sc_rfe_ctl |= + ETH_RFE_CTL_MCAST_HASH_; } i++; } @@ -1848,7 +1859,7 @@ muge_setmulti(struct usb_ether *ue) if_maddr_runlock(ifp); muge_multicast_write(sc); } - lan78xx_write_reg(sc, RFE_CTL, sc->sc_rfe_ctl); + lan78xx_write_reg(sc, ETH_RFE_CTL, sc->sc_rfe_ctl); } /** @@ -1870,11 +1881,11 @@ muge_setpromisc(struct usb_ether *ue) MUGE_LOCK_ASSERT(sc, MA_OWNED); if (ifp->if_flags & IFF_PROMISC) - sc->sc_rfe_ctl |= RFE_CTL_MCAST_EN_ | RFE_CTL_UCAST_EN_; + sc->sc_rfe_ctl |= ETH_RFE_CTL_MCAST_EN_ | ETH_RFE_CTL_UCAST_EN_; else - sc->sc_rfe_ctl &= ~(RFE_CTL_MCAST_EN_); + sc->sc_rfe_ctl &= ~(ETH_RFE_CTL_MCAST_EN_); - lan78xx_write_reg(sc, RFE_CTL, sc->sc_rfe_ctl); + lan78xx_write_reg(sc, ETH_RFE_CTL, sc->sc_rfe_ctl); } /** @@ -1898,19 +1909,22 @@ static int muge_sethwcsum(struct muge_softc *sc) MUGE_LOCK_ASSERT(sc, MA_OWNED); if (ifp->if_capabilities & IFCAP_RXCSUM) { - sc->sc_rfe_ctl |= RFE_CTL_IGMP_COE_ | RFE_CTL_ICMP_COE_; - sc->sc_rfe_ctl |= RFE_CTL_TCPUDP_COE_ | RFE_CTL_IP_COE_; + sc->sc_rfe_ctl |= ETH_RFE_CTL_IGMP_COE_ | ETH_RFE_CTL_ICMP_COE_; + sc->sc_rfe_ctl |= ETH_RFE_CTL_TCPUDP_COE_ | ETH_RFE_CTL_IP_COE_; } else { - sc->sc_rfe_ctl &= ~(RFE_CTL_IGMP_COE_ | RFE_CTL_ICMP_COE_); - sc->sc_rfe_ctl &= ~(RFE_CTL_TCPUDP_COE_ | RFE_CTL_IP_COE_); + sc->sc_rfe_ctl &= + ~(ETH_RFE_CTL_IGMP_COE_ | ETH_RFE_CTL_ICMP_COE_); + sc->sc_rfe_ctl &= + ~(ETH_RFE_CTL_TCPUDP_COE_ | ETH_RFE_CTL_IP_COE_); } - sc->sc_rfe_ctl &= ~RFE_CTL_VLAN_FILTER_; + sc->sc_rfe_ctl &= ~ETH_RFE_CTL_VLAN_FILTER_; - err = lan78xx_write_reg(sc, RFE_CTL, sc->sc_rfe_ctl); + err = lan78xx_write_reg(sc, ETH_RFE_CTL, sc->sc_rfe_ctl); if (err != 0) { - muge_warn_printf(sc, "failed to write RFE_CTL (err=%d)\n", err); + muge_warn_printf(sc, "failed to write ETH_RFE_CTL (err=%d)\n", + err); return (err); } Modified: head/sys/dev/usb/net/if_mugereg.h ============================================================================== --- head/sys/dev/usb/net/if_mugereg.h Fri May 18 14:14:04 2018 (r333793) +++ head/sys/dev/usb/net/if_mugereg.h Fri May 18 14:30:45 2018 (r333794) @@ -39,89 +39,89 @@ #define _IF_MUGEREG_H_ /* USB Vendor Requests */ -#define UVR_WRITE_REG 0xA0 -#define UVR_READ_REG 0xA1 -#define UVR_GET_STATS 0xA2 +#define UVR_WRITE_REG 0xA0 +#define UVR_READ_REG 0xA1 +#define UVR_GET_STATS 0xA2 /* Device ID and revision register */ -#define ID_REV 0x000 -#define ID_REV_CHIP_ID_MASK_ 0xFFFF0000UL -#define ID_REV_CHIP_REV_MASK_ 0x0000FFFFUL +#define ETH_ID_REV 0x000 +#define ETH_ID_REV_CHIP_ID_MASK_ 0xFFFF0000UL +#define ETH_ID_REV_CHIP_REV_MASK_ 0x0000FFFFUL /* Device interrupt status register. */ -#define INT_STS 0x00C -#define INT_STS_CLEAR_ALL_ 0xFFFFFFFFUL +#define ETH_INT_STS 0x00C +#define ETH_INT_STS_CLEAR_ALL_ 0xFFFFFFFFUL /* Hardware Configuration Register. */ -#define HW_CFG 0x010 -#define HW_CFG_LED3_EN_ (0x1UL << 23) -#define HW_CFG_LED2_EN_ (0x1UL << 22) -#define HW_CFG_LED1_EN_ (0x1UL << 21) -#define HW_CFG_LEDO_EN_ (0x1UL << 20) -#define HW_CFG_MEF_ (0x1UL << 4) -#define HW_CFG_ETC_ (0x1UL << 3) -#define HW_CFG_LRST_ (0x1UL << 1) /* Lite reset */ -#define HW_CFG_SRST_ (0x1UL << 0) /* Soft reset */ +#define ETH_HW_CFG 0x010 +#define ETH_HW_CFG_LED3_EN_ (0x1UL << 23) +#define ETH_HW_CFG_LED2_EN_ (0x1UL << 22) +#define ETH_HW_CFG_LED1_EN_ (0x1UL << 21) +#define ETH_HW_CFG_LEDO_EN_ (0x1UL << 20) +#define ETH_HW_CFG_MEF_ (0x1UL << 4) +#define ETH_HW_CFG_ETC_ (0x1UL << 3) +#define ETH_HW_CFG_LRST_ (0x1UL << 1) /* Lite reset */ +#define ETH_HW_CFG_SRST_ (0x1UL << 0) /* Soft reset */ /* Power Management Control Register. */ -#define PMT_CTL 0x014 -#define PMT_CTL_PHY_RST_ (0x1UL << 4) /* PHY reset */ -#define PMT_CTL_WOL_EN_ (0x1UL << 3) /* PHY wake-on-lan enable */ -#define PMT_CTL_PHY_WAKE_EN_ (0x1UL << 2) /* PHY interrupt as a wake up event*/ +#define ETH_PMT_CTL 0x014 +#define ETH_PMT_CTL_PHY_RST_ (0x1UL << 4) /* PHY reset */ +#define ETH_PMT_CTL_WOL_EN_ (0x1UL << 3) /* PHY wake-on-lan */ +#define ETH_PMT_CTL_PHY_WAKE_EN_ (0x1UL << 2) /* PHY int wake */ /* GPIO Configuration 0 Register. */ -#define GPIO_CFG0 0x018 +#define ETH_GPIO_CFG0 0x018 /* GPIO Configuration 1 Register. */ -#define GPIO_CFG1 0x01C +#define ETH_GPIO_CFG1 0x01C /* GPIO wake enable and polarity register. */ -#define GPIO_WAKE 0x020 +#define ETH_GPIO_WAKE 0x020 /* RX Command A */ -#define RX_CMD_A_RED_ (0x1UL << 22) /* Receive Error Detected */ -#define RX_CMD_A_ICSM_ (0x1UL << 14) -#define RX_CMD_A_LEN_MASK_ 0x00003FFFUL +#define RX_CMD_A_RED_ (0x1UL << 22) /* Receive Error Det */ +#define RX_CMD_A_ICSM_ (0x1UL << 14) +#define RX_CMD_A_LEN_MASK_ 0x00003FFFUL /* TX Command A */ -#define TX_CMD_A_LEN_MASK_ 0x000FFFFFUL -#define TX_CMD_A_FCS_ (0x1UL << 22) +#define TX_CMD_A_LEN_MASK_ 0x000FFFFFUL +#define TX_CMD_A_FCS_ (0x1UL << 22) /* Data Port Select Register */ -#define DP_SEL 0x024 -#define DP_SEL_DPRDY_ (0x1UL << 31) -#define DP_SEL_RSEL_VLAN_DA_ (0x1UL << 0) /* RFE VLAN and DA Hash Table */ -#define DP_SEL_RSEL_MASK_ 0x0000000F -#define DP_SEL_VHF_HASH_LEN 16 -#define DP_SEL_VHF_VLAN_LEN 128 +#define ETH_DP_SEL 0x024 +#define ETH_DP_SEL_DPRDY_ (0x1UL << 31) +#define ETH_DP_SEL_RSEL_VLAN_DA_ (0x1UL << 0) /* RFE VLAN/DA Hash */ +#define ETH_DP_SEL_RSEL_MASK_ 0x0000000F +#define ETH_DP_SEL_VHF_HASH_LEN 16 +#define ETH_DP_SEL_VHF_VLAN_LEN 128 /* Data Port Command Register */ -#define DP_CMD 0x028 -#define DP_CMD_WRITE_ (0x1UL << 0) /* 1 for write */ -#define DP_CMD_READ_ (0x0UL << 0) /* 0 for read */ +#define ETH_DP_CMD 0x028 +#define ETH_DP_CMD_WRITE_ (0x1UL << 0) /* 1 for write */ +#define ETH_DP_CMD_READ_ (0x0UL << 0) /* 0 for read */ /* Data Port Address Register */ -#define DP_ADDR 0x02C +#define ETH_DP_ADDR 0x02C /* Data Port Data Register */ -#define DP_DATA 0x030 +#define ETH_DP_DATA 0x030 /* EEPROM Command Register */ -#define E2P_CMD 0x040 -#define E2P_CMD_MASK_ 0x70000000UL -#define E2P_CMD_ADDR_MASK_ 0x000001FFUL -#define E2P_CMD_BUSY_ (0x1UL << 31) -#define E2P_CMD_READ_ (0x0UL << 28) -#define E2P_CMD_WRITE_ (0x3UL << 28) -#define E2P_CMD_ERASE_ (0x5UL << 28) -#define E2P_CMD_RELOAD_ (0x7UL << 28) -#define E2P_CMD_TIMEOUT_ (0x1UL << 10) -#define E2P_MAC_OFFSET 0x01 -#define E2P_INDICATOR_OFFSET 0x00 +#define ETH_E2P_CMD 0x040 +#define ETH_E2P_CMD_MASK_ 0x70000000UL +#define ETH_E2P_CMD_ADDR_MASK_ 0x000001FFUL +#define ETH_E2P_CMD_BUSY_ (0x1UL << 31) +#define ETH_E2P_CMD_READ_ (0x0UL << 28) +#define ETH_E2P_CMD_WRITE_ (0x3UL << 28) +#define ETH_E2P_CMD_ERASE_ (0x5UL << 28) +#define ETH_E2P_CMD_RELOAD_ (0x7UL << 28) +#define ETH_E2P_CMD_TIMEOUT_ (0x1UL << 10) +#define ETH_E2P_MAC_OFFSET 0x01 +#define ETH_E2P_INDICATOR_OFFSET 0x00 /* EEPROM Data Register */ -#define E2P_DATA 0x044 -#define E2P_INDICATOR 0xA5 /* Indicates an EEPROM is present */ +#define ETH_E2P_DATA 0x044 +#define ETH_E2P_INDICATOR 0xA5 /* EEPROM is present */ /* Packet sizes. */ #define MUGE_SS_USB_PKT_SIZE 1024 @@ -129,60 +129,60 @@ #define MUGE_FS_USB_PKT_SIZE 64 /* Receive Filtering Engine Control Register */ -#define RFE_CTL 0x0B0 -#define RFE_CTL_IGMP_COE_ (0x1U << 14) -#define RFE_CTL_ICMP_COE_ (0x1U << 13) -#define RFE_CTL_TCPUDP_COE_ (0x1U << 12) -#define RFE_CTL_IP_COE_ (0x1U << 11) -#define RFE_CTL_BCAST_EN_ (0x1U << 10) -#define RFE_CTL_MCAST_EN_ (0x1U << 9) -#define RFE_CTL_UCAST_EN_ (0x1U << 8) -#define RFE_CTL_VLAN_FILTER_ (0x1U << 5) -#define RFE_CTL_MCAST_HASH_ (0x1U << 3) -#define RFE_CTL_DA_PERFECT_ (0x1U << 1) +#define ETH_RFE_CTL 0x0B0 +#define ETH_RFE_CTL_IGMP_COE_ (0x1U << 14) +#define ETH_RFE_CTL_ICMP_COE_ (0x1U << 13) +#define ETH_RFE_CTL_TCPUDP_COE_ (0x1U << 12) +#define ETH_RFE_CTL_IP_COE_ (0x1U << 11) +#define ETH_RFE_CTL_BCAST_EN_ (0x1U << 10) +#define ETH_RFE_CTL_MCAST_EN_ (0x1U << 9) +#define ETH_RFE_CTL_UCAST_EN_ (0x1U << 8) +#define ETH_RFE_CTL_VLAN_FILTER_ (0x1U << 5) +#define ETH_RFE_CTL_MCAST_HASH_ (0x1U << 3) +#define ETH_RFE_CTL_DA_PERFECT_ (0x1U << 1) /* End address of the RX FIFO */ -#define FCT_RX_FIFO_END 0x0C8 -#define FCT_RX_FIFO_END_MASK_ 0x0000007FUL +#define ETH_FCT_RX_FIFO_END 0x0C8 +#define ETH_FCT_RX_FIFO_END_MASK_ 0x0000007FUL #define MUGE_MAX_RX_FIFO_SIZE (12 * 1024) /* End address of the TX FIFO */ -#define FCT_TX_FIFO_END 0x0CC -#define FCT_TX_FIFO_END_MASK_ 0x0000003FUL +#define ETH_FCT_TX_FIFO_END 0x0CC +#define ETH_FCT_TX_FIFO_END_MASK_ 0x0000003FUL #define MUGE_MAX_TX_FIFO_SIZE (12 * 1024) /* USB Configuration Register 0 */ -#define USB_CFG0 0x080 -#define USB_CFG_BIR_ (0x1U << 6) /* Bulk-In Empty response */ -#define USB_CFG_BCE_ (0x1U << 5) /* Burst Cap Enable */ +#define ETH_USB_CFG0 0x080 +#define ETH_USB_CFG_BIR_ (0x1U << 6) /* Bulk-In Empty resp */ +#define ETH_USB_CFG_BCE_ (0x1U << 5) /* Burst Cap Enable */ /* USB Configuration Register 1 */ -#define USB_CFG1 0x084 +#define ETH_USB_CFG1 0x084 /* USB Configuration Register 2 */ -#define USB_CFG2 0x088 +#define ETH_USB_CFG2 0x088 /* USB bConfigIndex: it only has one configuration. */ -#define MUGE_CONFIG_INDEX 0 +#define MUGE_CONFIG_INDEX 0 /* Burst Cap Register */ -#define BURST_CAP 0x090 +#define ETH_BURST_CAP 0x090 #define MUGE_DEFAULT_BURST_CAP_SIZE MUGE_MAX_TX_FIFO_SIZE /* Bulk-In Delay Register */ -#define BULK_IN_DLY 0x094 -#define MUGE_DEFAULT_BULK_IN_DELAY 0x0800 +#define ETH_BULK_IN_DLY 0x094 +#define MUGE_DEFAULT_BULK_IN_DELAY 0x0800 /* Interrupt Endpoint Control Register */ -#define INT_EP_CTL 0x098 -#define INT_ENP_PHY_INT (0x1U << 17) /* PHY Enable */ +#define ETH_INT_EP_CTL 0x098 +#define ETH_INT_ENP_PHY_INT (0x1U << 17) /* PHY Enable */ /* Registers on the phy, accessed via MII/MDIO */ -#define MUGE_PHY_INTR_STAT 25 -#define MUGE_PHY_INTR_MASK 26 -#define MUGE_PHY_INTR_LINK_CHANGE (0x1U << 13) +#define MUGE_PHY_INTR_STAT 25 +#define MUGE_PHY_INTR_MASK 26 +#define MUGE_PHY_INTR_LINK_CHANGE (0x1U << 13) #define MUGE_PHY_INTR_ANEG_COMP (0x1U << 10) -#define MUGE_EXT_PAGE_ACCESS 0x1F +#define MUGE_EXT_PAGE_ACCESS 0x1F #define MUGE_EXT_PAGE_SPACE_0 0x0000 #define MUGE_EXT_PAGE_SPACE_1 0x0001 #define MUGE_EXT_PAGE_SPACE_2 0x0002 @@ -193,58 +193,58 @@ #define MUGE_EXT_MODE_CTRL_AUTO_MDIX_ 0x0000 /* FCT Flow Control Threshold Register */ -#define FCT_FLOW 0x0D0 +#define ETH_FCT_FLOW 0x0D0 /* FCT RX FIFO Control Register */ -#define FCT_RX_CTL 0x0C0 +#define ETH_FCT_RX_CTL 0x0C0 /* FCT TX FIFO Control Register */ -#define FCT_TX_CTL 0x0C4 -#define FCT_TX_CTL_EN_ (0x1U << 31) +#define ETH_FCT_TX_CTL 0x0C4 +#define ETH_FCT_TX_CTL_EN_ (0x1U << 31) /* MAC Control Register */ -#define MAC_CR 0x100 -#define MAC_CR_AUTO_DUPLEX_ (0x1U << 12) -#define MAC_CR_AUTO_SPEED_ (0x1U << 11) +#define ETH_MAC_CR 0x100 +#define ETH_MAC_CR_AUTO_DUPLEX_ (0x1U << 12) +#define ETH_MAC_CR_AUTO_SPEED_ (0x1U << 11) /* MAC Receive Register */ -#define MAC_RX 0x104 -#define MAC_RX_MAX_FR_SIZE_MASK_ 0x3FFF0000 -#define MAC_RX_MAX_FR_SIZE_SHIFT_ 16 -#define MAC_RX_EN_ (0x1U << 0) /* Enable Receiver */ +#define ETH_MAC_RX 0x104 +#define ETH_MAC_RX_MAX_FR_SIZE_MASK_ 0x3FFF0000 +#define ETH_MAC_RX_MAX_FR_SIZE_SHIFT_ 16 +#define ETH_MAC_RX_EN_ (0x1U << 0) /* Enable Receiver */ /* MAC Transmit Register */ -#define MAC_TX 0x108 -#define MAC_TX_TXEN_ (0x1U << 0) /* Enable Transmitter */ +#define ETH_MAC_TX 0x108 +#define ETH_MAC_TX_TXEN_ (0x1U << 0) /* Enable Transmitter */ /* Flow Control Register */ -#define FLOW 0x10C -#define FLOW_CR_TX_FCEN_ (0x1U << 30) /* TX FC Enable */ -#define FLOW_CR_RX_FCEN_ (0x1U << 29) /* RX FC Enable */ +#define ETH_FLOW 0x10C +#define ETH_FLOW_CR_TX_FCEN_ (0x1U << 30) /* TX FC Enable */ +#define ETH_FLOW_CR_RX_FCEN_ (0x1U << 29) /* RX FC Enable */ /* MAC Receive Address Registers */ -#define RX_ADDRH 0x118 /* High */ -#define RX_ADDRL 0x11C /* Low */ +#define ETH_RX_ADDRH 0x118 /* High */ +#define ETH_RX_ADDRL 0x11C /* Low */ /* MII Access Register */ -#define MII_ACCESS 0x120 -#define MII_BUSY_ (0x1UL << 0) -#define MII_READ_ (0x0UL << 1) -#define MII_WRITE_ (0x1UL << 1) +#define ETH_MII_ACC 0x120 +#define ETH_MII_ACC_MII_BUSY_ (0x1UL << 0) +#define ETH_MII_ACC_MII_READ_ (0x0UL << 1) +#define ETH_MII_ACC_MII_WRITE_ (0x1UL << 1) /* MII Data Register */ -#define MII_DATA 0x124 +#define ETH_MII_DATA 0x124 /* MAC address perfect filter registers (ADDR_FILTx) */ -#define PFILTER_BASE 0x400 -#define PFILTER_HIX 0x00 -#define PFILTER_LOX 0x04 +#define ETH_MAF_BASE 0x400 +#define ETH_MAF_HIx 0x00 +#define ETH_MAF_LOx 0x04 #define MUGE_NUM_PFILTER_ADDRS_ 33 -#define PFILTER_ADDR_VALID_ (0x1UL << 31) -#define PFILTER_ADDR_TYPE_SRC_ (0x1UL << 30) -#define PFILTER_ADDR_TYPE_DST_ (0x0UL << 30) -#define PFILTER_HI(index) (PFILTER_BASE + (8 * (index)) + (PFILTER_HIX)) -#define PFILTER_LO(index) (PFILTER_BASE + (8 * (index)) + (PFILTER_LOX)) +#define ETH_MAF_HI_VALID_ (0x1UL << 31) +#define ETH_MAF_HI_TYPE_SRC_ (0x1UL << 30) +#define ETH_MAF_HI_TYPE_DST_ (0x0UL << 30) +#define PFILTER_HI(index) (ETH_MAF_BASE + (8 * (index)) + (ETH_MAF_HIx)) +#define PFILTER_LO(index) (ETH_MAF_BASE + (8 * (index)) + (ETH_MAF_LOx)) /* * These registers are not documented in the datasheet, and are based on @@ -276,82 +276,97 @@ /* Some unused registers, from the data sheet. */ #if 0 -#define BOS_ATTR 0x050 -#define SS_ATTR 0x054 -#define HS_ATTR 0x058 -#define FS_ATTR 0x05C -#define STRNG_ATTR0 0x060 -#define STRNG_ATTR1 0x064 -#define FLAG_ATTR 0x068 -#define SW_GP_1 0x06C -#define SW_GP_2 0x070 -#define SW_GP_3 0x074 -#define VLAN_TYPE 0x0B4 -#define RX_DP_STOR 0x0D4 -#define TX_DP_STOR 0x0D8 -#define LTM_BELT_IDLE0 0x0E0 -#define LTM_BELT_IDLE1 0x0E4 -#define LTM_BELT_ACT0 0x0E8 -#define LTM_BELT_ACT1 0x0EC -#define LTM_INACTIVE0 0x0F0 -#define LTM_INACTIVE1 0x0F4 +#define ETH_BOS_ATTR 0x050 +#define ETH_SS_ATTR 0x054 +#define ETH_HS_ATTR 0x058 +#define ETH_FS_ATTR 0x05C +#define ETH_STRNG_ATTR0 0x060 +#define ETH_STRNG_ATTR1 0x064 +#define ETH_STRNGFLAG_ATTR 0x068 +#define ETH_SW_GP_0 0x06C +#define ETH_SW_GP_1 0x070 +#define ETH_SW_GP_2 0x074 +#define ETH_VLAN_TYPE 0x0B4 +#define ETH_RX_DP_STOR 0x0D4 +#define ETH_TX_DP_STOR 0x0D8 +#define ETH_LTM_BELT_IDLE0 0x0E0 +#define ETH_LTM_BELT_IDLE1 0x0E4 +#define ETH_LTM_BELT_ACT0 0x0E8 +#define ETH_LTM_BELT_ACT1 0x0EC +#define ETH_LTM_INACTIVE0 0x0F0 +#define ETH_LTM_INACTIVE1 0x0F4 -#define RAND_SEED 0x110 -#define ERR_STS 0x114 +#define ETH_RAND_SEED 0x110 +#define ETH_ERR_STS 0x114 -#define EEE_TX_LPI_REQUEST_DELAY_CNT 0x130 -#define EEE_TW_TX_SYS 0x134 -#define EEE_TX_LPI_AUTO_REMOVAL_DELAY 0x138 +#define ETH_EEE_TX_LPI_REQ_DLY 0x130 +#define ETH_EEE_TW_TX_SYS 0x134 +#define ETH_EEE_TX_LPI_REM_DLY 0x138 -#define WUCSR1 0x140 -#define WK_SRC 0x144 -#define WUF_CFG_BASE 0x150 -#define WUF_MASK_BASE 0x200 -#define WUCSR2 0x600 +#define ETH_WUCSR1 0x140 +#define ETH_WK_SRC 0x144 +#define ETH_WUF_CFGx 0x150 +#define ETH_WUF_MASKx 0x200 +#define ETH_WUCSR2 0x600 -#define NSx_IPV6_ADDR_DEST_0 0x610 -#define NSx_IPV6_ADDR_DEST_1 0x614 -#define NSx_IPV6_ADDR_DEST_2 0x618 -#define NSx_IPV6_ADDR_DEST_3 0x61C +#define ETH_NS1_IPV6_ADDR_DEST0 0x610 +#define ETH_NS1_IPV6_ADDR_DEST1 0x614 +#define ETH_NS1_IPV6_ADDR_DEST2 0x618 +#define ETH_NS1_IPV6_ADDR_DEST3 0x61C -#define NSx_IPV6_ADDR_SRC_0 0x620 -#define NSx_IPV6_ADDR_SRC_1 0x624 -#define NSx_IPV6_ADDR_SRC_2 0x628 -#define NSx_IPV6_ADDR_SRC_3 0x62C +#define ETH_NS1_IPV6_ADDR_SRC0 0x620 +#define ETH_NS1_IPV6_ADDR_SRC1 0x624 +#define ETH_NS1_IPV6_ADDR_SRC2 0x628 +#define ETH_NS1_IPV6_ADDR_SRC3 0x62C *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 18 14:35:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21798EAA231; Fri, 18 May 2018 14:35:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7371278B01; Fri, 18 May 2018 14:35:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4IEZSUo011246; Fri, 18 May 2018 07:35:29 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4IEZSIQ011245; Fri, 18 May 2018 07:35:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805181435.w4IEZSIQ011245@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333673 - in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 In-Reply-To: <20180518141752.GA6250@bali> To: Andre Albsmeier Date: Fri, 18 May 2018 07:35:28 -0700 (PDT) CC: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:35:32 -0000 > On Wed, 16-May-2018 at 13:18:38 +0000, Warner Losh wrote: > > Author: imp > > Date: Wed May 16 13:18:37 2018 > > New Revision: 333673 > > URL: https://svnweb.freebsd.org/changeset/base/333673 > > > > Log: > > MFC r333436: only launch getty if underlying device exists > > Can the onifexists thing work under 11? I had problems > with my ttys until I switched back to "on". I also can't > find an MFC of r315733 which apparently implemented this > in HEAD... This has been caught during the Beta2 build and corrective actions are in process. The pointy hat belongs to me, as I asked imp to merge this, thinking that all the other parts had been merged as I did not get an error when I put onifexists in my 11-beta1 /etc/ttys, but was getting lots of noise from getty about attempts to start ttys on v1-v7 without this. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 18 14:57:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66CCCEAABFE; Fri, 18 May 2018 14:57:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18CA7797D0; Fri, 18 May 2018 14:57:07 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE19B19A13; Fri, 18 May 2018 14:57:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IEv6LI012630; Fri, 18 May 2018 14:57:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IEv69W012629; Fri, 18 May 2018 14:57:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805181457.w4IEv69W012629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 18 May 2018 14:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333795 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 333795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:57:07 -0000 Author: gjb Date: Fri May 18 14:57:06 2018 New Revision: 333795 URL: https://svnweb.freebsd.org/changeset/base/333795 Log: Revert r333774, which renames stable/11 from BETA1 to BETA2 in order to address an issue what was discovered with the BETA2 builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Fri May 18 14:30:45 2018 (r333794) +++ stable/11/sys/conf/newvers.sh Fri May 18 14:57:06 2018 (r333795) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="BETA2" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 18 14:58:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A45D6EAAC8C; Fri, 18 May 2018 14:58:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 586F079966; Fri, 18 May 2018 14:58:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3983C19A14; Fri, 18 May 2018 14:58:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IEw0OI012710; Fri, 18 May 2018 14:58:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IEvxut012704; Fri, 18 May 2018 14:57:59 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805181457.w4IEvxut012704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 18 May 2018 14:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333796 - in stable/11: include lib/libc/gen libexec/getty sbin/init X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11: include lib/libc/gen libexec/getty sbin/init X-SVN-Commit-Revision: 333796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:58:01 -0000 Author: gjb Date: Fri May 18 14:57:58 2018 New Revision: 333796 URL: https://svnweb.freebsd.org/changeset/base/333796 Log: MFC r315733, r315737, r315740, r330054: r315733 (imp): Impelemnt ttys onifexists in init. Implement a new init(8) option in /etc/ttys. If this option is present on the entry in /etc/ttys, the entry will be active if and only if it exists. If the name starts with a '/', it will be considered an absolute path. If not, it will be a path relative to /dev. This allows one to turn off video console getty that aren't present (while running a getty on them even when they aren't the system console). Likewise with serial ports. It differs from onifconsole in only requiring the device exist rather than it be listed as one of the system consoles. r315737 (ngie): Unbreak world by adding sys/stat.h for stat(2) r315740 (imp): Simplify the code a little. r330054 (trasz): Improve missing tty handling in init(8). This removes a check that did nothing - it was checking for ENXIO, which, with devfs, is no longer returned - and was badly placed anyway, and replaces it with similar one that works, and is done just before starting getty, instead of being done when rereading ttys(5). From the practical point of view, this makes init(8) handle disappearing terminals (eg /dev/ttyU*) gracefully, without unneccessary getty restarts and resulting error messages. Reported by: Bart Ender, Andre Albsmeier PR: 228315 Blocks: 11.2-BETA2 Approved by: re (marius) Sponsored by: The FreeBSD Foundation Modified: stable/11/include/ttyent.h stable/11/lib/libc/gen/getttyent.3 stable/11/lib/libc/gen/getttyent.c stable/11/libexec/getty/ttys.5 stable/11/sbin/init/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/include/ttyent.h ============================================================================== --- stable/11/include/ttyent.h Fri May 18 14:57:06 2018 (r333795) +++ stable/11/include/ttyent.h Fri May 18 14:57:58 2018 (r333796) @@ -38,6 +38,7 @@ #define _TTYS_OFF "off" #define _TTYS_ON "on" #define _TTYS_ONIFCONSOLE "onifconsole" +#define _TTYS_ONIFEXISTS "onifexists" #define _TTYS_SECURE "secure" #define _TTYS_INSECURE "insecure" #define _TTYS_WINDOW "window" @@ -54,6 +55,8 @@ struct ttyent { #define TTY_SECURE 0x02 /* allow uid of 0 to login */ #define TTY_DIALUP 0x04 /* is a dialup tty */ #define TTY_NETWORK 0x08 /* is a network tty */ +#define TTY_IFEXISTS 0x10 /* configured as "onifexists" */ +#define TTY_IFCONSOLE 0x20 /* configured as "onifconsole" */ int ty_status; /* status flags */ char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ Modified: stable/11/lib/libc/gen/getttyent.3 ============================================================================== --- stable/11/lib/libc/gen/getttyent.3 Fri May 18 14:57:06 2018 (r333795) +++ stable/11/lib/libc/gen/getttyent.3 Fri May 18 14:57:58 2018 (r333796) @@ -75,6 +75,8 @@ struct ttyent { #define TTY_SECURE 0x02 /* allow uid of 0 to login */ #define TTY_DIALUP 0x04 /* is a dialup tty */ #define TTY_NETWORK 0x08 /* is a network tty */ +#define TTY_IFEXISTS 0x10 /* configured as "onifexists" */ +#define TTY_IFCONSOLE 0x20 /* configured as "onifconsole" */ int ty_status; /* status flags */ char *ty_window; /* command to start up window manager */ char *ty_comment; /* comment field */ @@ -115,6 +117,10 @@ Identifies a tty used for network connections. If this flag is set, then .Fn isnettty will return a non-zero value. +.It Dv TTY_IFEXISTS +Identifies a tty that does not neccessarily exist. +.It Dv TTY_IFCONSOLE +Identifies a tty that might be a system console. .El .It Fa ty_window The command to execute for a window system associated with the line. Modified: stable/11/lib/libc/gen/getttyent.c ============================================================================== --- stable/11/lib/libc/gen/getttyent.c Fri May 18 14:57:06 2018 (r333795) +++ stable/11/lib/libc/gen/getttyent.c Fri May 18 14:57:58 2018 (r333796) @@ -34,6 +34,7 @@ static char sccsid[] = "@(#)getttyent.c 8.1 (Berkeley) __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -72,11 +73,14 @@ auto_tty_status(const char *ty_name) { size_t len; char *buf, *cons, *nextcons; + int rv; + rv = TTY_IFCONSOLE; + /* Check if this is an enabled kernel console line */ buf = NULL; if (sysctlbyname("kern.console", NULL, &len, NULL, 0) == -1) - return (0); /* Errors mean don't enable */ + return (rv); /* Errors mean don't enable */ buf = malloc(len); if (sysctlbyname("kern.console", buf, &len, NULL, 0) == -1) goto done; @@ -87,16 +91,34 @@ auto_tty_status(const char *ty_name) nextcons = buf; while ((cons = strsep(&nextcons, ",")) != NULL && strlen(cons) != 0) { if (strcmp(cons, ty_name) == 0) { - free(buf); - return (TTY_ON); + rv |= TTY_ON; + break; } } done: free(buf); - return (0); + return (rv); } +static int +auto_exists_status(const char *ty_name) +{ + struct stat sb; + char *dev; + int rv; + + rv = TTY_IFEXISTS; + if (*ty_name == '/') + asprintf(&dev, "%s", ty_name); + else + asprintf(&dev, "/dev/%s", ty_name); + if (dev != NULL && stat(dev, &sb) == 0) + rv |= TTY_ON; + free(dev); + return (rv); +} + struct ttyent * getttyent(void) { @@ -161,6 +183,8 @@ getttyent(void) tty.ty_status |= TTY_ON; else if (scmp(_TTYS_ONIFCONSOLE)) tty.ty_status |= auto_tty_status(tty.ty_name); + else if (scmp(_TTYS_ONIFEXISTS)) + tty.ty_status |= auto_exists_status(tty.ty_name); else if (scmp(_TTYS_SECURE)) tty.ty_status |= TTY_SECURE; else if (scmp(_TTYS_INSECURE)) Modified: stable/11/libexec/getty/ttys.5 ============================================================================== --- stable/11/libexec/getty/ttys.5 Fri May 18 14:57:06 2018 (r333795) +++ stable/11/libexec/getty/ttys.5 Fri May 18 14:57:58 2018 (r333796) @@ -28,7 +28,7 @@ .\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd March 9, 2014 +.Dd March 16, 2017 .Dt TTYS 5 .Os .Sh NAME @@ -105,6 +105,12 @@ should (should not) execute the command given in the s ``onifconsole'' will cause this line to be enabled if and only if it is an active kernel console device (it is equivalent to ``on'' in this case). +The flag ``onifexists'' will cause this line to be enabled if and only +if the name exists. +If the name starts with a ``/'', it will be considered an absolute +path. +Otherwise, it is considered a path relative to +.Pa /dev . The flag ``secure'' (if the console is enabled) allows users with a uid of 0 to login on this line. Modified: stable/11/sbin/init/init.c ============================================================================== --- stable/11/sbin/init/init.c Fri May 18 14:57:06 2018 (r333795) +++ stable/11/sbin/init/init.c Fri May 18 14:57:58 2018 (r333796) @@ -154,6 +154,8 @@ typedef struct init_session { int se_flags; /* status of session */ #define SE_SHUTDOWN 0x1 /* session won't be restarted */ #define SE_PRESENT 0x2 /* session is in /etc/ttys */ +#define SE_IFEXISTS 0x4 /* session defined as "onifexists" */ +#define SE_IFCONSOLE 0x8 /* session defined as "onifconsole" */ int se_nspace; /* spacing count */ char *se_device; /* filename of port */ char *se_getty; /* what to run on that port */ @@ -1260,7 +1262,6 @@ static session_t * new_session(session_t *sprev, struct ttyent *typ) { session_t *sp; - int fd; if ((typ->ty_status & TTY_ON) == 0 || typ->ty_name == 0 || @@ -1271,21 +1272,15 @@ new_session(session_t *sprev, struct ttyent *typ) sp->se_flags |= SE_PRESENT; + if ((typ->ty_status & TTY_IFEXISTS) != 0) + sp->se_flags |= SE_IFEXISTS; + + if ((typ->ty_status & TTY_IFCONSOLE) != 0) + sp->se_flags |= SE_IFCONSOLE; + if (asprintf(&sp->se_device, "%s%s", _PATH_DEV, typ->ty_name) < 0) err(1, "asprintf"); - /* - * Attempt to open the device, if we get "device not configured" - * then don't add the device to the session list. - */ - if ((fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0)) < 0) { - if (errno == ENXIO) { - free_session(sp); - return (0); - } - } else - close(fd); - if (setupargv(sp, typ) == 0) { free_session(sp); return (0); @@ -1505,6 +1500,30 @@ start_getty(session_t *sp) } /* + * Return 1 if the session is defined as "onifexists" + * or "onifconsole" and the device node does not exist. + */ +static int +session_has_no_tty(session_t *sp) +{ + int fd; + + if ((sp->se_flags & SE_IFEXISTS) == 0 && + (sp->se_flags & SE_IFCONSOLE) == 0) + return (0); + + fd = open(sp->se_device, O_RDONLY | O_NONBLOCK, 0); + if (fd < 0) { + if (errno == ENOENT) + return (1); + return (0); + } + + close(fd); + return (0); +} + +/* * Collect exit status for a child. * If an exiting login, start a new login running. */ @@ -1522,7 +1541,8 @@ collect_child(pid_t pid) del_session(sp); sp->se_process = 0; - if (sp->se_flags & SE_SHUTDOWN) { + if (sp->se_flags & SE_SHUTDOWN || + session_has_no_tty(sp)) { if ((sprev = sp->se_prev) != NULL) sprev->se_next = sp->se_next; else @@ -1607,6 +1627,8 @@ multi_user(void) for (sp = sessions; sp; sp = sp->se_next) { if (sp->se_process) + continue; + if (session_has_no_tty(sp)) continue; if ((pid = start_getty(sp)) == -1) { /* serious trouble */ From owner-svn-src-all@freebsd.org Fri May 18 14:59:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F2A3EAAD4B; Fri, 18 May 2018 14:59:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D575879AC7; Fri, 18 May 2018 14:59:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B782719A16; Fri, 18 May 2018 14:59:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IEx4Ne012809; Fri, 18 May 2018 14:59:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IEx4BA012808; Fri, 18 May 2018 14:59:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201805181459.w4IEx4BA012808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 18 May 2018 14:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333797 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 333797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 14:59:05 -0000 Author: gjb Date: Fri May 18 14:59:04 2018 New Revision: 333797 URL: https://svnweb.freebsd.org/changeset/base/333797 Log: Update stable/11 to BETA2 as part of the 11.2-RELEASE cycle. As 11.2-BETA2 needs to be rebuilt, this commit marks the real point in time for the rename. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Fri May 18 14:57:58 2018 (r333796) +++ stable/11/sys/conf/newvers.sh Fri May 18 14:59:04 2018 (r333797) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="BETA1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 18 16:19:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B96EAD4C1; Fri, 18 May 2018 16:19:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 43CF57D0D8; Fri, 18 May 2018 16:19:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A6411A738; Fri, 18 May 2018 16:19:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IGJjOh053701; Fri, 18 May 2018 16:19:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IGJjad053700; Fri, 18 May 2018 16:19:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805181619.w4IGJjad053700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 18 May 2018 16:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333798 - head/usr.bin/ncal X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/ncal X-SVN-Commit-Revision: 333798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 16:19:46 -0000 Author: imp Date: Fri May 18 16:19:45 2018 New Revision: 333798 URL: https://svnweb.freebsd.org/changeset/base/333798 Log: Based on multiple sources including the State Gazette the last day of Julian calendar in Bulgaria was 31.03.1916. Submitted by: Konstantin Terziev Pull Request: https://github.com/freebsd/freebsd/pull/142 (I independently confirmed the date and this was the right date to use for ncal) Modified: head/usr.bin/ncal/ncal.c Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Fri May 18 14:59:04 2018 (r333797) +++ head/usr.bin/ncal/ncal.c Fri May 18 16:19:45 2018 (r333798) @@ -78,7 +78,7 @@ static struct djswitch { {"AT", "Austria", {1583, 10, 5}}, {"AU", "Australia", {1752, 9, 2}}, {"BE", "Belgium", {1582, 12, 14}}, - {"BG", "Bulgaria", {1916, 3, 18}}, + {"BG", "Bulgaria", {1916, 3, 31}}, {"CA", "Canada", {1752, 9, 2}}, {"CH", "Switzerland", {1655, 2, 28}}, {"CN", "China", {1911, 12, 18}}, From owner-svn-src-all@freebsd.org Fri May 18 16:26:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1E74EAD99D for ; Fri, 18 May 2018 16:26:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CED07D7A7 for ; Fri, 18 May 2018 16:26:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id 144-v6so13773849iti.5 for ; Fri, 18 May 2018 09:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JUB6Y+uP4y0Y0xmKC70IcBGn1ghU8bG0L/5NBcoOSno=; b=iycna/flxR9/5K/vP8VRVXuDpXockYbEmh2vh9k9HtmhoYbTvjWi4Qzh89WbSxQoAW df5dPiC5wp1pJCW8yv4mThK03N7ZoHJ1kBYgMqVx5D3N0DzCWnZfmPdhWryyGsc69/3k RixTngRx06hqdRA+6HOHeKAWtjfoZTL0AjzrXWoGNL02l8d7SIR3cof+UrOO2z3IHX11 swlFAYva6ArYR24HBoWTB9guwYVnuTQfhe+R6rFpCITmSWGfFGYC7FVdlhD4i94PY9qk sEFziX51Mo+d4+dYpTDxLMuCi9j7au2uBq30VmNUcpp2kWWKvecbVBKRvsK6/3vcPn4g 9MAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JUB6Y+uP4y0Y0xmKC70IcBGn1ghU8bG0L/5NBcoOSno=; b=FlAu9EPDknqIdIaKH61NKSywVCHssvU8VeDdgXC8stMgzMO3hbBtOhYhiJIL36uxA6 YqYYjEUaTCnK636DTnm0zHFz/tPddD3X0TfgtVLVFOYXWhgOtgBGnaQ4I38E5NSJpGFg ZKmtRJqypjw5E3AK3FwSVdlhpwxi3rPSNLmQ6Zv7X89o+pv755vOiHtGN8cbzsTivUTM bxnVDKlL/qmYg2dAiYX3ScqPi68TF/q/22U0/4YoGkjrSPnFqsbAK44QUYYOR6dKLeM0 3xxL4dxEEjTIxAa25/V9v3Yr/5plEsIkA90m8cXYRExOKyBEMk7OELMCsaInE6LQvo4u A39g== X-Gm-Message-State: ALKqPweoHFxLtv3afeTgCDbZ3ZdYtWrsyxswiN6PAIeq/0tr2ymoLbcB X54wMAXx3NTkALhvRAYbJC+1jlu0RZaT+a1K25/UVw== X-Google-Smtp-Source: AB8JxZrf0VEOHmW4TtSOWtDaTiFRjwOqwXzGGNbX48ylTZH4mKyAknNNj8QJev1lspu2ihNMhqPqd1eGwBe/x7JVUJ4= X-Received: by 2002:a24:6ec1:: with SMTP id w184-v6mr7472497itc.57.1526660778469; Fri, 18 May 2018 09:26:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Fri, 18 May 2018 09:26:17 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <201805181435.w4IEZSIQ011245@pdx.rh.CN85.dnsmgr.net> References: <20180518141752.GA6250@bali> <201805181435.w4IEZSIQ011245@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 18 May 2018 10:26:17 -0600 X-Google-Sender-Auth: oWcLgSdKgp1UzZKcgUSsBWzrbRg Message-ID: Subject: Re: svn commit: r333673 - in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 To: "Rodney W. Grimes" Cc: Andre Albsmeier , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 16:26:19 -0000 On Fri, May 18, 2018 at 8:35 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Wed, 16-May-2018 at 13:18:38 +0000, Warner Losh wrote: > > > Author: imp > > > Date: Wed May 16 13:18:37 2018 > > > New Revision: 333673 > > > URL: https://svnweb.freebsd.org/changeset/base/333673 > > > > > > Log: > > > MFC r333436: only launch getty if underlying device exists > > > > Can the onifexists thing work under 11? I had problems > > with my ttys until I switched back to "on". I also can't > > find an MFC of r315733 which apparently implemented this > > in HEAD... > > This has been caught during the Beta2 build and corrective > actions are in process. > > The pointy hat belongs to me, as I asked imp to merge this, > thinking that all the other parts had been merged as I did > not get an error when I put onifexists in my 11-beta1 /etc/ttys, > but was getting lots of noise from getty about attempts to > start ttys on v1-v7 without this. > Should I un-merge this or merge the init code? I just checked the VM I tested against, and it was my -current VM, no the -stable one that I thought :( Or do you have it under control? Warner From owner-svn-src-all@freebsd.org Fri May 18 16:31:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD900EADAC6; Fri, 18 May 2018 16:31:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DCF77DB67; Fri, 18 May 2018 16:31:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 085FA1C160; Fri, 18 May 2018 16:31:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f51.google.com with SMTP id w202-v6so14795304lff.12; Fri, 18 May 2018 09:31:44 -0700 (PDT) X-Gm-Message-State: ALKqPwfgsDU9orEAu/VDe4x7wf66d07qiaNAX00k7UwXAuyZYKdL+6K7 bg4gie0RZsKBHaxj7FyVZPpdqWzFg8eimUQjtoI= X-Google-Smtp-Source: AB8JxZp6x3VkZ9ZgVyOX18hKztzC3/3ou0Rz7vERVC8f5HGjAati8ZRaiv4S2+oScWR7AEY3yiA6P35GAOVDTraXLe4= X-Received: by 2002:a19:8f8a:: with SMTP id s10-v6mr22426359lfk.47.1526661103527; Fri, 18 May 2018 09:31:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.49.18 with HTTP; Fri, 18 May 2018 09:31:22 -0700 (PDT) In-Reply-To: References: <20180518141752.GA6250@bali> <201805181435.w4IEZSIQ011245@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Fri, 18 May 2018 11:31:22 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333673 - in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 To: Warner Losh Cc: "Rodney W. Grimes" , Andre Albsmeier , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, Glen Barber Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 16:31:45 -0000 On Fri, May 18, 2018 at 11:26 AM, Warner Losh wrote: > > > On Fri, May 18, 2018 at 8:35 AM, Rodney W. Grimes > wrote: >> >> > On Wed, 16-May-2018 at 13:18:38 +0000, Warner Losh wrote: >> > > Author: imp >> > > Date: Wed May 16 13:18:37 2018 >> > > New Revision: 333673 >> > > URL: https://svnweb.freebsd.org/changeset/base/333673 >> > > >> > > Log: >> > > MFC r333436: only launch getty if underlying device exists >> > >> > Can the onifexists thing work under 11? I had problems >> > with my ttys until I switched back to "on". I also can't >> > find an MFC of r315733 which apparently implemented this >> > in HEAD... >> >> This has been caught during the Beta2 build and corrective >> actions are in process. >> >> The pointy hat belongs to me, as I asked imp to merge this, >> thinking that all the other parts had been merged as I did >> not get an error when I put onifexists in my 11-beta1 /etc/ttys, >> but was getting lots of noise from getty about attempts to >> start ttys on v1-v7 without this. > > > Should I un-merge this or merge the init code? I just checked the VM I > tested against, and it was my -current VM, no the -stable one that I thought > :( Or do you have it under control? > > Warner Pretty sure gjb@ already went ham and fixed this in r333796 . From owner-svn-src-all@freebsd.org Fri May 18 16:37:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34017EADD42; Fri, 18 May 2018 16:37:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A028C7DECE; Fri, 18 May 2018 16:37:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4IGWDPl011718; Fri, 18 May 2018 09:32:13 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4IGWDss011717; Fri, 18 May 2018 09:32:13 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805181632.w4IGWDss011717@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333673 - in stable/11/etc: etc.aarch64 etc.amd64 etc.arm etc.i386 etc.powerpc etc.riscv etc.sparc64 In-Reply-To: To: Warner Losh Date: Fri, 18 May 2018 09:32:13 -0700 (PDT) CC: "Rodney W. Grimes" , Andre Albsmeier , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 16:37:51 -0000 [ Charset UTF-8 unsupported, converting... ] > On Fri, May 18, 2018 at 8:35 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > On Wed, 16-May-2018 at 13:18:38 +0000, Warner Losh wrote: > > > > Author: imp > > > > Date: Wed May 16 13:18:37 2018 > > > > New Revision: 333673 > > > > URL: https://svnweb.freebsd.org/changeset/base/333673 > > > > > > > > Log: > > > > MFC r333436: only launch getty if underlying device exists > > > > > > Can the onifexists thing work under 11? I had problems > > > with my ttys until I switched back to "on". I also can't > > > find an MFC of r315733 which apparently implemented this > > > in HEAD... > > > > This has been caught during the Beta2 build and corrective > > actions are in process. > > > > The pointy hat belongs to me, as I asked imp to merge this, > > thinking that all the other parts had been merged as I did > > not get an error when I put onifexists in my 11-beta1 /etc/ttys, > > but was getting lots of noise from getty about attempts to > > start ttys on v1-v7 without this. > > > > Should I un-merge this or merge the init code? I just checked the VM I > tested against, and it was my -current VM, no the -stable one that I > thought :( Or do you have it under control? No, re(gjb) has merged the additional missing bits of the init changes to stable/11 and is rebuilding 11.2-Beta2. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 18 17:00:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5895EAE2A4; Fri, 18 May 2018 17:00:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 045F47EC1C; Fri, 18 May 2018 17:00:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FDDA1ADB1; Fri, 18 May 2018 17:00:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IGxxTo075598; Fri, 18 May 2018 16:59:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IGxxpF075597; Fri, 18 May 2018 16:59:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805181659.w4IGxxpF075597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 18 May 2018 16:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333799 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 333799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:00:02 -0000 Author: markj Date: Fri May 18 16:59:58 2018 New Revision: 333799 URL: https://svnweb.freebsd.org/changeset/base/333799 Log: Don't increment addl_page_shortage for wired pages. Such pages are dequeued as they're encountered during the inactive queue scan, so by the time we get to the active queue scan, they should have already been subtracted from the inactive queue length. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D15479 Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Fri May 18 16:19:45 2018 (r333798) +++ head/sys/vm/vm_pageout.c Fri May 18 16:59:58 2018 (r333799) @@ -1201,7 +1201,7 @@ vm_pageout_scan(struct vm_domain *vmd, int pass, int s } /* - * The addl_page_shortage is the number of temporarily + * The addl_page_shortage is an estimate of the number of temporarily * stuck pages in the inactive queue. In other words, the * number of pages from the inactive count that should be * discounted in setting the target for the active queue scan. @@ -1275,7 +1275,6 @@ recheck: goto reinsert; } if (m->wire_count != 0) { - addl_page_shortage++; vm_page_dequeue_deferred(m); continue; } From owner-svn-src-all@freebsd.org Fri May 18 17:08:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4738CEAE94A; Fri, 18 May 2018 17:08:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8DAE7F49E; Fri, 18 May 2018 17:07:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAD041AF5E; Fri, 18 May 2018 17:07:59 +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 w4IH7x03081414; Fri, 18 May 2018 17:07:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IH7xeu081413; Fri, 18 May 2018 17:07:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805181707.w4IH7xeu081413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 May 2018 17:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333800 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 333800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:08:00 -0000 Author: emaste Date: Fri May 18 17:07:59 2018 New Revision: 333800 URL: https://svnweb.freebsd.org/changeset/base/333800 Log: muge(4): style and comment cleanup And tag some spots to revisit with XXX. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Fri May 18 16:59:58 2018 (r333799) +++ head/sys/dev/usb/net/if_muge.c Fri May 18 17:07:59 2018 (r333800) @@ -152,19 +152,17 @@ do { \ enum { MUGE_BULK_DT_RD, MUGE_BULK_DT_WR, - /* - * the device does support interrupt endpoints, - * but they're not needed as we poll on MII status. - * MUGE_INTR_DT_WR, - * MUGE_INTR_DT_RD, - */ +#if 0 /* Ignore interrupt endpoints for now as we poll on MII status. */ + MUGE_INTR_DT_WR, + MUGE_INTR_DT_RD, +#endif MUGE_N_TRANSFER, }; struct muge_softc { struct usb_ether sc_ue; struct mtx sc_mtx; - struct usb_xfer *sc_xfer[MUGE_N_TRANSFER]; + struct usb_xfer *sc_xfer[MUGE_N_TRANSFER]; int sc_phyno; /* Settings for the mac control (MAC_CSR) register. */ @@ -184,7 +182,6 @@ struct muge_softc { #define MUGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define MUGE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) - static device_probe_t muge_probe; static device_attach_t muge_attach; static device_detach_t muge_detach; @@ -460,7 +457,7 @@ lan78xx_eeprom_read(struct muge_softc *sc, uint16_t of ret = -EINVAL; muge_dbg_printf(sc, "EEPROM not present\n"); } - return ret; + return (ret); } /** @@ -492,9 +489,9 @@ lan78xx_otp_read_raw(struct muge_softc *sc, uint16_t o err = lan78xx_read_reg(sc, OTP_PWR_DN, &val); - /* checking if bit is set */ + /* Checking if bit is set. */ if (val & OTP_PWR_DN_PWRDN_N) { - /* clearing it, then waiting for it to be cleared */ + /* Clear it, then wait for it to be cleared. */ lan78xx_write_reg(sc, OTP_PWR_DN, 0); err = lan78xx_wait_for_bits(sc, OTP_PWR_DN, OTP_PWR_DN_PWRDN_N); if (err != 0) { @@ -502,7 +499,7 @@ lan78xx_otp_read_raw(struct muge_softc *sc, uint16_t o goto done; } } - /* start reading the bytes, one at a time */ + /* Start reading the bytes, one at a time. */ for (i = 0; i < buflen; i++) { err = lan78xx_write_reg(sc, OTP_ADDR1, ((off + i) >> 8) & OTP_ADDR1_15_11); @@ -555,14 +552,14 @@ lan78xx_otp_read(struct muge_softc *sc, uint16_t off, if (err == 0) { if (sig == OTP_INDICATOR_1) { } else if (sig == OTP_INDICATOR_2) { - off += 0x100; + off += 0x100; /* XXX */ } else { err = -EINVAL; } - if(!err) + if (!err) err = lan78xx_otp_read_raw(sc, off, buf, buflen); } - return err; + return (err); } /** @@ -617,8 +614,7 @@ lan78xx_set_rx_max_frame_length(struct muge_softc *sc, uint32_t buf; bool rxenabled; - /* first we have to disable rx before changing the length */ - + /* First we have to disable rx before changing the length. */ err = lan78xx_read_reg(sc, ETH_MAC_RX, &buf); rxenabled = ((buf & ETH_MAC_RX_EN_) != 0); @@ -627,8 +623,7 @@ lan78xx_set_rx_max_frame_length(struct muge_softc *sc, err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); } - /* setting max frame length */ - + /* Setting max frame length. */ buf &= ~ETH_MAC_RX_MAX_FR_SIZE_MASK_; buf |= (((size + 4) << ETH_MAC_RX_MAX_FR_SIZE_SHIFT_) & ETH_MAC_RX_MAX_FR_SIZE_MASK_); @@ -641,7 +636,7 @@ lan78xx_set_rx_max_frame_length(struct muge_softc *sc, err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); } - return 0; + return (0); } /** @@ -733,7 +728,8 @@ lan78xx_miibus_writereg(device_t dev, int phy, int reg val = htole32(val); lan78xx_write_reg(sc, ETH_MII_DATA, val); - addr = (phy << 11) | (reg << 6) | ETH_MII_ACC_MII_WRITE_ | ETH_MII_ACC_MII_BUSY_; + addr = (phy << 11) | (reg << 6) | + ETH_MII_ACC_MII_WRITE_ | ETH_MII_ACC_MII_BUSY_; lan78xx_write_reg(sc, ETH_MII_ACC, addr); if (lan78xx_wait_for_bits(sc, ETH_MII_ACC, ETH_MII_ACC_MII_BUSY_) != 0) @@ -808,11 +804,11 @@ lan78xx_miibus_statchg(device_t dev) goto done; } - /* Enable/disable full duplex operation and TX/RX pause */ + /* Enable/disable full duplex operation and TX/RX pause. */ if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { muge_dbg_printf(sc, "full duplex operation\n"); - /* enable transmit MAC flow control function */ + /* Enable transmit MAC flow control function. */ if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) flow |= ETH_FLOW_CR_TX_FCEN_ | 0xFFFF; @@ -820,12 +816,13 @@ lan78xx_miibus_statchg(device_t dev) flow |= ETH_FLOW_CR_RX_FCEN_; } + /* XXX Flow control settings obtained from Microchip's driver. */ switch(usbd_get_speed(sc->sc_ue.ue_udev)) { case USB_SPEED_SUPER: - fct_flow = 0x817; /* XXX */ + fct_flow = 0x817; break; case USB_SPEED_HIGH: - fct_flow = 0x211; /* XXX */ + fct_flow = 0x211; break; default: break; @@ -899,7 +896,7 @@ lan78xx_phy_init(struct muge_softc *sc) MUGE_LOCK_ASSERT(sc, MA_OWNED); - /* Reset phy and wait for reset to complete */ + /* Reset phy and wait for reset to complete. */ lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR, BMCR_RESET); @@ -930,7 +927,7 @@ lan78xx_phy_init(struct muge_softc *sc) ANAR_10 | ANAR_10_FD | ANAR_TX | ANAR_TX_FD | ANAR_CSMA | ANAR_FC | ANAR_PAUSE_ASYM); - /* Restart auto-negotation */ + /* Restart auto-negotation. */ bmcr |= BMCR_STARTNEG; bmcr |= BMCR_AUTOEN; lan78xx_miibus_writereg(sc->sc_ue.ue_dev, sc->sc_phyno, MII_BMCR, bmcr); @@ -960,7 +957,7 @@ lan78xx_chip_init(struct muge_softc *sc) if (!locked) MUGE_LOCK(sc); - /* Enter H/W config mode */ + /* Enter H/W config mode. */ lan78xx_write_reg(sc, ETH_HW_CFG, ETH_HW_CFG_LRST_); if ((err = lan78xx_wait_for_bits(sc, ETH_HW_CFG, ETH_HW_CFG_LRST_)) != @@ -970,13 +967,13 @@ lan78xx_chip_init(struct muge_softc *sc) goto init_failed; } - /* Set the mac address */ + /* Set the mac address. */ if ((err = lan78xx_setmacaddress(sc, sc->sc_ue.ue_eaddr)) != 0) { muge_warn_printf(sc, "failed to set the MAC address\n"); goto init_failed; } - /* Read and display the revision register */ + /* Read and display the revision register. */ if ((err = lan78xx_read_reg(sc, ETH_ID_REV, &sc->sc_rev_id)) < 0) { muge_warn_printf(sc, "failed to read ETH_ID_REV (err = %d)\n", err); @@ -996,7 +993,7 @@ lan78xx_chip_init(struct muge_softc *sc) lan78xx_write_reg(sc, ETH_USB_CFG0, buf); /* - * LTM support will go here. + * XXX LTM support will go here. */ /* Configuring the burst cap. */ @@ -1013,10 +1010,10 @@ lan78xx_chip_init(struct muge_softc *sc) lan78xx_write_reg(sc, ETH_BURST_CAP, burst_cap); - /* Set the default bulk in delay (same value from Linux driver) */ + /* Set the default bulk in delay (same value from Linux driver). */ lan78xx_write_reg(sc, ETH_BULK_IN_DLY, MUGE_DEFAULT_BULK_IN_DELAY); - /* Multiple ethernet frames per USB packets */ + /* Multiple ethernet frames per USB packets. */ err = lan78xx_read_reg(sc, ETH_HW_CFG, &buf); buf |= ETH_HW_CFG_MEF_; err = lan78xx_write_reg(sc, ETH_HW_CFG, buf); @@ -1036,7 +1033,6 @@ lan78xx_chip_init(struct muge_softc *sc) * anyways, as that's what the Linux driver does. * */ - buf = (MUGE_MAX_RX_FIFO_SIZE - 512) / 512; err = lan78xx_write_reg(sc, ETH_FCT_RX_FIFO_END, buf); @@ -1098,40 +1094,32 @@ lan78xx_chip_init(struct muge_softc *sc) buf |= ETH_MAC_TX_TXEN_; err = lan78xx_write_reg(sc, ETH_MAC_TX, buf); - /* - * FIFO is capable of transmitting frames to MAC. - */ + /* FIFO is capable of transmitting frames to MAC. */ err = lan78xx_read_reg(sc, ETH_FCT_TX_CTL, &buf); buf |= ETH_FCT_TX_CTL_EN_; err = lan78xx_write_reg(sc, ETH_FCT_TX_CTL, buf); /* * Set max frame length. In linux this is dev->mtu (which by default - * is 1500) + VLAN_ETH_HLEN = 1518 + * is 1500) + VLAN_ETH_HLEN = 1518. */ err = lan78xx_set_rx_max_frame_length(sc, ETHER_MAX_LEN); - /* - * Initialise the PHY - */ + /* Initialise the PHY. */ if ((err = lan78xx_phy_init(sc)) != 0) goto init_failed; - /* - * enable MAC RX - */ + /* Enable MAC RX. */ err = lan78xx_read_reg(sc, ETH_MAC_RX, &buf); buf |= ETH_MAC_RX_EN_; err = lan78xx_write_reg(sc, ETH_MAC_RX, buf); - /* - * enable FIFO controller RX - */ + /* Enable FIFO controller RX. */ err = lan78xx_read_reg(sc, ETH_FCT_RX_CTL, &buf); buf |= ETH_FCT_TX_CTL_EN_; err = lan78xx_write_reg(sc, ETH_FCT_RX_CTL, buf); - return 0; + return (0); init_failed: if (!locked) @@ -1224,7 +1212,7 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err (pktlen > (actlen - off))) goto tr_setup; - /* Create a new mbuf to store the packet in */ + /* Create a new mbuf to store the packet. */ m = uether_newbuf(); if (m == NULL) { muge_warn_printf(sc, @@ -1335,7 +1323,6 @@ tr_setup: * sends them out. * */ - static void muge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -1467,9 +1454,9 @@ muge_attach_post(struct usb_ether *ue) uint32_t val; lan78xx_read_reg(sc, 0, &val); - /* Check if there is already a MAC address in the register */ + /* Read current MAC address from RX_ADDRx registers. */ if ((lan78xx_read_reg(sc, ETH_RX_ADDRL, &mac_l) == 0) && - (lan78xx_read_reg(sc, ETH_RX_ADDRH, &mac_h) == 0)) { + (lan78xx_read_reg(sc, ETH_RX_ADDRH, &mac_h) == 0)) { sc->sc_ue.ue_eaddr[5] = (uint8_t)((mac_h >> 8) & 0xff); sc->sc_ue.ue_eaddr[4] = (uint8_t)((mac_h) & 0xff); sc->sc_ue.ue_eaddr[3] = (uint8_t)((mac_l >> 24) & 0xff); @@ -1478,16 +1465,13 @@ muge_attach_post(struct usb_ether *ue) sc->sc_ue.ue_eaddr[0] = (uint8_t)((mac_l) & 0xff); } - /* - * MAC address is not set so try to read from EEPROM, if that fails - * generate a random MAC address. - */ + /* If RX_ADDRx did not provide a valid MAC address, try EEPROM. */ if (!ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { if ((lan78xx_eeprom_read(sc, ETH_E2P_MAC_OFFSET, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0) || (lan78xx_otp_read(sc, OTP_MAC_OFFSET, sc->sc_ue.ue_eaddr, ETHER_ADDR_LEN) == 0)) { - if(ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { + if (ETHER_IS_VALID(sc->sc_ue.ue_eaddr)) { muge_dbg_printf(sc, "MAC read from EEPROM\n"); } else { muge_dbg_printf(sc, "MAC assigned randomly\n"); @@ -1573,7 +1557,7 @@ muge_attach_post_sub(struct usb_ether *ue) BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); mtx_unlock(&Giant); - return 0; + return (0); } /** @@ -1626,7 +1610,7 @@ muge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data mask = ifr->ifr_reqcap ^ ifp->if_capenable; - /* Modify the RX CSUM enable bits */ + /* Modify the RX CSUM enable bits. */ if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { ifp->if_capenable ^= IFCAP_RXCSUM; @@ -1743,7 +1727,7 @@ lan78xx_dataport_write(struct muge_softc *sc, uint32_t } done: - return ret; + return (ret); } /** @@ -1811,11 +1795,11 @@ muge_setmulti(struct usb_ether *ue) sc->sc_rfe_ctl &= ~(ETH_RFE_CTL_UCAST_EN_ | ETH_RFE_CTL_MCAST_EN_ | ETH_RFE_CTL_DA_PERFECT_ | ETH_RFE_CTL_MCAST_HASH_); - /* Initializing hash filter table */ + /* Initialize hash filter table. */ for (i = 0; i < ETH_DP_SEL_VHF_HASH_LEN; i++) sc->sc_mchash_table[i] = 0; - /* Initializing perfect filter table */ + /* Initialize perfect filter table. */ for (i = 1; i < MUGE_NUM_PFILTER_ADDRS_; i++) { sc->sc_pfilter_table[i][0] = sc->sc_pfilter_table[i][1] = 0; @@ -1830,18 +1814,12 @@ muge_setmulti(struct usb_ether *ue) muge_dbg_printf(sc, "receive all multicast enabled\n"); sc->sc_rfe_ctl |= ETH_RFE_CTL_MCAST_EN_; } else { - /* - * Take the lock of the mac address list before hashing each of - * them. - */ + /* Lock the mac address list before hashing each of them. */ if_maddr_rlock(ifp); if (!TAILQ_EMPTY(&ifp->if_multiaddrs)) { i = 1; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - /* - * First we fill up the perfect address table. - */ + /* First fill up the perfect address table. */ addr = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); if (i < 33 /* XXX */) { @@ -1985,7 +1963,7 @@ muge_init(struct usb_ether *ue) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; - /* Cancel pending I/O */ + /* Cancel pending I/O. */ muge_stop(ue); /* Reset the ethernet interface. */ @@ -2010,9 +1988,6 @@ muge_init(struct usb_ether *ue) /** * muge_stop - Stops communication with the LAN78xx chip * @ue: USB ether interface - * - * - * */ static void muge_stop(struct usb_ether *ue) @@ -2026,7 +2001,7 @@ muge_stop(struct usb_ether *ue) sc->sc_flags &= ~MUGE_FLAG_LINK; /* - * stop all the transfers, if not already stopped: + * Stop all the transfers, if not already stopped. */ usbd_transfer_stop(sc->sc_xfer[MUGE_BULK_DT_WR]); usbd_transfer_stop(sc->sc_xfer[MUGE_BULK_DT_RD]); @@ -2063,8 +2038,7 @@ muge_tick(struct usb_ether *ue) * @ifp: inet interface pointer * @ifmr: interface media request * - * Basically boilerplate code that simply calls the mii functions to get the - * media status. + * Call the mii functions to get the media status. * * LOCKING: * Internally takes and releases the device lock. @@ -2129,7 +2103,7 @@ muge_attach(device_t dev) mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); - /* Setup the endpoints for the Microchip LAN78xx device(s) */ + /* Setup the endpoints for the Microchip LAN78xx device. */ iface_index = MUGE_IFACE_IDX; err = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, muge_config, MUGE_N_TRANSFER, sc, &sc->sc_mtx); From owner-svn-src-all@freebsd.org Fri May 18 17:23:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A71EAF17D; Fri, 18 May 2018 17:23:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2684880117; Fri, 18 May 2018 17:23:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07BD11B286; Fri, 18 May 2018 17:23:24 +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 w4IHNNda091950; Fri, 18 May 2018 17:23:23 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHNN6Y091949; Fri, 18 May 2018 17:23:23 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201805181723.w4IHNN6Y091949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 18 May 2018 17:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333801 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Commit-Revision: 333801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:23:24 -0000 Author: sbruno Date: Fri May 18 17:23:23 2018 New Revision: 333801 URL: https://svnweb.freebsd.org/changeset/base/333801 Log: Quiesce a couple pages of clang warnings with a cast. Duplicates linux maintainer commit: https://github.com/torvalds/linux/commit/627871b71c89a6ec12fbed75063f238e0c7127b2#diff-8c6ddb4c3ad69a6fb9f289475821db56 ar9300template_aphrodite.h:575:40: warning: implicit conversion from 'int' to 'u_int8_t' (aka 'unsigned char') changes value from 3495 to 167 [-Wconstant-conversion] /* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)} ^~~~~~~~~~~~~~~~~~ ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN' (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5)) Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D15476 Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Fri May 18 17:07:59 2018 (r333800) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Fri May 18 17:23:23 2018 (r333801) @@ -139,7 +139,7 @@ enum Ar9300EepromTemplate #define OSPREY_CUSTOMER_DATA_SIZE 20 #define FREQ2FBIN(x,y) \ - (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5)) + (u_int8_t)(((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5)) #define FBIN2FREQ(x,y) \ (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x)) #define OSPREY_MAX_CHAINS 3 From owner-svn-src-all@freebsd.org Fri May 18 17:29:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE5BEAF420 for ; Fri, 18 May 2018 17:29:12 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB498056E for ; Fri, 18 May 2018 17:29:11 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: f56ecea7-5ac0-11e8-9855-9df12b06b3a9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id f56ecea7-5ac0-11e8-9855-9df12b06b3a9; Fri, 18 May 2018 17:29:04 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w4IHT3lh087166; Fri, 18 May 2018 11:29:03 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1526664543.32688.57.camel@freebsd.org> Subject: Re: svn commit: r333801 - head/sys/contrib/dev/ath/ath_hal/ar9300 From: Ian Lepore To: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 18 May 2018 11:29:03 -0600 In-Reply-To: <201805181723.w4IHNN6Y091949@repo.freebsd.org> References: <201805181723.w4IHNN6Y091949@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:29:12 -0000 On Fri, 2018-05-18 at 17:23 +0000, Sean Bruno wrote: > Author: sbruno > Date: Fri May 18 17:23:23 2018 > New Revision: 333801 > URL: https://svnweb.freebsd.org/changeset/base/333801 > > Log: >   Quiesce a couple pages of clang warnings with a cast.  Duplicates >   linux maintainer commit: >    >   https://github.com/torvalds/linux/commit/627871b71c89a6ec12fbed75063f238e0c7127b2#diff-8c6ddb4c3ad69a6fb9f289475821db56 >    >   ar9300template_aphrodite.h:575:40: warning: implicit conversion from 'int' >     to 'u_int8_t' (aka 'unsigned char') changes value from 3495 to 167 >     [-Wconstant-conversion] >               /* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)} >                                                 ^~~~~~~~~~~~~~~~~~ >   ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN' >       (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5)) >    >   Reviewed by: imp >   MFC after: 1 week >   Differential Revision: https://reviews.freebsd.org/D15476 > > Modified: >   head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h > > Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h > ============================================================================== > --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Fri May 18 17:07:59 2018 (r333800) > +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Fri May 18 17:23:23 2018 (r333801) > @@ -139,7 +139,7 @@ enum Ar9300EepromTemplate >  #define OSPREY_CUSTOMER_DATA_SIZE    20 >   >  #define FREQ2FBIN(x,y) \ > -    (((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5)) > +    (u_int8_t)(((y) == HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / 5)) >  #define FBIN2FREQ(x,y) \ >      (((y) == HAL_FREQ_BAND_2GHZ) ? (2300 + x) : (4800 + 5 * x)) >  #define OSPREY_MAX_CHAINS            3 > How can this change possibly be correct? All the values involved are compile-time constants, the compiler did the math and tells you the result is 3495. Cast or not, that value is never going to fit into a uint8_t. Sure this supresses the warning, but what about actually fixing the overflow? -- Ian From owner-svn-src-all@freebsd.org Fri May 18 17:29:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E0BEAF47E; Fri, 18 May 2018 17:29:46 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE9618069A; Fri, 18 May 2018 17:29:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 733EA1B28B; Fri, 18 May 2018 17:29:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IHTj3Y092354; Fri, 18 May 2018 17:29:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHTh0A092344; Fri, 18 May 2018 17:29:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805181729.w4IHTh0A092344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 17:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333802 - in head: share/man/man9 sys/dev/hwpmc sys/kern sys/net sys/sys sys/tests/epoch X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: share/man/man9 sys/dev/hwpmc sys/kern sys/net sys/sys sys/tests/epoch X-SVN-Commit-Revision: 333802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:29:46 -0000 Author: mmacy Date: Fri May 18 17:29:43 2018 New Revision: 333802 URL: https://svnweb.freebsd.org/changeset/base/333802 Log: epoch(9): Make epochs non-preemptible by default There are risks associated with waiting on a preemptible epoch section. Change the name to make them not be the default and document the issue under CAVEATS. Reported by: markj Modified: head/share/man/man9/epoch.9 head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/subr_epoch.c head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/sys/epoch.h head/sys/sys/pmckern.h head/sys/tests/epoch/epoch_test.c Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Fri May 18 17:23:23 2018 (r333801) +++ head/share/man/man9/epoch.9 Fri May 18 17:29:43 2018 (r333802) @@ -49,15 +49,15 @@ .Ft void .Fn epoch_enter "epoch_t epoch" .Ft void -.Fn epoch_enter_critical "epoch_t epoch" +.Fn epoch_enter_preempt "epoch_t epoch" .Ft void .Fn epoch_exit "epoch_t epoch" .Ft void -.Fn epoch_exit_critical "epoch_t epoch" +.Fn epoch_exit_preempt "epoch_t epoch" .Ft void .Fn epoch_wait "epoch_t epoch" .Ft void -.Fn epoch_wait_critical "epoch_t epoch" +.Fn epoch_wait_preempt "epoch_t epoch" .Ft void .Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)" .Ft int @@ -73,20 +73,22 @@ Epochs are allocated with and freed with .Fn epoch_free . The flags passed to epoch_alloc determine whether preemption is -allowed during a section (the default) or not, as specified by -EPOCH_CRITICAL. +allowed during a section or not (the dafult), as specified by +EPOCH_PREEMPT. Threads indicate the start of an epoch critical section by calling .Fn epoch_enter . The end of a critical section is indicated by calling .Fn epoch_exit . -The _critical variants can be used around code in which it is safe -to have preemption disable. +The _preempt variants can be used around code which requires preemption. A thread can wait until a grace period has elapsed since any threads have entered the epoch by calling -.Fn epoch_wait . -The use of a EPOCH_CRITICAL epoch type allows one to use -.Fn epoch_wait_critical +.Fn epoch_wait +or +.Fn epoch_wait_preempt , +depending on the epoch_type. +The use of a default epoch type allows one to use +.Fn epoch_wait which is guaranteed to have much shorter completion times since we know that none of the threads in an epoch section will be preempted before completing its section. @@ -95,14 +97,14 @@ path it can ensure that a grace period has elapsed by .Fn epoch_call with a callback with any work that needs to wait for an epoch to elapse. Only non-sleepable locks can be acquired during a section protected by -.Fn epoch_enter +.Fn epoch_enter_preempt and -.Fn epoch_exit . +.Fn epoch_exit_preempt . INVARIANTS can assert that a thread is in an epoch by using .Fn in_epoch . .Pp -The epoch API currently does not support sleeping in epoch sections. -A caller cannot do epoch_enter recursively on different epochs. A +The epoch API currently does not support sleeping in epoch_preempt sections. +A caller cannot do epoch_enter recursively on different preemptible epochs. A caller should never call .Fn epoch_wait in the middle of an epoch section as this will lead to a deadlock. @@ -113,10 +115,16 @@ When modifying a list referenced from an epoch section routines must be used and the caller can no longer modify a list entry in place. An item to be modified must be handled with copy on write and frees must be deferred until after a grace period has elapsed. - .Sh RETURN VALUES .Fn in_epoch will return 1 if curthread is in an epoch, 0 otherwise. +.Sh CAVEATS +One must be cautious when using +.Fn epoch_wait_preempt +threads are pinned during epoch sections so if a thread in a section is then +preempted by a higher priority compute bound thread on that CPU it can be +prevented from leaving the section. Thus the wait time for the waiter is +potentially unbounded. .Sh EXAMPLES Async free example: Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Fri May 18 17:23:23 2018 (r333801) +++ head/sys/dev/hwpmc/hwpmc_mod.c Fri May 18 17:29:43 2018 (r333802) @@ -1717,12 +1717,12 @@ pmc_process_mmap(struct thread *td, struct pmckern_map const struct pmc_process *pp; freepath = fullpath = NULL; - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); pmc_getfilename((struct vnode *) pkm->pm_file, &fullpath, &freepath); pid = td->td_proc->p_pid; - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); /* Inform owners of all system-wide sampling PMCs. */ CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) @@ -1761,12 +1761,12 @@ pmc_process_munmap(struct thread *td, struct pmckern_m pid = td->td_proc->p_pid; - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_out(po, pid, pkm->pm_address, pkm->pm_address + pkm->pm_size); - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); if ((pp = pmc_find_process_descriptor(td->td_proc, 0)) == NULL) return; @@ -2065,13 +2065,13 @@ pmc_hook_handler(struct thread *td, int function, void pk = (struct pmckern_procexec *) arg; - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); /* Inform owners of SS mode PMCs of the exec event. */ CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_procexec(po, PMC_ID_INVALID, p->p_pid, pk->pm_entryaddr, fullpath); - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); PROC_LOCK(p); is_using_hwpmcs = p->p_flag & P_HWPMC; @@ -2749,7 +2749,7 @@ pmc_release_pmc_descriptor(struct pmc *pm) if (po->po_sscount == 0) { atomic_subtract_rel_int(&pmc_ss_count, 1); CK_LIST_REMOVE(po, po_ssnext); - epoch_wait(global_epoch); + epoch_wait_preempt(global_epoch_preempt); } } @@ -3243,7 +3243,7 @@ pmc_stop(struct pmc *pm) if (po->po_sscount == 0) { atomic_subtract_rel_int(&pmc_ss_count, 1); CK_LIST_REMOVE(po, po_ssnext); - epoch_wait(global_epoch); + epoch_wait_preempt(global_epoch_preempt); PMCDBG1(PMC,OPS,2,"po=%p removed from global list", po); } } @@ -4873,11 +4873,11 @@ pmc_process_exit(void *arg __unused, struct proc *p) /* * Log a sysexit event to all SS PMC owners. */ - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_sysexit(po, p->p_pid); - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); if (!is_using_hwpmcs) return; @@ -5058,11 +5058,11 @@ pmc_process_fork(void *arg __unused, struct proc *p1, * If there are system-wide sampling PMCs active, we need to * log all fork events to their owner's logs. */ - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_procfork(po, p1->p_pid, newproc->p_pid); - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); if (!is_using_hwpmcs) return; @@ -5131,12 +5131,12 @@ pmc_kld_load(void *arg __unused, linker_file_t lf) /* * Notify owners of system sampling PMCs about KLD operations. */ - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_in(po, (pid_t) -1, (uintfptr_t) lf->address, lf->filename); - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); /* * TODO: Notify owners of (all) process-sampling PMCs too. @@ -5149,12 +5149,12 @@ pmc_kld_unload(void *arg __unused, const char *filenam { struct pmc_owner *po; - epoch_enter(global_epoch); + epoch_enter_preempt(global_epoch_preempt); CK_LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) if (po->po_flags & PMC_PO_OWNS_LOGFILE) pmclog_process_map_out(po, (pid_t) -1, (uintfptr_t) address, (uintfptr_t) address + size); - epoch_exit(global_epoch); + epoch_exit_preempt(global_epoch_preempt); /* * TODO: Notify owners of process-sampling PMCs. Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri May 18 17:23:23 2018 (r333801) +++ head/sys/kern/subr_epoch.c Fri May 18 17:29:43 2018 (r333802) @@ -124,7 +124,7 @@ static __read_mostly int domoffsets[MAXMEMDOM]; static __read_mostly int inited; static __read_mostly int epoch_count; __read_mostly epoch_t global_epoch; -__read_mostly epoch_t global_epoch_critical; +__read_mostly epoch_t global_epoch_preempt; static void epoch_call_task(void *context __unused); @@ -169,7 +169,7 @@ epoch_init(void *arg __unused) } inited = 1; global_epoch = epoch_alloc(0); - global_epoch_critical = epoch_alloc(EPOCH_CRITICAL); + global_epoch_preempt = epoch_alloc(EPOCH_PREEMPT); } SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); @@ -247,7 +247,7 @@ epoch_free(epoch_t epoch) } #endif allepochs[epoch->e_idx] = NULL; - epoch_wait_critical(global_epoch_critical); + epoch_wait(global_epoch); if (usedomains) for (domain = 0; domain < vm_ndomains; domain++) free_domain(epoch->e_pcpu_dom[domain], M_EPOCH); @@ -263,10 +263,11 @@ epoch_free(epoch_t epoch) } while (0) void -epoch_enter_internal(epoch_t epoch, struct thread *td) +epoch_enter_preempt_internal(epoch_t epoch, struct thread *td) { struct epoch_pcpu_state *eps; + MPASS(epoch->e_flags & EPOCH_PREEMPT); INIT_CHECK(epoch); critical_enter(); td->td_pre_epoch_prio = td->td_priority; @@ -293,7 +294,7 @@ epoch_enter_internal(epoch_t epoch, struct thread *td) void -epoch_enter_critical(epoch_t epoch) +epoch_enter(epoch_t epoch) { ck_epoch_record_t *record; ck_epoch_section_t *section; @@ -310,7 +311,7 @@ epoch_enter_critical(epoch_t epoch) } void -epoch_exit_internal(epoch_t epoch, struct thread *td) +epoch_exit_preempt_internal(epoch_t epoch, struct thread *td) { struct epoch_pcpu_state *eps; @@ -319,6 +320,7 @@ epoch_exit_internal(epoch_t epoch, struct thread *td) critical_enter(); eps = epoch->e_pcpu[curcpu]; + MPASS(epoch->e_flags & EPOCH_PREEMPT); ck_epoch_end(&eps->eps_record.er_record, (ck_epoch_section_t*)&td->td_epoch_section); TAILQ_REMOVE(&eps->eps_record.er_tdlist, td, td_epochq); eps->eps_record.er_gen++; @@ -332,7 +334,7 @@ epoch_exit_internal(epoch_t epoch, struct thread *td) } void -epoch_exit_critical(epoch_t epoch) +epoch_exit(epoch_t epoch) { ck_epoch_record_t *record; ck_epoch_section_t *section; @@ -349,11 +351,11 @@ epoch_exit_critical(epoch_t epoch) } /* - * epoch_block_handler is a callback from the ck code when another thread is + * epoch_block_handler_preempt is a callback from the ck code when another thread is * currently in an epoch section. */ static void -epoch_block_handler(struct ck_epoch *global __unused, ck_epoch_record_t *cr, +epoch_block_handler_preempt(struct ck_epoch *global __unused, ck_epoch_record_t *cr, void *arg __unused) { epoch_record_t record; @@ -481,7 +483,7 @@ epoch_block_handler(struct ck_epoch *global __unused, } void -epoch_wait(epoch_t epoch) +epoch_wait_preempt(epoch_t epoch) { struct thread *td; int was_bound; @@ -495,6 +497,7 @@ epoch_wait(epoch_t epoch) #endif INIT_CHECK(epoch); + MPASS(epoch->e_flags & EPOCH_PREEMPT); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "epoch_wait() can sleep"); @@ -512,7 +515,7 @@ epoch_wait(epoch_t epoch) td->td_pinned = 0; sched_bind(td, old_cpu); - ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler, NULL); + ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_preempt, NULL); /* restore CPU binding, if any */ if (was_bound != 0) { @@ -535,19 +538,19 @@ epoch_wait(epoch_t epoch) } static void -epoch_block_handler_critical(struct ck_epoch *g __unused, ck_epoch_record_t *c __unused, +epoch_block_handler(struct ck_epoch *g __unused, ck_epoch_record_t *c __unused, void *arg __unused) { cpu_spinwait(); } void -epoch_wait_critical(epoch_t epoch) +epoch_wait(epoch_t epoch) { - MPASS(epoch->e_flags & EPOCH_CRITICAL); + MPASS(epoch->e_flags == 0); critical_enter(); - ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_critical, NULL); + ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler, NULL); critical_exit(); } @@ -585,7 +588,7 @@ epoch_call_task(void *arg __unused) ck_stack_init(&cb_stack); critical_enter(); - epoch_enter_critical(global_epoch_critical); + epoch_enter(global_epoch); for (total = i = 0; i < epoch_count; i++) { if (__predict_false((epoch = allepochs[i]) == NULL)) continue; @@ -595,7 +598,7 @@ epoch_call_task(void *arg __unused) ck_epoch_poll_deferred(record, &cb_stack); total += npending - record->n_pending; } - epoch_exit_critical(global_epoch_critical); + epoch_exit(global_epoch); *DPCPU_PTR(epoch_cb_count) -= total; critical_exit(); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri May 18 17:23:23 2018 (r333801) +++ head/sys/net/if.c Fri May 18 17:29:43 2018 (r333802) @@ -104,6 +104,7 @@ _Static_assert(sizeof(((struct ifreq *)0)->ifr_name) == offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru"); +epoch_t net_epoch_preempt; epoch_t net_epoch; #ifdef COMPAT_FREEBSD32 #include @@ -903,6 +904,7 @@ if_attachdomain(void *dummy) { struct ifnet *ifp; + net_epoch_preempt = epoch_alloc(EPOCH_PREEMPT); net_epoch = epoch_alloc(0); TAILQ_FOREACH(ifp, &V_ifnet, if_link) if_attachdomain1(ifp); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri May 18 17:23:23 2018 (r333801) +++ head/sys/net/if_lagg.c Fri May 18 17:29:43 2018 (r333802) @@ -73,8 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include -#define LAGG_RLOCK() epoch_enter(net_epoch) -#define LAGG_RUNLOCK() epoch_exit(net_epoch) +#define LAGG_RLOCK() epoch_enter_preempt(net_epoch_preempt) +#define LAGG_RUNLOCK() epoch_exit_preempt(net_epoch_preempt) #define LAGG_RLOCK_ASSERT() MPASS(in_epoch()) #define LAGG_UNLOCK_ASSERT() MPASS(!in_epoch()) @@ -859,7 +859,7 @@ lagg_port_destroy(struct lagg_port *lp, int rundelport * free port and release it's ifnet reference after a grace period has * elapsed. */ - epoch_call(net_epoch, &lp->lp_epoch_ctx, lagg_port_destroy_cb); + epoch_call(net_epoch_preempt, &lp->lp_epoch_ctx, lagg_port_destroy_cb); /* Update lagg capabilities */ lagg_capabilities(sc); lagg_linkstate(sc); Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Fri May 18 17:23:23 2018 (r333801) +++ head/sys/net/if_var.h Fri May 18 17:29:43 2018 (r333802) @@ -106,6 +106,7 @@ VNET_DECLARE(struct hhook_head *, ipsec_hhh_in[HHOOK_I VNET_DECLARE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]); #define V_ipsec_hhh_in VNET(ipsec_hhh_in) #define V_ipsec_hhh_out VNET(ipsec_hhh_out) +extern epoch_t net_epoch_preempt; extern epoch_t net_epoch; #endif /* _KERNEL */ Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Fri May 18 17:23:23 2018 (r333801) +++ head/sys/sys/epoch.h Fri May 18 17:29:43 2018 (r333802) @@ -35,10 +35,10 @@ struct epoch; typedef struct epoch *epoch_t; -#define EPOCH_CRITICAL 0x1 +#define EPOCH_PREEMPT 0x1 extern epoch_t global_epoch; -extern epoch_t global_epoch_critical; +extern epoch_t global_epoch_preempt; DPCPU_DECLARE(int, epoch_cb_count); DPCPU_DECLARE(struct grouptask, epoch_cb_task); @@ -50,17 +50,17 @@ typedef struct epoch_context *epoch_context_t; epoch_t epoch_alloc(int flags); void epoch_free(epoch_t epoch); -void epoch_enter_critical(epoch_t epoch); -void epoch_enter_internal(epoch_t epoch, struct thread *td); -void epoch_exit_critical(epoch_t epoch); -void epoch_exit_internal(epoch_t epoch, struct thread *td); +void epoch_enter(epoch_t epoch); +void epoch_enter_preempt_internal(epoch_t epoch, struct thread *td); +void epoch_exit(epoch_t epoch); +void epoch_exit_preempt_internal(epoch_t epoch, struct thread *td); void epoch_wait(epoch_t epoch); -void epoch_wait_critical(epoch_t epoch); +void epoch_wait_preempt(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(void); static __inline void -epoch_enter(epoch_t epoch) +epoch_enter_preempt(epoch_t epoch) { struct thread *td; int nesting; @@ -70,18 +70,18 @@ epoch_enter(epoch_t epoch) #ifndef INVARIANTS if (nesting == 0) #endif - epoch_enter_internal(epoch, td); + epoch_enter_preempt_internal(epoch, td); } static __inline void -epoch_exit(epoch_t epoch) +epoch_exit_preempt(epoch_t epoch) { struct thread *td; td = curthread; MPASS(td->td_epochnest); if (td->td_epochnest-- == 1) - epoch_exit_internal(epoch, td); + epoch_exit_preempt_internal(epoch, td); } #endif Modified: head/sys/sys/pmckern.h ============================================================================== --- head/sys/sys/pmckern.h Fri May 18 17:23:23 2018 (r333801) +++ head/sys/sys/pmckern.h Fri May 18 17:29:43 2018 (r333802) @@ -196,10 +196,10 @@ extern struct pmc_domain_buffer_header *pmc_dom_hdrs[M /* Hook invocation; for use within the kernel */ #define PMC_CALL_HOOK(t, cmd, arg) \ do { \ - epoch_enter(global_epoch); \ + epoch_enter_preempt(global_epoch_preempt); \ if (pmc_hook != NULL) \ (pmc_hook)((t), (cmd), (arg)); \ - epoch_exit(global_epoch); \ + epoch_exit_preempt(global_epoch_preempt); \ } while (0) /* Hook invocation that needs an exclusive lock */ Modified: head/sys/tests/epoch/epoch_test.c ============================================================================== --- head/sys/tests/epoch/epoch_test.c Fri May 18 17:23:23 2018 (r333801) +++ head/sys/tests/epoch/epoch_test.c Fri May 18 17:29:43 2018 (r333802) @@ -76,12 +76,12 @@ epoch_testcase1(struct epoch_test_instance *eti) mtxp = &mutexB; while (i < iterations) { - epoch_enter(test_epoch); + epoch_enter_preempt(test_epoch); mtx_lock(mtxp); i++; mtx_unlock(mtxp); - epoch_exit(test_epoch); - epoch_wait(test_epoch); + epoch_exit_preempt(test_epoch); + epoch_wait_preempt(test_epoch); } printf("test1: thread: %d took %d ticks to complete %d iterations\n", eti->threadid, ticks - startticks, iterations); @@ -98,13 +98,13 @@ epoch_testcase2(struct epoch_test_instance *eti) mtxp = &mutexA; while (i < iterations) { - epoch_enter(test_epoch); + epoch_enter_preempt(test_epoch); mtx_lock(mtxp); DELAY(1); i++; mtx_unlock(mtxp); - epoch_exit(test_epoch); - epoch_wait(test_epoch); + epoch_exit_preempt(test_epoch); + epoch_wait_preempt(test_epoch); } printf("test2: thread: %d took %d ticks to complete %d iterations\n", eti->threadid, ticks - startticks, iterations); @@ -139,7 +139,7 @@ test_modinit(void) int i, error, pri_range, pri_off; pri_range = PRI_MIN_TIMESHARE - PRI_MIN_REALTIME; - test_epoch = epoch_alloc(0); + test_epoch = epoch_alloc(EPOCH_PREEMPT); for (i = 0; i < mp_ncpus*2; i++) { etilist[i].threadid = i; error = kthread_add(testloop, &etilist[i], NULL, &testthreads[i], From owner-svn-src-all@freebsd.org Fri May 18 17:31:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18E8BEAF589; Fri, 18 May 2018 17:31:10 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7567808D9; Fri, 18 May 2018 17:31:09 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (67-0-228-75.albq.qwest.net [67.0.228.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id A406A192882; Fri, 18 May 2018 09:35:29 +0000 (UTC) Subject: Re: svn commit: r333801 - head/sys/contrib/dev/ath/ath_hal/ar9300 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805181723.w4IHNN6Y091949@repo.freebsd.org> <1526664543.32688.57.camel@freebsd.org> From: Sean Bruno Openpgp: preference=signencrypt Autocrypt: addr=sbruno@freebsd.org; prefer-encrypt=mutual; keydata= xsBNBFk+0UEBCADaf4bgxxKvMOhRV5NPoGWRCCGm49d6+1VFNlQ77WsY/+Zvf95TPULdRlnG w648KfxWt7+O3kdKhdRwnqlXWC7zA2Qt0dRE1yIqOGJ4jp4INvp/bcxWzgr0aoKOjrlnfxRV bh+s0rzdZt6TsNL3cVYxkC8oezjaUkHdW4mFJU249U1QJogkF8g0FeKNfEcjEkwJNX6lQJH+ EzCWT0NCk6J+Xyo+zOOljxPp1OUfdvZi3ulkU/qTZstGVWxFVsP8xQklV/y3AFcbIYx6iGJ4 5L7WuB0IWhO7Z4yHENr8wFaNYwpod9i4egX2BugbrM8pOfhN2/qqdeG1L5LMtXw3yyAhABEB AAHNN1NlYW4gQnJ1bm8gKEZyZWVCU0QgRGV2ZWxvcGVyIEtleSkgPHNicnVub0BmcmVlYnNk Lm9yZz7CwJQEEwEKAD4WIQToxOn4gDUE4eP0ujS95PX+ibX8tgUCWT7RQQIbAwUJBaOagAUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAAKCRC95PX+ibX8ttKTCACFKzRc56EBAlVotq02EjZP SfX+unlk6AuPBzShxqRxeK+bGYVCigrYd1M8nnskv0dEiZ5iYeND9HIxbpEyopqgpVTibA7w gBXaZ7SOEhNX1wXwg14JrralfSmPFMYni+sWegPMX/zwfAsn1z4mG1Nn44Xqo3o7CfpkMPy6 M5Bow2IDzIhEYISLR+urxs74/aHU35PLtBSDtu18914SEMDdva27MARN8mbeCDbuJVfGCPWy YHuy2t+9u2Zn5Dd+t3sBXLM9gpeaMm+4x6TNPpESygbVdh4tDdjVZ9DK/bWFg0kMgfZoaq6J l0jNsQXrZV3bzYNFbVw04pFcvA2GIJ7xzsBNBFk+0UEBCADIXBmQOaKMHGbc9vwjhV4Oj5aZ DdhNedn12FVeTdOXJvuTOusgxS29lla0RenHGDsgD08UiFpasBXWq/E+BhQ19d+iRbLLR17O KKc1ZGefoVbLARLXD68J5j4XAyK+6k2KqBLlqzAEpHTzsksM9naARkVXiEVcrt6ciw0FSm8n kuK3gDKKe93XfzfP+TQdbvvzJc7Fa+appLbXz61TM1aikaQlda8bWubDegwXbuoJdB34xU1m yjr/N4o+raL0x7QrzdH+wwgrTTo+H4S2c1972Skt5K5tbxLowfHicRl23V8itVQr3sBtlX4+ 66q+Apm7+R36bUS/k+G45Sp6iPpxABEBAAHCwHwEGAEKACYWIQToxOn4gDUE4eP0ujS95PX+ ibX8tgUCWT7RQQIbDAUJBaOagAAKCRC95PX+ibX8trrIB/9Pljqt/JGamD9tx4dOVmxSyFg9 z2xzgklTLuDgS73MM120mM7ao9AQUeWiSle/H0UCK7xPOzC/aeUC4oygDQKAfkkNbCNTo3+A qDjBRA8qx0e9a/QjDL+RFgD4L5kLT4tToY8T8HaBp8h03LBfk510IaI8oL/Jg7vpM3PDtJMW tUi2H+yNFmL3NfM2oBToWKLFsoP54f/eeeImrNnrlLjLHPzqS+/9apgYqX2Jwiv3tHBc4FTO GuY8VvF7BpixJs8Pc2RUuCfSyodrp1YG1kRGlXAH0cqwwr0Zmk4+7dZvtVQMCl6kS6q1+84q JwtItxS2eXSEA4NO0sQ3BXUywANh Message-ID: <7e76af2a-7229-ae4b-e060-7b9a355764be@freebsd.org> Date: Fri, 18 May 2018 11:31:03 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1526664543.32688.57.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:31:10 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7 Content-Type: multipart/mixed; boundary="i4GJo3K1oHs27WcmgOIJ0IkPqpj8uFWk7"; protected-headers="v1" From: Sean Bruno To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <7e76af2a-7229-ae4b-e060-7b9a355764be@freebsd.org> Subject: Re: svn commit: r333801 - head/sys/contrib/dev/ath/ath_hal/ar9300 References: <201805181723.w4IHNN6Y091949@repo.freebsd.org> <1526664543.32688.57.camel@freebsd.org> In-Reply-To: <1526664543.32688.57.camel@freebsd.org> --i4GJo3K1oHs27WcmgOIJ0IkPqpj8uFWk7 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 05/18/18 11:29, Ian Lepore wrote: > On Fri, 2018-05-18 at 17:23 +0000, Sean Bruno wrote: >> Author: sbruno >> Date: Fri May 18 17:23:23 2018 >> New Revision: 333801 >> URL: https://svnweb.freebsd.org/changeset/base/333801 >> >> Log: >> =C2=A0 Quiesce a couple pages of clang warnings with a cast.=C2=A0=C2=A0= Duplicates >> =C2=A0 linux maintainer commit: >> =C2=A0=C2=A0 >> =C2=A0 https://github.com/torvalds/linux/commit/627871b71c89a6ec12fbed= 75063f238e0c7127b2#diff-8c6ddb4c3ad69a6fb9f289475821db56 >> =C2=A0=C2=A0 >> =C2=A0 ar9300template_aphrodite.h:575:40: warning: implicit conversion= from 'int' >> =C2=A0=C2=A0=C2=A0=C2=A0to 'u_int8_t' (aka 'unsigned char') changes va= lue from 3495 to 167 >> =C2=A0=C2=A0=C2=A0=C2=A0[-Wconstant-conversion] >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0/* Data[8].ctl_edges[7].bChannel*/FREQ2FBIN(5795, 0)} >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^~~~~~~= ~~~~~~~~~~~ >> =C2=A0 ar9300eep.h:142:41: note: expanded from macro 'FREQ2FBIN' >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ?= ((x) - 2300) : (((x) - 4800) / 5)) >> =C2=A0=C2=A0 >> =C2=A0 Reviewed by: imp >> =C2=A0 MFC after: 1 week >> =C2=A0 Differential Revision: https://reviews.freebsd.org/D15476 >> >> Modified: >> =C2=A0 head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h >> >> Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Fri May 18 17:= 07:59 2018 (r333800) >> +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Fri May 18 17:= 23:23 2018 (r333801) >> @@ -139,7 +139,7 @@ enum Ar9300EepromTemplate >> =C2=A0#define OSPREY_CUSTOMER_DATA_SIZE=C2=A0=C2=A0=C2=A0=C2=A020 >> =C2=A0 >> =C2=A0#define FREQ2FBIN(x,y) \ >> -=C2=A0=C2=A0=C2=A0=C2=A0(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? ((x) - 230= 0) : (((x) - 4800) / 5)) >> +=C2=A0=C2=A0=C2=A0=C2=A0(u_int8_t)(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? = ((x) - 2300) : (((x) - 4800) / 5)) >> =C2=A0#define FBIN2FREQ(x,y) \ >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? (2300= + x) : (4800 + 5 * x)) >> =C2=A0#define OSPREY_MAX_CHAINS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A03 >> >=20 > How can this change possibly be correct? All the values involved are > compile-time constants, the compiler did the math and tells you the > result is=C2=A03495. Cast or not, that value is never going to fit into= a > uint8_t. Sure this supresses the warning, but what about actually > fixing the overflow? >=20 > -- Ian >=20 >=20 An excellent question all around. It appears that the maintainer at Qualcom acked the linux commit, so I'm not sure how to interpret all of this. sean --i4GJo3K1oHs27WcmgOIJ0IkPqpj8uFWk7-- --gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlr/DddfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LZi1ggA0qnZSZFdhY7nLXKfTAWYtbmQYTH+wtS7Ok5OWCuqBrTfzUoVgYPacJRL zAgXhCF3gm6/kBzQ/GB8zgiLFVD5z3nhNHlzOoMkZW65vyH6zRQdRtrzc8ezI/+U XvUE0VHpMmFfxGN9J0PkibzbF8PDByuHMY3reVKS7zj0PSJoCMfrYgTu0kqHfFtU JuHcnYYSRKNkUaSIoOQx4KMwjch/o6dMJ8UkNvM4c7xroFPeBI4Nx9yXggywxS9H MPFBOnfmlEWe3+Ff5jLO2/r0lhniKFFv8USTDaQfFwt0zynyOC4AA3EDDnbEr1yV LardcsrWCoI6a6Yb8czzquSXDY3Lzg== =9reQ -----END PGP SIGNATURE----- --gqoBk2eMRFXUDwtKBH73RCL503CaqjrE7-- From owner-svn-src-all@freebsd.org Fri May 18 17:43:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D18E0EAFB16; Fri, 18 May 2018 17:43:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72DA781292; Fri, 18 May 2018 17:43:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 502871B5C9; Fri, 18 May 2018 17:43:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IHhGVn002677; Fri, 18 May 2018 17:43:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHhGpQ002676; Fri, 18 May 2018 17:43:16 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201805181743.w4IHhGpQ002676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 18 May 2018 17:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333803 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/partedit X-SVN-Commit-Revision: 333803 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:43:17 -0000 Author: nwhitehorn Date: Fri May 18 17:43:15 2018 New Revision: 333803 URL: https://svnweb.freebsd.org/changeset/base/333803 Log: Fix math error in the computation of the free space after the last partition on a disk. This resulted in one sector always remaining free at the end. PR: bin/228322 Submitted by: Rikiya Yonemoto MFC after: 2 weeks Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri May 18 17:29:43 2018 (r333802) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri May 18 17:43:15 2018 (r333803) @@ -856,7 +856,7 @@ gpart_max_free(struct ggeom *geom, intmax_t *npartstar } if (end - lastend > maxsize) { - maxsize = end - lastend - 1; + maxsize = end - lastend; maxstart = lastend + 1; } From owner-svn-src-all@freebsd.org Fri May 18 17:46:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B13AEAFD50; Fri, 18 May 2018 17:46:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5C2581648; Fri, 18 May 2018 17:46:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 874CB1B5CF; Fri, 18 May 2018 17:46:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IHkeA4002895; Fri, 18 May 2018 17:46:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHkeVS002894; Fri, 18 May 2018 17:46:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201805181746.w4IHkeVS002894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 18 May 2018 17:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333804 - head/usr.sbin/bsdinstall X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/usr.sbin/bsdinstall X-SVN-Commit-Revision: 333804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:46:41 -0000 Author: nwhitehorn Date: Fri May 18 17:46:40 2018 New Revision: 333804 URL: https://svnweb.freebsd.org/changeset/base/333804 Log: Use sysrc(8) in the documentation rather than echoing things to rc.conf in order to encourage good habits. PR: 228325 Submitted by: Mateusz Piotrowski MFC after: 2 weeks Modified: head/usr.sbin/bsdinstall/bsdinstall.8 Modified: head/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall.8 Fri May 18 17:43:15 2018 (r333803) +++ head/usr.sbin/bsdinstall/bsdinstall.8 Fri May 18 17:46:40 2018 (r333804) @@ -333,8 +333,8 @@ PARTITIONS=ada0 DISTRIBUTIONS="kernel.txz base.txz" #!/bin/sh -echo "ifconfig_em0=DHCP" >> /etc/rc.conf -echo "sshd_enable=YES" >> /etc/rc.conf +sysrc ifconfig_em0=DHCP +sysrc sshd_enable=YES pkg install puppet .Ed .Pp From owner-svn-src-all@freebsd.org Fri May 18 17:51:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D1AEB016D; Fri, 18 May 2018 17:51:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE4A081AB7; Fri, 18 May 2018 17:51:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F66A1B62D; Fri, 18 May 2018 17:51:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IHpgKd007209; Fri, 18 May 2018 17:51:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHpghG007208; Fri, 18 May 2018 17:51:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805181751.w4IHpghG007208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 May 2018 17:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333805 - head/sys/amd64/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/amd64/conf X-SVN-Commit-Revision: 333805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:51:43 -0000 Author: emaste Date: Fri May 18 17:51:42 2018 New Revision: 333805 URL: https://svnweb.freebsd.org/changeset/base/333805 Log: amd64 GENERIC: correct whitespace on smartpqi entry Modified: head/sys/amd64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Fri May 18 17:46:40 2018 (r333804) +++ head/sys/amd64/conf/GENERIC Fri May 18 17:51:42 2018 (r333805) @@ -166,7 +166,7 @@ device iir # Intel Integrated RAID device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID device twa # 3ware 9000 series PATA/SATA RAID -device smartpqi # Microsemi smartpqi driver +device smartpqi # Microsemi smartpqi driver device tws # LSI 3ware 9750 SATA+SAS 6Gb/s RAID controller # RAID controllers From owner-svn-src-all@freebsd.org Fri May 18 17:58:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCB8EB047A; Fri, 18 May 2018 17:58:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1BBF8201C; Fri, 18 May 2018 17:58:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EBEB1B763; Fri, 18 May 2018 17:58:12 +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 w4IHwClN008290; Fri, 18 May 2018 17:58:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHw9gi008273; Fri, 18 May 2018 17:58:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805181758.w4IHw9gi008273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 18 May 2018 17:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333806 - in head/sys: dev/acpica dev/ofw fs/cuse i386/bios kern net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: dev/acpica dev/ofw fs/cuse i386/bios kern net X-SVN-Commit-Revision: 333806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:58:13 -0000 Author: emaste Date: Fri May 18 17:58:09 2018 New Revision: 333806 URL: https://svnweb.freebsd.org/changeset/base/333806 Log: Use NULL for SYSINIT's last arg, which is a pointer type Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/acpica/acpi.c head/sys/dev/ofw/ofw_fdt.c head/sys/fs/cuse/cuse.c head/sys/i386/bios/apm.c head/sys/kern/imgact_binmisc.c head/sys/kern/kern_linker.c head/sys/kern/kern_module.c head/sys/kern/kern_synch.c head/sys/kern/kern_sysctl.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c head/sys/kern/posix4_mib.c head/sys/kern/subr_pcpu.c head/sys/net/route.c head/sys/net/vnet.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/dev/acpica/acpi.c Fri May 18 17:58:09 2018 (r333806) @@ -4179,4 +4179,4 @@ acpi_pm_register(void *arg) power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, NULL); } -SYSINIT(power, SI_SUB_KLD, SI_ORDER_ANY, acpi_pm_register, 0); +SYSINIT(power, SI_SUB_KLD, SI_ORDER_ANY, acpi_pm_register, NULL); Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/dev/ofw/ofw_fdt.c Fri May 18 17:58:09 2018 (r333806) @@ -126,7 +126,7 @@ sysctl_register_fdt_oid(void *arg) CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_handle_dtb, "", "Device Tree Blob"); } -SYSINIT(dtb_oid, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_fdt_oid, 0); +SYSINIT(dtb_oid, SI_SUB_KMEM, SI_ORDER_ANY, sysctl_register_fdt_oid, NULL); static int ofw_fdt_init(ofw_t ofw, void *data) Modified: head/sys/fs/cuse/cuse.c ============================================================================== --- head/sys/fs/cuse/cuse.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/fs/cuse/cuse.c Fri May 18 17:58:09 2018 (r333806) @@ -252,7 +252,7 @@ cuse_kern_init(void *arg) (CUSE_VERSION >> 16) & 0xFF, (CUSE_VERSION >> 8) & 0xFF, (CUSE_VERSION >> 0) & 0xFF); } -SYSINIT(cuse_kern_init, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_init, 0); +SYSINIT(cuse_kern_init, SI_SUB_DEVFS, SI_ORDER_ANY, cuse_kern_init, NULL); static void cuse_kern_uninit(void *arg) Modified: head/sys/i386/bios/apm.c ============================================================================== --- head/sys/i386/bios/apm.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/i386/bios/apm.c Fri May 18 17:58:09 2018 (r333806) @@ -1532,4 +1532,4 @@ apm_pm_register(void *arg) power_pm_register(POWER_PM_TYPE_APM, apm_pm_func, NULL); } -SYSINIT(power, SI_SUB_KLD, SI_ORDER_ANY, apm_pm_register, 0); +SYSINIT(power, SI_SUB_KLD, SI_ORDER_ANY, apm_pm_register, NULL); Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/imgact_binmisc.c Fri May 18 17:58:09 2018 (r333806) @@ -747,8 +747,10 @@ imgact_binmisc_fini(void *arg) sx_destroy(&interp_list_sx); } -SYSINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_init, 0); -SYSUNINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_fini, 0); +SYSINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_init, + NULL); +SYSUNINIT(imgact_binmisc, SI_SUB_EXEC, SI_ORDER_MIDDLE, imgact_binmisc_fini, + NULL); /* * Tell kern_execve.c about it, with a little help from the linker. Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/kern_linker.c Fri May 18 17:58:09 2018 (r333806) @@ -163,7 +163,7 @@ linker_init(void *arg) TAILQ_INIT(&linker_files); } -SYSINIT(linker, SI_SUB_KLD, SI_ORDER_FIRST, linker_init, 0); +SYSINIT(linker, SI_SUB_KLD, SI_ORDER_FIRST, linker_init, NULL); static void linker_stop_class_add(void *arg) @@ -411,7 +411,7 @@ linker_init_kernel_modules(void) } SYSINIT(linker_kernel, SI_SUB_KLD, SI_ORDER_ANY, linker_init_kernel_modules, - 0); + NULL); static int linker_load_file(const char *filename, linker_file_t *result) @@ -1684,7 +1684,7 @@ fail: /* woohoo! we made it! */ } -SYSINIT(preload, SI_SUB_KLD, SI_ORDER_MIDDLE, linker_preload, 0); +SYSINIT(preload, SI_SUB_KLD, SI_ORDER_MIDDLE, linker_preload, NULL); /* * Handle preload files that failed to load any modules. @@ -1719,7 +1719,7 @@ linker_preload_finish(void *arg) * becomes runnable in SI_SUB_KTHREAD_INIT, so go slightly before that. */ SYSINIT(preload_finish, SI_SUB_KTHREAD_INIT - 100, SI_ORDER_MIDDLE, - linker_preload_finish, 0); + linker_preload_finish, NULL); /* * Search for a not-loaded module by name. Modified: head/sys/kern/kern_module.c ============================================================================== --- head/sys/kern/kern_module.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/kern_module.c Fri May 18 17:58:09 2018 (r333806) @@ -89,7 +89,7 @@ module_init(void *arg) SHUTDOWN_PRI_DEFAULT); } -SYSINIT(module, SI_SUB_KLD, SI_ORDER_FIRST, module_init, 0); +SYSINIT(module, SI_SUB_KLD, SI_ORDER_FIRST, module_init, NULL); static void module_shutdown(void *arg1, int arg2) Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/kern_synch.c Fri May 18 17:58:09 2018 (r333806) @@ -109,7 +109,7 @@ sleepinit(void *unused) * vmem tries to lock the sleepq mutexes when free'ing kva, so make sure * it is available. */ -SYSINIT(sleepinit, SI_SUB_KMEM, SI_ORDER_ANY, sleepinit, 0); +SYSINIT(sleepinit, SI_SUB_KMEM, SI_ORDER_ANY, sleepinit, NULL); /* * General sleep call. Suspends the current thread until a wakeup is Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/kern_sysctl.c Fri May 18 17:58:09 2018 (r333806) @@ -921,7 +921,7 @@ sysctl_register_all(void *arg) sysctl_register_oid(*oidp); SYSCTL_WUNLOCK(); } -SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); +SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, NULL); /* * "Staff-functions" Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/link_elf.c Fri May 18 17:58:09 2018 (r333806) @@ -469,7 +469,7 @@ link_elf_init(void* arg) #endif } -SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, 0); +SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, NULL); static int link_elf_preload_parse_symbols(elf_file_t ef) Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/link_elf_obj.c Fri May 18 17:58:09 2018 (r333806) @@ -194,7 +194,7 @@ link_elf_init(void *arg) linker_add_class(&link_elf_class); } -SYSINIT(link_elf_obj, SI_SUB_KLD, SI_ORDER_SECOND, link_elf_init, 0); +SYSINIT(link_elf_obj, SI_SUB_KLD, SI_ORDER_SECOND, link_elf_init, NULL); static int link_elf_link_preload(linker_class_t cls, const char *filename, Modified: head/sys/kern/posix4_mib.c ============================================================================== --- head/sys/kern/posix4_mib.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/posix4_mib.c Fri May 18 17:58:09 2018 (r333806) @@ -173,5 +173,5 @@ p31b_set_standard(void *dummy) } SYSINIT(p31b_set_standard, SI_SUB_P1003_1B, SI_ORDER_ANY, p31b_set_standard, - 0); + NULL); Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/kern/subr_pcpu.c Fri May 18 17:58:09 2018 (r333806) @@ -127,7 +127,7 @@ dpcpu_startup(void *dummy __unused) TAILQ_INSERT_HEAD(&dpcpu_head, df, df_link); sx_init(&dpcpu_lock, "dpcpu alloc lock"); } -SYSINIT(dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_startup, 0); +SYSINIT(dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_startup, NULL); /* * UMA_PCPU_ZONE zones, that are available for all kernel Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/net/route.c Fri May 18 17:58:09 2018 (r333806) @@ -228,7 +228,7 @@ route_init(void) if (rt_numfibs == 0) rt_numfibs = 1; } -SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, 0); +SYSINIT(route_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, route_init, NULL); static int rtentry_zinit(void *mem, int size, int how) Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Fri May 18 17:51:42 2018 (r333805) +++ head/sys/net/vnet.c Fri May 18 17:58:09 2018 (r333806) @@ -349,7 +349,7 @@ vnet_data_startup(void *dummy __unused) TAILQ_INSERT_HEAD(&vnet_data_free_head, df, vnd_link); sx_init(&vnet_data_free_lock, "vnet_data alloc lock"); } -SYSINIT(vnet_data, SI_SUB_KLD, SI_ORDER_FIRST, vnet_data_startup, 0); +SYSINIT(vnet_data, SI_SUB_KLD, SI_ORDER_FIRST, vnet_data_startup, NULL); /* Dummy VNET_SYSINIT to make sure we always reach the final end state. */ static void From owner-svn-src-all@freebsd.org Fri May 18 17:58:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FB43EB0499; Fri, 18 May 2018 17:58:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABA2D8202A; Fri, 18 May 2018 17:58:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D5541B764; Fri, 18 May 2018 17:58:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IHwFZv008337; Fri, 18 May 2018 17:58:15 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IHwFuA008336; Fri, 18 May 2018 17:58:15 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805181758.w4IHwFuA008336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 17:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333807 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 17:58:16 -0000 Author: mmacy Date: Fri May 18 17:58:15 2018 New Revision: 333807 URL: https://svnweb.freebsd.org/changeset/base/333807 Log: epoch: move epoch variables to read mostly section Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri May 18 17:58:09 2018 (r333806) +++ head/sys/net/if.c Fri May 18 17:58:15 2018 (r333807) @@ -104,8 +104,8 @@ _Static_assert(sizeof(((struct ifreq *)0)->ifr_name) == offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru"); -epoch_t net_epoch_preempt; -epoch_t net_epoch; +__read_mostly epoch_t net_epoch_preempt; +__read_mostly epoch_t net_epoch; #ifdef COMPAT_FREEBSD32 #include #include From owner-svn-src-all@freebsd.org Fri May 18 18:27:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55BF2EB10DB; Fri, 18 May 2018 18:27:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E5D83183; Fri, 18 May 2018 18:27:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA36E1BC44; Fri, 18 May 2018 18:27:17 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IIRHjq023541; Fri, 18 May 2018 18:27:17 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IIRHum023540; Fri, 18 May 2018 18:27:17 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805181827.w4IIRHum023540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 18:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333808 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 18:27:18 -0000 Author: mmacy Date: Fri May 18 18:27:17 2018 New Revision: 333808 URL: https://svnweb.freebsd.org/changeset/base/333808 Log: epoch(9): assert that epoch is allocated post-configure Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri May 18 17:58:15 2018 (r333807) +++ head/sys/kern/subr_epoch.c Fri May 18 18:27:17 2018 (r333808) @@ -267,8 +267,9 @@ epoch_enter_preempt_internal(epoch_t epoch, struct thr { struct epoch_pcpu_state *eps; - MPASS(epoch->e_flags & EPOCH_PREEMPT); + MPASS(cold || epoch != NULL); INIT_CHECK(epoch); + MPASS(epoch->e_flags & EPOCH_PREEMPT); critical_enter(); td->td_pre_epoch_prio = td->td_priority; eps = epoch->e_pcpu[curcpu]; @@ -300,6 +301,7 @@ epoch_enter(epoch_t epoch) ck_epoch_section_t *section; struct thread *td; + MPASS(cold || epoch != NULL); section = NULL; td = curthread; critical_enter(); @@ -495,6 +497,8 @@ epoch_wait_preempt(epoch_t epoch) locks = curthread->td_locks; #endif + + MPASS(cold || epoch != NULL); INIT_CHECK(epoch); MPASS(epoch->e_flags & EPOCH_PREEMPT); @@ -548,6 +552,8 @@ void epoch_wait(epoch_t epoch) { + MPASS(cold || epoch != NULL); + INIT_CHECK(epoch); MPASS(epoch->e_flags == 0); critical_enter(); ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler, NULL); From owner-svn-src-all@freebsd.org Fri May 18 18:48:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DB4BEB17E9; Fri, 18 May 2018 18:48:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0E8683C3F; Fri, 18 May 2018 18:48:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B21B41BF82; Fri, 18 May 2018 18:48:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IIm0Ad033933; Fri, 18 May 2018 18:48:00 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IIm0YE033932; Fri, 18 May 2018 18:48:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805181848.w4IIm0YE033932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 18:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333809 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 18:48:01 -0000 Author: mmacy Date: Fri May 18 18:48:00 2018 New Revision: 333809 URL: https://svnweb.freebsd.org/changeset/base/333809 Log: epoch(9): allocate net epochs earlier in boot Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Fri May 18 18:27:17 2018 (r333808) +++ head/sys/net/if.c Fri May 18 18:48:00 2018 (r333809) @@ -900,12 +900,20 @@ if_attach_internal(struct ifnet *ifp, int vmove, struc } static void -if_attachdomain(void *dummy) +if_epochalloc(void *dummy __unused) { - struct ifnet *ifp; net_epoch_preempt = epoch_alloc(EPOCH_PREEMPT); net_epoch = epoch_alloc(0); +} +SYSINIT(ifepochalloc, SI_SUB_TASKQ + 1, SI_ORDER_ANY, + if_epochalloc, NULL); + +static void +if_attachdomain(void *dummy) +{ + struct ifnet *ifp; + TAILQ_FOREACH(ifp, &V_ifnet, if_link) if_attachdomain1(ifp); } From owner-svn-src-all@freebsd.org Fri May 18 19:03:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1C6EB1D9B for ; Fri, 18 May 2018 19:03:21 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: from mail-lf0-x242.google.com (mail-lf0-x242.google.com [IPv6:2a00:1450:4010:c07::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 32056846F2 for ; Fri, 18 May 2018 19:03:20 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: by mail-lf0-x242.google.com with SMTP id t129-v6so15444453lff.3 for ; Fri, 18 May 2018 12:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bakulin-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oVai2/rDkI0YdqxIIsDPoNdXGqFgtpyAm3Rh9RJJDmg=; b=W6L1cvvP/0vgOwBDYMOQ1juGkN1wFhDdjIQ/L5tK0rLUEI74e94IX5SX0JLRT04GCF v75zAyV/QU/MoEmy3tuQGPe3qSyjFnuhL3BlMUQckL0PtBDbhz3jD3ewwE8J/W/Jte8f JZcvejyZ8BeXuLX8+Rcw2wW3sM9kbO/QMKZafreZwjgriMtZgiNiiHE6uCav4LAPwnBj SEnNS7tUX7ramrsVrh0KlRMX9pCmDg/MSYWFHeqfsmW9Hq3cCmKTbzsQBqPM85bCj3Tu NCqOPovRz29v0a1atUZZ7TSOiwBOEUVstyKXjFQnJx/WxojmxtcSEivX3Aqezie9rs5z 7VtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oVai2/rDkI0YdqxIIsDPoNdXGqFgtpyAm3Rh9RJJDmg=; b=TuVo7NApcf6t9+8hM7KvyxPcHs3+XQ2VCv7uPJ1DI4eShIJc+AN77+YIv2574qmp6c O4zu5gAqtZ+Kolp/yS6VHSnoX/LO1A5C7dYISOsJbN1bW8HTAQg3Xb//DEJlR9/Wg248 BO4tOVT6+bdgbnDPg7ii/q8ayEd1ZNdhsrgNo5o1oVXhIt/ANSWxrCXD1kKIuyakWy1l hZN+NMhWqYXRABKWs9Q3qM2O6mEQbQJXXejmLnRgurBKUlcgKpF0eoksDy5uMj6eGCbS 6Tk0/d8MUG/1aXFTPLCmY9073x3pEOIK+doaOxk8b3iIWGLGGW3lldvpIXq/sP9SIZxy DC7g== X-Gm-Message-State: ALKqPwdH0ETQnQvPTajNaA3Ci6TcUvrDEp7qHGwK3iUv25rTzYDiyPxN 9TqQmwMikWWQRHWdSdHoAlqddoYMKHIELjgXvSJFqw== X-Google-Smtp-Source: AB8JxZrTnrUX+zBilveObEhndGXf0ExKMXUDLVRdaJwGh91JOGanFRkGbwvUNsH65XW/oJLRuFj1aJiZF/154FOk6TM= X-Received: by 2002:a19:5348:: with SMTP id h69-v6mr22650457lfb.26.1526670198278; Fri, 18 May 2018 12:03:18 -0700 (PDT) MIME-Version: 1.0 References: <201805091847.w49IlPPa014617@repo.freebsd.org> In-Reply-To: <201805091847.w49IlPPa014617@repo.freebsd.org> From: Ilya Bakulin Date: Fri, 18 May 2018 21:03:06 +0200 Message-ID: Subject: Re: svn commit: r333425 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/cloudabi compat/linux compat/linuxkpi/common/include/linux dev/filemon dev/hwpmc fs/... To: mmacy@freebsd.org, manu@freebsd.org, Warner Losh 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.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 19:03:22 -0000 Hi Matt, seems this commit has broken at least BeagleBone Black booting process. On all revisions after it the kernel panics with this message: http://dl.bakulin.de/bbb_panic.txt My suspicion is that there are quite a few new SYSINIT objects that are created on startup, and as a result some kind of memory reservation gets exhausted. I don't have immediate idea how to debug this further; just can confirm that patching out this change allows the board to boot again. On Wed, May 9, 2018 at 8:47 PM Matt Macy wrote: > Author: mmacy > Date: Wed May 9 18:47:24 2018 > New Revision: 333425 > URL: https://svnweb.freebsd.org/changeset/base/333425 > > Log: > Eliminate the overhead of gratuitous repeated reinitialization of > cap_rights > > - Add macros to allow preinitialization of cap_rights_t. > > - Convert most commonly used code paths to use preinitialized > cap_rights_t. > A 3.6% speedup in fstat was measured with this change. > > Reported by: mjg > Reviewed by: oshogbo > Approved by: sbruno > MFC after: 1 month > > Modified: > head/sys/cddl/compat/opensolaris/sys/file.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > head/sys/compat/cloudabi/cloudabi_file.c > head/sys/compat/linux/linux_event.c > head/sys/compat/linux/linux_file.c > head/sys/compat/linux/linux_ioctl.c > head/sys/compat/linux/linux_mmap.c > head/sys/compat/linux/linux_socket.c > head/sys/compat/linux/linux_stats.c > head/sys/compat/linuxkpi/common/include/linux/file.h > head/sys/dev/filemon/filemon.c > head/sys/dev/hwpmc/hwpmc_logging.c > head/sys/fs/fdescfs/fdesc_vnops.c > head/sys/fs/fuse/fuse_vfsops.c > head/sys/kern/kern_descrip.c > head/sys/kern/kern_event.c > head/sys/kern/kern_exec.c > head/sys/kern/kern_sendfile.c > head/sys/kern/kern_sig.c > head/sys/kern/subr_capability.c > head/sys/kern/sys_generic.c > head/sys/kern/sys_procdesc.c > head/sys/kern/uipc_mqueue.c > head/sys/kern/uipc_sem.c > head/sys/kern/uipc_syscalls.c > head/sys/kern/vfs_aio.c > head/sys/kern/vfs_syscalls.c > head/sys/netsmb/smb_dev.c > head/sys/sys/capsicum.h > > Modified: head/sys/cddl/compat/opensolaris/sys/file.h > > ============================================================================== > --- head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:47:24 2018 > (r333425) > @@ -52,10 +52,9 @@ static __inline void > releasef(int fd) > { > struct file *fp; > - cap_rights_t rights; > > /* No CAP_ rights required, as we're only releasing. */ > - if (fget(curthread, fd, cap_rights_init(&rights), &fp) == 0) { > + if (fget(curthread, fd, &cap_no_rights, &fp) == 0) { > fdrop(fp, curthread); > fdrop(fp, curthread); > } > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > Wed May 9 18:41:04 2018 (r333424) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > Wed May 9 18:47:24 2018 (r333425) > @@ -4446,7 +4446,6 @@ zfs_ioc_recv(zfs_cmd_t *zc) > char *origin = NULL; > char *tosnap; > char tofs[ZFS_MAX_DATASET_NAME_LEN]; > - cap_rights_t rights; > boolean_t first_recvd_props = B_FALSE; > > if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || > @@ -4467,7 +4466,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) > #ifdef illumos > fp = getf(fd); > #else > - fget_read(curthread, fd, cap_rights_init(&rights, CAP_PREAD), &fp); > + fget_read(curthread, fd, &cap_pread_rights, &fp); > #endif > if (fp == NULL) { > nvlist_free(props); > @@ -4744,13 +4743,11 @@ zfs_ioc_send(zfs_cmd_t *zc) > dsl_pool_rele(dp, FTAG); > } else { > file_t *fp; > - cap_rights_t rights; > > #ifdef illumos > fp = getf(zc->zc_cookie); > #else > - fget_write(curthread, zc->zc_cookie, > - cap_rights_init(&rights, CAP_WRITE), &fp); > + fget_write(curthread, zc->zc_cookie, &cap_write_rights, > &fp); > #endif > if (fp == NULL) > return (SET_ERROR(EBADF)); > @@ -5387,15 +5384,13 @@ static int > zfs_ioc_diff(zfs_cmd_t *zc) > { > file_t *fp; > - cap_rights_t rights; > offset_t off; > int error; > > #ifdef illumos > fp = getf(zc->zc_cookie); > #else > - fget_write(curthread, zc->zc_cookie, > - cap_rights_init(&rights, CAP_WRITE), &fp); > + fget_write(curthread, zc->zc_cookie, &cap_write_rights, &fp); > #endif > if (fp == NULL) > return (SET_ERROR(EBADF)); > @@ -5787,7 +5782,6 @@ zfs_ioc_unjail(zfs_cmd_t *zc) > static int > zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) > { > - cap_rights_t rights; > file_t *fp; > int error; > offset_t off; > @@ -5815,7 +5809,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t > *innvl > #ifdef illumos > file_t *fp = getf(fd); > #else > - fget_write(curthread, fd, cap_rights_init(&rights, CAP_WRITE), > &fp); > + fget_write(curthread, fd, &cap_write_rights, &fp); > #endif > if (fp == NULL) > return (SET_ERROR(EBADF)); > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > Wed May 9 18:41:04 2018 (r333424) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > Wed May 9 18:47:24 2018 (r333425) > @@ -126,7 +126,7 @@ zfs_onexit_fd_hold(int fd, minor_t *minorp) > void *data; > int error; > > - fp = getf(fd, cap_rights_init(&rights)); > + fp = getf(fd, &cap_no_rights); > if (fp == NULL) > return (SET_ERROR(EBADF)); > > > Modified: head/sys/compat/cloudabi/cloudabi_file.c > > ============================================================================== > --- head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:47:24 2018 > (r333425) > @@ -390,12 +390,11 @@ cloudabi_sys_file_readdir(struct thread *td, > struct file *fp; > struct vnode *vp; > void *readbuf; > - cap_rights_t rights; > cloudabi_dircookie_t offset; > int error; > > /* Obtain directory vnode. */ > - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), > &fp); > + error = getvnode(td, uap->fd, &cap_read_rights, &fp); > if (error != 0) { > if (error == EINVAL) > return (ENOTDIR); > @@ -559,14 +558,13 @@ cloudabi_sys_file_stat_fget(struct thread *td, > struct stat sb; > cloudabi_filestat_t csb; > struct file *fp; > - cap_rights_t rights; > cloudabi_filetype_t filetype; > int error; > > memset(&csb, 0, sizeof(csb)); > > /* Fetch file descriptor attributes. */ > - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), > &fp); > + error = fget(td, uap->fd, &cap_fstat_rights, &fp); > if (error != 0) > return (error); > error = fo_stat(fp, &sb, td->td_ucred, td); > > Modified: head/sys/compat/linux/linux_event.c > > ============================================================================== > --- head/sys/compat/linux/linux_event.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/linux/linux_event.c Wed May 9 18:47:24 2018 > (r333425) > @@ -1190,14 +1190,13 @@ linux_timerfd_curval(struct timerfd *tfd, struct > itime > int > linux_timerfd_gettime(struct thread *td, struct > linux_timerfd_gettime_args *args) > { > - cap_rights_t rights; > struct l_itimerspec lots; > struct itimerspec ots; > struct timerfd *tfd; > struct file *fp; > int error; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_READ), > &fp); > + error = fget(td, args->fd, &cap_read_rights, &fp); > if (error != 0) > return (error); > tfd = fp->f_data; > @@ -1225,7 +1224,6 @@ linux_timerfd_settime(struct thread *td, struct > linux_ > struct l_itimerspec lots; > struct itimerspec nts, ots; > struct timespec cts, ts; > - cap_rights_t rights; > struct timerfd *tfd; > struct timeval tv; > struct file *fp; > @@ -1241,7 +1239,7 @@ linux_timerfd_settime(struct thread *td, struct > linux_ > if (error != 0) > return (error); > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_WRITE), > &fp); > + error = fget(td, args->fd, &cap_write_rights, &fp); > if (error != 0) > return (error); > tfd = fp->f_data; > > Modified: head/sys/compat/linux/linux_file.c > > ============================================================================== > --- head/sys/compat/linux/linux_file.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/linux/linux_file.c Wed May 9 18:47:24 2018 > (r333425) > @@ -89,7 +89,6 @@ linux_creat(struct thread *td, struct linux_creat_args > static int > linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, > int mode) > { > - cap_rights_t rights; > struct proc *p = td->td_proc; > struct file *fp; > int fd; > @@ -144,7 +143,7 @@ linux_common_open(struct thread *td, int dirfd, char * > * checking below. > */ > fd = td->td_retval[0]; > - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { > + if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { > if (fp->f_type != DTYPE_VNODE) { > fdrop(fp, td); > goto done; > @@ -263,13 +262,12 @@ linux_llseek(struct thread *td, struct > linux_llseek_ar > static int > linux_getdents_error(struct thread *td, int fd, int err) > { > - cap_rights_t rights; > struct vnode *vp; > struct file *fp; > int error; > > /* Linux return ENOTDIR in case when fd is not a directory. */ > - error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), &fp); > + error = getvnode(td, fd, &cap_read_rights, &fp); > if (error != 0) > return (error); > vp = fp->f_vnode; > @@ -985,15 +983,13 @@ linux_fdatasync(td, uap) > int > linux_pread(struct thread *td, struct linux_pread_args *uap) > { > - cap_rights_t rights; > struct vnode *vp; > int error; > > error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, uap->offset); > if (error == 0) { > /* This seems to violate POSIX but Linux does it. */ > - error = fgetvp(td, uap->fd, > - cap_rights_init(&rights, CAP_PREAD), &vp); > + error = fgetvp(td, uap->fd, &cap_pread_rights, &vp); > if (error != 0) > return (error); > if (vp->v_type == VDIR) { > @@ -1275,7 +1271,6 @@ fcntl_common(struct thread *td, struct > linux_fcntl_arg > { > struct l_flock linux_flock; > struct flock bsd_flock; > - cap_rights_t rights; > struct file *fp; > long arg; > int error, result; > @@ -1379,7 +1374,7 @@ fcntl_common(struct thread *td, struct > linux_fcntl_arg > * pipes under Linux-2.2.35 at least). > */ > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_FCNTL), &fp); > + &cap_fcntl_rights, &fp); > if (error) > return (error); > if (fp->f_type == DTYPE_PIPE) { > > Modified: head/sys/compat/linux/linux_ioctl.c > > ============================================================================== > --- head/sys/compat/linux/linux_ioctl.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/linux/linux_ioctl.c Wed May 9 18:47:24 2018 > (r333425) > @@ -194,13 +194,12 @@ struct linux_hd_big_geometry { > static int > linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error; > u_int sectorsize, fwcylinders, fwheads, fwsectors; > off_t mediasize, bytespercyl; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > switch (args->cmd & 0xffff) { > @@ -278,13 +277,12 @@ linux_ioctl_hdio(struct thread *td, struct > linux_ioctl > static int > linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error; > u_int sectorsize; > off_t mediasize; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > switch (args->cmd & 0xffff) { > @@ -717,11 +715,10 @@ linux_ioctl_termio(struct thread *td, struct > linux_ioc > struct termios bios; > struct linux_termios lios; > struct linux_termio lio; > - cap_rights_t rights; > struct file *fp; > int error; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > > @@ -1461,11 +1458,10 @@ bsd_to_linux_dvd_authinfo(struct dvd_authinfo *bp, > l_d > static int > linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > switch (args->cmd & 0xffff) { > @@ -1998,11 +1994,10 @@ linux_ioctl_sound(struct thread *td, struct > linux_ioct > static int > linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > switch (args->cmd & 0xffff) { > @@ -2411,7 +2406,6 @@ static int > linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) > { > char lifname[LINUX_IFNAMSIZ], ifname[IFNAMSIZ]; > - cap_rights_t rights; > struct ifnet *ifp; > struct file *fp; > int error, type; > @@ -2419,7 +2413,7 @@ linux_ioctl_socket(struct thread *td, struct > linux_ioc > ifp = NULL; > error = 0; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > type = fp->f_type; > @@ -2649,11 +2643,10 @@ linux_ioctl_socket(struct thread *td, struct > linux_ioc > static int > linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error, type; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > type = fp->f_type; > @@ -2685,11 +2678,10 @@ linux_ioctl_sg_io(struct thread *td, struct > linux_ioct > { > struct sg_io_hdr io; > struct sg_io_hdr32 io32; > - cap_rights_t rights; > struct file *fp; > int error; > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) { > printf("sg_linux_ioctl: fget returned %d\n", error); > return (error); > @@ -2997,7 +2989,6 @@ linux_v4l_cliplist_copy(struct l_video_window *lvw, > st > static int > linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error; > struct video_tuner vtun; > @@ -3016,7 +3007,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCGTUNER: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = copyin((void *) args->arg, &l_vtun, > sizeof(l_vtun)); > @@ -3036,7 +3027,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCSTUNER: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = copyin((void *) args->arg, &l_vtun, > sizeof(l_vtun)); > @@ -3055,7 +3046,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCGWIN: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, td); > @@ -3069,7 +3060,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCSWIN: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = copyin((void *) args->arg, &l_vwin, > sizeof(l_vwin)); > @@ -3094,7 +3085,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCGFBUF: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, td); > @@ -3108,7 +3099,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCSFBUF: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = copyin((void *) args->arg, &l_vbuf, > sizeof(l_vbuf)); > @@ -3138,7 +3129,7 @@ linux_ioctl_v4l(struct thread *td, struct > linux_ioctl_ > > case LINUX_VIDIOCSMICROCODE: > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = copyin((void *) args->arg, &l_vcode, > sizeof(l_vcode)); > @@ -3302,7 +3293,6 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, > struc > static int > linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > int error; > struct v4l2_format vformat; > @@ -3395,7 +3385,7 @@ linux_ioctl_v4l2(struct thread *td, struct > linux_ioctl > if (error) > return (error); > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error) > return (error); > if (linux_to_bsd_v4l2_format(&l_vformat, &vformat) != 0) > @@ -3420,7 +3410,7 @@ linux_ioctl_v4l2(struct thread *td, struct > linux_ioctl > return (error); > linux_to_bsd_v4l2_standard(&l_vstd, &vstd); > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error) > return (error); > error = fo_ioctl(fp, VIDIOC_ENUMSTD, (caddr_t)&vstd, > @@ -3444,7 +3434,7 @@ linux_ioctl_v4l2(struct thread *td, struct > linux_ioctl > if (error != 0) > return (error); > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > error = fo_ioctl(fp, VIDIOC_ENUMINPUT, (caddr_t)&vinp, > @@ -3465,7 +3455,7 @@ linux_ioctl_v4l2(struct thread *td, struct > linux_ioctl > if (error) > return (error); > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error) > return (error); > linux_to_bsd_v4l2_buffer(&l_vbuf, &vbuf); > @@ -3640,7 +3630,6 @@ linux_ioctl_fbsd_usb(struct thread *td, struct > linux_i > static int > linux_ioctl_evdev(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > clockid_t clock; > int error; > @@ -3668,7 +3657,7 @@ linux_ioctl_evdev(struct thread *td, struct > linux_ioct > return (error); > > error = fget(td, args->fd, > - cap_rights_init(&rights, CAP_IOCTL), &fp); > + &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > > @@ -3694,7 +3683,6 @@ linux_ioctl_evdev(struct thread *td, struct > linux_ioct > int > linux_ioctl(struct thread *td, struct linux_ioctl_args *args) > { > - cap_rights_t rights; > struct file *fp; > struct handler_element *he; > int error, cmd; > @@ -3705,7 +3693,7 @@ linux_ioctl(struct thread *td, struct > linux_ioctl_args > (unsigned long)args->cmd); > #endif > > - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > &fp); > + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > if (error != 0) > return (error); > if ((fp->f_flag & (FREAD|FWRITE)) == 0) { > > Modified: head/sys/compat/linux/linux_mmap.c > > ============================================================================== > --- head/sys/compat/linux/linux_mmap.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/linux/linux_mmap.c Wed May 9 18:47:24 2018 > (r333425) > @@ -72,7 +72,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s > int bsd_flags, error; > struct file *fp; > > - cap_rights_t rights; > LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", > addr, len, prot, flags, fd, pos); > > @@ -126,7 +125,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s > * protection options specified. > */ > > - error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), > &fp); > + error = fget(td, fd, &cap_mmap_rights, &fp); > if (error != 0) > return (error); > if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_DEV) { > > Modified: head/sys/compat/linux/linux_socket.c > > ============================================================================== > --- head/sys/compat/linux/linux_socket.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/linux/linux_socket.c Wed May 9 18:47:24 2018 > (r333425) > @@ -766,7 +766,6 @@ linux_bind(struct thread *td, struct linux_bind_args * > int > linux_connect(struct thread *td, struct linux_connect_args *args) > { > - cap_rights_t rights; > struct socket *so; > struct sockaddr *sa; > struct file *fp; > @@ -788,7 +787,7 @@ linux_connect(struct thread *td, struct linux_connect_ > * when on a non-blocking socket. Instead it returns the > * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. > */ > - error = getsock_cap(td, args->s, cap_rights_init(&rights, > CAP_CONNECT), > + error = getsock_cap(td, args->s, &cap_connect_rights, > &fp, &fflag, NULL); > if (error != 0) > return (error); > @@ -824,7 +823,6 @@ linux_accept_common(struct thread *td, int s, l_uintpt > socklen_t * __restrict anamelen; > int flags; > } */ bsd_args; > - cap_rights_t rights; > struct socket *so; > struct file *fp; > int error, error1; > @@ -842,8 +840,7 @@ linux_accept_common(struct thread *td, int s, l_uintpt > if (error == EFAULT && namelen != sizeof(struct > sockaddr_in)) > return (EINVAL); > if (error == EINVAL) { > - error1 = getsock_cap(td, s, > - cap_rights_init(&rights, CAP_ACCEPT), &fp, > NULL, NULL); > + error1 = getsock_cap(td, s, &cap_accept_rights, > &fp, NULL, NULL); > if (error1 != 0) > return (error1); > so = fp->f_data; > > Modified: head/sys/compat/linux/linux_stats.c > > ============================================================================== > --- head/sys/compat/linux/linux_stats.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/compat/linux/linux_stats.c Wed May 9 18:47:24 2018 > (r333425) > @@ -103,14 +103,13 @@ translate_fd_major_minor(struct thread *td, int fd, > st > { > struct file *fp; > struct vnode *vp; > - cap_rights_t rights; > int major, minor; > > /* > * No capability rights required here. > */ > if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || > - fget(td, fd, cap_rights_init(&rights), &fp) != 0) > + fget(td, fd, &cap_no_rights, &fp) != 0) > return; > vp = fp->f_vnode; > if (vp != NULL && vp->v_rdev != NULL && > @@ -680,12 +679,11 @@ linux_newfstatat(struct thread *td, struct > linux_newfs > int > linux_syncfs(struct thread *td, struct linux_syncfs_args *args) > { > - cap_rights_t rights; > struct mount *mp; > struct vnode *vp; > int error, save; > > - error = fgetvp(td, args->fd, cap_rights_init(&rights, CAP_FSYNC), > &vp); > + error = fgetvp(td, args->fd, &cap_fsync_rights, &vp); > if (error != 0) > /* > * Linux syncfs() returns only EBADF, however fgetvp() > > Modified: head/sys/compat/linuxkpi/common/include/linux/file.h > > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/file.h Wed May 9 > 18:41:04 2018 (r333424) > +++ head/sys/compat/linuxkpi/common/include/linux/file.h Wed May 9 > 18:47:24 2018 (r333425) > @@ -50,12 +50,11 @@ extern struct fileops linuxfileops; > static inline struct linux_file * > linux_fget(unsigned int fd) > { > - cap_rights_t rights; > struct file *file; > > /* lookup file pointer by file descriptor index */ > if (fget_unlocked(curthread->td_proc->p_fd, fd, > - cap_rights_init(&rights), &file, NULL) != 0) > + &cap_no_rights, &file, NULL) != 0) > return (NULL); > > /* check if file handle really belongs to us */ > @@ -88,11 +87,10 @@ file_count(struct linux_file *filp) > static inline void > put_unused_fd(unsigned int fd) > { > - cap_rights_t rights; > struct file *file; > > if (fget_unlocked(curthread->td_proc->p_fd, fd, > - cap_rights_init(&rights), &file, NULL) != 0) { > + &cap_no_rights, &file, NULL) != 0) { > return; > } > /* > @@ -109,11 +107,10 @@ put_unused_fd(unsigned int fd) > static inline void > fd_install(unsigned int fd, struct linux_file *filp) > { > - cap_rights_t rights; > struct file *file; > > if (fget_unlocked(curthread->td_proc->p_fd, fd, > - cap_rights_init(&rights), &file, NULL) != 0) { > + &cap_no_rights, &file, NULL) != 0) { > filp->_file = NULL; > } else { > filp->_file = file; > > Modified: head/sys/dev/filemon/filemon.c > > ============================================================================== > --- head/sys/dev/filemon/filemon.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/dev/filemon/filemon.c Wed May 9 18:47:24 2018 > (r333425) > @@ -361,7 +361,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t da > int error = 0; > struct filemon *filemon; > struct proc *p; > - cap_rights_t rights; > > if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) > return (error); > @@ -377,7 +376,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t da > } > > error = fget_write(td, *(int *)data, > - cap_rights_init(&rights, CAP_PWRITE), > + &cap_pwrite_rights, > &filemon->fp); > if (error == 0) > /* Write the file header. */ > > Modified: head/sys/dev/hwpmc/hwpmc_logging.c > > ============================================================================== > --- head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:47:24 2018 > (r333425) > @@ -638,7 +638,6 @@ int > pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd) > { > struct proc *p; > - cap_rights_t rights; > int error; > > sx_assert(&pmc_sx, SA_XLOCKED); > @@ -655,8 +654,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o > po->po_file)); > > /* get a reference to the file state */ > - error = fget_write(curthread, logfd, > - cap_rights_init(&rights, CAP_WRITE), &po->po_file); > + error = fget_write(curthread, logfd, &cap_write_rights, > &po->po_file); > if (error) > goto error; > > > Modified: head/sys/fs/fdescfs/fdesc_vnops.c > > ============================================================================== > --- head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:47:24 2018 > (r333425) > @@ -286,7 +286,6 @@ fdesc_lookup(struct vop_lookup_args *ap) > struct thread *td = cnp->cn_thread; > struct file *fp; > struct fdesc_get_ino_args arg; > - cap_rights_t rights; > int nlen = cnp->cn_namelen; > u_int fd, fd1; > int error; > @@ -331,7 +330,7 @@ fdesc_lookup(struct vop_lookup_args *ap) > /* > * No rights to check since 'fp' isn't actually used. > */ > - if ((error = fget(td, fd, cap_rights_init(&rights), &fp)) != 0) > + if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0) > goto bad; > > /* Check if we're looking up ourselves. */ > @@ -613,7 +612,6 @@ static int > fdesc_readlink(struct vop_readlink_args *va) > { > struct vnode *vp, *vn; > - cap_rights_t rights; > struct thread *td; > struct uio *uio; > struct file *fp; > @@ -631,7 +629,7 @@ fdesc_readlink(struct vop_readlink_args *va) > VOP_UNLOCK(vn, 0); > > td = curthread; > - error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, NULL); > + error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); > if (error != 0) > goto out; > > > Modified: head/sys/fs/fuse/fuse_vfsops.c > > ============================================================================== > --- head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:47:24 2018 > (r333425) > @@ -222,7 +222,6 @@ fuse_vfsop_mount(struct mount *mp) > struct file *fp, *fptmp; > char *fspec, *subtype; > struct vfsoptlist *opts; > - cap_rights_t rights; > > subtype = NULL; > max_read_set = 0; > @@ -292,7 +291,7 @@ fuse_vfsop_mount(struct mount *mp) > > FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); > > - err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp); > + err = fget(td, fd, &cap_read_rights, &fp); > if (err != 0) { > FS_DEBUG("invalid or not opened device: data=%p\n", data); > goto out; > > Modified: head/sys/kern/kern_descrip.c > > ============================================================================== > --- head/sys/kern/kern_descrip.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/kern/kern_descrip.c Wed May 9 18:47:24 2018 > (r333425) > @@ -490,7 +490,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > struct filedescent *fde; > struct proc *p; > struct vnode *vp; > - cap_rights_t rights; > int error, flg, tmp; > uint64_t bsize; > off_t foffset; > @@ -548,8 +547,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > break; > > case F_GETFL: > - error = fget_fcntl(td, fd, > - cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp); > + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETFL, > &fp); > if (error != 0) > break; > td->td_retval[0] = OFLAGS(fp->f_flag); > @@ -557,8 +555,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > break; > > case F_SETFL: > - error = fget_fcntl(td, fd, > - cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp); > + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, > &fp); > if (error != 0) > break; > do { > @@ -585,8 +582,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > break; > > case F_GETOWN: > - error = fget_fcntl(td, fd, > - cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, &fp); > + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETOWN, > &fp); > if (error != 0) > break; > error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, td); > @@ -596,8 +592,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > break; > > case F_SETOWN: > - error = fget_fcntl(td, fd, > - cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, &fp); > + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETOWN, > &fp); > if (error != 0) > break; > tmp = arg; > @@ -618,8 +613,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > > case F_SETLK: > do_setlk: > - cap_rights_init(&rights, CAP_FLOCK); > - error = fget_unlocked(fdp, fd, &rights, &fp, NULL); > + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, > NULL); > if (error != 0) > break; > if (fp->f_type != DTYPE_VNODE) { > @@ -711,7 +705,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > * that the closing thread was a bit slower and that the > * advisory lock succeeded before the close. > */ > - error = fget_unlocked(fdp, fd, &rights, &fp2, NULL); > + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2, NULL); > if (error != 0) { > fdrop(fp, td); > break; > @@ -729,8 +723,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > break; > > case F_GETLK: > - error = fget_unlocked(fdp, fd, > - cap_rights_init(&rights, CAP_FLOCK), &fp, NULL); > + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, > NULL); > if (error != 0) > break; > if (fp->f_type != DTYPE_VNODE) { > @@ -767,8 +760,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ > arg = arg ? 128 * 1024: 0; > /* FALLTHROUGH */ > case F_READAHEAD: > - error = fget_unlocked(fdp, fd, > - cap_rights_init(&rights), &fp, NULL); > + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); > if (error != 0) > break; > if (fp->f_type != DTYPE_VNODE) { > @@ -1363,12 +1355,11 @@ int > kern_fstat(struct thread *td, int fd, struct stat *sbp) > { > struct file *fp; > - cap_rights_t rights; > int error; > > AUDIT_ARG_FD(fd); > > - error = fget(td, fd, cap_rights_init(&rights, CAP_FSTAT), &fp); > + error = fget(td, fd, &cap_fstat_rights, &fp); > if (error != 0) > return (error); > > @@ -1445,10 +1436,9 @@ kern_fpathconf(struct thread *td, int fd, int name, > lo > { > struct file *fp; > struct vnode *vp; > - cap_rights_t rights; > int error; > > - error = fget(td, fd, cap_rights_init(&rights, CAP_FPATHCONF), &fp); > + error = fget(td, fd, &cap_fpathconf_rights, &fp); > if (error != 0) > return (error); > > @@ -2982,10 +2972,9 @@ sys_flock(struct thread *td, struct flock_args *uap) > struct file *fp; > struct vnode *vp; > struct flock lf; > - cap_rights_t rights; > int error; > > - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FLOCK), > &fp); > + error = fget(td, uap->fd, &cap_flock_rights, &fp); > if (error != 0) > return (error); > if (fp->f_type != DTYPE_VNODE) { > @@ -3633,7 +3622,7 @@ kern_proc_filedesc_out(struct proc *p, struct sbuf > *s > #ifdef CAPABILITIES > rights = *cap_rights(fdp, i); > #else /* !CAPABILITIES */ > - cap_rights_init(&rights); > + rights = cap_no_rights; > #endif > /* > * Create sysctl entry. It is OK to drop the filedesc > > Modified: head/sys/kern/kern_event.c > > ============================================================================== > --- head/sys/kern/kern_event.c Wed May 9 18:41:04 2018 (r333424) > +++ head/sys/kern/kern_event.c Wed May 9 18:47:24 2018 (r333425) > @@ -1286,7 +1286,6 @@ kqueue_register(struct kqueue *kq, struct kevent > *kev, > struct file *fp; > struct knote *kn, *tkn; > struct knlist *knl; > - cap_rights_t rights; > int error, filt, event; > int haskqglobal, filedesc_unlock; > > @@ -1322,8 +1321,7 @@ findkn: > if (kev->ident > INT_MAX) > error = EBADF; > else > - error = fget(td, kev->ident, > - cap_rights_init(&rights, CAP_EVENT), &fp); > + error = fget(td, kev->ident, &cap_event_rights, > &fp); > if (error) > goto done; > > > Modified: head/sys/kern/kern_exec.c > > ============================================================================== > --- head/sys/kern/kern_exec.c Wed May 9 18:41:04 2018 (r333424) > +++ head/sys/kern/kern_exec.c Wed May 9 18:47:24 2018 (r333425) > @@ -374,7 +374,6 @@ do_execve(struct thread *td, struct image_args *args, > struct ucred *tracecred = NULL; > #endif > struct vnode *oldtextvp = NULL, *newtextvp; > - cap_rights_t rights; > int credential_changing; > int textset; > #ifdef MAC > @@ -455,8 +454,7 @@ interpret: > /* > * Descriptors opened only with O_EXEC or O_RDONLY are > allowed. > */ > - error = fgetvp_exec(td, args->fd, > - cap_rights_init(&rights, CAP_FEXECVE), &newtextvp); > + error = fgetvp_exec(td, args->fd, &cap_fexecve_rights, > &newtextvp); > if (error) > goto exec_fail; > vn_lock(newtextvp, LK_EXCLUSIVE | LK_RETRY); > > Modified: head/sys/kern/kern_sendfile.c > > ============================================================================== > --- head/sys/kern/kern_sendfile.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/kern/kern_sendfile.c Wed May 9 18:47:24 2018 > (r333425) > @@ -511,7 +511,6 @@ static int > sendfile_getsock(struct thread *td, int s, struct file **sock_fp, > struct socket **so) > { > - cap_rights_t rights; > int error; > > *sock_fp = NULL; > @@ -520,7 +519,7 @@ sendfile_getsock(struct thread *td, int s, struct file > /* > * The socket must be a stream socket and connected. > */ > - error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SEND), > + error = getsock_cap(td, s, &cap_send_rights, > sock_fp, NULL, NULL); > if (error != 0) > return (error); > @@ -949,7 +948,6 @@ sendfile(struct thread *td, struct sendfile_args *uap, > struct sf_hdtr hdtr; > struct uio *hdr_uio, *trl_uio; > struct file *fp; > - cap_rights_t rights; > off_t sbytes; > int error; > > @@ -1000,10 +998,8 @@ sendfile(struct thread *td, struct sendfile_args > *uap, > * sendfile(2) can start at any offset within a file so we require > * CAP_READ+CAP_SEEK = CAP_PREAD. > */ > - if ((error = fget_read(td, uap->fd, > - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { > + if ((error = fget_read(td, uap->fd, &cap_pread_rights, &fp)) != 0) > goto out; > - } > > error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, > uap->nbytes, &sbytes, uap->flags, td); > > Modified: head/sys/kern/kern_sig.c > > ============================================================================== > --- head/sys/kern/kern_sig.c Wed May 9 18:41:04 2018 (r333424) > +++ head/sys/kern/kern_sig.c Wed May 9 18:47:24 2018 (r333425) > @@ -1789,7 +1789,6 @@ int > sys_pdkill(struct thread *td, struct pdkill_args *uap) > { > struct proc *p; > - cap_rights_t rights; > int error; > > AUDIT_ARG_SIGNUM(uap->signum); > @@ -1797,8 +1796,7 @@ sys_pdkill(struct thread *td, struct pdkill_args > *uap) > if ((u_int)uap->signum > _SIG_MAXSIG) > return (EINVAL); > > - error = procdesc_find(td, uap->fd, > - cap_rights_init(&rights, CAP_PDKILL), &p); > + error = procdesc_find(td, uap->fd, &cap_pdkill_rights, &p); > if (error) > return (error); > AUDIT_ARG_PROCESS(p); > > Modified: head/sys/kern/subr_capability.c > > ============================================================================== > --- head/sys/kern/subr_capability.c Wed May 9 18:41:04 2018 > (r333424) > +++ head/sys/kern/subr_capability.c Wed May 9 18:47:24 2018 > (r333425) > @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); > > #ifdef _KERNEL > #include > - > +#include > #include > #else /* !_KERNEL */ > #include > @@ -53,6 +53,38 @@ __FBSDID("$FreeBSD$"); > > #ifdef _KERNEL > #define assert(exp) KASSERT((exp), ("%s:%u", __func__, > __LINE__)) > + > +CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT); > +CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND); > +CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT); > +CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT); > +CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR); > +CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL); > +CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE); > +CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK); > +CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF); > +CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT); > +CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC); > +CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE); > +CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME); > +CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME); > +CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT); > +CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL); > +CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN); > +CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP); > +CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID); > +CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL); > +CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD); > +CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE); > +CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ); > +CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV); > +CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND); > +CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT); > +CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN); > +CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE); > + > +__read_mostly cap_rights_t cap_no_rights; > +CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights); > #endif > > #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-all@freebsd.org Fri May 18 19:09:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21837EB1E7C; Fri, 18 May 2018 19:09:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6531848C3; Fri, 18 May 2018 19:09: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DBA11C2AB; Fri, 18 May 2018 19:09: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 w4IJ9Blv044994; Fri, 18 May 2018 19:09:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IJ9BYp044993; Fri, 18 May 2018 19:09:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201805181909.w4IJ9BYp044993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 May 2018 19:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333810 - head/sys/dev/cxgbe/tom X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/cxgbe/tom X-SVN-Commit-Revision: 333810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 19:09:12 -0000 Author: jhb Date: Fri May 18 19:09:11 2018 New Revision: 333810 URL: https://svnweb.freebsd.org/changeset/base/333810 Log: Be more robust against garbage input on a TOE TLS TX socket. If a socket is closed or shutdown and a partial record (or what appears to be a partial record) is waiting in the socket buffer, discard the partial record and close the connection rather than waiting forever for the rest of the record. Reported by: Harsh Jain @ Chelsio Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/tom/t4_tls.c Modified: head/sys/dev/cxgbe/tom/t4_tls.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tls.c Fri May 18 18:48:00 2018 (r333809) +++ head/sys/dev/cxgbe/tom/t4_tls.c Fri May 18 19:09:11 2018 (r333810) @@ -1189,17 +1189,23 @@ t4_push_tls_records(struct adapter *sc, struct toepcb /* * A full TLS header is not yet queued, stop * for now until more data is added to the - * socket buffer. + * socket buffer. However, if the connection + * has been closed, we will never get the rest + * of the header so just discard the partial + * header and close the connection. */ #ifdef VERBOSE_TRACES - CTR4(KTR_CXGBE, "%s: tid %d sbavail %d sb_off %d", - __func__, toep->tid, sbavail(sb), tls_ofld->sb_off); + CTR5(KTR_CXGBE, "%s: tid %d sbavail %d sb_off %d%s", + __func__, toep->tid, sbavail(sb), tls_ofld->sb_off, + toep->flags & TPF_SEND_FIN ? "" : " SEND_FIN"); #endif if (sowwakeup) sowwakeup_locked(so); else SOCKBUF_UNLOCK(sb); SOCKBUF_UNLOCK_ASSERT(sb); + if (toep->flags & TPF_SEND_FIN) + t4_close_conn(sc, toep); return; } @@ -1216,19 +1222,25 @@ t4_push_tls_records(struct adapter *sc, struct toepcb /* * The full TLS record is not yet queued, stop * for now until more data is added to the - * socket buffer. + * socket buffer. However, if the connection + * has been closed, we will never get the rest + * of the record so just discard the partial + * record and close the connection. */ #ifdef VERBOSE_TRACES - CTR5(KTR_CXGBE, - "%s: tid %d sbavail %d sb_off %d plen %d", + CTR6(KTR_CXGBE, + "%s: tid %d sbavail %d sb_off %d plen %d%s", __func__, toep->tid, sbavail(sb), tls_ofld->sb_off, - plen); + plen, toep->flags & TPF_SEND_FIN ? "" : + " SEND_FIN"); #endif if (sowwakeup) sowwakeup_locked(so); else SOCKBUF_UNLOCK(sb); SOCKBUF_UNLOCK_ASSERT(sb); + if (toep->flags & TPF_SEND_FIN) + t4_close_conn(sc, toep); return; } From owner-svn-src-all@freebsd.org Fri May 18 19:49:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3783DED9636; Fri, 18 May 2018 19:49:58 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB9DB86847; Fri, 18 May 2018 19:49:57 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC94C1C947; Fri, 18 May 2018 19:49:57 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IJnvE4065554; Fri, 18 May 2018 19:49:57 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IJnsAu065535; Fri, 18 May 2018 19:49:54 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201805181949.w4IJnsAu065535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 18 May 2018 19:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333811 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in vendor/NetBSD/bmake/dist: . mk X-SVN-Commit-Revision: 333811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 19:49:58 -0000 Author: sjg Date: Fri May 18 19:49:54 2018 New Revision: 333811 URL: https://svnweb.freebsd.org/changeset/base/333811 Log: Import bmake-20180512 Of relevance: o job.c: skip polling job token pipe o parse.c: be more cautious about detecting depenency line rather than sysV style include. also in mk: * dirdeps.mk: include local.dirdeps-build.mk when .MAKE.LEVEL > 0 ie. we are building something. * FILES: add dirdeps-options.mk to deal with optional DIRDEPS. * ldorder.mk: describe how to use LDORDER_EXTERN_BARRIER if needed. Added: vendor/NetBSD/bmake/dist/mk/dirdeps-options.mk (contents, props changed) Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/VERSION vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/cython.mk vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/ldorder.mk vendor/NetBSD/bmake/dist/mk/meta.autodep.mk vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/parse.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/ChangeLog Fri May 18 19:49:54 2018 (r333811) @@ -1,3 +1,16 @@ +2018-05-12 Simon J. Gerraty + + * VERSION: 20180512 + Merge with NetBSD make, pick up + o job.c: skip polling job token pipe + +2018-04-05 Simon J. Gerraty + + * VERSION: 20180405 + Merge with NetBSD make, pick up + o parse.c: be more cautious about detecting depenency line + rather than sysV style include. + 2018-02-22 Simon J. Gerraty * VERSION: 20180222 Modified: vendor/NetBSD/bmake/dist/VERSION ============================================================================== --- vendor/NetBSD/bmake/dist/VERSION Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/VERSION Fri May 18 19:49:54 2018 (r333811) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20180222 +_MAKE_VERSION=20180512 Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/bmake.1 Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.272 2018/04/02 04:26:17 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -1865,7 +1865,8 @@ expression is applied. Similarly, if the form is .Ql Ic .ifmake or -.Ql Ic .ifnmake , the +.Ql Ic .ifnmake , +the .Dq make expression is applied. .Pp Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/job.c Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.192 2018/02/08 09:05:21 dholland Exp $ */ +/* $NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.192 2018/02/08 09:05:21 dholland Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.192 2018/02/08 09:05:21 dholland Exp $"); +__RCSID("$NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -2969,7 +2969,6 @@ Job_TokenWithdraw(void) } if (DEBUG(JOB)) fprintf(debug_file, "(%d) blocked for token\n", getpid()); - wantToken = 1; return FALSE; } Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/make.1 Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.272 2018/04/02 04:26:17 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -1865,7 +1865,8 @@ expression is applied. Similarly, if the form is .Ql Ic .ifmake or -.Ql Ic .ifnmake , the +.Ql Ic .ifnmake , +the .Dq make expression is applied. .Pp Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Fri May 18 19:49:54 2018 (r333811) @@ -1,3 +1,20 @@ +2018-04-20 Simon J Gerraty + + * install-mk (MK_VERSION): 20180420 + * dirdeps.mk: include local.dirdeps-build.mk when .MAKE.LEVEL > 0 + ie. we are building something. + +2018-04-14 Simon J Gerraty + + * FILES: add dirdeps-options.mk to deal with optional DIRDEPS. + +2018-04-05 Simon J Gerraty + + * install-mk (MK_VERSION): 20180405 + + * ldorder.mk: describe how to use LDORDER_EXTERN_BARRIER + if needed. + 2018-01-18 Simon J Gerraty * install-mk (MK_VERSION): 20180118 Modified: vendor/NetBSD/bmake/dist/mk/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/mk/FILES Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/FILES Fri May 18 19:49:54 2018 (r333811) @@ -59,6 +59,7 @@ warnings.mk whats.mk yacc.mk dirdeps.mk +dirdeps-options.mk gendirdeps.mk install-new.mk meta2deps.py Modified: vendor/NetBSD/bmake/dist/mk/cython.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/cython.mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/cython.mk Fri May 18 19:49:54 2018 (r333811) @@ -1,5 +1,5 @@ # RCSid: -# $Id: cython.mk,v 1.6 2014/10/15 06:23:51 sjg Exp $ +# $Id: cython.mk,v 1.7 2018/03/25 18:46:11 sjg Exp $ # # @(#) Copyright (c) 2014, Simon J. Gerraty # @@ -14,15 +14,6 @@ # sjg@crufty.net # -# this is what we build -CYTHON_MODULE = ${CYTHON_MODULE_NAME}${CYTHON_PYVERSION}.so - -CYTHON_MODULE_NAME?= it -CYTHON_SRCS?= ${CYTHON_MODULE_NAME}.pyx - -# this is where we save generated src -CYTHON_SAVEGENDIR?= ${.CURDIR}/gen - # pyprefix is where python bits are # which may not be where we want to put ours (prefix) .if exists(/usr/pkg/include) @@ -34,13 +25,36 @@ PYTHON_VERSION?= 2.7 PYTHON_H?= ${pyprefix}/include/python${PYTHON_VERSION}/Python.h PYVERSION:= ${PYTHON_VERSION:C,\..*,,} +CFLAGS+= -I${PYTHON_H:H} + +# conf.host_target() is limited to uname -m rather than uname -p +_HOST_MACHINE!= uname -m +.if ${HOST_TARGET:M*${_HOST_MACHINE}} == "" +PY_HOST_TARGET:= ${HOST_TARGET:S,${_HOST_ARCH:U${uname -p:L:sh}}$,${_HOST_MACHINE},} +.endif + +COMPILE.c?= ${CC} -c ${CFLAGS} +PICO?= .pico + +.SUFFIXES: ${PICO} .c + +.c${PICO}: + ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} + +# this is what we build +.if !empty(CYTHON_MODULE_NAME) +CYTHON_MODULE = ${CYTHON_MODULE_NAME}${CYTHON_PYVERSION}.so + +CYTHON_SRCS?= ${CYTHON_MODULE_NAME}.pyx + +# this is where we save generated src +CYTHON_SAVEGENDIR?= ${.CURDIR}/gen + # set this empty if you don't want to handle multiple versions .if !defined(CYTHON_PYVERSION) CYTHON_PYVERSION:= ${PYVERSION} .endif -CFLAGS+= -I${PYTHON_H:H} - CYTHON_GENSRCS= ${CYTHON_SRCS:R:S,$,${CYTHON_PYVERSION}.c,} SRCS+= ${CYTHON_GENSRCS} @@ -70,20 +84,9 @@ save-gen: ${CYTHON_GENSRCS} .endif -COMPILE.c?= ${CC} -c ${CFLAGS} +${CYTHON_MODULE}: ${SRCS:S,.c,${PICO},} + ${CC} ${CC_SHARED:U-shared} -o ${.TARGET} ${.ALLSRC:M*${PICO}} ${LDADD} -.c.So: - ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} - -${CYTHON_MODULE}: ${SRCS:S,.c,.So,} - ${CC} ${CC_SHARED:U-shared} -o ${.TARGET} ${.ALLSRC:M*.So} ${LDADD} - -# conf.host_target() is limited to uname -m rather than uname -p -_HOST_MACHINE!= uname -m -.if ${HOST_TARGET:M*${_HOST_MACHINE}} == "" -PY_HOST_TARGET:= ${HOST_TARGET:S,${_HOST_ARCH:U${uname -p:L:sh}}$,${_HOST_MACHINE},} -.endif - MODULE_BINDIR?= ${.CURDIR:H}/${PY_HOST_TARGET:U${HOST_TARGET}} build-cython-module: ${CYTHON_MODULE} @@ -93,4 +96,6 @@ install-cython-module: ${CYTHON_MODULE} ${INSTALL} -d ${DESTDIR}${MODULE_BINDIR} ${INSTALL} -m 755 ${.ALLSRC} ${DESTDIR}${MODULE_BINDIR} -CLEANFILES+= *.So ${CYTHON_MODULE} +CLEANFILES+= *${PICO} ${CYTHON_MODULE} + +.endif Added: vendor/NetBSD/bmake/dist/mk/dirdeps-options.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/bmake/dist/mk/dirdeps-options.mk Fri May 18 19:49:54 2018 (r333811) @@ -0,0 +1,70 @@ +# $Id: dirdeps-options.mk,v 1.5 2018/04/18 15:53:57 sjg Exp $ +# +# @(#) Copyright (c) 2018, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +## +# +# This makefile is used to deal with optional DIRDEPS. +# +# It is to be included by Makefile.depend.options in a +# directory which has DIRDEPS affected by optional features. +# Makefile.depend.options should set DIRDEPS_OPTIONS and +# may also set specific DIRDEPS.* for those options. +# +# If a Makefile.depend.options file exists, it will be included by +# dirdeps.mk and meta.autodep.mk +# +# We include local.dirdeps-option.mk which may also define DIRDEPS.* +# for options. +# +# Thus a directory, that is affected by an option FOO would have +# a Makefile.depend.options that sets +# DIRDEPS_OPTIONS= FOO +# It can also set either/both of +# DIRDEPS.FOO.yes +# DIRDEPS.FOO.no +# to whatever applies for that dir, or it can rely on globals +# set in local.dirdeps-option.mk +# Either way, we will .undef DIRDEPS.* when done. + +# This should have been set by Makefile.depend.options +# before including us +DIRDEPS_OPTIONS ?= + +# pickup any DIRDEPS.* we need +.-include + +.if ${.MAKE.LEVEL} == 0 +# :U below avoids potential errors when we := +.for o in ${DIRDEPS_OPTIONS:tu} +DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U} +.endfor +DIRDEPS := ${DIRDEPS:O:u} +# avoid cross contamination +.undef ${DIRDEPS_OPTIONS:tu:@o@DIRDEPS.$o.yes DIRDEPS.$o.no@} +.else +# whether options are enabled or not, +# we want to filter out the relevant DIRDEPS.* +# we should only be included by meta.autodep.mk +# if dependencies are to be updated +.for o in ${DIRDEPS_OPTIONS:tu} +.for d in ${DIRDEPS.$o.yes} ${DIRDEPS.$o.no} +.if exists(${SRCTOP}/$d) +GENDIRDEPS_FILTER += N$d* +.elif exists(${SRCTOP}/${d:R}) +GENDIRDEPS_FILTER += N${d:R}* +.endif +.endfor +.endfor +.endif Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Fri May 18 19:49:54 2018 (r333811) @@ -1,17 +1,17 @@ -# $Id: dirdeps.mk,v 1.90 2017/10/25 23:44:20 sjg Exp $ +# $Id: dirdeps.mk,v 1.95 2018/04/23 17:53:56 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# 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. +# 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. -# +# 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 @@ -22,7 +22,7 @@ # 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. +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Much of the complexity here is for supporting cross-building. # If a tree does not support that, simply using plain Makefile.depend @@ -56,7 +56,7 @@ # .MAKE.DEPENDFILE_PREFIX) to refer to these makefiles to # distinguish them from others. # -# Before each Makefile.depend file is read, we set +# Before each Makefile.depend file is read, we set # DEP_RELDIR to be the RELDIR (path relative to SRCTOP) for # its directory, and DEP_MACHINE etc according to the . # represented by the suffix of the corresponding target. @@ -89,7 +89,7 @@ # # For example: # -# # Always list MACHINE first, +# # Always list MACHINE first, # # other variables might be optional. # TARGET_SPEC_VARS = MACHINE TARGET_OS # .if ${TARGET_SPEC:Uno:M*,*} != "" @@ -101,7 +101,7 @@ # # and deal with MACHINE=${TARGET_SPEC} in the environment. # TARGET_SPEC = # # export but do not track -# .export-env TARGET_SPEC +# .export-env TARGET_SPEC # .export ${TARGET_SPEC_VARS} # .for v in ${TARGET_SPEC_VARS:O:u} # .if empty($v) @@ -328,7 +328,7 @@ _DEP_RELDIR := ${DEP_RELDIR} .endif # DIRDEPS_CACHE can be very handy for debugging. -# Also if repeatedly building the same target, +# Also if repeatedly building the same target, # we can avoid the overhead of re-computing the tree dependencies. MK_DIRDEPS_CACHE ?= no BUILD_DIRDEPS_CACHE ?= no @@ -441,7 +441,7 @@ _only_machines := ${_only_machines:O:u} # make sure we have a starting place? DIRDEPS ?= ${RELDIR} -.endif # target +.endif # target .if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" @@ -451,7 +451,7 @@ build-dirdeps: M_oneperline = @x@\\${.newline} $$x@ -.if ${BUILD_DIRDEPS_CACHE} == "no" +.if ${BUILD_DIRDEPS_CACHE} == "no" .if !target(dirdeps-cached) # we do this via sub-make BUILD_DIRDEPS = no @@ -469,7 +469,7 @@ dirdeps-cached: ${DIRDEPS_CACHE} .MAKE BUILD_DIRDEPS_MAKEFILE ?= ${MAKEFILE} BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} -# we need the .meta file to ensure we update if +# we need the .meta file to ensure we update if # any of the Makefile.depend* changed. # We do not want to compare the command line though. ${DIRDEPS_CACHE}: .META .NOMETA_CMP @@ -528,6 +528,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR} # on rare occasions, there can be a need for extra help _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc .-include <${_dep_hack}> +.-include <${_dep_hack:R}.options> .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC} # this should be all @@ -581,7 +582,7 @@ _build_dirs += ${_machines:N${DEP_TARGET_SPEC}:@m@${_C .if ${_debug_reldir} .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: DIRDEPS='${DIRDEPS}' -.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _machines='${_machines}' +.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _machines='${_machines}' .endif .if !empty(DIRDEPS) @@ -589,7 +590,7 @@ _build_dirs += ${_machines:N${DEP_TARGET_SPEC}:@m@${_C DEP_DIRDEPS_FILTER = \ ${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \ ${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \ - ${DIRDEPS_FILTER:U} + ${DIRDEPS_FILTER:U} .if empty(DEP_DIRDEPS_FILTER) # something harmless DEP_DIRDEPS_FILTER = U @@ -598,7 +599,7 @@ DEP_DIRDEPS_FILTER = U # this is what we start with __depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:O:u:@d@${SRCTOP}/$d@} -# some entries may be qualified with . +# some entries may be qualified with . # the :M*/*/*.* just tries to limit the dirs we check to likely ones. # the ${d:E:M*/*} ensures we don't consider junos/usr.sbin/mgd __qual_depdirs := ${__depdirs:M*/*/*.*:@d@${exists($d):?:${"${d:E:M*/*}":?:${exists(${d:R}):?$d:}}}@} @@ -606,7 +607,8 @@ __unqual_depdirs := ${__depdirs:${__qual_depdirs:Uno:$ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # if it was called out - we likely need it. -__hostdpadd := ${DPADD:U.:M${HOST_OBJTOP}/*:S,${HOST_OBJTOP}/,,:H:${NSkipDir}:${DIRDEPS_FILTER:ts:}:S,$,.host,:N.*:@d@${SRCTOP}/$d@} +__hostdpadd := ${DPADD:U.:M${HOST_OBJTOP}/*:S,${HOST_OBJTOP}/,,:H:${NSkipDir}:${DIRDEPS_FILTER:ts:}:S,$,.host,:N.*:@d@${SRCTOP}/$d@} \ + ${DPADD:U.:M${HOST_OBJTOP32:Uno}/*:S,${HOST_OBJTOP32:Uno}/,,:H:${NSkipDir}:${DIRDEPS_FILTER:ts:}:S,$,.host32,:N.*:@d@${SRCTOP}/$d@} __qual_depdirs += ${__hostdpadd} .endif @@ -710,7 +712,7 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_dtspec:[$i]} .else DEP_MACHINE := ${_DEP_MACHINE} .endif -# Warning: there is an assumption here that MACHINE is always +# Warning: there is an assumption here that MACHINE is always # the first entry in TARGET_SPEC_VARS. # If TARGET_SPEC and MACHINE are insufficient, you have a problem. _m := ${.MAKE.DEPENDFILE_PREFERENCE:T:S;${TARGET_SPEC}$;${d:E};:S;${MACHINE};${d:E:C/,.*//};:@m@${exists(${d:R}/$m):?${d:R}/$m:}@:[1]} @@ -720,7 +722,7 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M_dep_qual_fixe .if ${_debug_search} .info Looking for ${_qm} .endif -# set this "just in case" +# set this "just in case" # we can skip :tA since we computed the path above DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,} # and reset this @@ -743,6 +745,10 @@ DIRDEPS = # we are building something DEP_RELDIR := ${RELDIR} _DEP_RELDIR := ${RELDIR} +# Since we are/should be included by .MAKE.DEPENDFILE +# is is a final opportunity to add/hook global rules. +.-include + # pickup local dependencies .if ${MAKE_VERSION} < 20160220 .-include <.depend> Modified: vendor/NetBSD/bmake/dist/mk/gendirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.37 2018/01/31 19:06:46 sjg Exp $ +# $Id: gendirdeps.mk,v 1.38 2018/03/10 00:53:52 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -160,6 +160,12 @@ META2DEPS_CMD += -S ${SB_BACKING_SB}/src M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX} .endif +GENDIRDEPS_SEDCMDS += \ + -e 's,//*$$,,;s,\.${HOST_TARGET:Uhost}$$,.host,' \ + -e 's,\.${HOST_TARGET32:Uhost32}$$,.host32,' \ + -e 's,\.${MACHINE}$$,,' \ + -e 's:\.${TARGET_SPEC:U${MACHINE}}$$::' + # we are only interested in the dirs # specifically those we read something from. # we canonicalize them to keep things simple @@ -170,7 +176,7 @@ dir_list != cd ${_OBJDIR} && \ SRCTOP=${SRCTOP} RELDIR=${RELDIR} CURDIR=${_CURDIR} \ ${META2DEPS_ARGS} \ ${META_FILES:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ - sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,' + sed ${GENDIRDEPS_SEDCMDS} .if ${dir_list:M*ERROR\:*} != "" .warning ${dir_list:tW:C,.*(ERROR),\1,} @@ -194,7 +200,7 @@ dpadd_dir_list += ${f:H:tA} .endfor .if !empty(ddep_list) ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ - sed 's,//*$$,,;s,\.${HOST_TARGET:Uhost}$$,.host,;s,\.${HOST_TARGET32:Uhost32}$$,.host32,;s,\.${MACHINE}$$,,' + sed ${GENDIRDEPS_SEDCMDS} .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" .info ${RELDIR}: raw_dir_list='${dir_list}' Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/install-mk Fri May 18 19:49:54 2018 (r333811) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.153 2018/01/24 22:57:11 sjg Exp $ +# $Id: install-mk,v 1.156 2018/04/22 04:42:47 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20180118 +MK_VERSION=20180420 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/ldorder.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ldorder.mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/ldorder.mk Fri May 18 19:49:54 2018 (r333811) @@ -1,14 +1,14 @@ -# $Id: ldorder.mk,v 1.18 2018/02/11 18:27:59 sjg Exp $ +# $Id: ldorder.mk,v 1.25 2018/04/24 23:50:26 sjg Exp $ # # @(#) Copyright (c) 2015, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -27,14 +27,21 @@ .if !target(_LDORDER_USE) # does caller want to use ldorder? # yes for prog, normally no for lib -_ldorder_use := ${.ALLTARGETS:Mldorder} +.if ${.ALLTARGETS:Mldorder} != "" +_ldorder_use: +.endif +# define this if we need a barrier between local and external libs +# see below +LDORDER_EXTERN_BARRIER ?= .ldorder-extern-barrier + .-include # convert /path/to/libfoo.a into _{LIBFOO} LDORDER_INC_FILTER += S,+,PLUS,g S,.so$$,,g LDORDER_LIBS_FILTER += O:u LDORDER_INC ?= ldorder.inc +# for meta mode REFERENCE_FILE ?= : _LDORDER_USE: .ldorder-rm .USE .NOTMAIN @@ -72,9 +79,27 @@ LDADD_LDORDER ?= `cat ldorder` # for debug below _ldorder = ${RELDIR}.${TARGET_SPEC} +# we make have some libs that exist outside of $SB +# and want to insert a barrier +.if target(${LDORDER_EXTERN_BARRIER}) +# eg. in local.ldorder.mk +# ${LDORDER_EXTERN_BARRIER}: +# @test -z "${extern_ldorders}" || \ +# echo -Wl,-Bdynamic >> .ldorder +# +# feel free to put more suitable version in local.ldorder.mk if needed +# we do *not* count host libs in extern_ldorders +extern_ldorders ?= ${__dpadd_libs:tA:N/lib*:N/usr/lib*:N${SB}/*:N${SB_OBJROOT:tA}*:T:${LDORDER_LIBS_FILTER:ts:}:R:C/\.so.*//:S,^,.ldorder-,:N.ldorder-} +sb_ldorders ?= ${.ALLTARGETS:M.ldorder-*:N${LDORDER_EXTERN_BARRIER}:N.ldorder-rm:${extern_ldorders:${M_ListToSkip}}:N.ldorder-} + +# finally in Makefile after include of *.mk put +# .ldorder ${sb_ldorders}: ${LDORDER_EXTERN_BARRIER} +# ${LDORDER_EXTERN_BARRIER}: ${extern_ldorders} +.endif + .endif # !target(_LDORDER_USE) -.if !empty(LDORDER_LIBS) && !empty(_ldorder_use) +.if !empty(LDORDER_LIBS) && target(_ldorder_use) # canonicalize - these are just tokens anyway LDORDER_LIBS := ${LDORDER_LIBS:${LDORDER_LIBS_FILTER:ts:}:R:C/\.so.*//} _ldorders := ${LDORDER_LIBS:T:Mlib*:S,^,.ldorder-,} @@ -108,6 +133,7 @@ ${_ldorder}: ${_ldorders} __${__inc}__: # make sure this is reset LDORDER_LIBS = +_ldorders = .-include <${__inc}> .endif .endfor @@ -119,9 +145,12 @@ LDORDER_LIBS = # to add extra content - like CFLAGS libLDORDER_INC = lib${LIB}.${LDORDER_INC} .if !commands(${libLDORDER_INC}) +.if target(ldorder-header) +${libLDORDER_INC}: ldorder-header +.endif ${libLDORDER_INC}: @(cat /dev/null ${.ALLSRC:M*ldorder*}; \ - echo 'LDORDER_LIBS= ${_LDORDER_LIBS:T:R:${LDORDER_INC_FILTER:ts:}:tu:C,.*,_{&},}'; \ + echo 'LDORDER_LIBS= ${_LDORDER_LIBS:T:R:${LDORDER_INC_FILTER:ts:}:tu:C,.*,_{&},:N_{}}'; \ echo; echo '.include ' ) | sed 's,_{,$${,g' > ${.TARGET} .endif .endif Modified: vendor/NetBSD/bmake/dist/mk/meta.autodep.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.46 2017/10/25 23:44:20 sjg Exp $ +# $Id: meta.autodep.mk,v 1.48 2018/04/15 06:30:04 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -6,10 +6,10 @@ # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -39,7 +39,7 @@ ${s:T:R}$e: $s # you are supposed to know what you are doing! UPDATE_DEPENDFILE = yes .elif !empty(.TARGETS) && !make(all) -# do not update the *depend* files +# do not update the *depend* files # unless we are building the entire directory or the default target. # NO means don't update .depend - or Makefile.depend* # no means update .depend but not Makefile.depend* @@ -119,7 +119,7 @@ META_FILE_FILTER ?= N.meta META_FILE_FILTER += Ndirdeps.cache* .if !empty(DPADD) -# if we have any non-libs in DPADD, +# if we have any non-libs in DPADD, # they probably need to be paid attention to .if !empty(DPLIBS) FORCE_DPADD = ${DPADD:${DPLIBS:${M_ListToSkip}}:${DPADD_LAST:${M_ListToSkip}}} @@ -138,8 +138,8 @@ FORCE_DPADD += ${_nonlibs:@x@${DPADD:M*/$x}@} # if we don't have OBJS, then .depend isn't useful .if !target(.depend) && (!empty(OBJS) || ${.ALLTARGETS:M*.o} != "") # some makefiles and/or targets contain -# circular dependencies if you dig too deep -# (as meta mode is apt to do) +# circular dependencies if you dig too deep +# (as meta mode is apt to do) # so we provide a means of suppressing them. # the input to the loop below is target: dependency # with just one dependency per line. @@ -155,13 +155,13 @@ SUPPRESS_DEPEND += \ # we use ${.MAKE.META.CREATED} to trigger an update but # we process using ${.MAKE.META.FILES} # the double $$ defers initial evaluation -# if necessary, we fake .po dependencies, just so the result +# if necessary, we fake .po dependencies, just so the result # in Makefile.depend* is stable # The current objdir may be referred to in various ways OBJDIR_REFS += ${.OBJDIR} ${.OBJDIR:tA} ${_OBJDIR} ${RELOBJTOP}/${RELDIR} _depend = .depend # it would be nice to be able to get .SUFFIXES as ${.SUFFIXES} -# we actually only care about the .SUFFIXES of files that might be +# we actually only care about the .SUFFIXES of files that might be # generated by tools like yacc. DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx .hxx .cc .hh .depend: .NOMETA $${.MAKE.META.CREATED} ${_this} @@ -253,8 +253,13 @@ META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O .info ${_DEPENDFILE:S,${SRCTOP}/,,}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} xtras=${META_XTRAS} .endif -.if ${.MAKE.LEVEL} > 0 && !empty(GENDIRDEPS_FILTER) +.if ${.MAKE.LEVEL} > 0 +.if ${UPDATE_DEPENDFILE} == "yes" +.-include <${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}.options> +.endif +.if !empty(GENDIRDEPS_FILTER) .export GENDIRDEPS_FILTER +.endif .endif # we might have .../ in MAKESYSPATH Modified: vendor/NetBSD/bmake/dist/mk/own.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/own.mk Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/mk/own.mk Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -# $Id: own.mk,v 1.39 2018/01/26 20:08:16 sjg Exp $ +# $Id: own.mk,v 1.40 2018/04/23 04:53:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -91,7 +91,7 @@ OPTIONS_DEFAULT_NO+= DPADD_MK OPTIONS_DEFAULT_NO+= \ INSTALL_AS_USER \ GPROF \ - LDORDER_MK \ + PROG_LDORDER_MK \ LIBTOOL \ LINT \ @@ -114,7 +114,7 @@ OPTIONS_DEFAULT_YES+= \ OPTIONS_DEFAULT_DEPENDENT+= \ CATPAGES/MAN \ - PROG_LDORDER_MK/LDORDER_MK \ + LDORDER_MK/PROG_LDORDER_MK \ OBJDIRS/OBJ \ PICINSTALL/LINKLIB \ PICLIB/PIC \ Modified: vendor/NetBSD/bmake/dist/parse.c ============================================================================== --- vendor/NetBSD/bmake/dist/parse.c Fri May 18 19:09:11 2018 (r333810) +++ vendor/NetBSD/bmake/dist/parse.c Fri May 18 19:49:54 2018 (r333811) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"); #endif #endif /* not lint */ #endif @@ -371,9 +371,6 @@ static void ParseHasCommands(void *); static void ParseDoInclude(char *); static void ParseSetParseFile(const char *); static void ParseSetIncludedFile(void); -#ifdef SYSVINCLUDE -static void ParseTraditionalInclude(char *); -#endif #ifdef GMAKEEXPORT static void ParseGmakeExport(char *); #endif @@ -2519,8 +2516,73 @@ Parse_SetInput(const char *name, int line, int fd, ParseSetParseFile(name); } +/*- + *----------------------------------------------------------------------- + * IsInclude -- + * Check if the line is an include directive + * + * Results: + * TRUE if it is. + * + * Side Effects: + * None + * + *----------------------------------------------------------------------- + */ +static Boolean +IsInclude(const char *line, Boolean sysv) +{ + static const char inc[] = "include"; + static const size_t inclen = sizeof(inc) - 1; + + // 'd' is not valid for sysv + int o = strchr(&("ds-"[sysv]), *line) != NULL; + + if (strncmp(line + o, inc, inclen) != 0) + return FALSE; + + // Space is not mandatory for BSD .include + return !sysv || isspace((unsigned char)line[inclen + o]); +} + + #ifdef SYSVINCLUDE /*- + *----------------------------------------------------------------------- + * IsSysVInclude -- + * Check if the line is a SYSV include directive + * + * Results: + * TRUE if it is. + * + * Side Effects: + * None + * + *----------------------------------------------------------------------- + */ +static Boolean +IsSysVInclude(const char *line) +{ + const char *p; + + if (!IsInclude(line, TRUE)) + return FALSE; + + /* Avoid interpeting a dependency line as an include */ + for (p = line; (p = strchr(p, ':')) != NULL;) { + if (*++p == '\0') { + /* end of line -> dependency */ + return FALSE; + } + if (*p == ':' || isspace((unsigned char)*p)) { + /* :: operator or ': ' -> dependency */ + return FALSE; + } + } + return TRUE; +} + +/*- *--------------------------------------------------------------------- * ParseTraditionalInclude -- * Push to another file. @@ -3019,9 +3081,7 @@ Parse_File(const char *name, int fd) for (cp = line + 1; isspace((unsigned char)*cp); cp++) { continue; } - if (strncmp(cp, "include", 7) == 0 || - ((cp[0] == 'd' || cp[0] == 's' || cp[0] == '-') && - strncmp(&cp[1], "include", 7) == 0)) { + if (IsInclude(cp, FALSE)) { ParseDoInclude(cp); continue; } @@ -3083,12 +3143,7 @@ Parse_File(const char *name, int fd) } #ifdef SYSVINCLUDE - if (((strncmp(line, "include", 7) == 0 && - isspace((unsigned char) line[7])) || - ((line[0] == 's' || line[0] == '-') && - strncmp(&line[1], "include", 7) == 0 && - isspace((unsigned char) line[8]))) && - strchr(line, ':') == NULL) { + if (IsSysVInclude(line)) { /* * It's an S3/S5-style "include". */ From owner-svn-src-all@freebsd.org Fri May 18 19:50:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16A7EED966E; Fri, 18 May 2018 19:50:23 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B844086965; Fri, 18 May 2018 19:50:22 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F4DC1C94B; Fri, 18 May 2018 19:50:22 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IJoMnK065647; Fri, 18 May 2018 19:50:22 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IJoMoD065646; Fri, 18 May 2018 19:50:22 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201805181950.w4IJoMoD065646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 18 May 2018 19:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r333812 - vendor/NetBSD/bmake/20180512 X-SVN-Group: vendor X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: vendor/NetBSD/bmake/20180512 X-SVN-Commit-Revision: 333812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 19:50:23 -0000 Author: sjg Date: Fri May 18 19:50:22 2018 New Revision: 333812 URL: https://svnweb.freebsd.org/changeset/base/333812 Log: tag bmake-20180512 Added: vendor/NetBSD/bmake/20180512/ - copied from r333811, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Fri May 18 20:13:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0501CEDA1E8; Fri, 18 May 2018 20:13:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A902C878EF; Fri, 18 May 2018 20:13:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B2A61CE2C; Fri, 18 May 2018 20:13:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IKDn5l080972; Fri, 18 May 2018 20:13:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IKDY64080900; Fri, 18 May 2018 20:13:34 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805182013.w4IKDY64080900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 20:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333813 - in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/ralink arm/ti/cpsw arm/xscale/ixp425 compat/linux contrib/ipfilter/netinet dev/ae dev/age dev/al_eth dev/alc dev/ale... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/at91 arm/cavium/cns11xx arm/ralink arm/ti/cpsw arm/xscale/ixp425 compat/linux contrib/ipfilter/netinet dev/ae dev/age dev/al_eth dev/alc dev/ale dev/altera/atse dev/ath ... X-SVN-Commit-Revision: 333813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 20:13:50 -0000 Author: mmacy Date: Fri May 18 20:13:34 2018 New Revision: 333813 URL: https://svnweb.freebsd.org/changeset/base/333813 Log: ifnet: Replace if_addr_lock rwlock with epoch + mutex Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Modified: head/sys/arm/allwinner/if_emac.c head/sys/arm/at91/if_ate.c head/sys/arm/at91/if_macb.c head/sys/arm/cavium/cns11xx/if_ece.c head/sys/arm/ralink/if_fv.c head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/xscale/ixp425/if_npe.c head/sys/compat/linux/linux_ioctl.c head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c head/sys/dev/ae/if_ae.c head/sys/dev/age/if_age.c head/sys/dev/al_eth/al_eth.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/altera/atse/if_atse.c head/sys/dev/ath/if_ath.c head/sys/dev/bce/if_bce.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bm/if_bm.c head/sys/dev/bxe/bxe.c head/sys/dev/cas/if_cas.c head/sys/dev/cs/if_cs.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/dc/if_dc.c head/sys/dev/de/if_de.c head/sys/dev/dwc/if_dwc.c head/sys/dev/ed/if_ed.c head/sys/dev/et/if_et.c head/sys/dev/ex/if_ex.c head/sys/dev/fe/if_fe.c head/sys/dev/ffec/if_ffec.c head/sys/dev/gem/if_gem.c head/sys/dev/hme/if_hme.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/jme/if_jme.c head/sys/dev/le/lance.c head/sys/dev/lge/if_lge.c head/sys/dev/liquidio/lio_ioctl.c head/sys/dev/malo/if_malo.c head/sys/dev/mge/if_mge.c head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/msk/if_msk.c head/sys/dev/mxge/if_mxge.c head/sys/dev/my/if_my.c head/sys/dev/nge/if_nge.c head/sys/dev/oce/oce_hw.c head/sys/dev/otus/if_otus.c head/sys/dev/pcn/if_pcn.c head/sys/dev/qlnx/qlnxe/qlnx_os.c head/sys/dev/qlxgb/qla_os.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxge/qls_os.c head/sys/dev/re/if_re.c head/sys/dev/rl/if_rl.c head/sys/dev/rtwn/if_rtwn_rx.c head/sys/dev/sf/if_sf.c head/sys/dev/sfxge/sfxge_port.c head/sys/dev/sge/if_sge.c head/sys/dev/sis/if_sis.c head/sys/dev/sk/if_sk.c head/sys/dev/sn/if_sn.c head/sys/dev/ste/if_ste.c head/sys/dev/stge/if_stge.c head/sys/dev/ti/if_ti.c head/sys/dev/tl/if_tl.c head/sys/dev/tsec/if_tsec.c head/sys/dev/tx/if_tx.c head/sys/dev/txp/if_txp.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_smsc.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_ure.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/vge/if_vge.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vr/if_vr.c head/sys/dev/vte/if_vte.c head/sys/dev/wb/if_wb.c head/sys/dev/wi/if_wi.c head/sys/dev/xe/if_xe.c head/sys/dev/xen/netfront/netfront.c head/sys/dev/xl/if_xl.c head/sys/kern/subr_witness.c head/sys/modules/Makefile head/sys/net/if.c head/sys/net/if_lagg.c head/sys/net/if_spppsubr.c head/sys/net/if_stf.c head/sys/net/if_tap.c head/sys/net/if_tun.c head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/net/rtsock.c head/sys/netgraph/ng_eiface.c head/sys/netinet/if_ether.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_debug.c head/sys/netinet/in_mcast.c head/sys/netinet/in_pcb.c head/sys/netinet/in_var.h head/sys/netinet/ip_carp.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/raw_ip.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_input.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_rtr.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/pf/pf_if.c head/sys/nfs/bootp_subr.c head/sys/nfs/nfs_diskless.c head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c head/sys/ofed/include/rdma/ib_addr.h head/sys/powerpc/ps3/if_glc.c head/sys/powerpc/pseries/phyp_llan.c Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/allwinner/if_emac.c Fri May 18 20:13:34 2018 (r333813) @@ -240,7 +240,7 @@ emac_set_rx_mode(struct emac_softc *sc) hashes[1] = 0xffffffff; } else { if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->emac_ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->emac_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/at91/if_ate.c Fri May 18 20:13:34 2018 (r333813) @@ -535,7 +535,7 @@ ate_setmcast(struct ate_softc *sc) mcaf[0] = 0; mcaf[1] = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = ate_mac_hash(LLADDR((struct sockaddr_dl *) Modified: head/sys/arm/at91/if_macb.c ============================================================================== --- head/sys/arm/at91/if_macb.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/at91/if_macb.c Fri May 18 20:13:34 2018 (r333813) @@ -1137,7 +1137,7 @@ set_filter(struct macb_softc *sc) multicast_filter[0] = 0; multicast_filter[1] = 0; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; count++; Modified: head/sys/arm/cavium/cns11xx/if_ece.c ============================================================================== --- head/sys/arm/cavium/cns11xx/if_ece.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/cavium/cns11xx/if_ece.c Fri May 18 20:13:34 2018 (r333813) @@ -1839,7 +1839,7 @@ set_filter(struct ece_softc *sc) return; } if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; add_mac_entry(sc, Modified: head/sys/arm/ralink/if_fv.c ============================================================================== --- head/sys/arm/ralink/if_fv.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/ralink/if_fv.c Fri May 18 20:13:34 2018 (r333813) @@ -227,7 +227,7 @@ fv_setfilt(struct fv_softc *sc) i = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; ma = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri May 18 20:13:34 2018 (r333813) @@ -2465,7 +2465,7 @@ cpswp_ale_update_addresses(struct cpswp_softc *sc, int /* Set other multicast addrs desired. */ if_maddr_rlock(sc->ifp); - TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; cpsw_ale_mc_entry_set(sc->swsc, portmask, sc->vlan, Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/arm/xscale/ixp425/if_npe.c Fri May 18 20:13:34 2018 (r333813) @@ -435,7 +435,7 @@ npe_setmcast(struct npe_softc *sc) memset(set, 0xff, ETHER_ADDR_LEN); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mac = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/compat/linux/linux_ioctl.c Fri May 18 20:13:34 2018 (r333813) @@ -2241,7 +2241,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) ifc.ifc_len = 0; IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; if (sa->sa_family == AF_INET) ifc.ifc_len += sizeof(ifr); @@ -2282,7 +2282,7 @@ again: strlcpy(ifr.ifr_name, ifp->if_xname, LINUX_IFNAMSIZ); /* Walk the address list */ - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct sockaddr *sa = ifa->ifa_addr; if (sa->sa_family == AF_INET) { @@ -2361,7 +2361,7 @@ linux_gifhwaddr(struct ifnet *ifp, struct l_ifreq *ifr if (ifp->if_type != IFT_ETHER) return (ENOENT); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { sdl = (struct sockaddr_dl*)ifa->ifa_addr; if (sdl != NULL && (sdl->sdl_family == AF_LINK) && (sdl->sdl_type == IFT_ETHER)) { Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Fri May 18 19:50:22 2018 (r333812) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Fri May 18 20:13:34 2018 (r333813) @@ -227,7 +227,7 @@ struct route; struct mbuf; struct ifnet { char if_xname[IFNAMSIZ]; - TAILQ_HEAD(, ifaddr) if_addrlist; + STAILQ_HEAD(, ifaddr) if_addrlist; int (*if_output)(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); }; Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Fri May 18 20:13:34 2018 (r333813) @@ -1021,7 +1021,7 @@ ipf_ifpaddr(softc, v, atype, ifptr, inp, inpmask) else if (v == 6) bzero((char *)inp, sizeof(*inp)); #endif - ifa = TAILQ_FIRST(&ifp->if_addrhead); + ifa = CK_STAILQ_FIRST(&ifp->if_addrhead); sock = ifa->ifa_addr; while (sock != NULL && ifa != NULL) { @@ -1036,7 +1036,7 @@ ipf_ifpaddr(softc, v, atype, ifptr, inp, inpmask) break; } #endif - ifa = TAILQ_NEXT(ifa, ifa_link); + ifa = CK_STAILQ_NEXT(ifa, ifa_link); if (ifa != NULL) sock = ifa->ifa_addr; } Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ae/if_ae.c Fri May 18 20:13:34 2018 (r333813) @@ -2071,7 +2071,7 @@ ae_rxfilter(ae_softc_t *sc) */ bzero(mchash, sizeof(mchash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/age/if_age.c Fri May 18 20:13:34 2018 (r333813) @@ -3170,7 +3170,7 @@ age_rxfilter(struct age_softc *sc) bzero(mchash, sizeof(mchash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/al_eth/al_eth.c ============================================================================== --- head/sys/dev/al_eth/al_eth.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/al_eth/al_eth.c Fri May 18 20:13:34 2018 (r333813) @@ -2891,7 +2891,7 @@ al_eth_set_rx_mode(struct al_eth_adapter *adapter) unsigned char *mac; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (mc == MAX_NUM_MULTICAST_ADDRESSES) @@ -2905,7 +2905,7 @@ al_eth_set_rx_mode(struct al_eth_adapter *adapter) if_maddr_runlock(ifp); if_addr_rlock(ifp); - TAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) { if (ifua->ifa_addr->sa_family != AF_LINK) continue; if (uc == MAX_NUM_ADDRESSES) @@ -2951,7 +2951,7 @@ al_eth_set_rx_mode(struct al_eth_adapter *adapter) /* set new addresses */ i = AL_ETH_MAC_TABLE_UNICAST_IDX_BASE + 1; if_addr_rlock(ifp); - TAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifua, &ifp->if_addrhead, ifa_link) { if (ifua->ifa_addr->sa_family != AF_LINK) { continue; } Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/alc/if_alc.c Fri May 18 20:13:34 2018 (r333813) @@ -4608,7 +4608,7 @@ alc_rxfilter(struct alc_softc *sc) } if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ale/if_ale.c Fri May 18 20:13:34 2018 (r333813) @@ -3038,7 +3038,7 @@ ale_rxfilter(struct ale_softc *sc) bzero(mchash, sizeof(mchash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/altera/atse/if_atse.c ============================================================================== --- head/sys/dev/altera/atse/if_atse.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/altera/atse/if_atse.c Fri May 18 20:13:34 2018 (r333813) @@ -485,7 +485,7 @@ atse_rxfilter_locked(struct atse_softc *sc) * do all the programming afterwards. */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) { continue; } Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ath/if_ath.c Fri May 18 20:13:34 2018 (r333813) @@ -3615,7 +3615,7 @@ ath_update_mcast_hw(struct ath_softc *sc) TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { ifp = vap->iv_ifp; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { caddr_t dl; uint32_t val; uint8_t pos; Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/bce/if_bce.c Fri May 18 20:13:34 2018 (r333813) @@ -8117,7 +8117,7 @@ bce_set_rx_mode(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_MISC, "Enabling selective multicast mode.\n"); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/bfe/if_bfe.c Fri May 18 20:13:34 2018 (r333813) @@ -1109,7 +1109,7 @@ bfe_set_rx_mode(struct bfe_softc *sc) else { val &= ~BFE_RXCONF_ALLMULTI; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bfe_cam_write(sc, Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/bm/if_bm.c Fri May 18 20:13:34 2018 (r333813) @@ -939,7 +939,7 @@ bm_setladrf(struct bm_softc *sc) memset(hash, 0, sizeof(hash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/bxe/bxe.c Fri May 18 20:13:34 2018 (r333813) @@ -12004,7 +12004,7 @@ bxe_init_mcast_macs_list(struct bxe_softc struct ifmultiaddr *ifma; struct ecore_mcast_list_elem *mc_mac; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) { continue; } @@ -12027,7 +12027,7 @@ bxe_init_mcast_macs_list(struct bxe_softc } bzero(mc_mac, (sizeof(*mc_mac) * mc_count)); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) { continue; } @@ -12130,7 +12130,7 @@ bxe_set_uc_list(struct bxe_softc *sc) ifa = if_getifaddr(ifp); /* XXX Is this structure */ while (ifa) { if (ifa->ifa_addr->sa_family != AF_LINK) { - ifa = TAILQ_NEXT(ifa, ifa_link); + ifa = CK_STAILQ_NEXT(ifa, ifa_link); continue; } @@ -12150,7 +12150,7 @@ bxe_set_uc_list(struct bxe_softc *sc) return (rc); } - ifa = TAILQ_NEXT(ifa, ifa_link); + ifa = CK_STAILQ_NEXT(ifa, ifa_link); } #if __FreeBSD_version < 800000 Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/cas/if_cas.c Fri May 18 20:13:34 2018 (r333813) @@ -2546,7 +2546,7 @@ cas_setladrf(struct cas_softc *sc) memset(hash, 0, sizeof(hash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/cs/if_cs.c Fri May 18 20:13:34 2018 (r333813) @@ -1007,7 +1007,7 @@ cs_setmode(struct cs_softc *sc) * frames we're interested in. */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { struct sockaddr_dl *dl = (struct sockaddr_dl *)ifma->ifma_addr; Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/cxgb/cxgb_adapter.h Fri May 18 20:13:34 2018 (r333813) @@ -471,7 +471,7 @@ t3_get_next_mcaddr(struct t3_rx_mode *rm) int i = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (i == rm->idx) { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/cxgbe/t4_main.c Fri May 18 20:13:34 2018 (r333813) @@ -4266,7 +4266,7 @@ update_mac_settings(struct ifnet *ifp, int flags) int i = 0, j; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mcaddr[i] = Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/cxgbe/tom/t4_tom.c Fri May 18 20:13:34 2018 (r333813) @@ -965,7 +965,7 @@ update_clip_table(struct adapter *sc, struct tom_data /* XXX: races with if_vmove */ CURVNET_SET(vi->ifp->if_vnet); - TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { + CK_STAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) { lip = &ia->ia_addr.sin6_addr; KASSERT(!IN6_IS_ADDR_MULTICAST(lip), Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/dc/if_dc.c Fri May 18 20:13:34 2018 (r333813) @@ -997,7 +997,7 @@ dc_setfilt_21143(struct dc_softc *sc) DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_mchash_le(sc, @@ -1075,7 +1075,7 @@ dc_setfilt_admtek(struct dc_softc *sc) /* Now program new ones. */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (DC_IS_CENTAUR(sc)) @@ -1148,7 +1148,7 @@ dc_setfilt_asix(struct dc_softc *sc) /* now program new ones */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_mchash_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); @@ -1209,7 +1209,7 @@ dc_setfilt_uli(struct dc_softc *sc) /* Now build perfect filters. */ mcnt = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (mcnt >= DC_ULI_FILTER_NPERF) { @@ -1294,7 +1294,7 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_mchash_le(sc, Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/de/if_de.c Fri May 18 20:13:34 2018 (r333813) @@ -3053,7 +3053,7 @@ tulip_addr_filter(tulip_softc_t * const sc) else bcopy(sc->tulip_enaddr, eaddr, ETHER_ADDR_LEN); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family == AF_LINK) multicnt++; @@ -3080,7 +3080,7 @@ tulip_addr_filter(tulip_softc_t * const sc) */ bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata)); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3112,7 +3112,7 @@ tulip_addr_filter(tulip_softc_t * const sc) /* * Else can get perfect filtering for 16 addresses. */ - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); Modified: head/sys/dev/dwc/if_dwc.c ============================================================================== --- head/sys/dev/dwc/if_dwc.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/dwc/if_dwc.c Fri May 18 20:13:34 2018 (r333813) @@ -607,7 +607,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) for (i = 0; i < nhash; i++) hash[i] = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ed/if_ed.c Fri May 18 20:13:34 2018 (r333813) @@ -1701,7 +1701,7 @@ ed_ds_getmcaf(struct ed_softc *sc, uint32_t *mcaf) mcaf[1] = 0; if_maddr_rlock(sc->ifp); - TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/et/if_et.c Fri May 18 20:13:34 2018 (r333813) @@ -1581,7 +1581,7 @@ et_setmulti(struct et_softc *sc) count = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { uint32_t *hp, h; if (ifma->ifma_addr->sa_family != AF_LINK) Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ex/if_ex.c Fri May 18 20:13:34 2018 (r333813) @@ -866,7 +866,7 @@ ex_setmulti(struct ex_softc *sc) count = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; count++; @@ -900,7 +900,7 @@ ex_setmulti(struct ex_softc *sc) CSR_WRITE_2(sc, IO_PORT_REG, (count + 1) * 6); if_maddr_rlock(ifp); - TAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(maddr, &ifp->if_multiaddrs, ifma_link) { if (maddr->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/fe/if_fe.c ============================================================================== --- head/sys/dev/fe/if_fe.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/fe/if_fe.c Fri May 18 20:13:34 2018 (r333813) @@ -2076,7 +2076,7 @@ fe_mcaf ( struct fe_softc *sc ) filter = fe_filter_nothing; if_maddr_rlock(sc->ifp); - TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ffec/if_ffec.c Fri May 18 20:13:34 2018 (r333813) @@ -994,7 +994,7 @@ ffec_setup_rxfilter(struct ffec_softc *sc) else { ghash = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; /* 6 bits from MSB in LE CRC32 are used for hash. */ Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/gem/if_gem.c Fri May 18 20:13:34 2018 (r333813) @@ -2249,7 +2249,7 @@ gem_setladrf(struct gem_softc *sc) memset(hash, 0, sizeof(hash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/hme/if_hme.c Fri May 18 20:13:34 2018 (r333813) @@ -1723,7 +1723,7 @@ hme_setladrf(struct hme_softc *sc, int reenable) */ if_maddr_rlock(ifp); - TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/hyperv/netvsc/if_hn.c Fri May 18 20:13:34 2018 (r333813) @@ -931,7 +931,7 @@ hn_rxfilter_config(struct hn_softc *sc) filter |= NDIS_PACKET_TYPE_BROADCAST; /* TODO: support multicast list */ if ((ifp->if_flags & IFF_ALLMULTI) || - !TAILQ_EMPTY(&ifp->if_multiaddrs)) + !CK_STAILQ_EMPTY(&ifp->if_multiaddrs)) filter |= NDIS_PACKET_TYPE_ALL_MULTICAST; } return (hn_set_rxfilter(sc, filter)); @@ -1323,7 +1323,7 @@ hn_xpnt_vf_saveifflags(struct hn_softc *sc) HN_LOCK_ASSERT(sc); /* XXX vlan(4) style mcast addr maintenance */ - if (!TAILQ_EMPTY(&ifp->if_multiaddrs)) + if (!CK_STAILQ_EMPTY(&ifp->if_multiaddrs)) allmulti = IFF_ALLMULTI; /* Always set the VF's if_flags */ Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/if_ndis/if_ndis.c Fri May 18 20:13:34 2018 (r333813) @@ -313,7 +313,7 @@ ndis_setmulti(sc) return; } - if (TAILQ_EMPTY(&ifp->if_multiaddrs)) + if (CK_STAILQ_EMPTY(&ifp->if_multiaddrs)) return; len = sizeof(mclistsz); @@ -330,7 +330,7 @@ ndis_setmulti(sc) len = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ixgbe/if_ixv.c Fri May 18 20:13:34 2018 (r333813) @@ -846,7 +846,7 @@ ixv_if_multi_set(if_ctx_t ctx) IOCTL_DEBUGOUT("ixv_if_multi_set: begin"); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ixl/if_ixlv.c Fri May 18 20:13:34 2018 (r333813) @@ -2433,7 +2433,7 @@ ixlv_add_multi(struct ixl_vsi *vsi) ** Get a count, to decide if we ** simply use multicast promiscuous. */ - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mcnt++; @@ -2454,7 +2454,7 @@ ixlv_add_multi(struct ixl_vsi *vsi) mcnt = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (!ixlv_add_mac_filter(sc, @@ -2494,7 +2494,7 @@ ixlv_del_multi(struct ixl_vsi *vsi) && (f->flags & IXL_FILTER_MC)) { /* check if mac address in filter is in sc's list */ match = FALSE; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; u8 *mc_addr = Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/ixl/ixl_pf_main.c Fri May 18 20:13:34 2018 (r333813) @@ -876,7 +876,7 @@ ixl_set_promisc(struct ixl_vsi *vsi) else { /* Need to count the multicast addresses */ struct ifmultiaddr *ifma; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (mcnt == MAX_MULTICAST_ADDR) { @@ -916,7 +916,7 @@ ixl_add_multi(struct ixl_vsi *vsi) ** First just get a count, to decide if we ** we simply use multicast promiscuous. */ - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mcnt++; @@ -933,7 +933,7 @@ ixl_add_multi(struct ixl_vsi *vsi) mcnt = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; ixl_add_mc_filter(vsi, @@ -966,7 +966,7 @@ ixl_del_multi(struct ixl_vsi *vsi) SLIST_FOREACH(f, &vsi->ftl, next) { if ((f->flags & IXL_FILTER_USED) && (f->flags & IXL_FILTER_MC)) { match = FALSE; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; u8 *mc_addr = (u8 *)LLADDR((struct sockaddr_dl *)ifma->ifma_addr); Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/jme/if_jme.c Fri May 18 20:13:34 2018 (r333813) @@ -3278,7 +3278,7 @@ jme_set_filter(struct jme_softc *sc) bzero(mchash, sizeof(mchash)); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &sc->jme_ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &sc->jme_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/le/lance.c ============================================================================== --- head/sys/dev/le/lance.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/le/lance.c Fri May 18 20:13:34 2018 (r333813) @@ -602,7 +602,7 @@ lance_setladrf(struct lance_softc *sc, uint16_t *af) af[0] = af[1] = af[2] = af[3] = 0x0000; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/lge/if_lge.c Fri May 18 20:13:34 2018 (r333813) @@ -393,7 +393,7 @@ lge_setmulti(sc) /* now program new ones */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/liquidio/lio_ioctl.c ============================================================================== --- head/sys/dev/liquidio/lio_ioctl.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/liquidio/lio_ioctl.c Fri May 18 20:13:34 2018 (r333813) @@ -519,7 +519,7 @@ lio_set_mcast_list(struct ifnet *ifp) /* to protect access to if_multiaddrs */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; *mc = 0; Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/malo/if_malo.c Fri May 18 20:13:34 2018 (r333813) @@ -1539,7 +1539,7 @@ malo_setmcastfilter(struct malo_softc *sc) ifp = vap->iv_ifp; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/mge/if_mge.c Fri May 18 20:13:34 2018 (r333813) @@ -2052,7 +2052,7 @@ mge_setup_multicast(struct mge_softc *sc) memset(omt, 0, sizeof(omt)); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Fri May 18 20:13:34 2018 (r333813) @@ -623,7 +623,7 @@ static void mlx4_en_cache_uclist(struct net_device *de mlx4_en_clear_uclist(dev); if_addr_rlock(dev); - TAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifa, &dev->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_LINK) continue; if (((struct sockaddr_dl *)ifa->ifa_addr)->sdl_alen != @@ -661,7 +661,7 @@ static void mlx4_en_cache_mclist(struct net_device *de mlx4_en_clear_mclist(dev); if_maddr_rlock(dev); - TAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (((struct sockaddr_dl *)ifma->ifma_addr)->sdl_alen != Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri May 18 20:13:34 2018 (r333813) @@ -29,7 +29,6 @@ #include #include - #define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v) enum { @@ -767,7 +766,7 @@ mlx5e_sync_ifp_addr(struct mlx5e_priv *priv) LLADDR((struct sockaddr_dl *)(ifp->if_addr->ifa_addr))); if_addr_rlock(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_LINK) continue; mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_uc, @@ -776,7 +775,7 @@ mlx5e_sync_ifp_addr(struct mlx5e_priv *priv) if_addr_runlock(ifp); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mlx5e_add_eth_addr_to_hash(priv->eth_addr.if_mc, Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/msk/if_msk.c Fri May 18 20:13:34 2018 (r333813) @@ -600,7 +600,7 @@ msk_rxfilter(struct msk_if_softc *sc_if) } else { mode |= GM_RXCR_UCF_ENA; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/mxge/if_mxge.c Fri May 18 20:13:34 2018 (r333813) @@ -1146,7 +1146,7 @@ mxge_set_multicast_list(mxge_softc_t *sc) /* Walk the multicast list, and add each address */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), Modified: head/sys/dev/my/if_my.c ============================================================================== --- head/sys/dev/my/if_my.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/my/if_my.c Fri May 18 20:13:34 2018 (r333813) @@ -336,7 +336,7 @@ my_setmulti(struct my_softc * sc) /* now program new ones */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ~ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/nge/if_nge.c Fri May 18 20:13:34 2018 (r333813) @@ -727,7 +727,7 @@ nge_rxfilter(struct nge_softc *sc) * which bit within that byte needs to be set. */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/oce/oce_hw.c Fri May 18 20:13:34 2018 (r333813) @@ -569,7 +569,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) #if __FreeBSD_version > 800000 if_maddr_rlock(ifp); #endif - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/otus/if_otus.c Fri May 18 20:13:34 2018 (r333813) @@ -2330,7 +2330,7 @@ otus_set_multi(struct otus_softc *sc) TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { ifp = vap->iv_ifp; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { caddr_t dl; uint32_t val; Modified: head/sys/dev/pcn/if_pcn.c ============================================================================== --- head/sys/dev/pcn/if_pcn.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/pcn/if_pcn.c Fri May 18 20:13:34 2018 (r333813) @@ -371,7 +371,7 @@ pcn_setmulti(sc) /* now program new ones */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_le(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c ============================================================================== --- head/sys/dev/qlnx/qlnxe/qlnx_os.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/qlnx/qlnxe/qlnx_os.c Fri May 18 20:13:34 2018 (r333813) @@ -2278,7 +2278,7 @@ qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi) if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/qlxgb/qla_os.c Fri May 18 20:13:34 2018 (r333813) @@ -773,7 +773,7 @@ qla_set_multi(qla_host_t *ha, uint32_t add_multi) if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/qlxgbe/ql_os.c Fri May 18 20:13:34 2018 (r333813) @@ -988,7 +988,7 @@ qla_set_multi(qla_host_t *ha, uint32_t add_multi) if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/qlxge/qls_os.c ============================================================================== --- head/sys/dev/qlxge/qls_os.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/qlxge/qls_os.c Fri May 18 20:13:34 2018 (r333813) @@ -845,7 +845,7 @@ qls_set_multi(qla_host_t *ha, uint32_t add_multi) if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/re/if_re.c Fri May 18 20:13:34 2018 (r333813) @@ -685,7 +685,7 @@ re_set_rxmode(struct rl_softc *sc) } if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/rl/if_rl.c ============================================================================== --- head/sys/dev/rl/if_rl.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/rl/if_rl.c Fri May 18 20:13:34 2018 (r333813) @@ -538,7 +538,7 @@ rl_rxfilter(struct rl_softc *sc) } else { /* Now program new ones. */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/rtwn/if_rtwn_rx.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn_rx.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/rtwn/if_rtwn_rx.c Fri May 18 20:13:34 2018 (r333813) @@ -387,7 +387,7 @@ rtwn_set_multi(struct rtwn_softc *sc) TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { ifp = vap->iv_ifp; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { caddr_t dl; uint8_t pos; Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/sf/if_sf.c Fri May 18 20:13:34 2018 (r333813) @@ -484,8 +484,9 @@ sf_rxfilter(struct sf_softc *sc) /* Now program new ones. */ i = 1; + /* XXX how do we maintain reverse semantics without impl */ if_maddr_rlock(ifp); - TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; Modified: head/sys/dev/sfxge/sfxge_port.c ============================================================================== --- head/sys/dev/sfxge/sfxge_port.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/sfxge/sfxge_port.c Fri May 18 20:13:34 2018 (r333813) @@ -369,7 +369,7 @@ sfxge_mac_multicast_list_set(struct sfxge_softc *sc) port->mcast_count = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family == AF_LINK) { if (port->mcast_count == EFX_MAC_MULTICAST_LIST_MAX) { device_printf(sc->dev, Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/sge/if_sge.c Fri May 18 20:13:34 2018 (r333813) @@ -469,7 +469,7 @@ sge_rxfilter(struct sge_softc *sc) hashes[0] = hashes[1] = 0; /* Now program new ones. */ if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/sis/if_sis.c Fri May 18 20:13:34 2018 (r333813) @@ -744,7 +744,7 @@ sis_rxfilter_ns(struct sis_softc *sc) } if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = sis_mchash(sc, @@ -802,7 +802,7 @@ sis_rxfilter_sis(struct sis_softc *sc) hashes[i] = 0; i = 0; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = sis_mchash(sc, Modified: head/sys/dev/sk/if_sk.c ============================================================================== --- head/sys/dev/sk/if_sk.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/sk/if_sk.c Fri May 18 20:13:34 2018 (r333813) @@ -749,7 +749,8 @@ sk_rxfilter_genesis(sc_if) } else { i = 1; if_maddr_rlock(ifp); - TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, + /* XXX want to maintain reverse semantics */ + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -801,7 +802,7 @@ sk_rxfilter_yukon(sc_if) } else { mode |= YU_RCR_UFLEN; if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) Modified: head/sys/dev/sn/if_sn.c ============================================================================== --- head/sys/dev/sn/if_sn.c Fri May 18 19:50:22 2018 (r333812) +++ head/sys/dev/sn/if_sn.c Fri May 18 20:13:34 2018 (r333813) @@ -1418,7 +1418,7 @@ sn_getmcf(struct ifnet *ifp, uint8_t *mcf) bzero(mcf, MCFSZ); if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 18 20:24:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BEF5EDAB6E; Fri, 18 May 2018 20:24:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 313F46848C; Fri, 18 May 2018 20:24:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 124F81CFC0; Fri, 18 May 2018 20:24:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IKOJMl085936; Fri, 18 May 2018 20:24:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IKOJxT085934; Fri, 18 May 2018 20:24:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805182024.w4IKOJxT085934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 18 May 2018 20:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333814 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 333814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 20:24:20 -0000 Author: trasz Date: Fri May 18 20:24:19 2018 New Revision: 333814 URL: https://svnweb.freebsd.org/changeset/base/333814 Log: Stop claiming the device-side USB serial interfaces talk Hayes AT. There should be no functional difference. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_multi.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Fri May 18 20:13:34 2018 (r333813) +++ head/sys/dev/usb/template/usb_template_modem.c Fri May 18 20:24:19 2018 (r333814) @@ -170,7 +170,7 @@ static const struct usb_temp_interface_desc modem_ifac .ppEndpoints = modem_iface_0_ep, .bInterfaceClass = UICLASS_CDC, .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, - .bInterfaceProtocol = UIPROTO_CDC_AT, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = MODEM_INTERFACE_INDEX, }; Modified: head/sys/dev/usb/template/usb_template_multi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_multi.c Fri May 18 20:13:34 2018 (r333813) +++ head/sys/dev/usb/template/usb_template_multi.c Fri May 18 20:24:19 2018 (r333814) @@ -299,7 +299,7 @@ static const struct usb_temp_interface_desc modem_ifac .ppEndpoints = modem_iface_0_ep, .bInterfaceClass = UICLASS_CDC, .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, - .bInterfaceProtocol = UIPROTO_CDC_AT, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = MULTI_MODEM_INDEX, }; Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Fri May 18 20:13:34 2018 (r333813) +++ head/sys/dev/usb/template/usb_template_serialnet.c Fri May 18 20:24:19 2018 (r333814) @@ -296,7 +296,7 @@ static const struct usb_temp_interface_desc modem_ifac .ppEndpoints = modem_iface_0_ep, .bInterfaceClass = UICLASS_CDC, .bInterfaceSubClass = UISUBCLASS_ABSTRACT_CONTROL_MODEL, - .bInterfaceProtocol = UIPROTO_CDC_AT, + .bInterfaceProtocol = UIPROTO_CDC_NONE, .iInterface = SERIALNET_MODEM_INDEX, }; From owner-svn-src-all@freebsd.org Fri May 18 22:29:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23190EDE81F; Fri, 18 May 2018 22:29:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C34E96CD60; Fri, 18 May 2018 22:29:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 859441E54F; Fri, 18 May 2018 22:29:18 +0000 (UTC) (envelope-from jhb@freebsd.org) From: John Baldwin To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333757 - head/sys/sys Date: Fri, 18 May 2018 15:28:53 -0700 Message-ID: <61142337.Kuh28PEzu2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201805171930.w4HJUvPm018431@repo.freebsd.org> References: <201805171930.w4HJUvPm018431@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 22:29:19 -0000 On Thursday, May 17, 2018 07:30:57 PM Matt Macy wrote: > Author: mmacy > Date: Thu May 17 19:30:57 2018 > New Revision: 333757 > URL: https://svnweb.freebsd.org/changeset/base/333757 > > Log: > epoch(9): missed add from r333755 > > Reported by: flo > Approved by: sbruno > > Modified: > head/sys/sys/proc.h > > Modified: head/sys/sys/proc.h > ============================================================================== > --- head/sys/sys/proc.h Thu May 17 19:10:13 2018 (r333756) > +++ head/sys/sys/proc.h Thu May 17 19:30:57 2018 (r333757) > @@ -322,6 +322,7 @@ struct thread { > u_char td_pri_class; /* (t) Scheduling class. */ > u_char td_user_pri; /* (t) User pri from estcpu and nice. */ > u_char td_base_user_pri; /* (t) Base user pri */ > + u_char td_pre_epoch_prio; > uintptr_t td_rb_list; /* (k) Robust list head. */ > uintptr_t td_rbp_list; /* (k) Robust priv list head. */ > uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ Can you annotate the locking for this field for future readers? -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 18 22:36:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7447EDEC1A; Fri, 18 May 2018 22:36:49 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 753156D2E7; Fri, 18 May 2018 22:36:49 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 2EF711E649; Fri, 18 May 2018 22:36:49 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f53.google.com with SMTP id j186-v6so15005450ita.5; Fri, 18 May 2018 15:36:49 -0700 (PDT) X-Gm-Message-State: ALKqPwdPYlCstw6nLnDSs5GGsnGe2wJPq1RxhxeQqwhlJwttXbFMk567 PAO11906KtmXifwB1dqFHpO2Qz8dQH0BPDpt6UU= X-Google-Smtp-Source: AB8JxZpTZREluQwLAV/Q00rrQgy9aqMeSnIVmiRCFEF52jliLEJH1lwKyHgVopwCJwdXYqqYSbhG+r1pBlicNwp4w74= X-Received: by 2002:a24:5a85:: with SMTP id v127-v6mr9217070ita.128.1526683008528; Fri, 18 May 2018 15:36:48 -0700 (PDT) MIME-Version: 1.0 References: <201805171930.w4HJUvPm018431@repo.freebsd.org> <61142337.Kuh28PEzu2@ralph.baldwin.cx> In-Reply-To: <61142337.Kuh28PEzu2@ralph.baldwin.cx> From: Matthew Macy Date: Fri, 18 May 2018 15:36:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333757 - head/sys/sys To: John Baldwin 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.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 22:36:50 -0000 Sorry, will do On Fri, May 18, 2018 at 15:29 John Baldwin wrote: > On Thursday, May 17, 2018 07:30:57 PM Matt Macy wrote: > > Author: mmacy > > Date: Thu May 17 19:30:57 2018 > > New Revision: 333757 > > URL: https://svnweb.freebsd.org/changeset/base/333757 > > > > Log: > > epoch(9): missed add from r333755 > > > > Reported by: flo > > Approved by: sbruno > > > > Modified: > > head/sys/sys/proc.h > > > > Modified: head/sys/sys/proc.h > > > ============================================================================== > > --- head/sys/sys/proc.h Thu May 17 19:10:13 2018 (r333756) > > +++ head/sys/sys/proc.h Thu May 17 19:30:57 2018 (r333757) > > @@ -322,6 +322,7 @@ struct thread { > > u_char td_pri_class; /* (t) Scheduling class. */ > > u_char td_user_pri; /* (t) User pri from estcpu and > nice. */ > > u_char td_base_user_pri; /* (t) Base user pri */ > > + u_char td_pre_epoch_prio; > > uintptr_t td_rb_list; /* (k) Robust list head. */ > > uintptr_t td_rbp_list; /* (k) Robust priv list head. */ > > uintptr_t td_rb_inact; /* (k) Current in-action mutex > loc. */ > > Can you annotate the locking for this field for future readers? > > -- > John Baldwin > From owner-svn-src-all@freebsd.org Fri May 18 22:57:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5077CEDF397; Fri, 18 May 2018 22:57:53 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB9B06DD26; Fri, 18 May 2018 22:57:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB1EE1E82B; Fri, 18 May 2018 22:57:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4IMvqV7061417; Fri, 18 May 2018 22:57:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4IMvqtG061416; Fri, 18 May 2018 22:57:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201805182257.w4IMvqtG061416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 18 May 2018 22:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333816 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 22:57:53 -0000 Author: mjg Date: Fri May 18 22:57:52 2018 New Revision: 333816 URL: https://svnweb.freebsd.org/changeset/base/333816 Log: lockmgr: avoid atomic on unlock in the slow path The code is pretty much guaranteed not to be able to unlock. This is a minor nit. The code still performs way too many reads. The altered exclusive-locked condition is supposed to be always true as well, to be cleaned up at a later date. Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Fri May 18 22:22:08 2018 (r333815) +++ head/sys/kern/kern_lock.c Fri May 18 22:57:52 2018 (r333816) @@ -132,9 +132,11 @@ CTASSERT(LK_UNLOCKED == (LK_UNLOCKED & #define lockmgr_disowned(lk) \ (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == LK_KERNPROC) -#define lockmgr_xlocked(lk) \ - (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread) +#define lockmgr_xlocked_v(v) \ + (((v) & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread) +#define lockmgr_xlocked(lk) lockmgr_xlocked_v((lk)->lk_lock) + static void assert_lockmgr(const struct lock_object *lock, int how); #ifdef DDB static void db_show_lockmgr(const struct lock_object *lock); @@ -1021,7 +1023,7 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_i * The lock is held in exclusive mode. * If the lock is recursed also, then unrecurse it. */ - if (lockmgr_xlocked(lk) && lockmgr_recursed(lk)) { + if (lockmgr_xlocked_v(x) && lockmgr_recursed(lk)) { LOCK_LOG2(lk, "%s: %p unrecursing", __func__, lk); lk->lk_recurse--; goto out; @@ -1029,7 +1031,7 @@ lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_i if (tid != LK_KERNPROC) lock_profile_release_lock(&lk->lock_object); - if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) + if (x == tid && atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) goto out; sleepq_lock(&lk->lock_object); From owner-svn-src-all@freebsd.org Fri May 18 23:17:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A90EDFA30; Fri, 18 May 2018 23:17:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD86C6E684; Fri, 18 May 2018 23:17:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A90451EB96; Fri, 18 May 2018 23:17:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4INHnLC071514; Fri, 18 May 2018 23:17:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4INHnGx071513; Fri, 18 May 2018 23:17:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805182317.w4INHnGx071513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 18 May 2018 23:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333817 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 May 2018 23:17:50 -0000 Author: mmacy Date: Fri May 18 23:17:49 2018 New Revision: 333817 URL: https://svnweb.freebsd.org/changeset/base/333817 Log: Annotate td_pre_epoch_prio in struct thread Reported by: jhb Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri May 18 22:57:52 2018 (r333816) +++ head/sys/sys/proc.h Fri May 18 23:17:49 2018 (r333817) @@ -322,7 +322,7 @@ struct thread { u_char td_pri_class; /* (t) Scheduling class. */ u_char td_user_pri; /* (t) User pri from estcpu and nice. */ u_char td_base_user_pri; /* (t) Base user pri */ - u_char td_pre_epoch_prio; + u_char td_pre_epoch_prio; /* (k) User pri on entry to epoch */ uintptr_t td_rb_list; /* (k) Robust list head. */ uintptr_t td_rbp_list; /* (k) Robust priv list head. */ uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ From owner-svn-src-all@freebsd.org Sat May 19 00:04:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90657EE1496; Sat, 19 May 2018 00:04:03 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 239DB70E7A; Sat, 19 May 2018 00:04:03 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D93BE1F3E0; Sat, 19 May 2018 00:04:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J042fw099145; Sat, 19 May 2018 00:04:02 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J0419B099140; Sat, 19 May 2018 00:04:01 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190004.w4J0419B099140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 00:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333819 - in head/sys: conf modules/blake2 modules/crypto modules/drm2/i915kms modules/ipfilter X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf modules/blake2 modules/crypto modules/drm2/i915kms modules/ipfilter X-SVN-Commit-Revision: 333819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 00:04:03 -0000 Author: mmacy Date: Sat May 19 00:04:01 2018 New Revision: 333819 URL: https://svnweb.freebsd.org/changeset/base/333819 Log: Silence non-actionable warnings in vendor code We can't modify vendor code so there's no signal in warnings from it. Similarly -Waddress-of-packed-member is not useful on networking code as access to packed structures is fundamental to its operation. Modified: head/sys/conf/files head/sys/conf/kern.mk head/sys/modules/blake2/Makefile head/sys/modules/crypto/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/ipfilter/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri May 18 23:42:08 2018 (r333818) +++ head/sys/conf/files Sat May 19 00:04:01 2018 (r333819) @@ -565,7 +565,7 @@ contrib/ipfilter/netinet/ip_lookup.c optional ipfilter contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" + compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Fri May 18 23:42:08 2018 (r333818) +++ head/sys/conf/kern.mk Sat May 19 00:04:01 2018 (r333819) @@ -18,12 +18,13 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs # a false positive. .if ${COMPILER_TYPE} == "clang" NO_WCONSTANT_CONVERSION= -Wno-error-constant-conversion -NO_WSHIFT_COUNT_NEGATIVE= -Wno-error-shift-count-negative -NO_WSHIFT_COUNT_OVERFLOW= -Wno-error-shift-count-overflow -NO_WSELF_ASSIGN= -Wno-error-self-assign +NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative +NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow +NO_WSELF_ASSIGN= -Wno-self-assign NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. @@ -34,7 +35,7 @@ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-erro CWARNEXTRA+= -Wno-error-shift-negative-value .endif .if ${COMPILER_VERSION} >= 40000 -CWARNEXTRA+= -Wno-error-address-of-packed-member +CWARNEXTRA+= -Wno-address-of-packed-member .endif CLANG_NO_IAS= -no-integrated-as Modified: head/sys/modules/blake2/Makefile ============================================================================== --- head/sys/modules/blake2/Makefile Fri May 18 23:42:08 2018 (r333818) +++ head/sys/modules/blake2/Makefile Sat May 19 00:04:01 2018 (r333819) @@ -87,4 +87,5 @@ WARNS ?= 6 .include CWARNFLAGS.blake2-dispatch.c += -Wno-unused-const-variable +CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function CWARNFLAGS += -Wno-cast-qual Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Fri May 18 23:42:08 2018 (r333818) +++ head/sys/modules/crypto/Makefile Sat May 19 00:04:01 2018 (r333819) @@ -40,8 +40,8 @@ SRCS += blake2-sw.c CFLAGS.blake2b-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref CFLAGS.blake2s-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref CFLAGS.blake2-sw.c += -I${SRCTOP}/sys/crypto/blake2 -CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual +CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -Wno-unused-function +CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function SRCS += chacha.c SRCS += chacha-sw.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h Modified: head/sys/modules/drm2/i915kms/Makefile ============================================================================== --- head/sys/modules/drm2/i915kms/Makefile Fri May 18 23:42:08 2018 (r333818) +++ head/sys/modules/drm2/i915kms/Makefile Sat May 19 00:04:01 2018 (r333819) @@ -63,3 +63,8 @@ SRCS += \ CWARNFLAGS.i915_debug.c= -Wno-unused-function CWARNFLAGS.intel_lvds.c= -Wno-unused CWARNFLAGS.intel_tv.c= -Wno-unused +CWARNFLAGS.i915_gem.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.i915_gem_tiling.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.i915_gem_execbuffer.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.intel_display.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.intel_overlay.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} Modified: head/sys/modules/ipfilter/Makefile ============================================================================== --- head/sys/modules/ipfilter/Makefile Fri May 18 23:42:08 2018 (r333818) +++ head/sys/modules/ipfilter/Makefile Sat May 19 00:04:01 2018 (r333819) @@ -21,7 +21,7 @@ CWARNFLAGS.fil.c= ${NO_WSELF_ASSIGN} -Wno-unused CWARNFLAGS.ip_auth.c= -Wno-unused CWARNFLAGS.ip_fil_freebsd.c= -Wno-unused CWARNFLAGS.ip_frag.c= -Wno-unused -CWARNFLAGS.ip_htable.c= -Wno-unused +CWARNFLAGS.ip_htable.c= -Wno-unused ${NO_WTAUTOLOGICAL_POINTER_COMPARE} CWARNFLAGS.ip_dstlist.c= -Wno-unused CWARNFLAGS.ip_lookup.c= ${NO_WSELF_ASSIGN} -Wno-unused CWARNFLAGS.ip_nat.c= -Wno-unused From owner-svn-src-all@freebsd.org Sat May 19 00:26:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E257EE1EE4; Sat, 19 May 2018 00:26:05 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACFA9718FC; Sat, 19 May 2018 00:26:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 829801F71A; Sat, 19 May 2018 00:26:04 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J0Q4ni009337; Sat, 19 May 2018 00:26:04 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J0Q1Aa009316; Sat, 19 May 2018 00:26:01 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201805190026.w4J0Q1Aa009316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 19 May 2018 00:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333820 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Commit-Revision: 333820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 00:26:05 -0000 Author: sjg Date: Sat May 19 00:26:00 2018 New Revision: 333820 URL: https://svnweb.freebsd.org/changeset/base/333820 Log: Merge bmake-20180512 Skip polling job token pipe, better handle sysV style includes with variables. Added: head/contrib/bmake/mk/dirdeps-options.mk - copied unchanged from r333814, vendor/NetBSD/bmake/dist/mk/dirdeps-options.mk Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/VERSION head/contrib/bmake/bmake.1 head/contrib/bmake/job.c head/contrib/bmake/make.1 head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/FILES head/contrib/bmake/mk/cython.mk head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/gendirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/ldorder.mk head/contrib/bmake/mk/meta.autodep.mk head/contrib/bmake/mk/own.mk head/contrib/bmake/parse.c head/usr.bin/bmake/Makefile.config Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/ChangeLog Sat May 19 00:26:00 2018 (r333820) @@ -1,3 +1,16 @@ +2018-05-12 Simon J. Gerraty + + * VERSION: 20180512 + Merge with NetBSD make, pick up + o job.c: skip polling job token pipe + +2018-04-05 Simon J. Gerraty + + * VERSION: 20180405 + Merge with NetBSD make, pick up + o parse.c: be more cautious about detecting depenency line + rather than sysV style include. + 2018-02-22 Simon J. Gerraty * VERSION: 20180222 Modified: head/contrib/bmake/VERSION ============================================================================== --- head/contrib/bmake/VERSION Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/VERSION Sat May 19 00:26:00 2018 (r333820) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20180222 +_MAKE_VERSION=20180512 Modified: head/contrib/bmake/bmake.1 ============================================================================== --- head/contrib/bmake/bmake.1 Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/bmake.1 Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.272 2018/04/02 04:26:17 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -1865,7 +1865,8 @@ expression is applied. Similarly, if the form is .Ql Ic .ifmake or -.Ql Ic .ifnmake , the +.Ql Ic .ifnmake , +the .Dq make expression is applied. .Pp Modified: head/contrib/bmake/job.c ============================================================================== --- head/contrib/bmake/job.c Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/job.c Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.192 2018/02/08 09:05:21 dholland Exp $ */ +/* $NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.192 2018/02/08 09:05:21 dholland Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.192 2018/02/08 09:05:21 dholland Exp $"); +__RCSID("$NetBSD: job.c,v 1.195 2018/05/13 22:13:28 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -2998,7 +2998,6 @@ Job_TokenWithdraw(void) } if (DEBUG(JOB)) fprintf(debug_file, "(%d) blocked for token\n", getpid()); - wantToken = 1; return FALSE; } Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/make.1 Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.272 2018/04/02 04:26:17 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -1876,7 +1876,8 @@ expression is applied. Similarly, if the form is .Ql Ic .ifmake or -.Ql Ic .ifnmake , the +.Ql Ic .ifnmake , +the .Dq make expression is applied. .Pp Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/ChangeLog Sat May 19 00:26:00 2018 (r333820) @@ -1,3 +1,20 @@ +2018-04-20 Simon J Gerraty + + * install-mk (MK_VERSION): 20180420 + * dirdeps.mk: include local.dirdeps-build.mk when .MAKE.LEVEL > 0 + ie. we are building something. + +2018-04-14 Simon J Gerraty + + * FILES: add dirdeps-options.mk to deal with optional DIRDEPS. + +2018-04-05 Simon J Gerraty + + * install-mk (MK_VERSION): 20180405 + + * ldorder.mk: describe how to use LDORDER_EXTERN_BARRIER + if needed. + 2018-01-18 Simon J Gerraty * install-mk (MK_VERSION): 20180118 Modified: head/contrib/bmake/mk/FILES ============================================================================== --- head/contrib/bmake/mk/FILES Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/FILES Sat May 19 00:26:00 2018 (r333820) @@ -59,6 +59,7 @@ warnings.mk whats.mk yacc.mk dirdeps.mk +dirdeps-options.mk gendirdeps.mk install-new.mk meta2deps.py Modified: head/contrib/bmake/mk/cython.mk ============================================================================== --- head/contrib/bmake/mk/cython.mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/cython.mk Sat May 19 00:26:00 2018 (r333820) @@ -1,5 +1,5 @@ # RCSid: -# $Id: cython.mk,v 1.6 2014/10/15 06:23:51 sjg Exp $ +# $Id: cython.mk,v 1.7 2018/03/25 18:46:11 sjg Exp $ # # @(#) Copyright (c) 2014, Simon J. Gerraty # @@ -14,15 +14,6 @@ # sjg@crufty.net # -# this is what we build -CYTHON_MODULE = ${CYTHON_MODULE_NAME}${CYTHON_PYVERSION}.so - -CYTHON_MODULE_NAME?= it -CYTHON_SRCS?= ${CYTHON_MODULE_NAME}.pyx - -# this is where we save generated src -CYTHON_SAVEGENDIR?= ${.CURDIR}/gen - # pyprefix is where python bits are # which may not be where we want to put ours (prefix) .if exists(/usr/pkg/include) @@ -34,13 +25,36 @@ PYTHON_VERSION?= 2.7 PYTHON_H?= ${pyprefix}/include/python${PYTHON_VERSION}/Python.h PYVERSION:= ${PYTHON_VERSION:C,\..*,,} +CFLAGS+= -I${PYTHON_H:H} + +# conf.host_target() is limited to uname -m rather than uname -p +_HOST_MACHINE!= uname -m +.if ${HOST_TARGET:M*${_HOST_MACHINE}} == "" +PY_HOST_TARGET:= ${HOST_TARGET:S,${_HOST_ARCH:U${uname -p:L:sh}}$,${_HOST_MACHINE},} +.endif + +COMPILE.c?= ${CC} -c ${CFLAGS} +PICO?= .pico + +.SUFFIXES: ${PICO} .c + +.c${PICO}: + ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} + +# this is what we build +.if !empty(CYTHON_MODULE_NAME) +CYTHON_MODULE = ${CYTHON_MODULE_NAME}${CYTHON_PYVERSION}.so + +CYTHON_SRCS?= ${CYTHON_MODULE_NAME}.pyx + +# this is where we save generated src +CYTHON_SAVEGENDIR?= ${.CURDIR}/gen + # set this empty if you don't want to handle multiple versions .if !defined(CYTHON_PYVERSION) CYTHON_PYVERSION:= ${PYVERSION} .endif -CFLAGS+= -I${PYTHON_H:H} - CYTHON_GENSRCS= ${CYTHON_SRCS:R:S,$,${CYTHON_PYVERSION}.c,} SRCS+= ${CYTHON_GENSRCS} @@ -70,20 +84,9 @@ save-gen: ${CYTHON_GENSRCS} .endif -COMPILE.c?= ${CC} -c ${CFLAGS} +${CYTHON_MODULE}: ${SRCS:S,.c,${PICO},} + ${CC} ${CC_SHARED:U-shared} -o ${.TARGET} ${.ALLSRC:M*${PICO}} ${LDADD} -.c.So: - ${COMPILE.c} ${PICFLAG} ${CC_PIC} ${.IMPSRC} -o ${.TARGET} - -${CYTHON_MODULE}: ${SRCS:S,.c,.So,} - ${CC} ${CC_SHARED:U-shared} -o ${.TARGET} ${.ALLSRC:M*.So} ${LDADD} - -# conf.host_target() is limited to uname -m rather than uname -p -_HOST_MACHINE!= uname -m -.if ${HOST_TARGET:M*${_HOST_MACHINE}} == "" -PY_HOST_TARGET:= ${HOST_TARGET:S,${_HOST_ARCH:U${uname -p:L:sh}}$,${_HOST_MACHINE},} -.endif - MODULE_BINDIR?= ${.CURDIR:H}/${PY_HOST_TARGET:U${HOST_TARGET}} build-cython-module: ${CYTHON_MODULE} @@ -93,4 +96,6 @@ install-cython-module: ${CYTHON_MODULE} ${INSTALL} -d ${DESTDIR}${MODULE_BINDIR} ${INSTALL} -m 755 ${.ALLSRC} ${DESTDIR}${MODULE_BINDIR} -CLEANFILES+= *.So ${CYTHON_MODULE} +CLEANFILES+= *${PICO} ${CYTHON_MODULE} + +.endif Copied: head/contrib/bmake/mk/dirdeps-options.mk (from r333814, vendor/NetBSD/bmake/dist/mk/dirdeps-options.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/bmake/mk/dirdeps-options.mk Sat May 19 00:26:00 2018 (r333820, copy of r333814, vendor/NetBSD/bmake/dist/mk/dirdeps-options.mk) @@ -0,0 +1,70 @@ +# $Id: dirdeps-options.mk,v 1.5 2018/04/18 15:53:57 sjg Exp $ +# +# @(#) Copyright (c) 2018, Simon J. Gerraty +# +# This file is provided in the hope that it will +# be of use. There is absolutely NO WARRANTY. +# Permission to copy, redistribute or otherwise +# use this file is hereby granted provided that +# the above copyright notice and this notice are +# left intact. +# +# Please send copies of changes and bug-fixes to: +# sjg@crufty.net +# + +## +# +# This makefile is used to deal with optional DIRDEPS. +# +# It is to be included by Makefile.depend.options in a +# directory which has DIRDEPS affected by optional features. +# Makefile.depend.options should set DIRDEPS_OPTIONS and +# may also set specific DIRDEPS.* for those options. +# +# If a Makefile.depend.options file exists, it will be included by +# dirdeps.mk and meta.autodep.mk +# +# We include local.dirdeps-option.mk which may also define DIRDEPS.* +# for options. +# +# Thus a directory, that is affected by an option FOO would have +# a Makefile.depend.options that sets +# DIRDEPS_OPTIONS= FOO +# It can also set either/both of +# DIRDEPS.FOO.yes +# DIRDEPS.FOO.no +# to whatever applies for that dir, or it can rely on globals +# set in local.dirdeps-option.mk +# Either way, we will .undef DIRDEPS.* when done. + +# This should have been set by Makefile.depend.options +# before including us +DIRDEPS_OPTIONS ?= + +# pickup any DIRDEPS.* we need +.-include + +.if ${.MAKE.LEVEL} == 0 +# :U below avoids potential errors when we := +.for o in ${DIRDEPS_OPTIONS:tu} +DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U} +.endfor +DIRDEPS := ${DIRDEPS:O:u} +# avoid cross contamination +.undef ${DIRDEPS_OPTIONS:tu:@o@DIRDEPS.$o.yes DIRDEPS.$o.no@} +.else +# whether options are enabled or not, +# we want to filter out the relevant DIRDEPS.* +# we should only be included by meta.autodep.mk +# if dependencies are to be updated +.for o in ${DIRDEPS_OPTIONS:tu} +.for d in ${DIRDEPS.$o.yes} ${DIRDEPS.$o.no} +.if exists(${SRCTOP}/$d) +GENDIRDEPS_FILTER += N$d* +.elif exists(${SRCTOP}/${d:R}) +GENDIRDEPS_FILTER += N${d:R}* +.endif +.endfor +.endfor +.endif Modified: head/contrib/bmake/mk/dirdeps.mk ============================================================================== --- head/contrib/bmake/mk/dirdeps.mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/dirdeps.mk Sat May 19 00:26:00 2018 (r333820) @@ -1,17 +1,17 @@ -# $Id: dirdeps.mk,v 1.90 2017/10/25 23:44:20 sjg Exp $ +# $Id: dirdeps.mk,v 1.95 2018/04/23 17:53:56 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# 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. +# 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. -# +# 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 @@ -22,7 +22,7 @@ # 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. +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Much of the complexity here is for supporting cross-building. # If a tree does not support that, simply using plain Makefile.depend @@ -56,7 +56,7 @@ # .MAKE.DEPENDFILE_PREFIX) to refer to these makefiles to # distinguish them from others. # -# Before each Makefile.depend file is read, we set +# Before each Makefile.depend file is read, we set # DEP_RELDIR to be the RELDIR (path relative to SRCTOP) for # its directory, and DEP_MACHINE etc according to the . # represented by the suffix of the corresponding target. @@ -89,7 +89,7 @@ # # For example: # -# # Always list MACHINE first, +# # Always list MACHINE first, # # other variables might be optional. # TARGET_SPEC_VARS = MACHINE TARGET_OS # .if ${TARGET_SPEC:Uno:M*,*} != "" @@ -101,7 +101,7 @@ # # and deal with MACHINE=${TARGET_SPEC} in the environment. # TARGET_SPEC = # # export but do not track -# .export-env TARGET_SPEC +# .export-env TARGET_SPEC # .export ${TARGET_SPEC_VARS} # .for v in ${TARGET_SPEC_VARS:O:u} # .if empty($v) @@ -328,7 +328,7 @@ _DEP_RELDIR := ${DEP_RELDIR} .endif # DIRDEPS_CACHE can be very handy for debugging. -# Also if repeatedly building the same target, +# Also if repeatedly building the same target, # we can avoid the overhead of re-computing the tree dependencies. MK_DIRDEPS_CACHE ?= no BUILD_DIRDEPS_CACHE ?= no @@ -441,7 +441,7 @@ _only_machines := ${_only_machines:O:u} # make sure we have a starting place? DIRDEPS ?= ${RELDIR} -.endif # target +.endif # target .if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" @@ -451,7 +451,7 @@ build-dirdeps: M_oneperline = @x@\\${.newline} $$x@ -.if ${BUILD_DIRDEPS_CACHE} == "no" +.if ${BUILD_DIRDEPS_CACHE} == "no" .if !target(dirdeps-cached) # we do this via sub-make BUILD_DIRDEPS = no @@ -469,7 +469,7 @@ dirdeps-cached: ${DIRDEPS_CACHE} .MAKE BUILD_DIRDEPS_MAKEFILE ?= ${MAKEFILE} BUILD_DIRDEPS_TARGETS ?= ${.TARGETS} -# we need the .meta file to ensure we update if +# we need the .meta file to ensure we update if # any of the Makefile.depend* changed. # We do not want to compare the command line though. ${DIRDEPS_CACHE}: .META .NOMETA_CMP @@ -528,6 +528,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR} # on rare occasions, there can be a need for extra help _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc .-include <${_dep_hack}> +.-include <${_dep_hack:R}.options> .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC} # this should be all @@ -581,7 +582,7 @@ _build_dirs += ${_machines:N${DEP_TARGET_SPEC}:@m@${_C .if ${_debug_reldir} .info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: DIRDEPS='${DIRDEPS}' -.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _machines='${_machines}' +.info ${DEP_RELDIR}.${DEP_TARGET_SPEC}: _machines='${_machines}' .endif .if !empty(DIRDEPS) @@ -589,7 +590,7 @@ _build_dirs += ${_machines:N${DEP_TARGET_SPEC}:@m@${_C DEP_DIRDEPS_FILTER = \ ${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \ ${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \ - ${DIRDEPS_FILTER:U} + ${DIRDEPS_FILTER:U} .if empty(DEP_DIRDEPS_FILTER) # something harmless DEP_DIRDEPS_FILTER = U @@ -598,7 +599,7 @@ DEP_DIRDEPS_FILTER = U # this is what we start with __depdirs := ${DIRDEPS:${NSkipDir}:${DEP_DIRDEPS_FILTER:ts:}:C,//+,/,g:O:u:@d@${SRCTOP}/$d@} -# some entries may be qualified with . +# some entries may be qualified with . # the :M*/*/*.* just tries to limit the dirs we check to likely ones. # the ${d:E:M*/*} ensures we don't consider junos/usr.sbin/mgd __qual_depdirs := ${__depdirs:M*/*/*.*:@d@${exists($d):?:${"${d:E:M*/*}":?:${exists(${d:R}):?$d:}}}@} @@ -606,7 +607,8 @@ __unqual_depdirs := ${__depdirs:${__qual_depdirs:Uno:$ .if ${DEP_RELDIR} == ${_DEP_RELDIR} # if it was called out - we likely need it. -__hostdpadd := ${DPADD:U.:M${HOST_OBJTOP}/*:S,${HOST_OBJTOP}/,,:H:${NSkipDir}:${DIRDEPS_FILTER:ts:}:S,$,.host,:N.*:@d@${SRCTOP}/$d@} +__hostdpadd := ${DPADD:U.:M${HOST_OBJTOP}/*:S,${HOST_OBJTOP}/,,:H:${NSkipDir}:${DIRDEPS_FILTER:ts:}:S,$,.host,:N.*:@d@${SRCTOP}/$d@} \ + ${DPADD:U.:M${HOST_OBJTOP32:Uno}/*:S,${HOST_OBJTOP32:Uno}/,,:H:${NSkipDir}:${DIRDEPS_FILTER:ts:}:S,$,.host32,:N.*:@d@${SRCTOP}/$d@} __qual_depdirs += ${__hostdpadd} .endif @@ -710,7 +712,7 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_dtspec:[$i]} .else DEP_MACHINE := ${_DEP_MACHINE} .endif -# Warning: there is an assumption here that MACHINE is always +# Warning: there is an assumption here that MACHINE is always # the first entry in TARGET_SPEC_VARS. # If TARGET_SPEC and MACHINE are insufficient, you have a problem. _m := ${.MAKE.DEPENDFILE_PREFERENCE:T:S;${TARGET_SPEC}$;${d:E};:S;${MACHINE};${d:E:C/,.*//};:@m@${exists(${d:R}/$m):?${d:R}/$m:}@:[1]} @@ -720,7 +722,7 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M_dep_qual_fixe .if ${_debug_search} .info Looking for ${_qm} .endif -# set this "just in case" +# set this "just in case" # we can skip :tA since we computed the path above DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,} # and reset this @@ -743,6 +745,10 @@ DIRDEPS = # we are building something DEP_RELDIR := ${RELDIR} _DEP_RELDIR := ${RELDIR} +# Since we are/should be included by .MAKE.DEPENDFILE +# is is a final opportunity to add/hook global rules. +.-include + # pickup local dependencies .if ${MAKE_VERSION} < 20160220 .-include <.depend> Modified: head/contrib/bmake/mk/gendirdeps.mk ============================================================================== --- head/contrib/bmake/mk/gendirdeps.mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/gendirdeps.mk Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.37 2018/01/31 19:06:46 sjg Exp $ +# $Id: gendirdeps.mk,v 1.38 2018/03/10 00:53:52 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -160,6 +160,12 @@ META2DEPS_CMD += -S ${SB_BACKING_SB}/src M2D_OBJROOTS += ${SB_BACKING_SB}/${SB_OBJPREFIX} .endif +GENDIRDEPS_SEDCMDS += \ + -e 's,//*$$,,;s,\.${HOST_TARGET:Uhost}$$,.host,' \ + -e 's,\.${HOST_TARGET32:Uhost32}$$,.host32,' \ + -e 's,\.${MACHINE}$$,,' \ + -e 's:\.${TARGET_SPEC:U${MACHINE}}$$::' + # we are only interested in the dirs # specifically those we read something from. # we canonicalize them to keep things simple @@ -170,7 +176,7 @@ dir_list != cd ${_OBJDIR} && \ SRCTOP=${SRCTOP} RELDIR=${RELDIR} CURDIR=${_CURDIR} \ ${META2DEPS_ARGS} \ ${META_FILES:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ - sed 's,//*$$,,;s,\.${HOST_TARGET}$$,.host,' + sed ${GENDIRDEPS_SEDCMDS} .if ${dir_list:M*ERROR\:*} != "" .warning ${dir_list:tW:C,.*(ERROR),\1,} @@ -194,7 +200,7 @@ dpadd_dir_list += ${f:H:tA} .endfor .if !empty(ddep_list) ddeps != cat ${ddep_list:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \ - sed 's,//*$$,,;s,\.${HOST_TARGET:Uhost}$$,.host,;s,\.${HOST_TARGET32:Uhost32}$$,.host32,;s,\.${MACHINE}$$,,' + sed ${GENDIRDEPS_SEDCMDS} .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" .info ${RELDIR}: raw_dir_list='${dir_list}' Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/install-mk Sat May 19 00:26:00 2018 (r333820) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.153 2018/01/24 22:57:11 sjg Exp $ +# $Id: install-mk,v 1.156 2018/04/22 04:42:47 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20180118 +MK_VERSION=20180420 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/ldorder.mk ============================================================================== --- head/contrib/bmake/mk/ldorder.mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/ldorder.mk Sat May 19 00:26:00 2018 (r333820) @@ -1,14 +1,14 @@ -# $Id: ldorder.mk,v 1.18 2018/02/11 18:27:59 sjg Exp $ +# $Id: ldorder.mk,v 1.25 2018/04/24 23:50:26 sjg Exp $ # # @(#) Copyright (c) 2015, Simon J. Gerraty # # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -27,14 +27,21 @@ .if !target(_LDORDER_USE) # does caller want to use ldorder? # yes for prog, normally no for lib -_ldorder_use := ${.ALLTARGETS:Mldorder} +.if ${.ALLTARGETS:Mldorder} != "" +_ldorder_use: +.endif +# define this if we need a barrier between local and external libs +# see below +LDORDER_EXTERN_BARRIER ?= .ldorder-extern-barrier + .-include # convert /path/to/libfoo.a into _{LIBFOO} LDORDER_INC_FILTER += S,+,PLUS,g S,.so$$,,g LDORDER_LIBS_FILTER += O:u LDORDER_INC ?= ldorder.inc +# for meta mode REFERENCE_FILE ?= : _LDORDER_USE: .ldorder-rm .USE .NOTMAIN @@ -72,9 +79,27 @@ LDADD_LDORDER ?= `cat ldorder` # for debug below _ldorder = ${RELDIR}.${TARGET_SPEC} +# we make have some libs that exist outside of $SB +# and want to insert a barrier +.if target(${LDORDER_EXTERN_BARRIER}) +# eg. in local.ldorder.mk +# ${LDORDER_EXTERN_BARRIER}: +# @test -z "${extern_ldorders}" || \ +# echo -Wl,-Bdynamic >> .ldorder +# +# feel free to put more suitable version in local.ldorder.mk if needed +# we do *not* count host libs in extern_ldorders +extern_ldorders ?= ${__dpadd_libs:tA:N/lib*:N/usr/lib*:N${SB}/*:N${SB_OBJROOT:tA}*:T:${LDORDER_LIBS_FILTER:ts:}:R:C/\.so.*//:S,^,.ldorder-,:N.ldorder-} +sb_ldorders ?= ${.ALLTARGETS:M.ldorder-*:N${LDORDER_EXTERN_BARRIER}:N.ldorder-rm:${extern_ldorders:${M_ListToSkip}}:N.ldorder-} + +# finally in Makefile after include of *.mk put +# .ldorder ${sb_ldorders}: ${LDORDER_EXTERN_BARRIER} +# ${LDORDER_EXTERN_BARRIER}: ${extern_ldorders} +.endif + .endif # !target(_LDORDER_USE) -.if !empty(LDORDER_LIBS) && !empty(_ldorder_use) +.if !empty(LDORDER_LIBS) && target(_ldorder_use) # canonicalize - these are just tokens anyway LDORDER_LIBS := ${LDORDER_LIBS:${LDORDER_LIBS_FILTER:ts:}:R:C/\.so.*//} _ldorders := ${LDORDER_LIBS:T:Mlib*:S,^,.ldorder-,} @@ -108,6 +133,7 @@ ${_ldorder}: ${_ldorders} __${__inc}__: # make sure this is reset LDORDER_LIBS = +_ldorders = .-include <${__inc}> .endif .endfor @@ -119,9 +145,12 @@ LDORDER_LIBS = # to add extra content - like CFLAGS libLDORDER_INC = lib${LIB}.${LDORDER_INC} .if !commands(${libLDORDER_INC}) +.if target(ldorder-header) +${libLDORDER_INC}: ldorder-header +.endif ${libLDORDER_INC}: @(cat /dev/null ${.ALLSRC:M*ldorder*}; \ - echo 'LDORDER_LIBS= ${_LDORDER_LIBS:T:R:${LDORDER_INC_FILTER:ts:}:tu:C,.*,_{&},}'; \ + echo 'LDORDER_LIBS= ${_LDORDER_LIBS:T:R:${LDORDER_INC_FILTER:ts:}:tu:C,.*,_{&},:N_{}}'; \ echo; echo '.include ' ) | sed 's,_{,$${,g' > ${.TARGET} .endif .endif Modified: head/contrib/bmake/mk/meta.autodep.mk ============================================================================== --- head/contrib/bmake/mk/meta.autodep.mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/meta.autodep.mk Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.46 2017/10/25 23:44:20 sjg Exp $ +# $Id: meta.autodep.mk,v 1.48 2018/04/15 06:30:04 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -6,10 +6,10 @@ # This file is provided in the hope that it will # be of use. There is absolutely NO WARRANTY. # Permission to copy, redistribute or otherwise -# use this file is hereby granted provided that +# use this file is hereby granted provided that # the above copyright notice and this notice are -# left intact. -# +# left intact. +# # Please send copies of changes and bug-fixes to: # sjg@crufty.net # @@ -39,7 +39,7 @@ ${s:T:R}$e: $s # you are supposed to know what you are doing! UPDATE_DEPENDFILE = yes .elif !empty(.TARGETS) && !make(all) -# do not update the *depend* files +# do not update the *depend* files # unless we are building the entire directory or the default target. # NO means don't update .depend - or Makefile.depend* # no means update .depend but not Makefile.depend* @@ -119,7 +119,7 @@ META_FILE_FILTER ?= N.meta META_FILE_FILTER += Ndirdeps.cache* .if !empty(DPADD) -# if we have any non-libs in DPADD, +# if we have any non-libs in DPADD, # they probably need to be paid attention to .if !empty(DPLIBS) FORCE_DPADD = ${DPADD:${DPLIBS:${M_ListToSkip}}:${DPADD_LAST:${M_ListToSkip}}} @@ -138,8 +138,8 @@ FORCE_DPADD += ${_nonlibs:@x@${DPADD:M*/$x}@} # if we don't have OBJS, then .depend isn't useful .if !target(.depend) && (!empty(OBJS) || ${.ALLTARGETS:M*.o} != "") # some makefiles and/or targets contain -# circular dependencies if you dig too deep -# (as meta mode is apt to do) +# circular dependencies if you dig too deep +# (as meta mode is apt to do) # so we provide a means of suppressing them. # the input to the loop below is target: dependency # with just one dependency per line. @@ -155,13 +155,13 @@ SUPPRESS_DEPEND += \ # we use ${.MAKE.META.CREATED} to trigger an update but # we process using ${.MAKE.META.FILES} # the double $$ defers initial evaluation -# if necessary, we fake .po dependencies, just so the result +# if necessary, we fake .po dependencies, just so the result # in Makefile.depend* is stable # The current objdir may be referred to in various ways OBJDIR_REFS += ${.OBJDIR} ${.OBJDIR:tA} ${_OBJDIR} ${RELOBJTOP}/${RELDIR} _depend = .depend # it would be nice to be able to get .SUFFIXES as ${.SUFFIXES} -# we actually only care about the .SUFFIXES of files that might be +# we actually only care about the .SUFFIXES of files that might be # generated by tools like yacc. DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx .hxx .cc .hh .depend: .NOMETA $${.MAKE.META.CREATED} ${_this} @@ -253,8 +253,13 @@ META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O .info ${_DEPENDFILE:S,${SRCTOP}/,,}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} xtras=${META_XTRAS} .endif -.if ${.MAKE.LEVEL} > 0 && !empty(GENDIRDEPS_FILTER) +.if ${.MAKE.LEVEL} > 0 +.if ${UPDATE_DEPENDFILE} == "yes" +.-include <${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}.options> +.endif +.if !empty(GENDIRDEPS_FILTER) .export GENDIRDEPS_FILTER +.endif .endif # we might have .../ in MAKESYSPATH Modified: head/contrib/bmake/mk/own.mk ============================================================================== --- head/contrib/bmake/mk/own.mk Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/mk/own.mk Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -# $Id: own.mk,v 1.39 2018/01/26 20:08:16 sjg Exp $ +# $Id: own.mk,v 1.40 2018/04/23 04:53:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -91,7 +91,7 @@ OPTIONS_DEFAULT_NO+= DPADD_MK OPTIONS_DEFAULT_NO+= \ INSTALL_AS_USER \ GPROF \ - LDORDER_MK \ + PROG_LDORDER_MK \ LIBTOOL \ LINT \ @@ -114,7 +114,7 @@ OPTIONS_DEFAULT_YES+= \ OPTIONS_DEFAULT_DEPENDENT+= \ CATPAGES/MAN \ - PROG_LDORDER_MK/LDORDER_MK \ + LDORDER_MK/PROG_LDORDER_MK \ OBJDIRS/OBJ \ PICINSTALL/LINKLIB \ PICLIB/PIC \ Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Sat May 19 00:04:01 2018 (r333819) +++ head/contrib/bmake/parse.c Sat May 19 00:26:00 2018 (r333820) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.227 2018/02/22 01:59:28 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"); #endif #endif /* not lint */ #endif @@ -371,9 +371,6 @@ static void ParseHasCommands(void *); static void ParseDoInclude(char *); static void ParseSetParseFile(const char *); static void ParseSetIncludedFile(void); -#ifdef SYSVINCLUDE -static void ParseTraditionalInclude(char *); -#endif #ifdef GMAKEEXPORT static void ParseGmakeExport(char *); #endif @@ -2519,8 +2516,73 @@ Parse_SetInput(const char *name, int line, int fd, ParseSetParseFile(name); } +/*- + *----------------------------------------------------------------------- + * IsInclude -- + * Check if the line is an include directive + * + * Results: + * TRUE if it is. + * + * Side Effects: + * None + * + *----------------------------------------------------------------------- + */ +static Boolean +IsInclude(const char *line, Boolean sysv) +{ + static const char inc[] = "include"; + static const size_t inclen = sizeof(inc) - 1; + + // 'd' is not valid for sysv + int o = strchr(&("ds-"[sysv]), *line) != NULL; + + if (strncmp(line + o, inc, inclen) != 0) + return FALSE; + + // Space is not mandatory for BSD .include + return !sysv || isspace((unsigned char)line[inclen + o]); +} + + #ifdef SYSVINCLUDE /*- + *----------------------------------------------------------------------- + * IsSysVInclude -- + * Check if the line is a SYSV include directive + * + * Results: + * TRUE if it is. + * + * Side Effects: + * None + * + *----------------------------------------------------------------------- + */ +static Boolean +IsSysVInclude(const char *line) +{ + const char *p; + + if (!IsInclude(line, TRUE)) + return FALSE; + + /* Avoid interpeting a dependency line as an include */ + for (p = line; (p = strchr(p, ':')) != NULL;) { + if (*++p == '\0') { + /* end of line -> dependency */ + return FALSE; + } + if (*p == ':' || isspace((unsigned char)*p)) { + /* :: operator or ': ' -> dependency */ + return FALSE; + } + } + return TRUE; +} + +/*- *--------------------------------------------------------------------- * ParseTraditionalInclude -- * Push to another file. @@ -3019,9 +3081,7 @@ Parse_File(const char *name, int fd) for (cp = line + 1; isspace((unsigned char)*cp); cp++) { continue; } - if (strncmp(cp, "include", 7) == 0 || - ((cp[0] == 'd' || cp[0] == 's' || cp[0] == '-') && - strncmp(&cp[1], "include", 7) == 0)) { + if (IsInclude(cp, FALSE)) { ParseDoInclude(cp); continue; } @@ -3083,12 +3143,7 @@ Parse_File(const char *name, int fd) } #ifdef SYSVINCLUDE - if (((strncmp(line, "include", 7) == 0 && - isspace((unsigned char) line[7])) || - ((line[0] == 's' || line[0] == '-') && - strncmp(&line[1], "include", 7) == 0 && - isspace((unsigned char) line[8]))) && - strchr(line, ':') == NULL) { + if (IsSysVInclude(line)) { /* * It's an S3/S5-style "include". */ Modified: head/usr.bin/bmake/Makefile.config ============================================================================== --- head/usr.bin/bmake/Makefile.config Sat May 19 00:04:01 2018 (r333819) +++ head/usr.bin/bmake/Makefile.config Sat May 19 00:26:00 2018 (r333820) @@ -7,7 +7,7 @@ SRCTOP?= ${.CURDIR:H:H} # things set by configure -_MAKE_VERSION=20180222 +_MAKE_VERSION=20180512 prefix?= /usr srcdir= ${SRCTOP}/contrib/bmake From owner-svn-src-all@freebsd.org Sat May 19 02:17:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B59EE6863; Sat, 19 May 2018 02:17:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8525756E7; Sat, 19 May 2018 02:17:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B55C020AA2; Sat, 19 May 2018 02:17:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J2HIE8064667; Sat, 19 May 2018 02:17:18 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J2HIgB064666; Sat, 19 May 2018 02:17:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190217.w4J2HIgB064666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 02:17:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333823 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 02:17:19 -0000 Author: mmacy Date: Sat May 19 02:17:18 2018 New Revision: 333823 URL: https://svnweb.freebsd.org/changeset/base/333823 Log: pidctrl Actually use the variables that we assign to as seatbelts to prevent divide by zero Reviewed by: jeffr Modified: head/sys/kern/subr_pidctrl.c Modified: head/sys/kern/subr_pidctrl.c ============================================================================== --- head/sys/kern/subr_pidctrl.c Sat May 19 02:15:40 2018 (r333822) +++ head/sys/kern/subr_pidctrl.c Sat May 19 02:17:18 2018 (r333823) @@ -103,9 +103,9 @@ pidctrl_classic(struct pidctrl *pc, int input) pc->pc_derivative = error - pc->pc_olderror; /* Divide by inverse gain values to produce output. */ - output = ((pc->pc_error / pc->pc_Kpd) + - (pc->pc_integral / pc->pc_Kid)) + - (pc->pc_derivative / pc->pc_Kdd); + output = ((pc->pc_error / Kpd) + + (pc->pc_integral / Kid)) + + (pc->pc_derivative / Kdd); /* Save for sysctl. */ pc->pc_output = output; pc->pc_input = input; @@ -146,9 +146,9 @@ pidctrl_daemon(struct pidctrl *pc, int input) pc->pc_derivative = error - pc->pc_olderror; /* Divide by inverse gain values to produce output. */ - output = ((error / pc->pc_Kpd) + - (pc->pc_integral / pc->pc_Kid)) + - (pc->pc_derivative / pc->pc_Kdd); + output = ((error / Kpd) + + (pc->pc_integral / Kid)) + + (pc->pc_derivative / Kdd); output = MAX(output - pc->pc_output, 0); pc->pc_output += output; pc->pc_input = input; From owner-svn-src-all@freebsd.org Sat May 19 02:15:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF588EE67DF; Sat, 19 May 2018 02:15:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F0DE755F7; Sat, 19 May 2018 02:15:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FDC820A9A; Sat, 19 May 2018 02:15:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J2Feu9064559; Sat, 19 May 2018 02:15:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J2FeB9064558; Sat, 19 May 2018 02:15:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190215.w4J2FeB9064558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 02:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333822 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 02:15:41 -0000 Author: mmacy Date: Sat May 19 02:15:40 2018 New Revision: 333822 URL: https://svnweb.freebsd.org/changeset/base/333822 Log: fix gcc8 unused variable and set but not used variable in unix sockets add copyright from lock rewrite while here Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 (r333821) +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 (r333822) @@ -4,7 +4,7 @@ * Copyright (c) 1982, 1986, 1989, 1991, 1993 * The Regents of the University of California. * Copyright (c) 2004-2009 Robert N. M. Watson - * All rights reserved. + * Copyright (c) 2018 Matthew Macy * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -765,6 +765,7 @@ uipc_detach(struct socket *so) KASSERT(unp != NULL, ("uipc_detach: unp == NULL")); vp = NULL; + vplock = NULL; local_unp_rights = 0; UNP_LINK_WLOCK(); @@ -787,7 +788,8 @@ uipc_detach(struct socket *so) } if (unp->unp_vnode != vp && unp->unp_vnode != NULL) { - mtx_unlock(vplock); + if (vplock) + mtx_unlock(vplock); UNP_PCB_UNLOCK(unp); if (unp2) UNP_PCB_UNLOCK(unp2); @@ -1676,7 +1678,9 @@ static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2) { struct socket *so, *so2; - int rele, freed; +#ifdef INVARIANTS + int freed; +#endif KASSERT(unp2 != NULL, ("unp_disconnect: unp2 == NULL")); @@ -1688,7 +1692,6 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2) MPASS(unp->unp_conn == unp2); unp->unp_conn = NULL; - rele = 0; so = unp->unp_socket; so2 = unp2->unp_socket; switch (unp->unp_socket->so_type) { @@ -1713,9 +1716,15 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2) soisdisconnected(so2); break; } - freed = unp_pcb_rele(unp); +#ifdef INVARIANTS + freed = +#endif + unp_pcb_rele(unp); MPASS(freed == 0); - freed = unp_pcb_rele(unp2); +#ifdef INVARIANTS + freed = +#endif + unp_pcb_rele(unp2); MPASS(freed == 0); } From owner-svn-src-all@freebsd.org Sat May 19 03:23:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DC3CEE9827; Sat, 19 May 2018 03:23:47 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4461780A8; Sat, 19 May 2018 03:23:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B51AB21739; Sat, 19 May 2018 03:23:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3NkQJ001125; Sat, 19 May 2018 03:23:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3NknV001124; Sat, 19 May 2018 03:23:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805190323.w4J3NknV001124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 May 2018 03:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333824 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 333824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:23:47 -0000 Author: jhibbits Date: Sat May 19 03:23:46 2018 New Revision: 333824 URL: https://svnweb.freebsd.org/changeset/base/333824 Log: Add some Hypervisor interrupt definitions This mostly completes the interrupt definitions. There are still some left out, less likely to be used in the near term. Modified: head/sys/powerpc/include/trap.h Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Sat May 19 02:17:18 2018 (r333823) +++ head/sys/powerpc/include/trap.h Sat May 19 03:23:46 2018 (r333824) @@ -77,11 +77,18 @@ #define EXC_DSMISS 0x1200 /* Data store translation miss */ /* Power ISA 2.06+: */ +#define EXC_HDSI 0x0e00 /* Hypervisor Data Storage */ +#define EXC_HISI 0x0e20 /* Hypervisor Instruction Storage */ #define EXC_HEA 0x0e40 /* Hypervisor Emulation Assistance */ +#define EXC_HMI 0x0e60 /* Hypervisor Maintenance */ #define EXC_VSX 0x0f40 /* VSX Unavailable */ /* Power ISA 2.07+: */ #define EXC_FAC 0x0f60 /* Facility Unavailable */ +#define EXC_HFAC 0x0f80 /* Hypervisor Facility Unavailable */ + +/* Power ISA 3.0+: */ +#define EXC_HVI 0x0ea0 /* Hypervisor Virtualization */ /* The following are available on 4xx and 85xx */ #define EXC_CRIT 0x0100 /* Critical Input Interrupt */ From owner-svn-src-all@freebsd.org Sat May 19 03:49:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9493CEEAB0B; Sat, 19 May 2018 03:49:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48687792B1; Sat, 19 May 2018 03:49:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 299A521AB2; Sat, 19 May 2018 03:49:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3nbfD011900; Sat, 19 May 2018 03:49:37 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3naos011899; Sat, 19 May 2018 03:49:36 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190349.w4J3naos011899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333829 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:49:37 -0000 Author: mmacy Date: Sat May 19 03:49:36 2018 New Revision: 333829 URL: https://svnweb.freebsd.org/changeset/base/333829 Log: fix uninitialized variable warning Modified: head/sys/kern/subr_prf.c head/sys/kern/uipc_sockbuf.c Modified: head/sys/kern/subr_prf.c ============================================================================== --- head/sys/kern/subr_prf.c Sat May 19 03:48:35 2018 (r333828) +++ head/sys/kern/subr_prf.c Sat May 19 03:49:36 2018 (r333829) @@ -660,6 +660,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), vo int stop = 0, retval = 0; num = 0; + q = NULL; if (!func) d = (char *) arg; else Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sat May 19 03:48:35 2018 (r333828) +++ head/sys/kern/uipc_sockbuf.c Sat May 19 03:49:36 2018 (r333829) @@ -460,6 +460,7 @@ sbsetopt(struct socket *so, int cmd, u_long cc) u_int *hiwat, *lowat; int error; + sb = NULL; SOCK_LOCK(so); if (SOLISTENING(so)) { switch (cmd) { From owner-svn-src-all@freebsd.org Sat May 19 04:02:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA577EEB735; Sat, 19 May 2018 04:02:30 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9DA7A5A3; Sat, 19 May 2018 04:02:30 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60F7421DFA; Sat, 19 May 2018 04:02:30 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J42UOq021585; Sat, 19 May 2018 04:02:30 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J42UTW021583; Sat, 19 May 2018 04:02:30 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190402.w4J42UTW021583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333837 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:02:31 -0000 Author: mmacy Date: Sat May 19 04:02:29 2018 New Revision: 333837 URL: https://svnweb.freebsd.org/changeset/base/333837 Log: tty: conditionally assign to ret value only used by MPASS statement Modified: head/sys/kern/tty_inq.c head/sys/kern/tty_outq.c Modified: head/sys/kern/tty_inq.c ============================================================================== --- head/sys/kern/tty_inq.c Sat May 19 04:01:15 2018 (r333836) +++ head/sys/kern/tty_inq.c Sat May 19 04:02:29 2018 (r333837) @@ -328,13 +328,15 @@ ttyinq_write(struct ttyinq *ti, const void *buf, size_ int ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t nbytes, int quote) { +#ifdef INVARIANTS size_t ret; +#endif if (ttyinq_bytesleft(ti) < nbytes) return (-1); /* We should always be able to write it back. */ - ret = ttyinq_write(ti, buf, nbytes, quote); + DBGSET(ret, ttyinq_write(ti, buf, nbytes, quote)); MPASS(ret == nbytes); return (0); Modified: head/sys/kern/tty_outq.c ============================================================================== --- head/sys/kern/tty_outq.c Sat May 19 04:01:15 2018 (r333836) +++ head/sys/kern/tty_outq.c Sat May 19 04:02:29 2018 (r333837) @@ -324,13 +324,15 @@ ttyoutq_write(struct ttyoutq *to, const void *buf, siz int ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t nbytes) { +#ifdef INVARIANTS size_t ret; +#endif if (ttyoutq_bytesleft(to) < nbytes) return (-1); /* We should always be able to write it back. */ - ret = ttyoutq_write(to, buf, nbytes); + DBGSET(ret, ttyoutq_write(to, buf, nbytes)); MPASS(ret == nbytes); return (0); From owner-svn-src-all@freebsd.org Sat May 19 03:55:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C9B5EEB08B; Sat, 19 May 2018 03:55:41 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::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 6F14979A51; Sat, 19 May 2018 03:55:40 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x234.google.com with SMTP id m17-v6so16707627lfj.8; Fri, 18 May 2018 20:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=oKtRGDNblRUcLSlWOBNCE1hevqvo6wkjXQs4nKiwBj0=; b=a2I6cHTb1a+gBeezclP2BolDs19dTLUzQ7iiLgICR8eBfxQcNqzu+1qBjEuxJtlj5i ++V6CtLgaWjkiomCiASZvdGbhMnouW6jet4G/ZQjqbBklcTn3FzEpYA7I8SrzDqDWFc7 xlCpwK6y1AyO4Ix+WcUpZPgGYVVLKpNOBJFZzB6a8aHi/BpiHuoH3Oo+CVgECd9O1oEk QaoT3UWU4Ba8OdzPUZLaLYFNDyWIeUj62Nds0z+e/WKl1GceWX4OV9/QKNZXSYkyGWjE 61PHgA0fCkIybG2hQbYViKze2DhYJjBH58ZKL+fWijp71ssPc/MDnb0hKlul4/XVBR0c J3fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=oKtRGDNblRUcLSlWOBNCE1hevqvo6wkjXQs4nKiwBj0=; b=eLu8fplv3FcDpqu7rpne7zYimflH1m98WZUT89zq4jv4phaMnUERuIjixjlTgdFcLx c/pOvuOoguk1MulnIXDi+SGC6b1vfbSzkwNN5m4r/jX0Jd2z0BAQYOUWg6eU0N7VpAXy ZV0GPXSkf0bdbiamBuvKqauvIf/jHUUWzFfOJsxFOaNUTB1Rd9EvWPijR4SkHXEvdcS+ aHccKOthfb6UOHLb9pnSaaUI8Srzx6E6Bb8CkT07HU7P2AC/p4ZIjSOFWLOCDpeyMU70 Qq0bm9rwb9CNIDVBPNT9uENJLlfPqUu60hpoQAtDayJhUEjyK+CVXq+1tP/5LZp/6wEP 05zg== X-Gm-Message-State: ALKqPwdeT1eMDhnv2LmjntgjyvhFc5znPlJztshqooY6NfC3XEOtECMG PR7dAhQD7kq/jWA323+ZohaYD7pV1m/wMGeIz5tEkA== X-Google-Smtp-Source: AB8JxZoNgYq2202Nii3zs8Fs2nUqnlezr1XcHIghgN/jHrS+1/RJ6CfXuB4ub3+/Kl1Z3Eh/ol0KrHBogmBSELr7irA= X-Received: by 2002:a2e:86d9:: with SMTP id n25-v6mr7015250ljj.18.1526702138714; Fri, 18 May 2018 20:55:38 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 2002:a2e:3a13:0:0:0:0:0 with HTTP; Fri, 18 May 2018 20:55:38 -0700 (PDT) In-Reply-To: <201805190345.w4J3jcAv011569@repo.freebsd.org> References: <201805190345.w4J3jcAv011569@repo.freebsd.org> From: Justin Hibbits Date: Fri, 18 May 2018 22:55:38 -0500 X-Google-Sender-Auth: PMVqbTS5_2HjaBd4OAZgVJN7IIo Message-ID: Subject: Re: svn commit: r333825 - head/sys/powerpc/ofw To: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:55:41 -0000 On Fri, May 18, 2018 at 10:45 PM, Justin Hibbits wrote: > Author: jhibbits > Date: Sat May 19 03:45:38 2018 > New Revision: 333825 > URL: https://svnweb.freebsd.org/changeset/base/333825 > > Log: > Add yet another option for gathering available memory > > On some POWER9 systems, 'reg' denotes the full memory in the system, while > 'linux,usable-memory' denotes the usable memory. Some memory is reserved for > NVLink usage, so is partitioned off. > > Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D15482 From owner-svn-src-all@freebsd.org Sat May 19 03:45:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18959EEA861; Sat, 19 May 2018 03:45:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC77378E0B; Sat, 19 May 2018 03:45:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8828A21AA8; Sat, 19 May 2018 03:45:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3jc4t011570; Sat, 19 May 2018 03:45:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3jcAv011569; Sat, 19 May 2018 03:45:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805190345.w4J3jcAv011569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 May 2018 03:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333825 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 333825 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:45:39 -0000 Author: jhibbits Date: Sat May 19 03:45:38 2018 New Revision: 333825 URL: https://svnweb.freebsd.org/changeset/base/333825 Log: Add yet another option for gathering available memory On some POWER9 systems, 'reg' denotes the full memory in the system, while 'linux,usable-memory' denotes the usable memory. Some memory is reserved for NVLink usage, so is partitioned off. Submitted by: Breno Leitao Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sat May 19 03:23:46 2018 (r333824) +++ head/sys/powerpc/ofw/ofw_machdep.c Sat May 19 03:45:38 2018 (r333825) @@ -342,6 +342,16 @@ ofw_mem_regions(struct mem_region *memp, int *memsz, res = parse_ofw_memory(phandle, "reg", &memp[msz]); msz += res/sizeof(struct mem_region); + + /* + * On POWER9 Systems we might have both linux,usable-memory and + * reg properties. 'reg' denotes all available memory, but we + * must use 'linux,usable-memory', a subset, as some memory + * regions are reserved for NVLink. + */ + if (OF_getproplen(phandle, "linux,usable-memory") >= 0) + res = parse_ofw_memory(phandle, "linux,usable-memory", + &availp[asz]); if (OF_getproplen(phandle, "available") >= 0) res = parse_ofw_memory(phandle, "available", &availp[asz]); From owner-svn-src-all@freebsd.org Sat May 19 03:47:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBD96EEA9BC; Sat, 19 May 2018 03:47:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F5BC78FA2; Sat, 19 May 2018 03:47:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81D9B21AAC; Sat, 19 May 2018 03:47:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3lTkm011679; Sat, 19 May 2018 03:47:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3lTG5011678; Sat, 19 May 2018 03:47:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805190347.w4J3lTG5011678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 May 2018 03:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333826 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 333826 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:47:30 -0000 Author: jhibbits Date: Sat May 19 03:47:28 2018 New Revision: 333826 URL: https://svnweb.freebsd.org/changeset/base/333826 Log: Fix a manual copy from the original diff for r333825 The 'else' was in the original diff. Submitted by: Breno Leitao Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sat May 19 03:45:38 2018 (r333825) +++ head/sys/powerpc/ofw/ofw_machdep.c Sat May 19 03:47:28 2018 (r333826) @@ -352,7 +352,7 @@ ofw_mem_regions(struct mem_region *memp, int *memsz, if (OF_getproplen(phandle, "linux,usable-memory") >= 0) res = parse_ofw_memory(phandle, "linux,usable-memory", &availp[asz]); - if (OF_getproplen(phandle, "available") >= 0) + else if (OF_getproplen(phandle, "available") >= 0) res = parse_ofw_memory(phandle, "available", &availp[asz]); else From owner-svn-src-all@freebsd.org Sat May 19 03:47:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E1CBEEA9D8; Sat, 19 May 2018 03:47:38 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F32CD79081; Sat, 19 May 2018 03:47:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5D6121AAE; Sat, 19 May 2018 03:47:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3lbLV011730; Sat, 19 May 2018 03:47:37 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3lbC6011729; Sat, 19 May 2018 03:47:37 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190347.w4J3lbC6011729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333827 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333827 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:47:38 -0000 Author: mmacy Date: Sat May 19 03:47:37 2018 New Revision: 333827 URL: https://svnweb.freebsd.org/changeset/base/333827 Log: subr_epoch.c fix unused variable warnings Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sat May 19 03:47:28 2018 (r333826) +++ head/sys/kern/subr_epoch.c Sat May 19 03:47:37 2018 (r333827) @@ -136,7 +136,7 @@ static bool usedomains = true; static void epoch_init(void *arg __unused) { - int domain, count, cpu; + int domain, cpu; block_count = counter_u64_alloc(M_WAITOK); migrate_count = counter_u64_alloc(M_WAITOK); @@ -146,7 +146,7 @@ epoch_init(void *arg __unused) epoch_call_task_count = counter_u64_alloc(M_WAITOK); if (usedomains == false) goto done; - count = domain = 0; + domain = 0; domoffsets[0] = 0; for (domain = 0; domain < vm_ndomains; domain++) { domcount[domain] = CPU_COUNT(&cpuset_domain[domain]); @@ -361,13 +361,11 @@ epoch_block_handler_preempt(struct ck_epoch *global __ void *arg __unused) { epoch_record_t record; - struct epoch_pcpu_state *eps; struct thread *td, *tdwait, *owner; struct turnstile *ts; struct lock_object *lock; int spincount, gen; - eps = arg; record = __containerof(cr, struct epoch_record, er_record); td = curthread; spincount = 0; From owner-svn-src-all@freebsd.org Sat May 19 03:48:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3977AEEAA34; Sat, 19 May 2018 03:48:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFDE979168; Sat, 19 May 2018 03:48:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C25B521AB0; Sat, 19 May 2018 03:48:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3mZ3t011808; Sat, 19 May 2018 03:48:35 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3mZC8011807; Sat, 19 May 2018 03:48:35 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190348.w4J3mZC8011807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333828 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333828 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:48:36 -0000 Author: mmacy Date: Sat May 19 03:48:35 2018 New Revision: 333828 URL: https://svnweb.freebsd.org/changeset/base/333828 Log: sys_process.c fix set but not used warning Modified: head/sys/kern/sys_process.c Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Sat May 19 03:47:37 2018 (r333827) +++ head/sys/kern/sys_process.c Sat May 19 03:48:35 2018 (r333828) @@ -321,7 +321,6 @@ proc_iop(struct thread *td, struct proc *p, vm_offset_ struct iovec iov; struct uio uio; ssize_t slen; - int error; MPASS(len < SSIZE_MAX); slen = (ssize_t)len; @@ -335,7 +334,7 @@ proc_iop(struct thread *td, struct proc *p, vm_offset_ uio.uio_segflg = UIO_SYSSPACE; uio.uio_rw = rw; uio.uio_td = td; - error = proc_rwmem(p, &uio); + proc_rwmem(p, &uio); if (uio.uio_resid == slen) return (-1); return (slen - uio.uio_resid); From owner-svn-src-all@freebsd.org Sat May 19 03:50:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 333DDEEABF9; Sat, 19 May 2018 03:50:30 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1AB77945E; Sat, 19 May 2018 03:50:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B219D21AB8; Sat, 19 May 2018 03:50:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3oTOK012009; Sat, 19 May 2018 03:50:29 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3oTNX012008; Sat, 19 May 2018 03:50:29 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190350.w4J3oTNX012008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333830 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:50:30 -0000 Author: mmacy Date: Sat May 19 03:50:29 2018 New Revision: 333830 URL: https://svnweb.freebsd.org/changeset/base/333830 Log: add DBGSET macro to conditionally assign to a variable depending on INVARIANTS Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat May 19 03:49:36 2018 (r333829) +++ head/sys/sys/systm.h Sat May 19 03:50:29 2018 (r333830) @@ -85,6 +85,7 @@ void kassert_panic(const char *fmt, ...) __printflike #endif #ifdef INVARIANTS /* The option is always available */ +#define DBGSET(lhs, rhs) lhs = (rhs) #define KASSERT(exp,msg) do { \ if (__predict_false(!(exp))) \ kassert_panic msg; \ @@ -96,6 +97,7 @@ void kassert_panic(const char *fmt, ...) __printflike } \ } while (0) #else +#define DBGSET(lhs, rhs) rhs #define KASSERT(exp,msg) do { \ } while (0) From owner-svn-src-all@freebsd.org Sat May 19 03:56:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 817DBEEB119; Sat, 19 May 2018 03:56:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32AD879C9F; Sat, 19 May 2018 03:56:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13D3F21C58; Sat, 19 May 2018 03:56:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3udG0016752; Sat, 19 May 2018 03:56:39 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3udob016751; Sat, 19 May 2018 03:56:39 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190356.w4J3udob016751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333833 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:56:40 -0000 Author: mmacy Date: Sat May 19 03:56:39 2018 New Revision: 333833 URL: https://svnweb.freebsd.org/changeset/base/333833 Log: sysv_msg initialize saved_msgsz Modified: head/sys/kern/sysv_msg.c Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Sat May 19 03:55:42 2018 (r333832) +++ head/sys/kern/sysv_msg.c Sat May 19 03:56:39 2018 (r333833) @@ -776,7 +776,7 @@ kern_msgsnd(struct thread *td, int msqid, const void * struct prison *rpr; short next; #ifdef RACCT - size_t saved_msgsz; + size_t saved_msgsz = 0; #endif rpr = msg_find_prison(td->td_ucred); From owner-svn-src-all@freebsd.org Sat May 19 04:14:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B46CAEEC179; Sat, 19 May 2018 04:14:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 666017B479; Sat, 19 May 2018 04:14:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 468D421FAC; Sat, 19 May 2018 04:14:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4E1i4027123; Sat, 19 May 2018 04:14:01 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4E1t2027122; Sat, 19 May 2018 04:14:01 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190414.w4J4E1t2027122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333845 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:14:01 -0000 Author: mmacy Date: Sat May 19 04:14:00 2018 New Revision: 333845 URL: https://svnweb.freebsd.org/changeset/base/333845 Log: cpuset_thread0: avoid unused assignment on non debug build Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Sat May 19 04:13:20 2018 (r333844) +++ head/sys/kern/kern_cpuset.c Sat May 19 04:14:00 2018 (r333845) @@ -1385,8 +1385,10 @@ struct cpuset * cpuset_thread0(void) { struct cpuset *set; - int error; int i; +#ifdef INVARIANTS + int error; +#endif cpuset_zone = uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); @@ -1411,14 +1413,14 @@ cpuset_thread0(void) * Now derive a default (1), modifiable set from that to give out. */ set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - error = _cpuset_create(set, cpuset_zero, NULL, NULL, 1); + DBGSET(error, _cpuset_create(set, cpuset_zero, NULL, NULL, 1)); KASSERT(error == 0, ("Error creating default set: %d\n", error)); cpuset_default = set; /* * Create the kernel set (2). */ set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - error = _cpuset_create(set, cpuset_zero, NULL, NULL, 2); + DBGSET(error, _cpuset_create(set, cpuset_zero, NULL, NULL, 2)); KASSERT(error == 0, ("Error creating kernel set: %d\n", error)); set->cs_domain = &domainset2; cpuset_kernel = set; From owner-svn-src-all@freebsd.org Sat May 19 04:13:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAE4BEEC0C2; Sat, 19 May 2018 04:13:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70BE27B32D; Sat, 19 May 2018 04:13:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 522B521FAB; Sat, 19 May 2018 04:13:21 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4DLNp027045; Sat, 19 May 2018 04:13:21 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4DLag027044; Sat, 19 May 2018 04:13:21 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190413.w4J4DLag027044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333844 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:13:21 -0000 Author: mmacy Date: Sat May 19 04:13:20 2018 New Revision: 333844 URL: https://svnweb.freebsd.org/changeset/base/333844 Log: make_dev: avoid unused assignments on non debug builds Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat May 19 04:10:53 2018 (r333843) +++ head/sys/kern/kern_conf.c Sat May 19 04:13:20 2018 (r333844) @@ -866,11 +866,13 @@ make_dev(struct cdevsw *devsw, int unit, uid_t uid, gi { struct cdev *dev; va_list ap; +#ifdef INVARIANTS int res; +#endif va_start(ap, fmt); - res = make_dev_credv(0, &dev, devsw, unit, NULL, uid, gid, mode, fmt, - ap); + DBGSET(res, make_dev_credv(0, &dev, devsw, unit, NULL, uid, gid, mode, fmt, + ap)); va_end(ap); KASSERT(res == 0 && dev != NULL, ("make_dev: failed make_dev_credv (error=%d)", res)); @@ -883,10 +885,12 @@ make_dev_cred(struct cdevsw *devsw, int unit, struct u { struct cdev *dev; va_list ap; +#ifdef INVARIANTS int res; +#endif va_start(ap, fmt); - res = make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap); + DBGSET(res, make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap)); va_end(ap); KASSERT(res == 0 && dev != NULL, @@ -996,10 +1000,11 @@ make_dev_alias(struct cdev *pdev, const char *fmt, ... { struct cdev *dev; va_list ap; +#ifdef INVARIANTS int res; - +#endif va_start(ap, fmt); - res = make_dev_alias_v(MAKEDEV_WAITOK, &dev, pdev, fmt, ap); + DBGSET(res, make_dev_alias_v(MAKEDEV_WAITOK, &dev, pdev, fmt, ap)); va_end(ap); KASSERT(res == 0 && dev != NULL, From owner-svn-src-all@freebsd.org Sat May 19 04:01:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42350EEB554; Sat, 19 May 2018 04:01:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2AB57A276; Sat, 19 May 2018 04:01:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4D8C21CA1; Sat, 19 May 2018 04:01:15 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J41FZ6017137; Sat, 19 May 2018 04:01:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J41FBp017135; Sat, 19 May 2018 04:01:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805190401.w4J41FBp017135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 May 2018 04:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333836 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 333836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:01:16 -0000 Author: jhibbits Date: Sat May 19 04:01:15 2018 New Revision: 333836 URL: https://svnweb.freebsd.org/changeset/base/333836 Log: powerpc64: Add OPAL definitions Summary: Add additional OPAL PCI definitions and expand the code to use them in order to ease the OPAL interface process for new comers. These definitions came directly from the OPAL code and they are the same for both PHB3 (POWER8) and PHB4 (POWER9). Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D15432 Modified: head/sys/powerpc/powernv/opal.h head/sys/powerpc/powernv/opal_pci.c Modified: head/sys/powerpc/powernv/opal.h ============================================================================== --- head/sys/powerpc/powernv/opal.h Sat May 19 03:58:40 2018 (r333835) +++ head/sys/powerpc/powernv/opal.h Sat May 19 04:01:15 2018 (r333836) @@ -79,6 +79,20 @@ int opal_call(uint64_t token, ...); #define OPAL_UNMAP_PE 0 #define OPAL_MAP_PE 1 +#define OPAL_PCI_BUS_ANY 0 +#define OPAL_PCI_BUS_3BITS 2 +#define OPAL_PCI_BUS_4BITS 3 +#define OPAL_PCI_BUS_5BITS 4 +#define OPAL_PCI_BUS_6BITS 5 +#define OPAL_PCI_BUS_7BITS 6 +#define OPAL_PCI_BUS_ALL 7 /* Match bus number exactly */ + +#define OPAL_IGNORE_RID_DEVICE_NUMBER 0 +#define OPAL_COMPARE_RID_DEVICE_NUMBER 1 + +#define OPAL_IGNORE_RID_FUNC_NUMBER 0 +#define OPAL_COMPARE_RID_FUNC_NUMBER 1 + #define OPAL_SUCCESS 0 #define OPAL_PARAMETER -1 #define OPAL_BUSY -2 Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Sat May 19 03:58:40 2018 (r333835) +++ head/sys/powerpc/powernv/opal_pci.c Sat May 19 04:01:15 2018 (r333836) @@ -254,8 +254,8 @@ opalpci_attach(device_t dev) * such time as we start wanting to do things like bhyve. */ err = opal_call(OPAL_PCI_SET_PE, sc->phb_id, OPAL_PCI_DEFAULT_PE, - 0, 0, 0, 0, /* All devices */ - OPAL_MAP_PE); + 0, OPAL_PCI_BUS_ANY, OPAL_IGNORE_RID_DEVICE_NUMBER, + OPAL_IGNORE_RID_FUNC_NUMBER, OPAL_MAP_PE); if (err != 0) { device_printf(dev, "PE mapping failed: %d\n", err); return (ENXIO); From owner-svn-src-all@freebsd.org Sat May 19 03:52:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86D53EEAE91; Sat, 19 May 2018 03:52:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A687986C; Sat, 19 May 2018 03:52:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1465E21C4E; Sat, 19 May 2018 03:52:56 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3qt1D016488; Sat, 19 May 2018 03:52:55 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3qtA9016486; Sat, 19 May 2018 03:52:55 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190352.w4J3qtA9016486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333831 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:52:56 -0000 Author: mmacy Date: Sat May 19 03:52:55 2018 New Revision: 333831 URL: https://svnweb.freebsd.org/changeset/base/333831 Log: fix uninitialized variable warning in reader locks Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat May 19 03:50:29 2018 (r333830) +++ head/sys/kern/kern_rwlock.c Sat May 19 03:52:55 2018 (r333831) @@ -887,7 +887,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #ifdef ADAPTIVE_RWLOCKS int spintries = 0; int i, n; - enum { READERS, WRITER } sleep_reason; + enum { READERS, WRITER } sleep_reason = READERS; #endif uintptr_t x; #ifdef LOCK_PROFILING Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat May 19 03:50:29 2018 (r333830) +++ head/sys/kern/kern_sx.c Sat May 19 03:52:55 2018 (r333831) @@ -551,7 +551,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO #ifdef ADAPTIVE_SX volatile struct thread *owner; u_int i, n, spintries = 0; - enum { READERS, WRITER } sleep_reason; + enum { READERS, WRITER } sleep_reason = READERS; bool adaptive; #endif #ifdef LOCK_PROFILING @@ -568,7 +568,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state; + uintptr_t state = 0; #endif int extra_work = 0; @@ -944,7 +944,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state; + uintptr_t state = 0; #endif int extra_work = 0; From owner-svn-src-all@freebsd.org Sat May 19 03:57:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51A1FEEB1BE; Sat, 19 May 2018 03:57:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE77479DDB; Sat, 19 May 2018 03:57:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCE2921C5B; Sat, 19 May 2018 03:57:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3vfbi016839; Sat, 19 May 2018 03:57:41 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3vfqY016838; Sat, 19 May 2018 03:57:41 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190357.w4J3vfqY016838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333834 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:57:42 -0000 Author: mmacy Date: Sat May 19 03:57:41 2018 New Revision: 333834 URL: https://svnweb.freebsd.org/changeset/base/333834 Log: signotify: don't create a stack local that isn't used on non-debug builds Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat May 19 03:56:39 2018 (r333833) +++ head/sys/kern/kern_sig.c Sat May 19 03:57:41 2018 (r333834) @@ -605,11 +605,8 @@ cursig(struct thread *td) void signotify(struct thread *td) { - struct proc *p; - p = td->td_proc; - - PROC_LOCK_ASSERT(p, MA_OWNED); + PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); if (SIGPENDING(td)) { thread_lock(td); From owner-svn-src-all@freebsd.org Sat May 19 03:55:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C916EEB095; Sat, 19 May 2018 03:55:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 507D379A6C; Sat, 19 May 2018 03:55:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 318AA21C53; Sat, 19 May 2018 03:55:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3thDJ016666; Sat, 19 May 2018 03:55:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3thw4016665; Sat, 19 May 2018 03:55:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190355.w4J3thw4016665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333832 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:55:43 -0000 Author: mmacy Date: Sat May 19 03:55:42 2018 New Revision: 333832 URL: https://svnweb.freebsd.org/changeset/base/333832 Log: remove unused variable Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat May 19 03:52:55 2018 (r333831) +++ head/sys/kern/kern_shutdown.c Sat May 19 03:55:42 2018 (r333832) @@ -1495,10 +1495,7 @@ dump_write(struct dumperinfo *di, void *virtual, vm_of int dump_finish(struct dumperinfo *di, struct kerneldumpheader *kdh) { - uint64_t extent; int error; - - extent = dtoh64(kdh->dumpextent); if (di->kdcomp != NULL) { error = compressor_flush(di->kdcomp->kdc_stream); From owner-svn-src-all@freebsd.org Sat May 19 03:58:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE21EEB214; Sat, 19 May 2018 03:58:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C82879ECD; Sat, 19 May 2018 03:58:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D6C621C5D; Sat, 19 May 2018 03:58:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J3we0L016925; Sat, 19 May 2018 03:58:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J3wes8016924; Sat, 19 May 2018 03:58:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190358.w4J3wes8016924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 03:58:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333835 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 03:58:41 -0000 Author: mmacy Date: Sat May 19 03:58:40 2018 New Revision: 333835 URL: https://svnweb.freebsd.org/changeset/base/333835 Log: remove unused locked variable in lockmgr_unlock_fast_path Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sat May 19 03:57:41 2018 (r333834) +++ head/sys/kern/kern_lock.c Sat May 19 03:58:40 2018 (r333835) @@ -1101,7 +1101,6 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, { struct lock_class *class; uintptr_t x, tid; - bool unlocked; const char *file; int line; @@ -1112,12 +1111,10 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, line = __LINE__; _lockmgr_assert(lk, KA_LOCKED, file, line); - unlocked = false; x = lk->lk_lock; if (__predict_true(x & LK_SHARE) != 0) { if (lockmgr_sunlock_try(lk, &x)) { lockmgr_note_shared_release(lk, file, line); - unlocked = true; } else { return (lockmgr_sunlock_hard(lk, x, flags, ilk, file, line)); } @@ -1126,7 +1123,6 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, if (!lockmgr_recursed(lk) && atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { lockmgr_note_exclusive_release(lk, file, line); - unlocked = true; } else { return (lockmgr_xunlock_hard(lk, x, flags, ilk, file, line)); } From owner-svn-src-all@freebsd.org Sat May 19 04:08:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2090EEBB3E; Sat, 19 May 2018 04:08:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AEED7ABF5; Sat, 19 May 2018 04:08:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 574C921E13; Sat, 19 May 2018 04:08:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J48CXY021983; Sat, 19 May 2018 04:08:12 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J48Cwb021982; Sat, 19 May 2018 04:08:12 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190408.w4J48Cwb021982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333841 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:08:13 -0000 Author: mmacy Date: Sat May 19 04:08:11 2018 New Revision: 333841 URL: https://svnweb.freebsd.org/changeset/base/333841 Log: cache_lookup remove unused variable and initialize used Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat May 19 04:07:00 2018 (r333840) +++ head/sys/kern/vfs_cache.c Sat May 19 04:08:11 2018 (r333841) @@ -752,6 +752,7 @@ cache_negative_shrink_select(int start, struct namecac int i; *ncpp = ncp = NULL; + neglist = NULL; for (i = start; i < numneglists; i++) { neglist = &neglists[i]; @@ -1230,7 +1231,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st struct namecache_ts *ncp_ts; struct namecache *ncp; struct rwlock *blp; - struct mtx *dvlp, *dvlp2; + struct mtx *dvlp; uint32_t hash; int error, ltype; @@ -1249,12 +1250,12 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st retry: blp = NULL; + dvlp = NULL; error = 0; if (cnp->cn_namelen == 2 && cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') { counter_u64_add(dotdothits, 1); dvlp = VP2VNODELOCK(dvp); - dvlp2 = NULL; mtx_lock(dvlp); ncp = dvp->v_cache_dd; if (ncp == NULL) { @@ -1629,6 +1630,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, cache_celockstate_init(&cel); ndd = NULL; + ncp_ts = NULL; flag = 0; if (cnp->cn_nameptr[0] == '.') { if (cnp->cn_namelen == 1) From owner-svn-src-all@freebsd.org Sat May 19 04:07:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D621EEBAD7; Sat, 19 May 2018 04:07:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 077D47AB01; Sat, 19 May 2018 04:07:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC49621E12; Sat, 19 May 2018 04:07:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J470uc021898; Sat, 19 May 2018 04:07:00 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J470xC021897; Sat, 19 May 2018 04:07:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190407.w4J470xC021897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333840 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:07:01 -0000 Author: mmacy Date: Sat May 19 04:07:00 2018 New Revision: 333840 URL: https://svnweb.freebsd.org/changeset/base/333840 Log: filt_timerdetach: only assign to old if we're going to check it in a KASSERT Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat May 19 04:05:36 2018 (r333839) +++ head/sys/kern/kern_event.c Sat May 19 04:07:00 2018 (r333840) @@ -751,12 +751,14 @@ static void filt_timerdetach(struct knote *kn) { struct kq_timer_cb_data *kc; +#ifdef INVARIANTS unsigned int old; +#endif kc = kn->kn_ptr.p_v; callout_drain(&kc->c); free(kc, M_KQUEUE); - old = atomic_fetchadd_int(&kq_ncallouts, -1); + DBGSET(old, atomic_fetchadd_int(&kq_ncallouts, -1)); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ } From owner-svn-src-all@freebsd.org Sat May 19 04:04:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2CD4EEB904; Sat, 19 May 2018 04:04:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 823917A7D2; Sat, 19 May 2018 04:04:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6362C21E02; Sat, 19 May 2018 04:04:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J44jVF021708; Sat, 19 May 2018 04:04:45 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J44jtX021707; Sat, 19 May 2018 04:04:45 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190404.w4J44jtX021707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333838 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:04:46 -0000 Author: mmacy Date: Sat May 19 04:04:44 2018 New Revision: 333838 URL: https://svnweb.freebsd.org/changeset/base/333838 Log: simplify control flow so that gcc knows we never pass save to curthread_pflags_restore without initializing Modified: head/sys/kern/subr_uio.c Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Sat May 19 04:02:29 2018 (r333837) +++ head/sys/kern/subr_uio.c Sat May 19 04:04:44 2018 (r333838) @@ -212,7 +212,7 @@ uiomove_faultflag(void *cp, int n, struct uio *uio, in size_t cnt; int error, newflags, save; - error = 0; + save = error = 0; KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, ("uiomove: mode")); @@ -275,7 +275,7 @@ uiomove_faultflag(void *cp, int n, struct uio *uio, in n -= cnt; } out: - if (uio->uio_segflg == UIO_USERSPACE) + if (save) curthread_pflags_restore(save); return (error); } From owner-svn-src-all@freebsd.org Sat May 19 04:05:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CF5DEEB9D0; Sat, 19 May 2018 04:05:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C3217A95C; Sat, 19 May 2018 04:05:37 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E212921E0B; Sat, 19 May 2018 04:05:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J45aUZ021795; Sat, 19 May 2018 04:05:36 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J45aaI021794; Sat, 19 May 2018 04:05:36 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190405.w4J45aaI021794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333839 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:05:37 -0000 Author: mmacy Date: Sat May 19 04:05:36 2018 New Revision: 333839 URL: https://svnweb.freebsd.org/changeset/base/333839 Log: getnextevent: put variable only used by KTR under ifdef KTR Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Sat May 19 04:04:44 2018 (r333838) +++ head/sys/kern/kern_clocksource.c Sat May 19 04:05:36 2018 (r333839) @@ -272,18 +272,22 @@ getnextevent(void) #ifdef SMP int cpu; #endif +#ifdef KTR int c; + c = -1; +#endif state = DPCPU_PTR(timerstate); event = state->nextevent; - c = -1; #ifdef SMP if ((timer->et_flags & ET_FLAGS_PERCPU) == 0) { CPU_FOREACH(cpu) { state = DPCPU_ID_PTR(cpu, timerstate); if (event > state->nextevent) { event = state->nextevent; +#ifdef KTR c = cpu; +#endif } } } From owner-svn-src-all@freebsd.org Sat May 19 04:21:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F6EEECAD3; Sat, 19 May 2018 04:21:51 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE8C37C038; Sat, 19 May 2018 04:21:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D10AB221A9; Sat, 19 May 2018 04:21:50 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4Lo1F031174; Sat, 19 May 2018 04:21:50 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4LoVI031172; Sat, 19 May 2018 04:21:50 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805190421.w4J4LoVI031172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 May 2018 04:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333846 - in head/sys/powerpc: aim powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim powerpc X-SVN-Commit-Revision: 333846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:21:51 -0000 Author: jhibbits Date: Sat May 19 04:21:50 2018 New Revision: 333846 URL: https://svnweb.freebsd.org/changeset/base/333846 Log: Add hypervisor trap handling, using HSRR0/HSRR1 Summary: Some hypervisor exceptions on POWER architecture only save state to HSRR0/HSRR1. Until we have bhyve on POWER, use a lightweight exception frontend which copies HSRR0/HSRR1 into SRR0/SRR1, and run the normal trap handler. The first user of this is the Hypervisor Virtualization Interrupt, which targets the XIVE interrupt controller on POWER9. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D15487 Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/powerpc/interrupt.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sat May 19 04:14:00 2018 (r333845) +++ head/sys/powerpc/aim/aim_machdep.c Sat May 19 04:21:50 2018 (r333846) @@ -148,6 +148,7 @@ extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern void *rstcode, *rstcodeend; extern void *trapcode, *trapcodeend; +extern void *hypertrapcode, *hypertrapcodeend; extern void *generictrap, *generictrap64; extern void *alitrap, *aliend; extern void *dsitrap, *dsiend; @@ -360,6 +361,11 @@ aim_cpu_init(vm_offset_t toc) bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); } + #else + trapsize = (size_t)&hypertrapcodeend - (size_t)&hypertrapcode; + bcopy(&hypertrapcode, (void *)(EXC_HEA + trap_offset), trapsize); + bcopy(&hypertrapcode, (void *)(EXC_HMI + trap_offset), trapsize); + bcopy(&hypertrapcode, (void *)(EXC_HVI + trap_offset), trapsize); #endif bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstcodeend - Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sat May 19 04:14:00 2018 (r333845) +++ head/sys/powerpc/aim/trap_subr64.S Sat May 19 04:21:50 2018 (r333846) @@ -446,6 +446,20 @@ CNAME(trapcode): blrl /* Branch to generictrap */ CNAME(trapcodeend): +/* Same thing for traps setting HSRR0/HSS1 */ + .globl CNAME(hypertrapcode),CNAME(hypertrapcodeend) + .p2align 3 +CNAME(hypertrapcode): + mtsprg1 %r1 /* save SP */ + mflr %r1 /* Save the old LR in r1 */ + mtsprg2 %r1 /* And then in SPRG2 */ + ld %r1,TRAP_GENTRAP(0) + addi %r1,%r1,(generichypertrap-generictrap) + mtlr %r1 + li %r1, 0xe0 /* How to get the vector from LR */ + blrl /* Branch to generictrap */ +CNAME(hypertrapcodeend): + /* * For SLB misses: do special things for the kernel * @@ -757,6 +771,13 @@ realtrap: * SPRG2 - Original LR */ +generichypertrap: + mtsprg3 %r1 + mfspr %r1, SPR_HSRR0 + mtsrr0 %r1 + mfspr %r1, SPR_HSRR1 + mtsrr1 %r1 + mfsprg3 %r1 .globl CNAME(generictrap) generictrap: /* Save R1 for computing the exception vector */ Modified: head/sys/powerpc/powerpc/interrupt.c ============================================================================== --- head/sys/powerpc/powerpc/interrupt.c Sat May 19 04:14:00 2018 (r333845) +++ head/sys/powerpc/powerpc/interrupt.c Sat May 19 04:21:50 2018 (r333846) @@ -86,6 +86,7 @@ powerpc_interrupt(struct trapframe *framep) switch (framep->exc) { case EXC_EXI: + case EXC_HVI: critical_enter(); PIC_DISPATCH(root_pic, framep); critical_exit(); From owner-svn-src-all@freebsd.org Sat May 19 04:10:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B786EEBD4F; Sat, 19 May 2018 04:10:54 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1A7B7AFDB; Sat, 19 May 2018 04:10:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D408321E33; Sat, 19 May 2018 04:10:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4Ardd025270; Sat, 19 May 2018 04:10:53 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4ArSR025269; Sat, 19 May 2018 04:10:53 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190410.w4J4ArSR025269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333843 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:10:54 -0000 Author: mmacy Date: Sat May 19 04:10:53 2018 New Revision: 333843 URL: https://svnweb.freebsd.org/changeset/base/333843 Log: mqueue: avoid unused variables Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Sat May 19 04:09:58 2018 (r333842) +++ head/sys/kern/uipc_mqueue.c Sat May 19 04:10:53 2018 (r333843) @@ -1343,14 +1343,12 @@ mqfs_read(struct vop_read_args *ap) char buf[80]; struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; - struct mqfs_node *pn; struct mqueue *mq; int len, error; if (vp->v_type != VREG) return (EINVAL); - pn = VTON(vp); mq = VTOMQ(vp); snprintf(buf, sizeof(buf), "QSIZE:%-10ld MAXMSG:%-10ld CURMSG:%-10ld MSGSIZE:%-10ld\n", @@ -2439,11 +2437,13 @@ sys_kmq_notify(struct thread *td, struct kmq_notify_ar static void mqueue_fdclose(struct thread *td, int fd, struct file *fp) { - struct filedesc *fdp; struct mqueue *mq; +#ifdef INVARIANTS + struct filedesc *fdp; fdp = td->td_proc->p_fd; FILEDESC_LOCK_ASSERT(fdp); +#endif if (fp->f_ops == &mqueueops) { mq = FPTOMQ(fp); From owner-svn-src-all@freebsd.org Sat May 19 04:09:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE0FEEBC56; Sat, 19 May 2018 04:09:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC56F7AD79; Sat, 19 May 2018 04:09:58 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8798A21E14; Sat, 19 May 2018 04:09:58 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J49wIM022084; Sat, 19 May 2018 04:09:58 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J49wda022083; Sat, 19 May 2018 04:09:58 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190409.w4J49wda022083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333842 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:09:59 -0000 Author: mmacy Date: Sat May 19 04:09:58 2018 New Revision: 333842 URL: https://svnweb.freebsd.org/changeset/base/333842 Log: physio: avoid uninitialized variables Modified: head/sys/kern/kern_physio.c Modified: head/sys/kern/kern_physio.c ============================================================================== --- head/sys/kern/kern_physio.c Sat May 19 04:08:11 2018 (r333841) +++ head/sys/kern/kern_physio.c Sat May 19 04:09:58 2018 (r333842) @@ -51,6 +51,8 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) vm_prot_t prot; csw = dev->si_devsw; + npages = 0; + sa = NULL; /* check if character device is being destroyed */ if (csw == NULL) return (ENXIO); @@ -177,7 +179,7 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) error = EFAULT; goto doerror; } - if (pbuf) { + if (pbuf && sa) { pmap_qenter((vm_offset_t)sa, pages, npages); bp->bio_data = sa + poff; From owner-svn-src-all@freebsd.org Sat May 19 04:43:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DB6CEEDC7A; Sat, 19 May 2018 04:43:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E39767D068; Sat, 19 May 2018 04:43:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4DC722524; Sat, 19 May 2018 04:43:49 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4hn8m042550; Sat, 19 May 2018 04:43:49 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4hnXp042549; Sat, 19 May 2018 04:43:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190443.w4J4hnXp042549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333847 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:43:50 -0000 Author: mmacy Date: Sat May 19 04:43:49 2018 New Revision: 333847 URL: https://svnweb.freebsd.org/changeset/base/333847 Log: malloc: avoid possibly returning stack garbage if MALLOC_DEBUG is defined Modified: head/sys/kern/kern_malloc.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Sat May 19 04:21:50 2018 (r333846) +++ head/sys/kern/kern_malloc.c Sat May 19 04:43:49 2018 (r333847) @@ -559,6 +559,7 @@ malloc(size_t size, struct malloc_type *mtp, int flags #endif #ifdef MALLOC_DEBUG + va = NULL; if (malloc_dbg(&va, &size, mtp, flags) != 0) return (va); #endif @@ -604,6 +605,7 @@ malloc_domain(size_t size, struct malloc_type *mtp, in #endif #ifdef MALLOC_DEBUG + va = NULL; if (malloc_dbg(&va, &size, mtp, flags) != 0) return (va); #endif From owner-svn-src-all@freebsd.org Sat May 19 04:48:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D7FAEEDF98; Sat, 19 May 2018 04:48:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7667D568; Sat, 19 May 2018 04:48:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E29682252C; Sat, 19 May 2018 04:48:26 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4mQfT042883; Sat, 19 May 2018 04:48:26 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4mQZG042881; Sat, 19 May 2018 04:48:26 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190448.w4J4mQZG042881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:48:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333850 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:48:27 -0000 Author: mmacy Date: Sat May 19 04:48:26 2018 New Revision: 333850 URL: https://svnweb.freebsd.org/changeset/base/333850 Log: tty: use __unused annotation instead to silence warnings Modified: head/sys/kern/tty_inq.c head/sys/kern/tty_outq.c Modified: head/sys/kern/tty_inq.c ============================================================================== --- head/sys/kern/tty_inq.c Sat May 19 04:47:34 2018 (r333849) +++ head/sys/kern/tty_inq.c Sat May 19 04:48:26 2018 (r333850) @@ -328,15 +328,13 @@ ttyinq_write(struct ttyinq *ti, const void *buf, size_ int ttyinq_write_nofrag(struct ttyinq *ti, const void *buf, size_t nbytes, int quote) { -#ifdef INVARIANTS - size_t ret; -#endif + size_t ret __unused; if (ttyinq_bytesleft(ti) < nbytes) return (-1); /* We should always be able to write it back. */ - DBGSET(ret, ttyinq_write(ti, buf, nbytes, quote)); + ret = ttyinq_write(ti, buf, nbytes, quote); MPASS(ret == nbytes); return (0); Modified: head/sys/kern/tty_outq.c ============================================================================== --- head/sys/kern/tty_outq.c Sat May 19 04:47:34 2018 (r333849) +++ head/sys/kern/tty_outq.c Sat May 19 04:48:26 2018 (r333850) @@ -324,15 +324,13 @@ ttyoutq_write(struct ttyoutq *to, const void *buf, siz int ttyoutq_write_nofrag(struct ttyoutq *to, const void *buf, size_t nbytes) { -#ifdef INVARIANTS - size_t ret; -#endif + size_t ret __unused; if (ttyoutq_bytesleft(to) < nbytes) return (-1); /* We should always be able to write it back. */ - DBGSET(ret, ttyoutq_write(to, buf, nbytes)); + ret = ttyoutq_write(to, buf, nbytes); MPASS(ret == nbytes); return (0); From owner-svn-src-all@freebsd.org Sat May 19 04:46:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B511EEDD73; Sat, 19 May 2018 04:46:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38CC07D229; Sat, 19 May 2018 04:46:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A9CC22529; Sat, 19 May 2018 04:46:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4kZgB042726; Sat, 19 May 2018 04:46:35 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4kZ3q042721; Sat, 19 May 2018 04:46:35 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190446.w4J4kZ3q042721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333848 - in head/sys: conf modules/bxe modules/drm2/i915kms modules/drm2/radeonkms X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: conf modules/bxe modules/drm2/i915kms modules/drm2/radeonkms X-SVN-Commit-Revision: 333848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:46:36 -0000 Author: mmacy Date: Sat May 19 04:46:34 2018 New Revision: 333848 URL: https://svnweb.freebsd.org/changeset/base/333848 Log: disable set but not used on code that can't be changed Modified: head/sys/conf/kern.mk head/sys/modules/bxe/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/drm2/radeonkms/Makefile Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat May 19 04:43:49 2018 (r333847) +++ head/sys/conf/kern.mk Sat May 19 04:46:34 2018 (r333848) @@ -49,6 +49,7 @@ CLANG_NO_IAS34= -no-integrated-as .if ${COMPILER_VERSION} >= 40800 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. +NO_WUNUSED_BUT_SET_VARIABLE = -Wno-unused-but-set-variable CWARNEXTRA?= -Wno-error=address \ -Wno-error=aggressive-loop-optimizations \ -Wno-error=array-bounds \ Modified: head/sys/modules/bxe/Makefile ============================================================================== --- head/sys/modules/bxe/Makefile Sat May 19 04:43:49 2018 (r333847) +++ head/sys/modules/bxe/Makefile Sat May 19 04:46:34 2018 (r333848) @@ -19,3 +19,4 @@ SRCS += bxe.c \ CFLAGS += -I${BXE} .include +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} Modified: head/sys/modules/drm2/i915kms/Makefile ============================================================================== --- head/sys/modules/drm2/i915kms/Makefile Sat May 19 04:43:49 2018 (r333847) +++ head/sys/modules/drm2/i915kms/Makefile Sat May 19 04:46:34 2018 (r333848) @@ -68,3 +68,4 @@ CWARNFLAGS.i915_gem_tiling.c= ${NO_WTAUTOLOGICAL_POINT CWARNFLAGS.i915_gem_execbuffer.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} CWARNFLAGS.intel_display.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} CWARNFLAGS.intel_overlay.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Sat May 19 04:43:49 2018 (r333847) +++ head/sys/modules/drm2/radeonkms/Makefile Sat May 19 04:46:34 2018 (r333848) @@ -118,3 +118,4 @@ CFLAGS+= -I${SRCTOP}/sys/dev/drm2/radeon CWARNFLAGS.radeon_cp.c= -Wno-unused-value CWARNFLAGS.r600_cp.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} +CWARNFLAGS+= ${NO_WUNUSED_BUT_SET_VARIABLE} From owner-svn-src-all@freebsd.org Sat May 19 04:47:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55828EEDE6B; Sat, 19 May 2018 04:47:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8837D3B1; Sat, 19 May 2018 04:47:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFE002252B; Sat, 19 May 2018 04:47:34 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4lYcB042804; Sat, 19 May 2018 04:47:34 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4lYKt042803; Sat, 19 May 2018 04:47:34 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190447.w4J4lYKt042803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333849 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:47:35 -0000 Author: mmacy Date: Sat May 19 04:47:34 2018 New Revision: 333849 URL: https://svnweb.freebsd.org/changeset/base/333849 Log: epoch: avoid warning when INVARIANTS is not enabled Modified: head/sys/sys/epoch.h Modified: head/sys/sys/epoch.h ============================================================================== --- head/sys/sys/epoch.h Sat May 19 04:46:34 2018 (r333848) +++ head/sys/sys/epoch.h Sat May 19 04:47:34 2018 (r333849) @@ -63,7 +63,7 @@ static __inline void epoch_enter_preempt(epoch_t epoch) { struct thread *td; - int nesting; + int nesting __unused; td = curthread; nesting = td->td_epochnest++; From owner-svn-src-all@freebsd.org Sat May 19 04:56:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E037CEEE85B; Sat, 19 May 2018 04:56:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8140B7DED4; Sat, 19 May 2018 04:56:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CC0E226C2; Sat, 19 May 2018 04:56:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4uBRw048039; Sat, 19 May 2018 04:56:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4uBiJ048038; Sat, 19 May 2018 04:56:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201805190456.w4J4uBiJ048038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 19 May 2018 04:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333851 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 333851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:56:12 -0000 Author: jhibbits Date: Sat May 19 04:56:10 2018 New Revision: 333851 URL: https://svnweb.freebsd.org/changeset/base/333851 Log: Add SPR_HSRR0/SPR_HSRR1 definitions Reported by: Mark Millard Pointy-hat to: jhibbits Modified: head/sys/powerpc/include/spr.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat May 19 04:48:26 2018 (r333850) +++ head/sys/powerpc/include/spr.h Sat May 19 04:56:10 2018 (r333851) @@ -239,6 +239,8 @@ #define EPCR_PMGS 0x00200000 #define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ +#define SPR_HSRR0 0x13a +#define SPR_HSRR1 0x13b #define SPR_LPCR 0x13e /* Logical Partitioning Control */ #define LPCR_LPES 0x008 /* Bit 60 */ #define SPR_LPID 0x13f /* Logical Partitioning Control */ From owner-svn-src-all@freebsd.org Sat May 19 04:59:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B8CEEE9B5; Sat, 19 May 2018 04:59:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7833A7E0D5; Sat, 19 May 2018 04:59:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59B01226C5; Sat, 19 May 2018 04:59:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J4xeMg048218; Sat, 19 May 2018 04:59:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J4xdKe048215; Sat, 19 May 2018 04:59:39 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190459.w4J4xdKe048215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 04:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333852 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 04:59:41 -0000 Author: mmacy Date: Sat May 19 04:59:39 2018 New Revision: 333852 URL: https://svnweb.freebsd.org/changeset/base/333852 Log: vfs: annotate variables only used by debug builds as __unused Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sat May 19 04:56:10 2018 (r333851) +++ head/sys/kern/vfs_bio.c Sat May 19 04:59:39 2018 (r333852) @@ -1851,10 +1851,8 @@ bq_init(struct bufqueue *bq, int qindex, int subqueue, static void bd_init(struct bufdomain *bd) { - int domain; int i; - domain = bd - bdomain; bd->bd_cleanq = &bd->bd_subq[mp_maxid + 1]; bq_init(bd->bd_cleanq, QUEUE_CLEAN, mp_maxid + 1, "bufq clean lock"); bq_init(&bd->bd_dirtyq, QUEUE_DIRTY, -1, "bufq dirty lock"); @@ -2843,7 +2841,7 @@ vfs_vmio_iodone(struct buf *bp) vm_ooffset_t foff; vm_page_t m; vm_object_t obj; - struct vnode *vp; + struct vnode *vp __unused; int i, iosize, resid; bool bogus; @@ -5014,7 +5012,7 @@ bufsync(struct bufobj *bo, int waitfor) void bufstrategy(struct bufobj *bo, struct buf *bp) { - int i = 0; + int i __unused; struct vnode *vp; vp = bp->b_vp; Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat May 19 04:56:10 2018 (r333851) +++ head/sys/kern/vfs_lookup.c Sat May 19 04:59:39 2018 (r333852) @@ -92,9 +92,9 @@ static int crossmp_vop_lock1(struct vop_lock1_args *ap) { struct vnode *vp; - struct lock *lk; - const char *file; - int flags, line; + struct lock *lk __unused; + const char *file __unused; + int flags, line __unused; vp = ap->a_vp; lk = vp->v_vnlock; @@ -118,7 +118,7 @@ static int crossmp_vop_unlock(struct vop_unlock_args *ap) { struct vnode *vp; - struct lock *lk; + struct lock *lk __unused; int flags; vp = ap->a_vp; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat May 19 04:56:10 2018 (r333851) +++ head/sys/kern/vfs_subr.c Sat May 19 04:59:39 2018 (r333852) @@ -1405,7 +1405,7 @@ getnewvnode(const char *tag, struct mount *mp, struct struct thread *td; struct lock_object *lo; static int cyclecount; - int error; + int error __unused; CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag); vp = NULL; From owner-svn-src-all@freebsd.org Sat May 19 05:00:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13939EEEA13; Sat, 19 May 2018 05:00:17 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B991A7E21D; Sat, 19 May 2018 05:00:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A4BE226CA; Sat, 19 May 2018 05:00:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J50Gxk048345; Sat, 19 May 2018 05:00:16 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J50GcD048344; Sat, 19 May 2018 05:00:16 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190500.w4J50GcD048344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333853 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:00:17 -0000 Author: mmacy Date: Sat May 19 05:00:16 2018 New Revision: 333853 URL: https://svnweb.freebsd.org/changeset/base/333853 Log: turnstile / sleepqueue: annotate variables only used by debug builds Modified: head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_turnstile.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sat May 19 04:59:39 2018 (r333852) +++ head/sys/kern/subr_sleepqueue.c Sat May 19 05:00:16 2018 (r333853) @@ -384,7 +384,7 @@ void sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr, int flags) { - struct sleepqueue_chain *sc; + struct sleepqueue_chain *sc __unused; struct thread *td; sbintime_t pr1; @@ -780,7 +780,7 @@ sleepq_type(void *wchan) static int sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri) { - struct sleepqueue_chain *sc; + struct sleepqueue_chain *sc __unused; MPASS(td != NULL); MPASS(sq->sq_wchan != NULL); @@ -974,7 +974,7 @@ sleepq_remove_matching(struct sleepqueue *sq, int queu static void sleepq_timeout(void *arg) { - struct sleepqueue_chain *sc; + struct sleepqueue_chain *sc __unused; struct sleepqueue *sq; struct thread *td; void *wchan; Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sat May 19 04:59:39 2018 (r333852) +++ head/sys/kern/subr_turnstile.c Sat May 19 05:00:16 2018 (r333853) @@ -804,7 +804,7 @@ turnstile_wait(struct turnstile *ts, struct thread *ow int turnstile_signal(struct turnstile *ts, int queue) { - struct turnstile_chain *tc; + struct turnstile_chain *tc __unused; struct thread *td; int empty; @@ -855,7 +855,7 @@ turnstile_signal(struct turnstile *ts, int queue) void turnstile_broadcast(struct turnstile *ts, int queue) { - struct turnstile_chain *tc; + struct turnstile_chain *tc __unused; struct turnstile *ts1; struct thread *td; From owner-svn-src-all@freebsd.org Sat May 19 05:02:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2358BEEEC3D; Sat, 19 May 2018 05:02:41 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD2437E654; Sat, 19 May 2018 05:02:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF6992286C; Sat, 19 May 2018 05:02:40 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J52eNt053067; Sat, 19 May 2018 05:02:40 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J52ewu053066; Sat, 19 May 2018 05:02:40 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190502.w4J52ewu053066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333854 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:02:41 -0000 Author: mmacy Date: Sat May 19 05:02:40 2018 New Revision: 333854 URL: https://svnweb.freebsd.org/changeset/base/333854 Log: capsicum: annotate variable only used by debug Modified: head/sys/kern/subr_capability.c Modified: head/sys/kern/subr_capability.c ============================================================================== --- head/sys/kern/subr_capability.c Sat May 19 05:00:16 2018 (r333853) +++ head/sys/kern/subr_capability.c Sat May 19 05:02:40 2018 (r333854) @@ -108,7 +108,7 @@ static void cap_rights_vset(cap_rights_t *rights, va_list ap) { uint64_t right; - int i, n; + int i, n __unused; assert(CAPVER(rights) == CAP_RIGHTS_VERSION_00); @@ -133,7 +133,7 @@ static void cap_rights_vclear(cap_rights_t *rights, va_list ap) { uint64_t right; - int i, n; + int i, n __unused; assert(CAPVER(rights) == CAP_RIGHTS_VERSION_00); @@ -158,7 +158,7 @@ static bool cap_rights_is_vset(const cap_rights_t *rights, va_list ap) { uint64_t right; - int i, n; + int i, n __unused; assert(CAPVER(rights) == CAP_RIGHTS_VERSION_00); @@ -194,7 +194,7 @@ __cap_rights_sysinit(void *arg) cap_rights_t * __cap_rights_init(int version, cap_rights_t *rights, ...) { - unsigned int n; + unsigned int n __unused; va_list ap; assert(version == CAP_RIGHTS_VERSION_00); From owner-svn-src-all@freebsd.org Sat May 19 05:04:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E227DEEECCB; Sat, 19 May 2018 05:04:38 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 978657E7B9; Sat, 19 May 2018 05:04:38 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79DFC2286E; Sat, 19 May 2018 05:04:38 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J54cwv053192; Sat, 19 May 2018 05:04:38 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J54ccT053191; Sat, 19 May 2018 05:04:38 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190504.w4J54ccT053191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333855 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:04:39 -0000 Author: mmacy Date: Sat May 19 05:04:38 2018 New Revision: 333855 URL: https://svnweb.freebsd.org/changeset/base/333855 Log: lockf: annotate LOCKF_DEBUG only var Modified: head/sys/kern/kern_lockf.c Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Sat May 19 05:02:40 2018 (r333854) +++ head/sys/kern/kern_lockf.c Sat May 19 05:04:38 2018 (r333855) @@ -2235,8 +2235,9 @@ graph_add_edge(struct owner_graph *g, struct owner_ver { struct owner_edge *e; struct owner_vertex_list deltaF, deltaB; - int nF, nB, n, vi, i; + int nF, n, vi, i; int *indices; + int nB __unused; sx_assert(&lf_owner_graph_lock, SX_XLOCKED); From owner-svn-src-all@freebsd.org Sat May 19 05:06:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70698EEED5F; Sat, 19 May 2018 05:06:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F9307E925; Sat, 19 May 2018 05:06:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00ADB22873; Sat, 19 May 2018 05:06:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J56ILB053311; Sat, 19 May 2018 05:06:18 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J56IAt053310; Sat, 19 May 2018 05:06:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190506.w4J56IAt053310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333856 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:06:19 -0000 Author: mmacy Date: Sat May 19 05:06:18 2018 New Revision: 333856 URL: https://svnweb.freebsd.org/changeset/base/333856 Log: kevent: annotate unused stack local Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat May 19 05:04:38 2018 (r333855) +++ head/sys/kern/kern_event.c Sat May 19 05:06:18 2018 (r333856) @@ -751,14 +751,12 @@ static void filt_timerdetach(struct knote *kn) { struct kq_timer_cb_data *kc; -#ifdef INVARIANTS - unsigned int old; -#endif + unsigned int old __unused; kc = kn->kn_ptr.p_v; callout_drain(&kc->c); free(kc, M_KQUEUE); - DBGSET(old, atomic_fetchadd_int(&kq_ncallouts, -1)); + old = atomic_fetchadd_int(&kq_ncallouts, -1); KASSERT(old > 0, ("Number of callouts cannot become negative")); kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ } From owner-svn-src-all@freebsd.org Sat May 19 05:07:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E50FEEEDCC; Sat, 19 May 2018 05:07:04 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D42F77EA6A; Sat, 19 May 2018 05:07:03 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B54C022874; Sat, 19 May 2018 05:07:03 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5731d053383; Sat, 19 May 2018 05:07:03 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J573uH053382; Sat, 19 May 2018 05:07:03 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190507.w4J573uH053382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333857 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:07:04 -0000 Author: mmacy Date: Sat May 19 05:07:03 2018 New Revision: 333857 URL: https://svnweb.freebsd.org/changeset/base/333857 Log: conf: revert last change and annotate unused var instead Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Sat May 19 05:06:18 2018 (r333856) +++ head/sys/kern/kern_conf.c Sat May 19 05:07:03 2018 (r333857) @@ -866,13 +866,11 @@ make_dev(struct cdevsw *devsw, int unit, uid_t uid, gi { struct cdev *dev; va_list ap; -#ifdef INVARIANTS - int res; -#endif + int res __unused; va_start(ap, fmt); - DBGSET(res, make_dev_credv(0, &dev, devsw, unit, NULL, uid, gid, mode, fmt, - ap)); + res = make_dev_credv(0, &dev, devsw, unit, NULL, uid, gid, mode, fmt, + ap); va_end(ap); KASSERT(res == 0 && dev != NULL, ("make_dev: failed make_dev_credv (error=%d)", res)); @@ -885,12 +883,10 @@ make_dev_cred(struct cdevsw *devsw, int unit, struct u { struct cdev *dev; va_list ap; -#ifdef INVARIANTS - int res; -#endif + int res __unused; va_start(ap, fmt); - DBGSET(res, make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap)); + res = make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap); va_end(ap); KASSERT(res == 0 && dev != NULL, @@ -1000,11 +996,10 @@ make_dev_alias(struct cdev *pdev, const char *fmt, ... { struct cdev *dev; va_list ap; -#ifdef INVARIANTS - int res; -#endif + int res __unused; + va_start(ap, fmt); - DBGSET(res, make_dev_alias_v(MAKEDEV_WAITOK, &dev, pdev, fmt, ap)); + res = make_dev_alias_v(MAKEDEV_WAITOK, &dev, pdev, fmt, ap); va_end(ap); KASSERT(res == 0 && dev != NULL, From owner-svn-src-all@freebsd.org Sat May 19 05:07:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D496BEEEE29; Sat, 19 May 2018 05:07:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 853AA7EB94; Sat, 19 May 2018 05:07:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 672CF22875; Sat, 19 May 2018 05:07:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J57WxJ053447; Sat, 19 May 2018 05:07:32 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J57W3D053446; Sat, 19 May 2018 05:07:32 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190507.w4J57W3D053446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333858 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:07:33 -0000 Author: mmacy Date: Sat May 19 05:07:31 2018 New Revision: 333858 URL: https://svnweb.freebsd.org/changeset/base/333858 Log: cpuset: revert and annotate instead Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Sat May 19 05:07:03 2018 (r333857) +++ head/sys/kern/kern_cpuset.c Sat May 19 05:07:31 2018 (r333858) @@ -1386,9 +1386,7 @@ cpuset_thread0(void) { struct cpuset *set; int i; -#ifdef INVARIANTS - int error; -#endif + int error __unused; cpuset_zone = uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0); @@ -1413,14 +1411,14 @@ cpuset_thread0(void) * Now derive a default (1), modifiable set from that to give out. */ set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - DBGSET(error, _cpuset_create(set, cpuset_zero, NULL, NULL, 1)); + error = _cpuset_create(set, cpuset_zero, NULL, NULL, 1); KASSERT(error == 0, ("Error creating default set: %d\n", error)); cpuset_default = set; /* * Create the kernel set (2). */ set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); - DBGSET(error, _cpuset_create(set, cpuset_zero, NULL, NULL, 2)); + error = _cpuset_create(set, cpuset_zero, NULL, NULL, 2); KASSERT(error == 0, ("Error creating kernel set: %d\n", error)); set->cs_domain = &domainset2; cpuset_kernel = set; From owner-svn-src-all@freebsd.org Sat May 19 05:09:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79D96EEEEF6; Sat, 19 May 2018 05:09:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 166107ED2F; Sat, 19 May 2018 05:09:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E66A522876; Sat, 19 May 2018 05:09:10 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J59AuH053546; Sat, 19 May 2018 05:09:10 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J59Atx053545; Sat, 19 May 2018 05:09:10 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190509.w4J59Atx053545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333859 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:09:11 -0000 Author: mmacy Date: Sat May 19 05:09:10 2018 New Revision: 333859 URL: https://svnweb.freebsd.org/changeset/base/333859 Log: umtx: don't call umtxq_getchain unless the value is needed Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat May 19 05:07:31 2018 (r333858) +++ head/sys/kern/kern_umtx.c Sat May 19 05:09:10 2018 (r333859) @@ -662,11 +662,9 @@ umtxq_remove_queue(struct umtx_q *uq, int q) static int umtxq_count(struct umtx_key *key) { - struct umtxq_chain *uc; struct umtxq_queue *uh; - uc = umtxq_getchain(key); - UMTXQ_LOCKED_ASSERT(uc); + UMTXQ_LOCKED_ASSERT(umtxq_getchain(key)); uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE); if (uh != NULL) return (uh->length); @@ -680,12 +678,10 @@ umtxq_count(struct umtx_key *key) static int umtxq_count_pi(struct umtx_key *key, struct umtx_q **first) { - struct umtxq_chain *uc; struct umtxq_queue *uh; *first = NULL; - uc = umtxq_getchain(key); - UMTXQ_LOCKED_ASSERT(uc); + UMTXQ_LOCKED_ASSERT(umtxq_getchain(key)); uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE); if (uh != NULL) { *first = TAILQ_FIRST(&uh->head); @@ -727,14 +723,12 @@ umtxq_check_susp(struct thread *td) static int umtxq_signal_queue(struct umtx_key *key, int n_wake, int q) { - struct umtxq_chain *uc; struct umtxq_queue *uh; struct umtx_q *uq; int ret; ret = 0; - uc = umtxq_getchain(key); - UMTXQ_LOCKED_ASSERT(uc); + UMTXQ_LOCKED_ASSERT(umtxq_getchain(key)); uh = umtxq_queue_lookup(key, q); if (uh != NULL) { while ((uq = TAILQ_FIRST(&uh->head)) != NULL) { @@ -754,10 +748,8 @@ umtxq_signal_queue(struct umtx_key *key, int n_wake, i static inline void umtxq_signal_thread(struct umtx_q *uq) { - struct umtxq_chain *uc; - uc = umtxq_getchain(&uq->uq_key); - UMTXQ_LOCKED_ASSERT(uc); + UMTXQ_LOCKED_ASSERT(umtxq_getchain(&uq->uq_key)); umtxq_remove(uq); wakeup(uq); } @@ -1663,16 +1655,18 @@ static int umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, uint32_t owner, const char *wmesg, struct abs_timeout *timo, bool shared) { - struct umtxq_chain *uc; struct thread *td, *td1; struct umtx_q *uq1; int error, pri; +#ifdef INVARIANTS + struct umtxq_chain *uc; + uc = umtxq_getchain(&pi->pi_key); +#endif error = 0; td = uq->uq_thread; KASSERT(td == curthread, ("inconsistent uq_thread")); - uc = umtxq_getchain(&uq->uq_key); - UMTXQ_LOCKED_ASSERT(uc); + UMTXQ_LOCKED_ASSERT(umtxq_getchain(&uq->uq_key)); KASSERT(uc->uc_busy != 0, ("umtx chain is not busy")); umtxq_insert(uq); mtx_lock(&umtx_lock); @@ -1728,10 +1722,8 @@ umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, static void umtx_pi_ref(struct umtx_pi *pi) { - struct umtxq_chain *uc; - uc = umtxq_getchain(&pi->pi_key); - UMTXQ_LOCKED_ASSERT(uc); + UMTXQ_LOCKED_ASSERT(umtxq_getchain(&pi->pi_key)); pi->pi_refcount++; } From owner-svn-src-all@freebsd.org Sat May 19 05:10:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8742EEEFC2; Sat, 19 May 2018 05:10:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5247EECF; Sat, 19 May 2018 05:10:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3BE912288D; Sat, 19 May 2018 05:10:52 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5AqI7054368; Sat, 19 May 2018 05:10:52 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5AqfS054367; Sat, 19 May 2018 05:10:52 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190510.w4J5AqfS054367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333860 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:10:52 -0000 Author: mmacy Date: Sat May 19 05:10:51 2018 New Revision: 333860 URL: https://svnweb.freebsd.org/changeset/base/333860 Log: sendfile: annotate unused value and ensure that npages is actually initialized Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Sat May 19 05:09:10 2018 (r333859) +++ head/sys/kern/kern_sendfile.c Sat May 19 05:10:51 2018 (r333860) @@ -341,7 +341,7 @@ sendfile_swapin(vm_object_t obj, struct sf_io *sfio, o } for (int i = 0; i < npages;) { - int j, a, count, rv; + int j, a, count, rv __unused; /* Skip valid pages. */ if (vm_page_is_valid(pa[i], vmoff(i, off) & PAGE_MASK, @@ -688,6 +688,7 @@ retry_space: if (space == 0) { sfio = NULL; nios = 0; + npages = 0; goto prepend_header; } hdr_uio = NULL; From owner-svn-src-all@freebsd.org Sat May 19 05:12:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90F0EEEF184; Sat, 19 May 2018 05:12:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 430B67F23C; Sat, 19 May 2018 05:12:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24280229F1; Sat, 19 May 2018 05:12:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5CJDP058206; Sat, 19 May 2018 05:12:19 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5CIWI058136; Sat, 19 May 2018 05:12:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190512.w4J5CIWI058136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333861 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:12:19 -0000 Author: mmacy Date: Sat May 19 05:12:18 2018 New Revision: 333861 URL: https://svnweb.freebsd.org/changeset/base/333861 Log: intr: eliminate / annotate unused stack locals Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sat May 19 05:10:51 2018 (r333860) +++ head/sys/kern/kern_intr.c Sat May 19 05:12:18 2018 (r333861) @@ -949,7 +949,6 @@ intr_event_schedule_thread(struct intr_event *ie) struct intr_thread *it; struct thread *td; struct thread *ctd; - struct proc *p; /* * If no ithread or no handlers, then we have a stray interrupt. @@ -961,7 +960,6 @@ intr_event_schedule_thread(struct intr_event *ie) ctd = curthread; it = ie->ie_thread; td = it->it_thread; - p = td->td_proc; /* * If any of the handlers for this ithread claim to be good @@ -973,7 +971,7 @@ intr_event_schedule_thread(struct intr_event *ie) random_harvest_queue(&entropy, sizeof(entropy), 2, RANDOM_INTERRUPT); } - KASSERT(p != NULL, ("ithread %s has no process", ie->ie_name)); + KASSERT(td->td_proc != NULL, ("ithread %s has no process", ie->ie_name)); /* * Set it_need to tell the thread to keep running if it is already @@ -1215,7 +1213,7 @@ swi_sched(void *cookie, int flags) struct intr_handler *ih = (struct intr_handler *)cookie; struct intr_event *ie = ih->ih_event; struct intr_entropy entropy; - int error; + int error __unused; CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name, ih->ih_need); @@ -1474,7 +1472,7 @@ intr_event_handle(struct intr_event *ie, struct trapfr struct intr_handler *ih; struct trapframe *oldframe; struct thread *td; - int error, ret, thread; + int ret, thread; td = curthread; @@ -1547,7 +1545,9 @@ intr_event_handle(struct intr_event *ie, struct trapfr /* Schedule the ithread if needed. */ if (thread) { - error = intr_event_schedule_thread(ie); + int error __unused; + + error = intr_event_schedule_thread(ie); KASSERT(error == 0, ("bad stray interrupt")); } critical_exit(); From owner-svn-src-all@freebsd.org Sat May 19 05:12:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA880EEF1D8; Sat, 19 May 2018 05:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FDCD7F3B6; Sat, 19 May 2018 05:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81B9322A08; Sat, 19 May 2018 05:12:57 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5Cvmg058332; Sat, 19 May 2018 05:12:57 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5CvWK058331; Sat, 19 May 2018 05:12:57 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190512.w4J5CvWK058331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333862 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 333862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:12:58 -0000 Author: mmacy Date: Sat May 19 05:12:57 2018 New Revision: 333862 URL: https://svnweb.freebsd.org/changeset/base/333862 Log: back out DBGSET macro Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat May 19 05:12:18 2018 (r333861) +++ head/sys/sys/systm.h Sat May 19 05:12:57 2018 (r333862) @@ -85,7 +85,6 @@ void kassert_panic(const char *fmt, ...) __printflike #endif #ifdef INVARIANTS /* The option is always available */ -#define DBGSET(lhs, rhs) lhs = (rhs) #define KASSERT(exp,msg) do { \ if (__predict_false(!(exp))) \ kassert_panic msg; \ @@ -97,7 +96,6 @@ void kassert_panic(const char *fmt, ...) __printflike } \ } while (0) #else -#define DBGSET(lhs, rhs) rhs #define KASSERT(exp,msg) do { \ } while (0) From owner-svn-src-all@freebsd.org Sat May 19 05:14:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D50BEEF283; Sat, 19 May 2018 05:14:07 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C10147F568; Sat, 19 May 2018 05:14:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8825322A09; Sat, 19 May 2018 05:14:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5E66g058423; Sat, 19 May 2018 05:14:06 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5E5gG058420; Sat, 19 May 2018 05:14:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190514.w4J5E5gG058420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333863 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 333863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:14:07 -0000 Author: mmacy Date: Sat May 19 05:14:05 2018 New Revision: 333863 URL: https://svnweb.freebsd.org/changeset/base/333863 Log: capsicum: propagate const correctness Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_capability.c head/sys/sys/capsicum.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat May 19 05:12:57 2018 (r333862) +++ head/sys/kern/kern_descrip.c Sat May 19 05:14:05 2018 (r333863) @@ -2625,9 +2625,9 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights struct file **fpp, seq_t *seqp) { #ifdef CAPABILITIES - struct filedescent *fde; + const struct filedescent *fde; #endif - struct fdescenttbl *fdt; + const struct fdescenttbl *fdt; struct file *fp; u_int count; #ifdef CAPABILITIES @@ -2673,7 +2673,7 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights * table before this fd was closed, so it possible that * there is a stale fp pointer in cached version. */ - fdt = *(struct fdescenttbl * volatile *)&(fdp->fd_files); + fdt = *(const struct fdescenttbl * const volatile *)&(fdp->fd_files); continue; } /* Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Sat May 19 05:12:57 2018 (r333862) +++ head/sys/kern/sys_capability.c Sat May 19 05:14:05 2018 (r333863) @@ -183,7 +183,7 @@ cap_check(const cap_rights_t *havep, const cap_rights_ * Convert capability rights into VM access flags. */ u_char -cap_rights_to_vmprot(cap_rights_t *havep) +cap_rights_to_vmprot(const cap_rights_t *havep) { u_char maxprot; @@ -204,14 +204,14 @@ cap_rights_to_vmprot(cap_rights_t *havep) * this one file. */ -cap_rights_t * -cap_rights_fde(struct filedescent *fdep) +const cap_rights_t * +cap_rights_fde(const struct filedescent *fdep) { return (&fdep->fde_rights); } -cap_rights_t * +const cap_rights_t * cap_rights(struct filedesc *fdp, int fd) { Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Sat May 19 05:12:57 2018 (r333862) +++ head/sys/sys/capsicum.h Sat May 19 05:14:05 2018 (r333863) @@ -444,14 +444,14 @@ int cap_check(const cap_rights_t *havep, const cap_rig /* * Convert capability rights into VM access flags. */ -u_char cap_rights_to_vmprot(cap_rights_t *havep); +u_char cap_rights_to_vmprot(const cap_rights_t *havep); /* * For the purposes of procstat(1) and similar tools, allow kern_descrip.c to * extract the rights from a capability. */ -cap_rights_t *cap_rights_fde(struct filedescent *fde); -cap_rights_t *cap_rights(struct filedesc *fdp, int fd); +const cap_rights_t *cap_rights_fde(const struct filedescent *fde); +const cap_rights_t *cap_rights(struct filedesc *fdp, int fd); int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd); int cap_fcntl_check_fde(struct filedescent *fde, int cmd); From owner-svn-src-all@freebsd.org Sat May 19 05:27:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22DADEEF875; Sat, 19 May 2018 05:27:51 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C779B7FBEA; Sat, 19 May 2018 05:27:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8AE822B9E; Sat, 19 May 2018 05:27:50 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5Roqv063391; Sat, 19 May 2018 05:27:50 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5RncB063385; Sat, 19 May 2018 05:27:49 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190527.w4J5RncB063385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333864 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:27:51 -0000 Author: mmacy Date: Sat May 19 05:27:49 2018 New Revision: 333864 URL: https://svnweb.freebsd.org/changeset/base/333864 Log: net: fix set but not used Modified: head/sys/net/if_clone.c head/sys/net/if_epair.c head/sys/net/if_lagg.c head/sys/net/if_stf.c head/sys/net/if_vxlan.c head/sys/net/iflib.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sat May 19 05:14:05 2018 (r333863) +++ head/sys/net/if_clone.c Sat May 19 05:27:49 2018 (r333864) @@ -416,7 +416,7 @@ if_clone_simple(const char *name, ifcs_create_t create for (unit = 0; unit < minifs; unit++) { char name[IFNAMSIZ]; - int error; + int error __unused; snprintf(name, IFNAMSIZ, "%s%d", ifc->ifc_name, unit); error = if_clone_createif(ifc, name, IFNAMSIZ, NULL); Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Sat May 19 05:14:05 2018 (r333863) +++ head/sys/net/if_epair.c Sat May 19 05:27:49 2018 (r333864) @@ -251,7 +251,7 @@ static void epair_nh_sintr(struct mbuf *m) { struct ifnet *ifp; - struct epair_softc *sc; + struct epair_softc *sc __unused; ifp = m->m_pkthdr.rcvif; (*ifp->if_input)(ifp, m); @@ -296,7 +296,7 @@ epair_nh_drainedcpu(u_int cpuid) IFQ_LOCK(&ifp->if_snd); if (IFQ_IS_EMPTY(&ifp->if_snd)) { - struct epair_softc *sc; + struct epair_softc *sc __unused; STAILQ_REMOVE(&epair_dpcpu->epair_ifp_drain_list, elm, epair_ifp_drain, ifp_next); @@ -337,7 +337,7 @@ epair_remove_ifp_from_draining(struct ifnet *ifp) STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list, ifp_next, tvar) { if (ifp == elm->ifp) { - struct epair_softc *sc; + struct epair_softc *sc __unused; STAILQ_REMOVE( &epair_dpcpu->epair_ifp_drain_list, elm, Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sat May 19 05:14:05 2018 (r333863) +++ head/sys/net/if_lagg.c Sat May 19 05:27:49 2018 (r333864) @@ -1641,10 +1641,7 @@ static int lagg_transmit(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - int error, len, mcast; - - len = m->m_pkthdr.len; - mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; + int error; LAGG_RLOCK(); /* We need a Tx algorithm and at least one port */ Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Sat May 19 05:14:05 2018 (r333863) +++ head/sys/net/if_stf.c Sat May 19 05:27:49 2018 (r333864) @@ -272,7 +272,7 @@ static int stf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) { struct stf_softc *sc = ifp->if_softc; - int err; + int err __unused; err = encap_detach(sc->encap_cookie); KASSERT(err == 0, ("Unexpected error detaching encap_cookie")); Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Sat May 19 05:14:05 2018 (r333863) +++ head/sys/net/if_vxlan.c Sat May 19 05:27:49 2018 (r333864) @@ -588,7 +588,7 @@ vxlan_ftable_update_locked(struct vxlan_softc *sc, struct rm_priotracker *tracker) { struct vxlan_ftable_entry *fe; - int error; + int error __unused; VXLAN_LOCK_ASSERT(sc); @@ -863,8 +863,9 @@ static void vxlan_socket_destroy(struct vxlan_socket *vso) { struct socket *so; - struct vxlan_socket_mc_info *mc; +#ifdef INVARIANTS int i; + struct vxlan_socket_mc_info *mc; for (i = 0; i < VXLAN_SO_MC_MAX_GROUPS; i++) { mc = &vso->vxlso_mc[i]; @@ -878,7 +879,7 @@ vxlan_socket_destroy(struct vxlan_socket *vso) ("%s: socket %p vni_hash[%d] not empty", __func__, vso, i)); } - +#endif so = vso->vxlso_sock; if (so != NULL) { vso->vxlso_sock = NULL; @@ -2505,7 +2506,7 @@ vxlan_rcv_udp_packet(struct mbuf *m, int offset, struc struct vxlan_socket *vso; struct vxlan_header *vxh, vxlanhdr; uint32_t vni; - int error; + int error __unused; M_ASSERTPKTHDR(m); vso = xvso; Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat May 19 05:14:05 2018 (r333863) +++ head/sys/net/iflib.c Sat May 19 05:27:49 2018 (r333864) @@ -1270,7 +1270,6 @@ static void iflib_gen_mac(if_ctx_t ctx) { struct thread *td; - struct ifnet *ifp; MD5_CTX mdctx; char uuid[HOSTUUIDLEN+1]; char buf[HOSTUUIDLEN+16]; @@ -1278,7 +1277,6 @@ iflib_gen_mac(if_ctx_t ctx) unsigned char digest[16]; td = curthread; - ifp = ctx->ifc_ifp; mac = ctx->ifc_mac; uuid[HOSTUUIDLEN] = 0; bcopy(td->td_ucred->cr_prison->pr_hostuuid, uuid, HOSTUUIDLEN); @@ -4281,10 +4279,7 @@ iflib_reset_qvalues(if_ctx_t ctx) if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; if_shared_ctx_t sctx = ctx->ifc_sctx; device_t dev = ctx->ifc_dev; - int i, main_txq, main_rxq; - - main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0; - main_rxq = (sctx->isc_flags & IFLIB_HAS_RXCQ) ? 1 : 0; + int i; scctx->isc_txrx_budget_bytes_max = IFLIB_MAX_TX_BYTES; scctx->isc_tx_qdepth = IFLIB_DEFAULT_TX_QDEPTH; From owner-svn-src-all@freebsd.org Sat May 19 05:37:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5175EEEFAEE; Sat, 19 May 2018 05:37:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB2C080058; Sat, 19 May 2018 05:37:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C227322D48; Sat, 19 May 2018 05:37:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5bICU068870; Sat, 19 May 2018 05:37:18 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5bIY8068869; Sat, 19 May 2018 05:37:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190537.w4J5bIY8068869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333865 - head/sys/dev/netmap X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/netmap X-SVN-Commit-Revision: 333865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:37:19 -0000 Author: mmacy Date: Sat May 19 05:37:18 2018 New Revision: 333865 URL: https://svnweb.freebsd.org/changeset/base/333865 Log: netmap: compare e1 with e2, not with itself Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Sat May 19 05:27:49 2018 (r333864) +++ head/sys/dev/netmap/netmap_freebsd.c Sat May 19 05:37:18 2018 (r333865) @@ -651,7 +651,7 @@ nm_os_extmem_nextpage(struct nm_os_extmem *e) int nm_os_extmem_isequal(struct nm_os_extmem *e1, struct nm_os_extmem *e2) { - return (e1->obj == e1->obj); + return (e1->obj == e2->obj); } int From owner-svn-src-all@freebsd.org Sat May 19 05:37:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4753AEEFB38; Sat, 19 May 2018 05:37:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAC048016D; Sat, 19 May 2018 05:37:58 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBCCF22D49; Sat, 19 May 2018 05:37:58 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5bw2e068935; Sat, 19 May 2018 05:37:58 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5bwxR068934; Sat, 19 May 2018 05:37:58 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190537.w4J5bwxR068934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333866 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:37:59 -0000 Author: mmacy Date: Sat May 19 05:37:58 2018 New Revision: 333866 URL: https://svnweb.freebsd.org/changeset/base/333866 Log: AF_UNIX: switch to annotations to avoid warnings Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sat May 19 05:37:18 2018 (r333865) +++ head/sys/kern/uipc_usrreq.c Sat May 19 05:37:58 2018 (r333866) @@ -1678,9 +1678,7 @@ static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2) { struct socket *so, *so2; -#ifdef INVARIANTS - int freed; -#endif + int freed __unused; KASSERT(unp2 != NULL, ("unp_disconnect: unp2 == NULL")); @@ -1716,15 +1714,9 @@ unp_disconnect(struct unpcb *unp, struct unpcb *unp2) soisdisconnected(so2); break; } -#ifdef INVARIANTS - freed = -#endif - unp_pcb_rele(unp); + freed = unp_pcb_rele(unp); MPASS(freed == 0); -#ifdef INVARIANTS - freed = -#endif - unp_pcb_rele(unp2); + freed = unp_pcb_rele(unp2); MPASS(freed == 0); } From owner-svn-src-all@freebsd.org Sat May 19 05:55:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3597EEFF78; Sat, 19 May 2018 05:55:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94FD780877; Sat, 19 May 2018 05:55:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76E492306C; Sat, 19 May 2018 05:55:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5t0Nj078512; Sat, 19 May 2018 05:55:00 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5t0IM078511; Sat, 19 May 2018 05:55:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190555.w4J5t0IM078511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333867 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:55:01 -0000 Author: mmacy Date: Sat May 19 05:55:00 2018 New Revision: 333867 URL: https://svnweb.freebsd.org/changeset/base/333867 Log: tcp fastopen: fix may be uninitialized Modified: head/sys/netinet/tcp_fastopen.c Modified: head/sys/netinet/tcp_fastopen.c ============================================================================== --- head/sys/netinet/tcp_fastopen.c Sat May 19 05:37:58 2018 (r333866) +++ head/sys/netinet/tcp_fastopen.c Sat May 19 05:55:00 2018 (r333867) @@ -856,6 +856,7 @@ tcp_fastopen_connect(struct tcpcb *tp) uint16_t server_mss; uint64_t psk_cookie; + psk_cookie = 0; inp = tp->t_inpcb; cce = tcp_fastopen_ccache_lookup(&inp->inp_inc, &ccb); if (cce) { @@ -875,7 +876,7 @@ tcp_fastopen_connect(struct tcpcb *tp) server_mss = cce->server_mss; CCB_UNLOCK(ccb); if (tp->t_tfo_client_cookie_len == - TCP_FASTOPEN_PSK_LEN) { + TCP_FASTOPEN_PSK_LEN && psk_cookie) { tp->t_tfo_client_cookie_len = TCP_FASTOPEN_COOKIE_LEN; memcpy(tp->t_tfo_cookie.client, &psk_cookie, From owner-svn-src-all@freebsd.org Sat May 19 05:55:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB89EEFFCE; Sat, 19 May 2018 05:55:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 038DF809DA; Sat, 19 May 2018 05:55:32 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D242306D; Sat, 19 May 2018 05:55:31 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5tVQ9078580; Sat, 19 May 2018 05:55:31 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5tVDY078579; Sat, 19 May 2018 05:55:31 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190555.w4J5tVDY078579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333868 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:55:32 -0000 Author: mmacy Date: Sat May 19 05:55:31 2018 New Revision: 333868 URL: https://svnweb.freebsd.org/changeset/base/333868 Log: tcp sysctl fix may be uninitialized Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sat May 19 05:55:00 2018 (r333867) +++ head/sys/netinet/tcp_subr.c Sat May 19 05:55:31 2018 (r333868) @@ -539,9 +539,9 @@ sysctl_net_inet_list_func_info(SYSCTL_HANDLER_ARGS) * the list matches what we have recorded. */ rw_rlock(&tcp_function_lock); -#ifdef INVARIANTS + cnt = 0; -#else +#ifndef INVARIANTS if (req->oldptr == NULL) { cnt = tcp_fb_cnt; goto skip_loop; @@ -1779,7 +1779,7 @@ tcp_discardcb(struct tcpcb *tp) #ifdef INET6 int isipv6 = (inp->inp_vflag & INP_IPV6) != 0; #endif /* INET6 */ - int released; + int released __unused; INP_WLOCK_ASSERT(inp); From owner-svn-src-all@freebsd.org Sat May 19 05:56:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95A6CEF0061; Sat, 19 May 2018 05:56:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493DF80B33; Sat, 19 May 2018 05:56:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A48B2306E; Sat, 19 May 2018 05:56:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5uOYM078666; Sat, 19 May 2018 05:56:24 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5uMH5078656; Sat, 19 May 2018 05:56:22 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190556.w4J5uMH5078656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333869 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 333869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:56:24 -0000 Author: mmacy Date: Sat May 19 05:56:21 2018 New Revision: 333869 URL: https://svnweb.freebsd.org/changeset/base/333869 Log: netinet silence warnings Modified: head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_mcast.c head/sys/netinet/ip_mroute.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_syscalls.c head/sys/netinet/sctputil.c head/sys/netinet/siftr.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/igmp.c Sat May 19 05:56:21 2018 (r333869) @@ -1846,7 +1846,7 @@ igmp_v3_process_group_timers(struct in_multi_head *inm * immediate transmission. */ if (query_response_timer_expired) { - int retval; + int retval __unused; retval = igmp_v3_enqueue_group_record(qrq, inm, 0, 1, (inm->inm_state == IGMP_SG_QUERY_PENDING_MEMBER)); @@ -2562,7 +2562,7 @@ igmp_final_leave(struct in_multi *inm, struct igmp_ifs inm->inm_state = IGMP_NOT_MEMBER; inm->inm_sctimer = 0; } else { - int retval; + int retval __unused; inm_acquire_locked(inm); @@ -2635,7 +2635,7 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct struct ifnet *ifp; struct ip_msource *ims, *nims; struct mbuf *m0, *m, *md; - int error, is_filter_list_change; + int is_filter_list_change; int minrec0len, m0srcs, msrcs, nbytes, off; int record_has_sources; int now; @@ -2645,7 +2645,6 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct IN_MULTI_LIST_LOCK_ASSERT(); - error = 0; ifp = inm->inm_ifp; is_filter_list_change = 0; m = NULL; @@ -3303,7 +3302,7 @@ igmp_v3_dispatch_general_query(struct igmp_ifsoftc *ig struct ifmultiaddr *ifma; struct ifnet *ifp; struct in_multi *inm; - int retval, loop; + int retval __unused, loop; IN_MULTI_LIST_LOCK_ASSERT(); IGMP_LOCK_ASSERT(); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/in.c Sat May 19 05:56:21 2018 (r333869) @@ -1152,7 +1152,6 @@ in_lltable_match_prefix(const struct sockaddr *saddr, static void in_lltable_free_entry(struct lltable *llt, struct llentry *lle) { - struct ifnet *ifp; size_t pkts_dropped; LLE_WLOCK_ASSERT(lle); @@ -1160,8 +1159,7 @@ in_lltable_free_entry(struct lltable *llt, struct llen /* Unlink entry from table if not already */ if ((lle->la_flags & LLE_LINKED) != 0) { - ifp = llt->llt_ifp; - IF_AFDATA_WLOCK_ASSERT(ifp); + IF_AFDATA_WLOCK_ASSERT(llt->llt_ifp); lltable_unlink_entry(llt, lle); } Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/in_mcast.c Sat May 19 05:56:21 2018 (r333869) @@ -347,10 +347,10 @@ inm_lookup_locked(struct ifnet *ifp, const struct in_a if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; - inm = (struct in_multi *)ifma->ifma_protospec; - if (inm->inm_addr.s_addr == ina.s_addr) - break; - inm = NULL; + inm = (struct in_multi *)ifma->ifma_protospec; + if (inm->inm_addr.s_addr == ina.s_addr) + break; + inm = NULL; } return (inm); } Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/ip_mroute.c Sat May 19 05:56:21 2018 (r333869) @@ -1680,7 +1680,7 @@ send_packet(struct vif *vifp, struct mbuf *m) { struct ip_moptions imo; struct in_multi *imm[2]; - int error; + int error __unused; VIF_LOCK_ASSERT(); Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/sctp_indata.c Sat May 19 05:56:21 2018 (r333869) @@ -1672,8 +1672,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc int *break_flag, int last_chunk, uint8_t chk_type) { /* Process a data chunk */ - /* struct sctp_tmit_chunk *chk; */ - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk = NULL; uint32_t tsn, fsn, gap, mid; struct mbuf *dmbuf; int the_len; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/sctp_output.c Sat May 19 05:56:21 2018 (r333869) @@ -11030,7 +11030,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad struct sctp_chunkhdr *ch; #if defined(INET) || defined(INET6) struct udphdr *udp; - int ret; + int ret __unused; #endif int len, cause_len, padding_len; #ifdef INET Modified: head/sys/netinet/sctp_syscalls.c ============================================================================== --- head/sys/netinet/sctp_syscalls.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/sctp_syscalls.c Sat May 19 05:56:21 2018 (r333869) @@ -91,7 +91,7 @@ static struct syscall_helper_data sctp_syscalls[] = { static void sctp_syscalls_init(void *unused __unused) { - int error; + int error __unused; error = syscall_helper_register(sctp_syscalls, SY_THR_STATIC); KASSERT((error == 0), Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/sctputil.c Sat May 19 05:56:21 2018 (r333869) @@ -72,7 +72,7 @@ extern const struct sctp_ss_functions sctp_ss_function void sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, int from, int incr) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.sb.stcb = stcb; sctp_clog.x.sb.so_sbcc = sb->sb_cc; @@ -93,7 +93,7 @@ sctp_sblog(struct sockbuf *sb, struct sctp_tcb *stcb, void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.close.inp = (void *)inp; sctp_clog.x.close.sctp_flags = inp->sctp_flags; @@ -117,7 +117,7 @@ sctp_log_closing(struct sctp_inpcb *inp, struct sctp_t void rto_logging(struct sctp_nets *net, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; memset(&sctp_clog, 0, sizeof(sctp_clog)); sctp_clog.x.rto.net = (void *)net; @@ -134,7 +134,7 @@ rto_logging(struct sctp_nets *net, int from) void sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t tsn, uint16_t sseq, uint16_t stream, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.strlog.stcb = stcb; sctp_clog.x.strlog.n_tsn = tsn; @@ -154,7 +154,7 @@ sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t void sctp_log_nagle_event(struct sctp_tcb *stcb, int action) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.nagle.stcb = (void *)stcb; sctp_clog.x.nagle.total_flight = stcb->asoc.total_flight; @@ -173,7 +173,7 @@ sctp_log_nagle_event(struct sctp_tcb *stcb, int action void sctp_log_sack(uint32_t old_cumack, uint32_t cumack, uint32_t tsn, uint16_t gaps, uint16_t dups, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.sack.cumack = cumack; sctp_clog.x.sack.oldcumack = old_cumack; @@ -192,7 +192,7 @@ sctp_log_sack(uint32_t old_cumack, uint32_t cumack, ui void sctp_log_map(uint32_t map, uint32_t cum, uint32_t high, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; memset(&sctp_clog, 0, sizeof(sctp_clog)); sctp_clog.x.map.base = map; @@ -210,7 +210,7 @@ sctp_log_map(uint32_t map, uint32_t cum, uint32_t high void sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; memset(&sctp_clog, 0, sizeof(sctp_clog)); sctp_clog.x.fr.largest_tsn = biggest_tsn; @@ -229,7 +229,7 @@ sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new void sctp_log_mb(struct mbuf *m, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.mb.mp = m; sctp_clog.x.mb.mbuf_flags = (uint8_t)(SCTP_BUF_GET_FLAGS(m)); @@ -265,7 +265,7 @@ sctp_log_mbc(struct mbuf *m, int from) void sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_read *poschk, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; if (control == NULL) { SCTP_PRINTF("Gak log of NULL?\n"); @@ -294,7 +294,7 @@ sctp_log_strm_del(struct sctp_queued_to_read *control, void sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets *net, int augment, uint8_t from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.cwnd.net = net; if (stcb->asoc.send_queue_cnt > 255) @@ -329,7 +329,7 @@ sctp_log_cwnd(struct sctp_tcb *stcb, struct sctp_nets void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; memset(&sctp_clog, 0, sizeof(sctp_clog)); if (inp) { @@ -373,7 +373,7 @@ sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *net, int error, int burst, uint8_t from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; memset(&sctp_clog, 0, sizeof(sctp_clog)); sctp_clog.x.cwnd.net = net; @@ -400,7 +400,7 @@ sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_n void sctp_log_rwnd(uint8_t from, uint32_t peers_rwnd, uint32_t snd_size, uint32_t overhead) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.rwnd.rwnd = peers_rwnd; sctp_clog.x.rwnd.send_size = snd_size; @@ -418,7 +418,7 @@ sctp_log_rwnd(uint8_t from, uint32_t peers_rwnd, uint3 void sctp_log_rwnd_set(uint8_t from, uint32_t peers_rwnd, uint32_t flight_size, uint32_t overhead, uint32_t a_rwndval) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.rwnd.rwnd = peers_rwnd; sctp_clog.x.rwnd.send_size = flight_size; @@ -437,7 +437,7 @@ sctp_log_rwnd_set(uint8_t from, uint32_t peers_rwnd, u static void sctp_log_mbcnt(uint8_t from, uint32_t total_oq, uint32_t book, uint32_t total_mbcnt_q, uint32_t mbcnt) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.mbcnt.total_queue_size = total_oq; sctp_clog.x.mbcnt.size_change = book; @@ -465,7 +465,7 @@ sctp_misc_ints(uint8_t from, uint32_t a, uint32_t b, u void sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_cnt, int from) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.wake.stcb = (void *)stcb; sctp_clog.x.wake.wake_cnt = wake_cnt; @@ -511,7 +511,7 @@ sctp_wakeup_log(struct sctp_tcb *stcb, uint32_t wake_c void sctp_log_block(uint8_t from, struct sctp_association *asoc, size_t sendlen) { - struct sctp_cwnd_log sctp_clog; + struct sctp_cwnd_log sctp_clog __unused; sctp_clog.x.blk.onsb = asoc->total_output_queue_size; sctp_clog.x.blk.send_sent_qcnt = (uint16_t)(asoc->send_queue_cnt + asoc->sent_queue_cnt); Modified: head/sys/netinet/siftr.c ============================================================================== --- head/sys/netinet/siftr.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/siftr.c Sat May 19 05:56:21 2018 (r333869) @@ -1201,10 +1201,10 @@ siftr_manage_ops(uint8_t action) struct timeval tval; struct flow_hash_node *counter, *tmp_counter; struct sbuf *s; - int i, key_index, ret, error; + int i, key_index, error; uint32_t bytes_to_write, total_skipped_pkts; uint16_t lport, fport; - uint8_t *key, ipver; + uint8_t *key, ipver __unused; #ifdef SIFTR_IPV6 uint32_t laddr[4]; @@ -1235,7 +1235,7 @@ siftr_manage_ops(uint8_t action) siftr_exit_pkt_manager_thread = 0; - ret = kthread_add(&siftr_pkt_manager_thread, NULL, NULL, + kthread_add(&siftr_pkt_manager_thread, NULL, NULL, &siftr_pkt_manager_thr, RFNOWAIT, 0, "siftr_pkt_manager_thr"); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sat May 19 05:55:31 2018 (r333868) +++ head/sys/netinet/tcp_timewait.c Sat May 19 05:56:21 2018 (r333869) @@ -645,7 +645,7 @@ tcp_tw_2msl_stop(struct tcptw *tw, int reuse) { struct ucred *cred; struct inpcb *inp; - int released; + int released __unused; INP_INFO_RLOCK_ASSERT(&V_tcbinfo); From owner-svn-src-all@freebsd.org Sat May 19 05:57:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77F8AEF011E; Sat, 19 May 2018 05:57:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2238480CC1; Sat, 19 May 2018 05:57:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 028E42306F; Sat, 19 May 2018 05:57:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5vRv1078753; Sat, 19 May 2018 05:57:27 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5vRLY078748; Sat, 19 May 2018 05:57:27 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190557.w4J5vRLY078748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333870 - in head/sys/dev: bnxt ixgbe netmap X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/dev: bnxt ixgbe netmap X-SVN-Commit-Revision: 333870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:57:28 -0000 Author: mmacy Date: Sat May 19 05:57:26 2018 New Revision: 333870 URL: https://svnweb.freebsd.org/changeset/base/333870 Log: netmap and iflib drivers, silence unused var warnings Modified: head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_txrx.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixgbe/ixgbe_x550.c head/sys/dev/netmap/if_ptnet.c Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Sat May 19 05:56:21 2018 (r333869) +++ head/sys/dev/bnxt/bnxt_hwrm.c Sat May 19 05:57:26 2018 (r333870) @@ -633,9 +633,7 @@ int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic) { struct hwrm_vnic_cfg_input req = {0}; - struct hwrm_vnic_cfg_output *resp; - resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_CFG); if (vnic->flags & BNXT_VNIC_FLAG_DEFAULT) @@ -953,9 +951,7 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnx uint32_t hash_type) { struct hwrm_vnic_rss_cfg_input req = {0}; - struct hwrm_vnic_rss_cfg_output *resp; - resp = (void *)softc->hwrm_cmd_resp.idi_vaddr; bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG); req.hash_type = htole32(hash_type); Modified: head/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- head/sys/dev/bnxt/bnxt_txrx.c Sat May 19 05:56:21 2018 (r333869) +++ head/sys/dev/bnxt/bnxt_txrx.c Sat May 19 05:57:26 2018 (r333870) @@ -263,7 +263,6 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) uint32_t pidx; uint8_t flid; uint64_t *paddrs; - caddr_t *vaddrs; qidx_t *frag_idxs; rxqid = iru->iru_qsidx; @@ -271,7 +270,6 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru) len = iru->iru_buf_size; pidx = iru->iru_pidx; flid = iru->iru_flidx; - vaddrs = iru->iru_vaddrs; paddrs = iru->iru_paddrs; frag_idxs = iru->iru_idxs; @@ -533,7 +531,6 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info { struct rx_tpa_end_cmpl *agend = &((struct rx_tpa_end_cmpl *)cpr->ring.vaddr)[cpr->cons]; - struct rx_tpa_end_cmpl_hi *agendh; struct rx_abuf_cmpl *acp; struct bnxt_full_tpa_start *tpas; uint32_t flags2; @@ -566,7 +563,6 @@ bnxt_pkt_get_tpa(struct bnxt_softc *softc, if_rxd_info /* Now the second 16-byte BD */ NEXT_CP_CONS_V(&cpr->ring, cpr->cons, cpr->v_bit); ri->iri_cidx = RING_NEXT(&cpr->ring, ri->iri_cidx); - agendh = &((struct rx_tpa_end_cmpl_hi *)cpr->ring.vaddr)[cpr->cons]; flags2 = le32toh(tpas->high.flags2); if ((flags2 & RX_TPA_START_CMPL_FLAGS2_META_FORMAT_MASK) == Modified: head/sys/dev/ixgbe/ix_txrx.c ============================================================================== --- head/sys/dev/ixgbe/ix_txrx.c Sat May 19 05:56:21 2018 (r333869) +++ head/sys/dev/ixgbe/ix_txrx.c Sat May 19 05:57:26 2018 (r333870) @@ -217,6 +217,7 @@ ixgbe_isc_txd_encap(void *arg, if_pkt_info_t pi) } olinfo_status |= IXGBE_ADVTXD_CC; + pidx_last = 0; for (j = 0; j < nsegs; j++) { bus_size_t seglen; Modified: head/sys/dev/ixgbe/ixgbe_x550.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_x550.c Sat May 19 05:56:21 2018 (r333869) +++ head/sys/dev/ixgbe/ixgbe_x550.c Sat May 19 05:57:26 2018 (r333870) @@ -1134,7 +1134,7 @@ s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 device_type, u32 data) { u32 gssr = IXGBE_GSSR_PHY1_SM | IXGBE_GSSR_PHY0_SM; - u32 command, error; + u32 command, error __unused; s32 ret; ret = ixgbe_acquire_swfw_semaphore(hw, gssr); @@ -1180,7 +1180,7 @@ s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u u32 device_type, u32 *data) { u32 gssr = IXGBE_GSSR_PHY1_SM | IXGBE_GSSR_PHY0_SM; - u32 command, error; + u32 command, error __unused; s32 ret; ret = ixgbe_acquire_swfw_semaphore(hw, gssr); Modified: head/sys/dev/netmap/if_ptnet.c ============================================================================== --- head/sys/dev/netmap/if_ptnet.c Sat May 19 05:56:21 2018 (r333869) +++ head/sys/dev/netmap/if_ptnet.c Sat May 19 05:57:26 2018 (r333870) @@ -757,7 +757,7 @@ ptnet_ioctl(if_t ifp, u_long cmd, caddr_t data) struct ptnet_softc *sc = if_getsoftc(ifp); device_t dev = sc->dev; struct ifreq *ifr = (struct ifreq *)data; - int mask, err = 0; + int mask __unused, err = 0; switch (cmd) { case SIOCSIFFLAGS: From owner-svn-src-all@freebsd.org Sat May 19 05:58:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A285EF0178; Sat, 19 May 2018 05:58:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C0C0880DFE; Sat, 19 May 2018 05:58:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2B9123070; Sat, 19 May 2018 05:58:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J5w5Yv078824; Sat, 19 May 2018 05:58:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J5w5Au078823; Sat, 19 May 2018 05:58:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190558.w4J5w5Au078823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 05:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333871 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 333871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 05:58:06 -0000 Author: mmacy Date: Sat May 19 05:58:05 2018 New Revision: 333871 URL: https://svnweb.freebsd.org/changeset/base/333871 Log: pmap: silence warnings Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat May 19 05:57:26 2018 (r333870) +++ head/sys/amd64/amd64/pmap.c Sat May 19 05:58:05 2018 (r333871) @@ -7366,6 +7366,7 @@ pmap_activate_sw(struct thread *td) u_int cpuid; struct amd64tss *tssp; + rflags = 0; oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); if (oldpmap == pmap) @@ -7680,7 +7681,7 @@ pmap_map_io_transient(vm_page_t page[], vm_offset_t va vm_paddr_t paddr; boolean_t needs_mapping; pt_entry_t *pte; - int cache_bits, error, i; + int cache_bits, error __unused, i; /* * Allocate any KVA space that we need, this is done in a separate From owner-svn-src-all@freebsd.org Sat May 19 06:31:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E2B7EF0C7A; Sat, 19 May 2018 06:31:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D872781C12; Sat, 19 May 2018 06:31:17 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B99B2235AE; Sat, 19 May 2018 06:31:17 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J6VHn3094226; Sat, 19 May 2018 06:31:17 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J6VHhr094225; Sat, 19 May 2018 06:31:17 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190631.w4J6VHhr094225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 06:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333872 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 333872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 06:31:18 -0000 Author: mmacy Date: Sat May 19 06:31:17 2018 New Revision: 333872 URL: https://svnweb.freebsd.org/changeset/base/333872 Log: ctfconvert: silence useless enum has too many values warning Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat May 19 05:58:05 2018 (r333871) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat May 19 06:31:17 2018 (r333872) @@ -438,8 +438,6 @@ write_type(void *arg1, void *arg2) i++; /* count up enum members */ if (i > CTF_MAX_VLEN) { - warning("enum %s has too many values: %d > %d\n", - tdesc_name(tp), i, CTF_MAX_VLEN); i = CTF_MAX_VLEN; } From owner-svn-src-all@freebsd.org Sat May 19 07:04:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E992CEF17FB; Sat, 19 May 2018 07:04:45 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 815CF82E93; Sat, 19 May 2018 07:04:44 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2FE523C0A; Sat, 19 May 2018 07:04:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J74h7w014931; Sat, 19 May 2018 07:04:43 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J74hED014930; Sat, 19 May 2018 07:04:43 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190704.w4J74hED014930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 07:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333873 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 07:04:46 -0000 Author: mmacy Date: Sat May 19 07:04:43 2018 New Revision: 333873 URL: https://svnweb.freebsd.org/changeset/base/333873 Log: intr unbreak KTR/LINT build Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Sat May 19 06:31:17 2018 (r333872) +++ head/sys/kern/kern_intr.c Sat May 19 07:04:43 2018 (r333873) @@ -985,13 +985,13 @@ intr_event_schedule_thread(struct intr_event *ie) atomic_store_rel_int(&it->it_need, 1); thread_lock(td); if (TD_AWAITING_INTR(td)) { - CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, p->p_pid, + CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, td->td_proc->p_pid, td->td_name); TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); } else { CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", - __func__, p->p_pid, td->td_name, it->it_need, td->td_state); + __func__, td->td_proc->p_pid, td->td_name, it->it_need, td->td_state); } thread_unlock(td); From owner-svn-src-all@freebsd.org Sat May 19 07:13:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F34AAEF1A79; Sat, 19 May 2018 07:13:50 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F78183371; Sat, 19 May 2018 07:13:50 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com [209.85.214.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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 5A3B321A64; Sat, 19 May 2018 07:13:50 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f49.google.com with SMTP id e185-v6so4340045ita.0; Sat, 19 May 2018 00:13:50 -0700 (PDT) X-Gm-Message-State: ALKqPwcLFFEzXbr+8RkXNuRZ9VMaHRhI/sKtBOiHxT5YtS/QnNBBZ7O0 KWfHlale8jVL4b1GMWWm4BOaCKti4JNlM3l99qg= X-Google-Smtp-Source: AB8JxZqGQflrG/MMH7SWPvKmh6yWOODi/vqoqd1Vc8CfokxcQcnrX8ylDUKmn9VCWiw6pjniv3w7KRgZHTV/v1Wjz4Y= X-Received: by 2002:a24:5a85:: with SMTP id v127-v6mr10289013ita.128.1526714029437; Sat, 19 May 2018 00:13:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Sat, 19 May 2018 00:13:48 -0700 (PDT) In-Reply-To: References: <201805091847.w49IlPPa014617@repo.freebsd.org> From: Matthew Macy Date: Sat, 19 May 2018 00:13:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333425 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/cloudabi compat/linux compat/linuxkpi/common/include/linux dev/filemon dev/hwpmc fs/... To: Ilya Bakulin Cc: manu@freebsd.org, Warner Losh , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 07:13:51 -0000 I guess we'll need to allocate more pages at boot. We must have been on the edge already if that pushed us over. -M On Fri, May 18, 2018 at 12:03 PM, Ilya Bakulin wrote: > Hi Matt, > seems this commit has broken at least BeagleBone Black booting process. On > all revisions after it the kernel panics with this message: > http://dl.bakulin.de/bbb_panic.txt > My suspicion is that there are quite a few new SYSINIT objects that are > created on startup, and as a result some kind of memory reservation gets > exhausted. I don't have immediate idea how to debug this further; just can > confirm that patching out this change allows the board to boot again. > > > On Wed, May 9, 2018 at 8:47 PM Matt Macy wrote: >> >> Author: mmacy >> Date: Wed May 9 18:47:24 2018 >> New Revision: 333425 >> URL: https://svnweb.freebsd.org/changeset/base/333425 >> >> Log: >> Eliminate the overhead of gratuitous repeated reinitialization of >> cap_rights >> >> - Add macros to allow preinitialization of cap_rights_t. >> >> - Convert most commonly used code paths to use preinitialized >> cap_rights_t. >> A 3.6% speedup in fstat was measured with this change. >> >> Reported by: mjg >> Reviewed by: oshogbo >> Approved by: sbruno >> MFC after: 1 month >> >> Modified: >> head/sys/cddl/compat/opensolaris/sys/file.h >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> head/sys/compat/cloudabi/cloudabi_file.c >> head/sys/compat/linux/linux_event.c >> head/sys/compat/linux/linux_file.c >> head/sys/compat/linux/linux_ioctl.c >> head/sys/compat/linux/linux_mmap.c >> head/sys/compat/linux/linux_socket.c >> head/sys/compat/linux/linux_stats.c >> head/sys/compat/linuxkpi/common/include/linux/file.h >> head/sys/dev/filemon/filemon.c >> head/sys/dev/hwpmc/hwpmc_logging.c >> head/sys/fs/fdescfs/fdesc_vnops.c >> head/sys/fs/fuse/fuse_vfsops.c >> head/sys/kern/kern_descrip.c >> head/sys/kern/kern_event.c >> head/sys/kern/kern_exec.c >> head/sys/kern/kern_sendfile.c >> head/sys/kern/kern_sig.c >> head/sys/kern/subr_capability.c >> head/sys/kern/sys_generic.c >> head/sys/kern/sys_procdesc.c >> head/sys/kern/uipc_mqueue.c >> head/sys/kern/uipc_sem.c >> head/sys/kern/uipc_syscalls.c >> head/sys/kern/vfs_aio.c >> head/sys/kern/vfs_syscalls.c >> head/sys/netsmb/smb_dev.c >> head/sys/sys/capsicum.h >> >> Modified: head/sys/cddl/compat/opensolaris/sys/file.h >> >> ============================================================================== >> --- head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:47:24 2018 >> (r333425) >> @@ -52,10 +52,9 @@ static __inline void >> releasef(int fd) >> { >> struct file *fp; >> - cap_rights_t rights; >> >> /* No CAP_ rights required, as we're only releasing. */ >> - if (fget(curthread, fd, cap_rights_init(&rights), &fp) == 0) { >> + if (fget(curthread, fd, &cap_no_rights, &fp) == 0) { >> fdrop(fp, curthread); >> fdrop(fp, curthread); >> } >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> Wed May 9 18:41:04 2018 (r333424) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> Wed May 9 18:47:24 2018 (r333425) >> @@ -4446,7 +4446,6 @@ zfs_ioc_recv(zfs_cmd_t *zc) >> char *origin = NULL; >> char *tosnap; >> char tofs[ZFS_MAX_DATASET_NAME_LEN]; >> - cap_rights_t rights; >> boolean_t first_recvd_props = B_FALSE; >> >> if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || >> @@ -4467,7 +4466,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) >> #ifdef illumos >> fp = getf(fd); >> #else >> - fget_read(curthread, fd, cap_rights_init(&rights, CAP_PREAD), >> &fp); >> + fget_read(curthread, fd, &cap_pread_rights, &fp); >> #endif >> if (fp == NULL) { >> nvlist_free(props); >> @@ -4744,13 +4743,11 @@ zfs_ioc_send(zfs_cmd_t *zc) >> dsl_pool_rele(dp, FTAG); >> } else { >> file_t *fp; >> - cap_rights_t rights; >> >> #ifdef illumos >> fp = getf(zc->zc_cookie); >> #else >> - fget_write(curthread, zc->zc_cookie, >> - cap_rights_init(&rights, CAP_WRITE), &fp); >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, >> &fp); >> #endif >> if (fp == NULL) >> return (SET_ERROR(EBADF)); >> @@ -5387,15 +5384,13 @@ static int >> zfs_ioc_diff(zfs_cmd_t *zc) >> { >> file_t *fp; >> - cap_rights_t rights; >> offset_t off; >> int error; >> >> #ifdef illumos >> fp = getf(zc->zc_cookie); >> #else >> - fget_write(curthread, zc->zc_cookie, >> - cap_rights_init(&rights, CAP_WRITE), &fp); >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, &fp); >> #endif >> if (fp == NULL) >> return (SET_ERROR(EBADF)); >> @@ -5787,7 +5782,6 @@ zfs_ioc_unjail(zfs_cmd_t *zc) >> static int >> zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) >> { >> - cap_rights_t rights; >> file_t *fp; >> int error; >> offset_t off; >> @@ -5815,7 +5809,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t >> *innvl >> #ifdef illumos >> file_t *fp = getf(fd); >> #else >> - fget_write(curthread, fd, cap_rights_init(&rights, CAP_WRITE), >> &fp); >> + fget_write(curthread, fd, &cap_write_rights, &fp); >> #endif >> if (fp == NULL) >> return (SET_ERROR(EBADF)); >> >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> >> ============================================================================== >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> Wed May 9 18:41:04 2018 (r333424) >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> Wed May 9 18:47:24 2018 (r333425) >> @@ -126,7 +126,7 @@ zfs_onexit_fd_hold(int fd, minor_t *minorp) >> void *data; >> int error; >> >> - fp = getf(fd, cap_rights_init(&rights)); >> + fp = getf(fd, &cap_no_rights); >> if (fp == NULL) >> return (SET_ERROR(EBADF)); >> >> >> Modified: head/sys/compat/cloudabi/cloudabi_file.c >> >> ============================================================================== >> --- head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -390,12 +390,11 @@ cloudabi_sys_file_readdir(struct thread *td, >> struct file *fp; >> struct vnode *vp; >> void *readbuf; >> - cap_rights_t rights; >> cloudabi_dircookie_t offset; >> int error; >> >> /* Obtain directory vnode. */ >> - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), >> &fp); >> + error = getvnode(td, uap->fd, &cap_read_rights, &fp); >> if (error != 0) { >> if (error == EINVAL) >> return (ENOTDIR); >> @@ -559,14 +558,13 @@ cloudabi_sys_file_stat_fget(struct thread *td, >> struct stat sb; >> cloudabi_filestat_t csb; >> struct file *fp; >> - cap_rights_t rights; >> cloudabi_filetype_t filetype; >> int error; >> >> memset(&csb, 0, sizeof(csb)); >> >> /* Fetch file descriptor attributes. */ >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), >> &fp); >> + error = fget(td, uap->fd, &cap_fstat_rights, &fp); >> if (error != 0) >> return (error); >> error = fo_stat(fp, &sb, td->td_ucred, td); >> >> Modified: head/sys/compat/linux/linux_event.c >> >> ============================================================================== >> --- head/sys/compat/linux/linux_event.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/linux/linux_event.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -1190,14 +1190,13 @@ linux_timerfd_curval(struct timerfd *tfd, struct >> itime >> int >> linux_timerfd_gettime(struct thread *td, struct >> linux_timerfd_gettime_args *args) >> { >> - cap_rights_t rights; >> struct l_itimerspec lots; >> struct itimerspec ots; >> struct timerfd *tfd; >> struct file *fp; >> int error; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_READ), >> &fp); >> + error = fget(td, args->fd, &cap_read_rights, &fp); >> if (error != 0) >> return (error); >> tfd = fp->f_data; >> @@ -1225,7 +1224,6 @@ linux_timerfd_settime(struct thread *td, struct >> linux_ >> struct l_itimerspec lots; >> struct itimerspec nts, ots; >> struct timespec cts, ts; >> - cap_rights_t rights; >> struct timerfd *tfd; >> struct timeval tv; >> struct file *fp; >> @@ -1241,7 +1239,7 @@ linux_timerfd_settime(struct thread *td, struct >> linux_ >> if (error != 0) >> return (error); >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_WRITE), >> &fp); >> + error = fget(td, args->fd, &cap_write_rights, &fp); >> if (error != 0) >> return (error); >> tfd = fp->f_data; >> >> Modified: head/sys/compat/linux/linux_file.c >> >> ============================================================================== >> --- head/sys/compat/linux/linux_file.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/linux/linux_file.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -89,7 +89,6 @@ linux_creat(struct thread *td, struct linux_creat_args >> static int >> linux_common_open(struct thread *td, int dirfd, char *path, int l_flags, >> int mode) >> { >> - cap_rights_t rights; >> struct proc *p = td->td_proc; >> struct file *fp; >> int fd; >> @@ -144,7 +143,7 @@ linux_common_open(struct thread *td, int dirfd, char * >> * checking below. >> */ >> fd = td->td_retval[0]; >> - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == 0) { >> + if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { >> if (fp->f_type != DTYPE_VNODE) { >> fdrop(fp, td); >> goto done; >> @@ -263,13 +262,12 @@ linux_llseek(struct thread *td, struct >> linux_llseek_ar >> static int >> linux_getdents_error(struct thread *td, int fd, int err) >> { >> - cap_rights_t rights; >> struct vnode *vp; >> struct file *fp; >> int error; >> >> /* Linux return ENOTDIR in case when fd is not a directory. */ >> - error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), &fp); >> + error = getvnode(td, fd, &cap_read_rights, &fp); >> if (error != 0) >> return (error); >> vp = fp->f_vnode; >> @@ -985,15 +983,13 @@ linux_fdatasync(td, uap) >> int >> linux_pread(struct thread *td, struct linux_pread_args *uap) >> { >> - cap_rights_t rights; >> struct vnode *vp; >> int error; >> >> error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, >> uap->offset); >> if (error == 0) { >> /* This seems to violate POSIX but Linux does it. */ >> - error = fgetvp(td, uap->fd, >> - cap_rights_init(&rights, CAP_PREAD), &vp); >> + error = fgetvp(td, uap->fd, &cap_pread_rights, &vp); >> if (error != 0) >> return (error); >> if (vp->v_type == VDIR) { >> @@ -1275,7 +1271,6 @@ fcntl_common(struct thread *td, struct >> linux_fcntl_arg >> { >> struct l_flock linux_flock; >> struct flock bsd_flock; >> - cap_rights_t rights; >> struct file *fp; >> long arg; >> int error, result; >> @@ -1379,7 +1374,7 @@ fcntl_common(struct thread *td, struct >> linux_fcntl_arg >> * pipes under Linux-2.2.35 at least). >> */ >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_FCNTL), &fp); >> + &cap_fcntl_rights, &fp); >> if (error) >> return (error); >> if (fp->f_type == DTYPE_PIPE) { >> >> Modified: head/sys/compat/linux/linux_ioctl.c >> >> ============================================================================== >> --- head/sys/compat/linux/linux_ioctl.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/linux/linux_ioctl.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -194,13 +194,12 @@ struct linux_hd_big_geometry { >> static int >> linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error; >> u_int sectorsize, fwcylinders, fwheads, fwsectors; >> off_t mediasize, bytespercyl; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> switch (args->cmd & 0xffff) { >> @@ -278,13 +277,12 @@ linux_ioctl_hdio(struct thread *td, struct >> linux_ioctl >> static int >> linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error; >> u_int sectorsize; >> off_t mediasize; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> switch (args->cmd & 0xffff) { >> @@ -717,11 +715,10 @@ linux_ioctl_termio(struct thread *td, struct >> linux_ioc >> struct termios bios; >> struct linux_termios lios; >> struct linux_termio lio; >> - cap_rights_t rights; >> struct file *fp; >> int error; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> >> @@ -1461,11 +1458,10 @@ bsd_to_linux_dvd_authinfo(struct dvd_authinfo *bp, >> l_d >> static int >> linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> switch (args->cmd & 0xffff) { >> @@ -1998,11 +1994,10 @@ linux_ioctl_sound(struct thread *td, struct >> linux_ioct >> static int >> linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> switch (args->cmd & 0xffff) { >> @@ -2411,7 +2406,6 @@ static int >> linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) >> { >> char lifname[LINUX_IFNAMSIZ], ifname[IFNAMSIZ]; >> - cap_rights_t rights; >> struct ifnet *ifp; >> struct file *fp; >> int error, type; >> @@ -2419,7 +2413,7 @@ linux_ioctl_socket(struct thread *td, struct >> linux_ioc >> ifp = NULL; >> error = 0; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> type = fp->f_type; >> @@ -2649,11 +2643,10 @@ linux_ioctl_socket(struct thread *td, struct >> linux_ioc >> static int >> linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error, type; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> type = fp->f_type; >> @@ -2685,11 +2678,10 @@ linux_ioctl_sg_io(struct thread *td, struct >> linux_ioct >> { >> struct sg_io_hdr io; >> struct sg_io_hdr32 io32; >> - cap_rights_t rights; >> struct file *fp; >> int error; >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) { >> printf("sg_linux_ioctl: fget returned %d\n", error); >> return (error); >> @@ -2997,7 +2989,6 @@ linux_v4l_cliplist_copy(struct l_video_window *lvw, >> st >> static int >> linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error; >> struct video_tuner vtun; >> @@ -3016,7 +3007,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCGTUNER: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = copyin((void *) args->arg, &l_vtun, >> sizeof(l_vtun)); >> @@ -3036,7 +3027,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCSTUNER: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = copyin((void *) args->arg, &l_vtun, >> sizeof(l_vtun)); >> @@ -3055,7 +3046,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCGWIN: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, td); >> @@ -3069,7 +3060,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCSWIN: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = copyin((void *) args->arg, &l_vwin, >> sizeof(l_vwin)); >> @@ -3094,7 +3085,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCGFBUF: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, >> td); >> @@ -3108,7 +3099,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCSFBUF: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = copyin((void *) args->arg, &l_vbuf, >> sizeof(l_vbuf)); >> @@ -3138,7 +3129,7 @@ linux_ioctl_v4l(struct thread *td, struct >> linux_ioctl_ >> >> case LINUX_VIDIOCSMICROCODE: >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = copyin((void *) args->arg, &l_vcode, >> sizeof(l_vcode)); >> @@ -3302,7 +3293,6 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, >> struc >> static int >> linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> int error; >> struct v4l2_format vformat; >> @@ -3395,7 +3385,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> linux_ioctl >> if (error) >> return (error); >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error) >> return (error); >> if (linux_to_bsd_v4l2_format(&l_vformat, &vformat) != 0) >> @@ -3420,7 +3410,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> linux_ioctl >> return (error); >> linux_to_bsd_v4l2_standard(&l_vstd, &vstd); >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error) >> return (error); >> error = fo_ioctl(fp, VIDIOC_ENUMSTD, (caddr_t)&vstd, >> @@ -3444,7 +3434,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> linux_ioctl >> if (error != 0) >> return (error); >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> error = fo_ioctl(fp, VIDIOC_ENUMINPUT, (caddr_t)&vinp, >> @@ -3465,7 +3455,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> linux_ioctl >> if (error) >> return (error); >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error) >> return (error); >> linux_to_bsd_v4l2_buffer(&l_vbuf, &vbuf); >> @@ -3640,7 +3630,6 @@ linux_ioctl_fbsd_usb(struct thread *td, struct >> linux_i >> static int >> linux_ioctl_evdev(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> clockid_t clock; >> int error; >> @@ -3668,7 +3657,7 @@ linux_ioctl_evdev(struct thread *td, struct >> linux_ioct >> return (error); >> >> error = fget(td, args->fd, >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> + &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> >> @@ -3694,7 +3683,6 @@ linux_ioctl_evdev(struct thread *td, struct >> linux_ioct >> int >> linux_ioctl(struct thread *td, struct linux_ioctl_args *args) >> { >> - cap_rights_t rights; >> struct file *fp; >> struct handler_element *he; >> int error, cmd; >> @@ -3705,7 +3693,7 @@ linux_ioctl(struct thread *td, struct >> linux_ioctl_args >> (unsigned long)args->cmd); >> #endif >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> &fp); >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> if (error != 0) >> return (error); >> if ((fp->f_flag & (FREAD|FWRITE)) == 0) { >> >> Modified: head/sys/compat/linux/linux_mmap.c >> >> ============================================================================== >> --- head/sys/compat/linux/linux_mmap.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/linux/linux_mmap.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -72,7 +72,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s >> int bsd_flags, error; >> struct file *fp; >> >> - cap_rights_t rights; >> LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", >> addr, len, prot, flags, fd, pos); >> >> @@ -126,7 +125,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s >> * protection options specified. >> */ >> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), >> &fp); >> + error = fget(td, fd, &cap_mmap_rights, &fp); >> if (error != 0) >> return (error); >> if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_DEV) >> { >> >> Modified: head/sys/compat/linux/linux_socket.c >> >> ============================================================================== >> --- head/sys/compat/linux/linux_socket.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/linux/linux_socket.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -766,7 +766,6 @@ linux_bind(struct thread *td, struct linux_bind_args * >> int >> linux_connect(struct thread *td, struct linux_connect_args *args) >> { >> - cap_rights_t rights; >> struct socket *so; >> struct sockaddr *sa; >> struct file *fp; >> @@ -788,7 +787,7 @@ linux_connect(struct thread *td, struct linux_connect_ >> * when on a non-blocking socket. Instead it returns the >> * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. >> */ >> - error = getsock_cap(td, args->s, cap_rights_init(&rights, >> CAP_CONNECT), >> + error = getsock_cap(td, args->s, &cap_connect_rights, >> &fp, &fflag, NULL); >> if (error != 0) >> return (error); >> @@ -824,7 +823,6 @@ linux_accept_common(struct thread *td, int s, l_uintpt >> socklen_t * __restrict anamelen; >> int flags; >> } */ bsd_args; >> - cap_rights_t rights; >> struct socket *so; >> struct file *fp; >> int error, error1; >> @@ -842,8 +840,7 @@ linux_accept_common(struct thread *td, int s, l_uintpt >> if (error == EFAULT && namelen != sizeof(struct >> sockaddr_in)) >> return (EINVAL); >> if (error == EINVAL) { >> - error1 = getsock_cap(td, s, >> - cap_rights_init(&rights, CAP_ACCEPT), &fp, >> NULL, NULL); >> + error1 = getsock_cap(td, s, &cap_accept_rights, >> &fp, NULL, NULL); >> if (error1 != 0) >> return (error1); >> so = fp->f_data; >> >> Modified: head/sys/compat/linux/linux_stats.c >> >> ============================================================================== >> --- head/sys/compat/linux/linux_stats.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/compat/linux/linux_stats.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -103,14 +103,13 @@ translate_fd_major_minor(struct thread *td, int fd, >> st >> { >> struct file *fp; >> struct vnode *vp; >> - cap_rights_t rights; >> int major, minor; >> >> /* >> * No capability rights required here. >> */ >> if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || >> - fget(td, fd, cap_rights_init(&rights), &fp) != 0) >> + fget(td, fd, &cap_no_rights, &fp) != 0) >> return; >> vp = fp->f_vnode; >> if (vp != NULL && vp->v_rdev != NULL && >> @@ -680,12 +679,11 @@ linux_newfstatat(struct thread *td, struct >> linux_newfs >> int >> linux_syncfs(struct thread *td, struct linux_syncfs_args *args) >> { >> - cap_rights_t rights; >> struct mount *mp; >> struct vnode *vp; >> int error, save; >> >> - error = fgetvp(td, args->fd, cap_rights_init(&rights, CAP_FSYNC), >> &vp); >> + error = fgetvp(td, args->fd, &cap_fsync_rights, &vp); >> if (error != 0) >> /* >> * Linux syncfs() returns only EBADF, however fgetvp() >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/file.h >> >> ============================================================================== >> --- head/sys/compat/linuxkpi/common/include/linux/file.h Wed May 9 >> 18:41:04 2018 (r333424) >> +++ head/sys/compat/linuxkpi/common/include/linux/file.h Wed May 9 >> 18:47:24 2018 (r333425) >> @@ -50,12 +50,11 @@ extern struct fileops linuxfileops; >> static inline struct linux_file * >> linux_fget(unsigned int fd) >> { >> - cap_rights_t rights; >> struct file *file; >> >> /* lookup file pointer by file descriptor index */ >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >> - cap_rights_init(&rights), &file, NULL) != 0) >> + &cap_no_rights, &file, NULL) != 0) >> return (NULL); >> >> /* check if file handle really belongs to us */ >> @@ -88,11 +87,10 @@ file_count(struct linux_file *filp) >> static inline void >> put_unused_fd(unsigned int fd) >> { >> - cap_rights_t rights; >> struct file *file; >> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >> - cap_rights_init(&rights), &file, NULL) != 0) { >> + &cap_no_rights, &file, NULL) != 0) { >> return; >> } >> /* >> @@ -109,11 +107,10 @@ put_unused_fd(unsigned int fd) >> static inline void >> fd_install(unsigned int fd, struct linux_file *filp) >> { >> - cap_rights_t rights; >> struct file *file; >> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >> - cap_rights_init(&rights), &file, NULL) != 0) { >> + &cap_no_rights, &file, NULL) != 0) { >> filp->_file = NULL; >> } else { >> filp->_file = file; >> >> Modified: head/sys/dev/filemon/filemon.c >> >> ============================================================================== >> --- head/sys/dev/filemon/filemon.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/dev/filemon/filemon.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -361,7 +361,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t da >> int error = 0; >> struct filemon *filemon; >> struct proc *p; >> - cap_rights_t rights; >> >> if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) >> return (error); >> @@ -377,7 +376,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t da >> } >> >> error = fget_write(td, *(int *)data, >> - cap_rights_init(&rights, CAP_PWRITE), >> + &cap_pwrite_rights, >> &filemon->fp); >> if (error == 0) >> /* Write the file header. */ >> >> Modified: head/sys/dev/hwpmc/hwpmc_logging.c >> >> ============================================================================== >> --- head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -638,7 +638,6 @@ int >> pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int >> logfd) >> { >> struct proc *p; >> - cap_rights_t rights; >> int error; >> >> sx_assert(&pmc_sx, SA_XLOCKED); >> @@ -655,8 +654,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct pmc_o >> po->po_file)); >> >> /* get a reference to the file state */ >> - error = fget_write(curthread, logfd, >> - cap_rights_init(&rights, CAP_WRITE), &po->po_file); >> + error = fget_write(curthread, logfd, &cap_write_rights, >> &po->po_file); >> if (error) >> goto error; >> >> >> Modified: head/sys/fs/fdescfs/fdesc_vnops.c >> >> ============================================================================== >> --- head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -286,7 +286,6 @@ fdesc_lookup(struct vop_lookup_args *ap) >> struct thread *td = cnp->cn_thread; >> struct file *fp; >> struct fdesc_get_ino_args arg; >> - cap_rights_t rights; >> int nlen = cnp->cn_namelen; >> u_int fd, fd1; >> int error; >> @@ -331,7 +330,7 @@ fdesc_lookup(struct vop_lookup_args *ap) >> /* >> * No rights to check since 'fp' isn't actually used. >> */ >> - if ((error = fget(td, fd, cap_rights_init(&rights), &fp)) != 0) >> + if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0) >> goto bad; >> >> /* Check if we're looking up ourselves. */ >> @@ -613,7 +612,6 @@ static int >> fdesc_readlink(struct vop_readlink_args *va) >> { >> struct vnode *vp, *vn; >> - cap_rights_t rights; >> struct thread *td; >> struct uio *uio; >> struct file *fp; >> @@ -631,7 +629,7 @@ fdesc_readlink(struct vop_readlink_args *va) >> VOP_UNLOCK(vn, 0); >> >> td = curthread; >> - error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, NULL); >> + error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); >> if (error != 0) >> goto out; >> >> >> Modified: head/sys/fs/fuse/fuse_vfsops.c >> >> ============================================================================== >> --- head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -222,7 +222,6 @@ fuse_vfsop_mount(struct mount *mp) >> struct file *fp, *fptmp; >> char *fspec, *subtype; >> struct vfsoptlist *opts; >> - cap_rights_t rights; >> >> subtype = NULL; >> max_read_set = 0; >> @@ -292,7 +291,7 @@ fuse_vfsop_mount(struct mount *mp) >> >> FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); >> >> - err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp); >> + err = fget(td, fd, &cap_read_rights, &fp); >> if (err != 0) { >> FS_DEBUG("invalid or not opened device: data=%p\n", data); >> goto out; >> >> Modified: head/sys/kern/kern_descrip.c >> >> ============================================================================== >> --- head/sys/kern/kern_descrip.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/kern/kern_descrip.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -490,7 +490,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> struct filedescent *fde; >> struct proc *p; >> struct vnode *vp; >> - cap_rights_t rights; >> int error, flg, tmp; >> uint64_t bsize; >> off_t foffset; >> @@ -548,8 +547,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> break; >> >> case F_GETFL: >> - error = fget_fcntl(td, fd, >> - cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp); >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETFL, >> &fp); >> if (error != 0) >> break; >> td->td_retval[0] = OFLAGS(fp->f_flag); >> @@ -557,8 +555,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> break; >> >> case F_SETFL: >> - error = fget_fcntl(td, fd, >> - cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp); >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, >> &fp); >> if (error != 0) >> break; >> do { >> @@ -585,8 +582,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> break; >> >> case F_GETOWN: >> - error = fget_fcntl(td, fd, >> - cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, &fp); >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETOWN, >> &fp); >> if (error != 0) >> break; >> error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, td); >> @@ -596,8 +592,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> break; >> >> case F_SETOWN: >> - error = fget_fcntl(td, fd, >> - cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, &fp); >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETOWN, >> &fp); >> if (error != 0) >> break; >> tmp = arg; >> @@ -618,8 +613,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> >> case F_SETLK: >> do_setlk: >> - cap_rights_init(&rights, CAP_FLOCK); >> - error = fget_unlocked(fdp, fd, &rights, &fp, NULL); >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, >> NULL); >> if (error != 0) >> break; >> if (fp->f_type != DTYPE_VNODE) { >> @@ -711,7 +705,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> * that the closing thread was a bit slower and that the >> * advisory lock succeeded before the close. >> */ >> - error = fget_unlocked(fdp, fd, &rights, &fp2, NULL); >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2, >> NULL); >> if (error != 0) { >> fdrop(fp, td); >> break; >> @@ -729,8 +723,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> break; >> >> case F_GETLK: >> - error = fget_unlocked(fdp, fd, >> - cap_rights_init(&rights, CAP_FLOCK), &fp, NULL); >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, >> NULL); >> if (error != 0) >> break; >> if (fp->f_type != DTYPE_VNODE) { >> @@ -767,8 +760,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_ >> arg = arg ? 128 * 1024: 0; >> /* FALLTHROUGH */ >> case F_READAHEAD: >> - error = fget_unlocked(fdp, fd, >> - cap_rights_init(&rights), &fp, NULL); >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, NULL); >> if (error != 0) >> break; >> if (fp->f_type != DTYPE_VNODE) { >> @@ -1363,12 +1355,11 @@ int >> kern_fstat(struct thread *td, int fd, struct stat *sbp) >> { >> struct file *fp; >> - cap_rights_t rights; >> int error; >> >> AUDIT_ARG_FD(fd); >> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FSTAT), &fp); >> + error = fget(td, fd, &cap_fstat_rights, &fp); >> if (error != 0) >> return (error); >> >> @@ -1445,10 +1436,9 @@ kern_fpathconf(struct thread *td, int fd, int name, >> lo >> { >> struct file *fp; >> struct vnode *vp; >> - cap_rights_t rights; >> int error; >> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FPATHCONF), >> &fp); >> + error = fget(td, fd, &cap_fpathconf_rights, &fp); >> if (error != 0) >> return (error); >> >> @@ -2982,10 +2972,9 @@ sys_flock(struct thread *td, struct flock_args >> *uap) >> struct file *fp; >> struct vnode *vp; >> struct flock lf; >> - cap_rights_t rights; >> int error; >> >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FLOCK), >> &fp); >> + error = fget(td, uap->fd, &cap_flock_rights, &fp); >> if (error != 0) >> return (error); >> if (fp->f_type != DTYPE_VNODE) { >> @@ -3633,7 +3622,7 @@ kern_proc_filedesc_out(struct proc *p, struct sbuf >> *s >> #ifdef CAPABILITIES >> rights = *cap_rights(fdp, i); >> #else /* !CAPABILITIES */ >> - cap_rights_init(&rights); >> + rights = cap_no_rights; >> #endif >> /* >> * Create sysctl entry. It is OK to drop the filedesc >> >> Modified: head/sys/kern/kern_event.c >> >> ============================================================================== >> --- head/sys/kern/kern_event.c Wed May 9 18:41:04 2018 (r333424) >> +++ head/sys/kern/kern_event.c Wed May 9 18:47:24 2018 (r333425) >> @@ -1286,7 +1286,6 @@ kqueue_register(struct kqueue *kq, struct kevent >> *kev, >> struct file *fp; >> struct knote *kn, *tkn; >> struct knlist *knl; >> - cap_rights_t rights; >> int error, filt, event; >> int haskqglobal, filedesc_unlock; >> >> @@ -1322,8 +1321,7 @@ findkn: >> if (kev->ident > INT_MAX) >> error = EBADF; >> else >> - error = fget(td, kev->ident, >> - cap_rights_init(&rights, CAP_EVENT), &fp); >> + error = fget(td, kev->ident, &cap_event_rights, >> &fp); >> if (error) >> goto done; >> >> >> Modified: head/sys/kern/kern_exec.c >> >> ============================================================================== >> --- head/sys/kern/kern_exec.c Wed May 9 18:41:04 2018 (r333424) >> +++ head/sys/kern/kern_exec.c Wed May 9 18:47:24 2018 (r333425) >> @@ -374,7 +374,6 @@ do_execve(struct thread *td, struct image_args *args, >> struct ucred *tracecred = NULL; >> #endif >> struct vnode *oldtextvp = NULL, *newtextvp; >> - cap_rights_t rights; >> int credential_changing; >> int textset; >> #ifdef MAC >> @@ -455,8 +454,7 @@ interpret: >> /* >> * Descriptors opened only with O_EXEC or O_RDONLY are >> allowed. >> */ >> - error = fgetvp_exec(td, args->fd, >> - cap_rights_init(&rights, CAP_FEXECVE), &newtextvp); >> + error = fgetvp_exec(td, args->fd, &cap_fexecve_rights, >> &newtextvp); >> if (error) >> goto exec_fail; >> vn_lock(newtextvp, LK_EXCLUSIVE | LK_RETRY); >> >> Modified: head/sys/kern/kern_sendfile.c >> >> ============================================================================== >> --- head/sys/kern/kern_sendfile.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/kern/kern_sendfile.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -511,7 +511,6 @@ static int >> sendfile_getsock(struct thread *td, int s, struct file **sock_fp, >> struct socket **so) >> { >> - cap_rights_t rights; >> int error; >> >> *sock_fp = NULL; >> @@ -520,7 +519,7 @@ sendfile_getsock(struct thread *td, int s, struct file >> /* >> * The socket must be a stream socket and connected. >> */ >> - error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SEND), >> + error = getsock_cap(td, s, &cap_send_rights, >> sock_fp, NULL, NULL); >> if (error != 0) >> return (error); >> @@ -949,7 +948,6 @@ sendfile(struct thread *td, struct sendfile_args *uap, >> struct sf_hdtr hdtr; >> struct uio *hdr_uio, *trl_uio; >> struct file *fp; >> - cap_rights_t rights; >> off_t sbytes; >> int error; >> >> @@ -1000,10 +998,8 @@ sendfile(struct thread *td, struct sendfile_args >> *uap, >> * sendfile(2) can start at any offset within a file so we require >> * CAP_READ+CAP_SEEK = CAP_PREAD. >> */ >> - if ((error = fget_read(td, uap->fd, >> - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { >> + if ((error = fget_read(td, uap->fd, &cap_pread_rights, &fp)) != 0) >> goto out; >> - } >> >> error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, >> uap->nbytes, &sbytes, uap->flags, td); >> >> Modified: head/sys/kern/kern_sig.c >> >> ============================================================================== >> --- head/sys/kern/kern_sig.c Wed May 9 18:41:04 2018 (r333424) >> +++ head/sys/kern/kern_sig.c Wed May 9 18:47:24 2018 (r333425) >> @@ -1789,7 +1789,6 @@ int >> sys_pdkill(struct thread *td, struct pdkill_args *uap) >> { >> struct proc *p; >> - cap_rights_t rights; >> int error; >> >> AUDIT_ARG_SIGNUM(uap->signum); >> @@ -1797,8 +1796,7 @@ sys_pdkill(struct thread *td, struct pdkill_args >> *uap) >> if ((u_int)uap->signum > _SIG_MAXSIG) >> return (EINVAL); >> >> - error = procdesc_find(td, uap->fd, >> - cap_rights_init(&rights, CAP_PDKILL), &p); >> + error = procdesc_find(td, uap->fd, &cap_pdkill_rights, &p); >> if (error) >> return (error); >> AUDIT_ARG_PROCESS(p); >> >> Modified: head/sys/kern/subr_capability.c >> >> ============================================================================== >> --- head/sys/kern/subr_capability.c Wed May 9 18:41:04 2018 >> (r333424) >> +++ head/sys/kern/subr_capability.c Wed May 9 18:47:24 2018 >> (r333425) >> @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); >> >> #ifdef _KERNEL >> #include >> - >> +#include >> #include >> #else /* !_KERNEL */ >> #include >> @@ -53,6 +53,38 @@ __FBSDID("$FreeBSD$"); >> >> #ifdef _KERNEL >> #define assert(exp) KASSERT((exp), ("%s:%u", __func__, >> __LINE__)) >> + >> +CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT); >> +CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND); >> +CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT); >> +CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT); >> +CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR); >> +CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL); >> +CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE); >> +CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK); >> +CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF); >> +CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT); >> +CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC); >> +CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE); >> +CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME); >> +CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME); >> +CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT); >> +CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL); >> +CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN); >> +CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP); >> +CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID); >> +CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL); >> +CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD); >> +CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE); >> +CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ); >> +CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV); >> +CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND); >> +CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT); >> +CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN); >> +CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE); >> + >> +__read_mostly cap_rights_t cap_no_rights; >> +CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights); >> #endif >> >> #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> > From owner-svn-src-all@freebsd.org Sat May 19 07:15:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CDB3EF1B17; Sat, 19 May 2018 07:15:02 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::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 14F86834DD; Sat, 19 May 2018 07:15:01 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x241.google.com with SMTP id m9-v6so13179045qtb.5; Sat, 19 May 2018 00:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IQZOqXbwOAZ2FHumya1arVfTfl27Eb9ePlZ51RnDimo=; b=Q3mmxfIHtRhrIQtz96c7pW8ZL4weEvh7gsRP/8uSmLFj3c/9OI8fWUqke8RrtlAGBi ozcYZKvHgDzPncIaZCsF7lB5ThMyo1W1eLwC/an1mgTw/iBbhMZDwCwDiUhbRSsiPkJP WJu0XxrY6OWsQHSO6fsBOMIL/DKiDmOCwRm7EyvCjUG6sS7g1nQdYNrEyv8SLJLkPdAU okZkG7+UETXErbE8I4DqBKzrK6gw6uivZzUNrWgbbYZZlJZ7WEtwjDWtpl7OXCeWkq8q 7BdkSMPUKokYadBrc6MngbGhJ8Xg/rRVe2CF6Fy8UWwTnHIJLhscEd7VXmGBzvDuIREh l3Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IQZOqXbwOAZ2FHumya1arVfTfl27Eb9ePlZ51RnDimo=; b=mqqhqn/lc9ML0OAso1AzpM32RNjz8jjDK2DmtbYX91WevAVqm5lL39jR0mJ++m8eCE U0r8JT0YvYMZn1pdTOHvHu26evcZCS6FdB+5Fo5z71GJIAoqbbvw8UF8HT5K4tXDHnB8 eXBXL3Dnu7FzC5o7+Juan0HHgTO+/OdmTYxK76NMp4VSY0GCHPSYOoP67D56/WVfXeqB pfpqSR22BQjTs9h/eCZhjcLHMu+1FjraCXlKfk7+uDYuN5Xa8/fbhzjYVRqtNekI1l5l Ioz4UOLQMbA3GVlc0RbOb0aldowZfp4FfYIosnUt8zd4ZXxmyN8XaRsE+LB709CtZ8Er CCnA== X-Gm-Message-State: ALKqPweURBwBAED/qUT3JZ3KOCzeU4dAJej7hXJ9gQPxa7ufKxU8lzUz Rd/rnFBoWTMu181jYcx2IV3VyxjQGWKD2gmoe38l8w== X-Google-Smtp-Source: AB8JxZqKLWyb760eLnOI1LQ+tJW8Jok++InOMi8DBYptf9hJFqEiVU8VrpX8VDUcF4mDQSfJbLvQTEY8hz3oFCklkgI= X-Received: by 2002:a0c:91b5:: with SMTP id n50-v6mr11622017qvn.20.1526714101008; Sat, 19 May 2018 00:15:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.28.74 with HTTP; Sat, 19 May 2018 00:14:59 -0700 (PDT) In-Reply-To: References: <201805091847.w49IlPPa014617@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 19 May 2018 09:14:59 +0200 Message-ID: Subject: Re: svn commit: r333425 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/cloudabi compat/linux compat/linuxkpi/common/include/linux dev/filemon dev/hwpmc fs/... To: Matthew Macy Cc: Ilya Bakulin , manu@freebsd.org, Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 07:15:03 -0000 imo all these sysinits can and shoud be collapsed into one, which will have a side effect of getting rid of the problem. On Sat, May 19, 2018 at 9:13 AM, Matthew Macy wrote: > I guess we'll need to allocate more pages at boot. We must have been > on the edge already if that pushed us over. > -M > > On Fri, May 18, 2018 at 12:03 PM, Ilya Bakulin wrote: > > Hi Matt, > > seems this commit has broken at least BeagleBone Black booting process. > On > > all revisions after it the kernel panics with this message: > > http://dl.bakulin.de/bbb_panic.txt > > My suspicion is that there are quite a few new SYSINIT objects that are > > created on startup, and as a result some kind of memory reservation gets > > exhausted. I don't have immediate idea how to debug this further; just > can > > confirm that patching out this change allows the board to boot again. > > > > > > On Wed, May 9, 2018 at 8:47 PM Matt Macy wrote: > >> > >> Author: mmacy > >> Date: Wed May 9 18:47:24 2018 > >> New Revision: 333425 > >> URL: https://svnweb.freebsd.org/changeset/base/333425 > >> > >> Log: > >> Eliminate the overhead of gratuitous repeated reinitialization of > >> cap_rights > >> > >> - Add macros to allow preinitialization of cap_rights_t. > >> > >> - Convert most commonly used code paths to use preinitialized > >> cap_rights_t. > >> A 3.6% speedup in fstat was measured with this change. > >> > >> Reported by: mjg > >> Reviewed by: oshogbo > >> Approved by: sbruno > >> MFC after: 1 month > >> > >> Modified: > >> head/sys/cddl/compat/opensolaris/sys/file.h > >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > >> head/sys/compat/cloudabi/cloudabi_file.c > >> head/sys/compat/linux/linux_event.c > >> head/sys/compat/linux/linux_file.c > >> head/sys/compat/linux/linux_ioctl.c > >> head/sys/compat/linux/linux_mmap.c > >> head/sys/compat/linux/linux_socket.c > >> head/sys/compat/linux/linux_stats.c > >> head/sys/compat/linuxkpi/common/include/linux/file.h > >> head/sys/dev/filemon/filemon.c > >> head/sys/dev/hwpmc/hwpmc_logging.c > >> head/sys/fs/fdescfs/fdesc_vnops.c > >> head/sys/fs/fuse/fuse_vfsops.c > >> head/sys/kern/kern_descrip.c > >> head/sys/kern/kern_event.c > >> head/sys/kern/kern_exec.c > >> head/sys/kern/kern_sendfile.c > >> head/sys/kern/kern_sig.c > >> head/sys/kern/subr_capability.c > >> head/sys/kern/sys_generic.c > >> head/sys/kern/sys_procdesc.c > >> head/sys/kern/uipc_mqueue.c > >> head/sys/kern/uipc_sem.c > >> head/sys/kern/uipc_syscalls.c > >> head/sys/kern/vfs_aio.c > >> head/sys/kern/vfs_syscalls.c > >> head/sys/netsmb/smb_dev.c > >> head/sys/sys/capsicum.h > >> > >> Modified: head/sys/cddl/compat/opensolaris/sys/file.h > >> > >> ============================================================ > ================== > >> --- head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:41:04 > 2018 > >> (r333424) > >> +++ head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:47:24 > 2018 > >> (r333425) > >> @@ -52,10 +52,9 @@ static __inline void > >> releasef(int fd) > >> { > >> struct file *fp; > >> - cap_rights_t rights; > >> > >> /* No CAP_ rights required, as we're only releasing. */ > >> - if (fget(curthread, fd, cap_rights_init(&rights), &fp) == 0) { > >> + if (fget(curthread, fd, &cap_no_rights, &fp) == 0) { > >> fdrop(fp, curthread); > >> fdrop(fp, curthread); > >> } > >> > >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ > zfs_ioctl.c > >> > >> ============================================================ > ================== > >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > >> Wed May 9 18:41:04 2018 (r333424) > >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c > >> Wed May 9 18:47:24 2018 (r333425) > >> @@ -4446,7 +4446,6 @@ zfs_ioc_recv(zfs_cmd_t *zc) > >> char *origin = NULL; > >> char *tosnap; > >> char tofs[ZFS_MAX_DATASET_NAME_LEN]; > >> - cap_rights_t rights; > >> boolean_t first_recvd_props = B_FALSE; > >> > >> if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || > >> @@ -4467,7 +4466,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) > >> #ifdef illumos > >> fp = getf(fd); > >> #else > >> - fget_read(curthread, fd, cap_rights_init(&rights, CAP_PREAD), > >> &fp); > >> + fget_read(curthread, fd, &cap_pread_rights, &fp); > >> #endif > >> if (fp == NULL) { > >> nvlist_free(props); > >> @@ -4744,13 +4743,11 @@ zfs_ioc_send(zfs_cmd_t *zc) > >> dsl_pool_rele(dp, FTAG); > >> } else { > >> file_t *fp; > >> - cap_rights_t rights; > >> > >> #ifdef illumos > >> fp = getf(zc->zc_cookie); > >> #else > >> - fget_write(curthread, zc->zc_cookie, > >> - cap_rights_init(&rights, CAP_WRITE), &fp); > >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, > >> &fp); > >> #endif > >> if (fp == NULL) > >> return (SET_ERROR(EBADF)); > >> @@ -5387,15 +5384,13 @@ static int > >> zfs_ioc_diff(zfs_cmd_t *zc) > >> { > >> file_t *fp; > >> - cap_rights_t rights; > >> offset_t off; > >> int error; > >> > >> #ifdef illumos > >> fp = getf(zc->zc_cookie); > >> #else > >> - fget_write(curthread, zc->zc_cookie, > >> - cap_rights_init(&rights, CAP_WRITE), &fp); > >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, &fp); > >> #endif > >> if (fp == NULL) > >> return (SET_ERROR(EBADF)); > >> @@ -5787,7 +5782,6 @@ zfs_ioc_unjail(zfs_cmd_t *zc) > >> static int > >> zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t > *outnvl) > >> { > >> - cap_rights_t rights; > >> file_t *fp; > >> int error; > >> offset_t off; > >> @@ -5815,7 +5809,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t > >> *innvl > >> #ifdef illumos > >> file_t *fp = getf(fd); > >> #else > >> - fget_write(curthread, fd, cap_rights_init(&rights, CAP_WRITE), > >> &fp); > >> + fget_write(curthread, fd, &cap_write_rights, &fp); > >> #endif > >> if (fp == NULL) > >> return (SET_ERROR(EBADF)); > >> > >> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ > zfs_onexit.c > >> > >> ============================================================ > ================== > >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > >> Wed May 9 18:41:04 2018 (r333424) > >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c > >> Wed May 9 18:47:24 2018 (r333425) > >> @@ -126,7 +126,7 @@ zfs_onexit_fd_hold(int fd, minor_t *minorp) > >> void *data; > >> int error; > >> > >> - fp = getf(fd, cap_rights_init(&rights)); > >> + fp = getf(fd, &cap_no_rights); > >> if (fp == NULL) > >> return (SET_ERROR(EBADF)); > >> > >> > >> Modified: head/sys/compat/cloudabi/cloudabi_file.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:41:04 > 2018 > >> (r333424) > >> +++ head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:47:24 > 2018 > >> (r333425) > >> @@ -390,12 +390,11 @@ cloudabi_sys_file_readdir(struct thread *td, > >> struct file *fp; > >> struct vnode *vp; > >> void *readbuf; > >> - cap_rights_t rights; > >> cloudabi_dircookie_t offset; > >> int error; > >> > >> /* Obtain directory vnode. */ > >> - error = getvnode(td, uap->fd, cap_rights_init(&rights, > CAP_READ), > >> &fp); > >> + error = getvnode(td, uap->fd, &cap_read_rights, &fp); > >> if (error != 0) { > >> if (error == EINVAL) > >> return (ENOTDIR); > >> @@ -559,14 +558,13 @@ cloudabi_sys_file_stat_fget(struct thread *td, > >> struct stat sb; > >> cloudabi_filestat_t csb; > >> struct file *fp; > >> - cap_rights_t rights; > >> cloudabi_filetype_t filetype; > >> int error; > >> > >> memset(&csb, 0, sizeof(csb)); > >> > >> /* Fetch file descriptor attributes. */ > >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), > >> &fp); > >> + error = fget(td, uap->fd, &cap_fstat_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = fo_stat(fp, &sb, td->td_ucred, td); > >> > >> Modified: head/sys/compat/linux/linux_event.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linux/linux_event.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/compat/linux/linux_event.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -1190,14 +1190,13 @@ linux_timerfd_curval(struct timerfd *tfd, struct > >> itime > >> int > >> linux_timerfd_gettime(struct thread *td, struct > >> linux_timerfd_gettime_args *args) > >> { > >> - cap_rights_t rights; > >> struct l_itimerspec lots; > >> struct itimerspec ots; > >> struct timerfd *tfd; > >> struct file *fp; > >> int error; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_READ), > >> &fp); > >> + error = fget(td, args->fd, &cap_read_rights, &fp); > >> if (error != 0) > >> return (error); > >> tfd = fp->f_data; > >> @@ -1225,7 +1224,6 @@ linux_timerfd_settime(struct thread *td, struct > >> linux_ > >> struct l_itimerspec lots; > >> struct itimerspec nts, ots; > >> struct timespec cts, ts; > >> - cap_rights_t rights; > >> struct timerfd *tfd; > >> struct timeval tv; > >> struct file *fp; > >> @@ -1241,7 +1239,7 @@ linux_timerfd_settime(struct thread *td, struct > >> linux_ > >> if (error != 0) > >> return (error); > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_WRITE), > >> &fp); > >> + error = fget(td, args->fd, &cap_write_rights, &fp); > >> if (error != 0) > >> return (error); > >> tfd = fp->f_data; > >> > >> Modified: head/sys/compat/linux/linux_file.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linux/linux_file.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/compat/linux/linux_file.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -89,7 +89,6 @@ linux_creat(struct thread *td, struct linux_creat_args > >> static int > >> linux_common_open(struct thread *td, int dirfd, char *path, int > l_flags, > >> int mode) > >> { > >> - cap_rights_t rights; > >> struct proc *p = td->td_proc; > >> struct file *fp; > >> int fd; > >> @@ -144,7 +143,7 @@ linux_common_open(struct thread *td, int dirfd, > char * > >> * checking below. > >> */ > >> fd = td->td_retval[0]; > >> - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == > 0) { > >> + if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { > >> if (fp->f_type != DTYPE_VNODE) { > >> fdrop(fp, td); > >> goto done; > >> @@ -263,13 +262,12 @@ linux_llseek(struct thread *td, struct > >> linux_llseek_ar > >> static int > >> linux_getdents_error(struct thread *td, int fd, int err) > >> { > >> - cap_rights_t rights; > >> struct vnode *vp; > >> struct file *fp; > >> int error; > >> > >> /* Linux return ENOTDIR in case when fd is not a directory. */ > >> - error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), > &fp); > >> + error = getvnode(td, fd, &cap_read_rights, &fp); > >> if (error != 0) > >> return (error); > >> vp = fp->f_vnode; > >> @@ -985,15 +983,13 @@ linux_fdatasync(td, uap) > >> int > >> linux_pread(struct thread *td, struct linux_pread_args *uap) > >> { > >> - cap_rights_t rights; > >> struct vnode *vp; > >> int error; > >> > >> error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, > >> uap->offset); > >> if (error == 0) { > >> /* This seems to violate POSIX but Linux does it. */ > >> - error = fgetvp(td, uap->fd, > >> - cap_rights_init(&rights, CAP_PREAD), &vp); > >> + error = fgetvp(td, uap->fd, &cap_pread_rights, &vp); > >> if (error != 0) > >> return (error); > >> if (vp->v_type == VDIR) { > >> @@ -1275,7 +1271,6 @@ fcntl_common(struct thread *td, struct > >> linux_fcntl_arg > >> { > >> struct l_flock linux_flock; > >> struct flock bsd_flock; > >> - cap_rights_t rights; > >> struct file *fp; > >> long arg; > >> int error, result; > >> @@ -1379,7 +1374,7 @@ fcntl_common(struct thread *td, struct > >> linux_fcntl_arg > >> * pipes under Linux-2.2.35 at least). > >> */ > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_FCNTL), &fp); > >> + &cap_fcntl_rights, &fp); > >> if (error) > >> return (error); > >> if (fp->f_type == DTYPE_PIPE) { > >> > >> Modified: head/sys/compat/linux/linux_ioctl.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linux/linux_ioctl.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/compat/linux/linux_ioctl.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -194,13 +194,12 @@ struct linux_hd_big_geometry { > >> static int > >> linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> u_int sectorsize, fwcylinders, fwheads, fwsectors; > >> off_t mediasize, bytespercyl; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> switch (args->cmd & 0xffff) { > >> @@ -278,13 +277,12 @@ linux_ioctl_hdio(struct thread *td, struct > >> linux_ioctl > >> static int > >> linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> u_int sectorsize; > >> off_t mediasize; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> switch (args->cmd & 0xffff) { > >> @@ -717,11 +715,10 @@ linux_ioctl_termio(struct thread *td, struct > >> linux_ioc > >> struct termios bios; > >> struct linux_termios lios; > >> struct linux_termio lio; > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> > >> @@ -1461,11 +1458,10 @@ bsd_to_linux_dvd_authinfo(struct dvd_authinfo > *bp, > >> l_d > >> static int > >> linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> switch (args->cmd & 0xffff) { > >> @@ -1998,11 +1994,10 @@ linux_ioctl_sound(struct thread *td, struct > >> linux_ioct > >> static int > >> linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> switch (args->cmd & 0xffff) { > >> @@ -2411,7 +2406,6 @@ static int > >> linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) > >> { > >> char lifname[LINUX_IFNAMSIZ], ifname[IFNAMSIZ]; > >> - cap_rights_t rights; > >> struct ifnet *ifp; > >> struct file *fp; > >> int error, type; > >> @@ -2419,7 +2413,7 @@ linux_ioctl_socket(struct thread *td, struct > >> linux_ioc > >> ifp = NULL; > >> error = 0; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> type = fp->f_type; > >> @@ -2649,11 +2643,10 @@ linux_ioctl_socket(struct thread *td, struct > >> linux_ioc > >> static int > >> linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error, type; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> type = fp->f_type; > >> @@ -2685,11 +2678,10 @@ linux_ioctl_sg_io(struct thread *td, struct > >> linux_ioct > >> { > >> struct sg_io_hdr io; > >> struct sg_io_hdr32 io32; > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) { > >> printf("sg_linux_ioctl: fget returned %d\n", error); > >> return (error); > >> @@ -2997,7 +2989,6 @@ linux_v4l_cliplist_copy(struct l_video_window > *lvw, > >> st > >> static int > >> linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> struct video_tuner vtun; > >> @@ -3016,7 +3007,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCGTUNER: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = copyin((void *) args->arg, &l_vtun, > >> sizeof(l_vtun)); > >> @@ -3036,7 +3027,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCSTUNER: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = copyin((void *) args->arg, &l_vtun, > >> sizeof(l_vtun)); > >> @@ -3055,7 +3046,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCGWIN: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, > td); > >> @@ -3069,7 +3060,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCSWIN: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = copyin((void *) args->arg, &l_vwin, > >> sizeof(l_vwin)); > >> @@ -3094,7 +3085,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCGFBUF: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, > >> td); > >> @@ -3108,7 +3099,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCSFBUF: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = copyin((void *) args->arg, &l_vbuf, > >> sizeof(l_vbuf)); > >> @@ -3138,7 +3129,7 @@ linux_ioctl_v4l(struct thread *td, struct > >> linux_ioctl_ > >> > >> case LINUX_VIDIOCSMICROCODE: > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = copyin((void *) args->arg, &l_vcode, > >> sizeof(l_vcode)); > >> @@ -3302,7 +3293,6 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, > >> struc > >> static int > >> linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> int error; > >> struct v4l2_format vformat; > >> @@ -3395,7 +3385,7 @@ linux_ioctl_v4l2(struct thread *td, struct > >> linux_ioctl > >> if (error) > >> return (error); > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error) > >> return (error); > >> if (linux_to_bsd_v4l2_format(&l_vformat, &vformat) != > 0) > >> @@ -3420,7 +3410,7 @@ linux_ioctl_v4l2(struct thread *td, struct > >> linux_ioctl > >> return (error); > >> linux_to_bsd_v4l2_standard(&l_vstd, &vstd); > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error) > >> return (error); > >> error = fo_ioctl(fp, VIDIOC_ENUMSTD, (caddr_t)&vstd, > >> @@ -3444,7 +3434,7 @@ linux_ioctl_v4l2(struct thread *td, struct > >> linux_ioctl > >> if (error != 0) > >> return (error); > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> error = fo_ioctl(fp, VIDIOC_ENUMINPUT, (caddr_t)&vinp, > >> @@ -3465,7 +3455,7 @@ linux_ioctl_v4l2(struct thread *td, struct > >> linux_ioctl > >> if (error) > >> return (error); > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error) > >> return (error); > >> linux_to_bsd_v4l2_buffer(&l_vbuf, &vbuf); > >> @@ -3640,7 +3630,6 @@ linux_ioctl_fbsd_usb(struct thread *td, struct > >> linux_i > >> static int > >> linux_ioctl_evdev(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> clockid_t clock; > >> int error; > >> @@ -3668,7 +3657,7 @@ linux_ioctl_evdev(struct thread *td, struct > >> linux_ioct > >> return (error); > >> > >> error = fget(td, args->fd, > >> - cap_rights_init(&rights, CAP_IOCTL), &fp); > >> + &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> > >> @@ -3694,7 +3683,6 @@ linux_ioctl_evdev(struct thread *td, struct > >> linux_ioct > >> int > >> linux_ioctl(struct thread *td, struct linux_ioctl_args *args) > >> { > >> - cap_rights_t rights; > >> struct file *fp; > >> struct handler_element *he; > >> int error, cmd; > >> @@ -3705,7 +3693,7 @@ linux_ioctl(struct thread *td, struct > >> linux_ioctl_args > >> (unsigned long)args->cmd); > >> #endif > >> > >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), > >> &fp); > >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); > >> if (error != 0) > >> return (error); > >> if ((fp->f_flag & (FREAD|FWRITE)) == 0) { > >> > >> Modified: head/sys/compat/linux/linux_mmap.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linux/linux_mmap.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/compat/linux/linux_mmap.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -72,7 +72,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s > >> int bsd_flags, error; > >> struct file *fp; > >> > >> - cap_rights_t rights; > >> LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", > >> addr, len, prot, flags, fd, pos); > >> > >> @@ -126,7 +125,7 @@ linux_mmap_common(struct thread *td, uintptr_t > addr, s > >> * protection options specified. > >> */ > >> > >> - error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), > >> &fp); > >> + error = fget(td, fd, &cap_mmap_rights, &fp); > >> if (error != 0) > >> return (error); > >> if (fp->f_type != DTYPE_VNODE && fp->f_type != > DTYPE_DEV) > >> { > >> > >> Modified: head/sys/compat/linux/linux_socket.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linux/linux_socket.c Wed May 9 18:41:04 > 2018 > >> (r333424) > >> +++ head/sys/compat/linux/linux_socket.c Wed May 9 18:47:24 > 2018 > >> (r333425) > >> @@ -766,7 +766,6 @@ linux_bind(struct thread *td, struct > linux_bind_args * > >> int > >> linux_connect(struct thread *td, struct linux_connect_args *args) > >> { > >> - cap_rights_t rights; > >> struct socket *so; > >> struct sockaddr *sa; > >> struct file *fp; > >> @@ -788,7 +787,7 @@ linux_connect(struct thread *td, struct > linux_connect_ > >> * when on a non-blocking socket. Instead it returns the > >> * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. > >> */ > >> - error = getsock_cap(td, args->s, cap_rights_init(&rights, > >> CAP_CONNECT), > >> + error = getsock_cap(td, args->s, &cap_connect_rights, > >> &fp, &fflag, NULL); > >> if (error != 0) > >> return (error); > >> @@ -824,7 +823,6 @@ linux_accept_common(struct thread *td, int s, > l_uintpt > >> socklen_t * __restrict anamelen; > >> int flags; > >> } */ bsd_args; > >> - cap_rights_t rights; > >> struct socket *so; > >> struct file *fp; > >> int error, error1; > >> @@ -842,8 +840,7 @@ linux_accept_common(struct thread *td, int s, > l_uintpt > >> if (error == EFAULT && namelen != sizeof(struct > >> sockaddr_in)) > >> return (EINVAL); > >> if (error == EINVAL) { > >> - error1 = getsock_cap(td, s, > >> - cap_rights_init(&rights, CAP_ACCEPT), &fp, > >> NULL, NULL); > >> + error1 = getsock_cap(td, s, &cap_accept_rights, > >> &fp, NULL, NULL); > >> if (error1 != 0) > >> return (error1); > >> so = fp->f_data; > >> > >> Modified: head/sys/compat/linux/linux_stats.c > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linux/linux_stats.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/compat/linux/linux_stats.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -103,14 +103,13 @@ translate_fd_major_minor(struct thread *td, int > fd, > >> st > >> { > >> struct file *fp; > >> struct vnode *vp; > >> - cap_rights_t rights; > >> int major, minor; > >> > >> /* > >> * No capability rights required here. > >> */ > >> if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || > >> - fget(td, fd, cap_rights_init(&rights), &fp) != 0) > >> + fget(td, fd, &cap_no_rights, &fp) != 0) > >> return; > >> vp = fp->f_vnode; > >> if (vp != NULL && vp->v_rdev != NULL && > >> @@ -680,12 +679,11 @@ linux_newfstatat(struct thread *td, struct > >> linux_newfs > >> int > >> linux_syncfs(struct thread *td, struct linux_syncfs_args *args) > >> { > >> - cap_rights_t rights; > >> struct mount *mp; > >> struct vnode *vp; > >> int error, save; > >> > >> - error = fgetvp(td, args->fd, cap_rights_init(&rights, > CAP_FSYNC), > >> &vp); > >> + error = fgetvp(td, args->fd, &cap_fsync_rights, &vp); > >> if (error != 0) > >> /* > >> * Linux syncfs() returns only EBADF, however fgetvp() > >> > >> Modified: head/sys/compat/linuxkpi/common/include/linux/file.h > >> > >> ============================================================ > ================== > >> --- head/sys/compat/linuxkpi/common/include/linux/file.h Wed > May 9 > >> 18:41:04 2018 (r333424) > >> +++ head/sys/compat/linuxkpi/common/include/linux/file.h Wed > May 9 > >> 18:47:24 2018 (r333425) > >> @@ -50,12 +50,11 @@ extern struct fileops linuxfileops; > >> static inline struct linux_file * > >> linux_fget(unsigned int fd) > >> { > >> - cap_rights_t rights; > >> struct file *file; > >> > >> /* lookup file pointer by file descriptor index */ > >> if (fget_unlocked(curthread->td_proc->p_fd, fd, > >> - cap_rights_init(&rights), &file, NULL) != 0) > >> + &cap_no_rights, &file, NULL) != 0) > >> return (NULL); > >> > >> /* check if file handle really belongs to us */ > >> @@ -88,11 +87,10 @@ file_count(struct linux_file *filp) > >> static inline void > >> put_unused_fd(unsigned int fd) > >> { > >> - cap_rights_t rights; > >> struct file *file; > >> > >> if (fget_unlocked(curthread->td_proc->p_fd, fd, > >> - cap_rights_init(&rights), &file, NULL) != 0) { > >> + &cap_no_rights, &file, NULL) != 0) { > >> return; > >> } > >> /* > >> @@ -109,11 +107,10 @@ put_unused_fd(unsigned int fd) > >> static inline void > >> fd_install(unsigned int fd, struct linux_file *filp) > >> { > >> - cap_rights_t rights; > >> struct file *file; > >> > >> if (fget_unlocked(curthread->td_proc->p_fd, fd, > >> - cap_rights_init(&rights), &file, NULL) != 0) { > >> + &cap_no_rights, &file, NULL) != 0) { > >> filp->_file = NULL; > >> } else { > >> filp->_file = file; > >> > >> Modified: head/sys/dev/filemon/filemon.c > >> > >> ============================================================ > ================== > >> --- head/sys/dev/filemon/filemon.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/dev/filemon/filemon.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -361,7 +361,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t > da > >> int error = 0; > >> struct filemon *filemon; > >> struct proc *p; > >> - cap_rights_t rights; > >> > >> if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) > >> return (error); > >> @@ -377,7 +376,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t > da > >> } > >> > >> error = fget_write(td, *(int *)data, > >> - cap_rights_init(&rights, CAP_PWRITE), > >> + &cap_pwrite_rights, > >> &filemon->fp); > >> if (error == 0) > >> /* Write the file header. */ > >> > >> Modified: head/sys/dev/hwpmc/hwpmc_logging.c > >> > >> ============================================================ > ================== > >> --- head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -638,7 +638,6 @@ int > >> pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int > >> logfd) > >> { > >> struct proc *p; > >> - cap_rights_t rights; > >> int error; > >> > >> sx_assert(&pmc_sx, SA_XLOCKED); > >> @@ -655,8 +654,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct > pmc_o > >> po->po_file)); > >> > >> /* get a reference to the file state */ > >> - error = fget_write(curthread, logfd, > >> - cap_rights_init(&rights, CAP_WRITE), &po->po_file); > >> + error = fget_write(curthread, logfd, &cap_write_rights, > >> &po->po_file); > >> if (error) > >> goto error; > >> > >> > >> Modified: head/sys/fs/fdescfs/fdesc_vnops.c > >> > >> ============================================================ > ================== > >> --- head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -286,7 +286,6 @@ fdesc_lookup(struct vop_lookup_args *ap) > >> struct thread *td = cnp->cn_thread; > >> struct file *fp; > >> struct fdesc_get_ino_args arg; > >> - cap_rights_t rights; > >> int nlen = cnp->cn_namelen; > >> u_int fd, fd1; > >> int error; > >> @@ -331,7 +330,7 @@ fdesc_lookup(struct vop_lookup_args *ap) > >> /* > >> * No rights to check since 'fp' isn't actually used. > >> */ > >> - if ((error = fget(td, fd, cap_rights_init(&rights), &fp)) != 0) > >> + if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0) > >> goto bad; > >> > >> /* Check if we're looking up ourselves. */ > >> @@ -613,7 +612,6 @@ static int > >> fdesc_readlink(struct vop_readlink_args *va) > >> { > >> struct vnode *vp, *vn; > >> - cap_rights_t rights; > >> struct thread *td; > >> struct uio *uio; > >> struct file *fp; > >> @@ -631,7 +629,7 @@ fdesc_readlink(struct vop_readlink_args *va) > >> VOP_UNLOCK(vn, 0); > >> > >> td = curthread; > >> - error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, > NULL); > >> + error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); > >> if (error != 0) > >> goto out; > >> > >> > >> Modified: head/sys/fs/fuse/fuse_vfsops.c > >> > >> ============================================================ > ================== > >> --- head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -222,7 +222,6 @@ fuse_vfsop_mount(struct mount *mp) > >> struct file *fp, *fptmp; > >> char *fspec, *subtype; > >> struct vfsoptlist *opts; > >> - cap_rights_t rights; > >> > >> subtype = NULL; > >> max_read_set = 0; > >> @@ -292,7 +291,7 @@ fuse_vfsop_mount(struct mount *mp) > >> > >> FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); > >> > >> - err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp); > >> + err = fget(td, fd, &cap_read_rights, &fp); > >> if (err != 0) { > >> FS_DEBUG("invalid or not opened device: data=%p\n", > data); > >> goto out; > >> > >> Modified: head/sys/kern/kern_descrip.c > >> > >> ============================================================ > ================== > >> --- head/sys/kern/kern_descrip.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/kern/kern_descrip.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -490,7 +490,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> struct filedescent *fde; > >> struct proc *p; > >> struct vnode *vp; > >> - cap_rights_t rights; > >> int error, flg, tmp; > >> uint64_t bsize; > >> off_t foffset; > >> @@ -548,8 +547,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> break; > >> > >> case F_GETFL: > >> - error = fget_fcntl(td, fd, > >> - cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp); > >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETFL, > >> &fp); > >> if (error != 0) > >> break; > >> td->td_retval[0] = OFLAGS(fp->f_flag); > >> @@ -557,8 +555,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> break; > >> > >> case F_SETFL: > >> - error = fget_fcntl(td, fd, > >> - cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp); > >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, > >> &fp); > >> if (error != 0) > >> break; > >> do { > >> @@ -585,8 +582,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> break; > >> > >> case F_GETOWN: > >> - error = fget_fcntl(td, fd, > >> - cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, &fp); > >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETOWN, > >> &fp); > >> if (error != 0) > >> break; > >> error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, td); > >> @@ -596,8 +592,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> break; > >> > >> case F_SETOWN: > >> - error = fget_fcntl(td, fd, > >> - cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, &fp); > >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETOWN, > >> &fp); > >> if (error != 0) > >> break; > >> tmp = arg; > >> @@ -618,8 +613,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> > >> case F_SETLK: > >> do_setlk: > >> - cap_rights_init(&rights, CAP_FLOCK); > >> - error = fget_unlocked(fdp, fd, &rights, &fp, NULL); > >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, > >> NULL); > >> if (error != 0) > >> break; > >> if (fp->f_type != DTYPE_VNODE) { > >> @@ -711,7 +705,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> * that the closing thread was a bit slower and that the > >> * advisory lock succeeded before the close. > >> */ > >> - error = fget_unlocked(fdp, fd, &rights, &fp2, NULL); > >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2, > >> NULL); > >> if (error != 0) { > >> fdrop(fp, td); > >> break; > >> @@ -729,8 +723,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> break; > >> > >> case F_GETLK: > >> - error = fget_unlocked(fdp, fd, > >> - cap_rights_init(&rights, CAP_FLOCK), &fp, NULL); > >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, > >> NULL); > >> if (error != 0) > >> break; > >> if (fp->f_type != DTYPE_VNODE) { > >> @@ -767,8 +760,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, > intptr_ > >> arg = arg ? 128 * 1024: 0; > >> /* FALLTHROUGH */ > >> case F_READAHEAD: > >> - error = fget_unlocked(fdp, fd, > >> - cap_rights_init(&rights), &fp, NULL); > >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, > NULL); > >> if (error != 0) > >> break; > >> if (fp->f_type != DTYPE_VNODE) { > >> @@ -1363,12 +1355,11 @@ int > >> kern_fstat(struct thread *td, int fd, struct stat *sbp) > >> { > >> struct file *fp; > >> - cap_rights_t rights; > >> int error; > >> > >> AUDIT_ARG_FD(fd); > >> > >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FSTAT), &fp); > >> + error = fget(td, fd, &cap_fstat_rights, &fp); > >> if (error != 0) > >> return (error); > >> > >> @@ -1445,10 +1436,9 @@ kern_fpathconf(struct thread *td, int fd, int > name, > >> lo > >> { > >> struct file *fp; > >> struct vnode *vp; > >> - cap_rights_t rights; > >> int error; > >> > >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FPATHCONF), > >> &fp); > >> + error = fget(td, fd, &cap_fpathconf_rights, &fp); > >> if (error != 0) > >> return (error); > >> > >> @@ -2982,10 +2972,9 @@ sys_flock(struct thread *td, struct flock_args > >> *uap) > >> struct file *fp; > >> struct vnode *vp; > >> struct flock lf; > >> - cap_rights_t rights; > >> int error; > >> > >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FLOCK), > >> &fp); > >> + error = fget(td, uap->fd, &cap_flock_rights, &fp); > >> if (error != 0) > >> return (error); > >> if (fp->f_type != DTYPE_VNODE) { > >> @@ -3633,7 +3622,7 @@ kern_proc_filedesc_out(struct proc *p, struct > sbuf > >> *s > >> #ifdef CAPABILITIES > >> rights = *cap_rights(fdp, i); > >> #else /* !CAPABILITIES */ > >> - cap_rights_init(&rights); > >> + rights = cap_no_rights; > >> #endif > >> /* > >> * Create sysctl entry. It is OK to drop the filedesc > >> > >> Modified: head/sys/kern/kern_event.c > >> > >> ============================================================ > ================== > >> --- head/sys/kern/kern_event.c Wed May 9 18:41:04 2018 > (r333424) > >> +++ head/sys/kern/kern_event.c Wed May 9 18:47:24 2018 > (r333425) > >> @@ -1286,7 +1286,6 @@ kqueue_register(struct kqueue *kq, struct kevent > >> *kev, > >> struct file *fp; > >> struct knote *kn, *tkn; > >> struct knlist *knl; > >> - cap_rights_t rights; > >> int error, filt, event; > >> int haskqglobal, filedesc_unlock; > >> > >> @@ -1322,8 +1321,7 @@ findkn: > >> if (kev->ident > INT_MAX) > >> error = EBADF; > >> else > >> - error = fget(td, kev->ident, > >> - cap_rights_init(&rights, CAP_EVENT), &fp); > >> + error = fget(td, kev->ident, &cap_event_rights, > >> &fp); > >> if (error) > >> goto done; > >> > >> > >> Modified: head/sys/kern/kern_exec.c > >> > >> ============================================================ > ================== > >> --- head/sys/kern/kern_exec.c Wed May 9 18:41:04 2018 > (r333424) > >> +++ head/sys/kern/kern_exec.c Wed May 9 18:47:24 2018 > (r333425) > >> @@ -374,7 +374,6 @@ do_execve(struct thread *td, struct image_args > *args, > >> struct ucred *tracecred = NULL; > >> #endif > >> struct vnode *oldtextvp = NULL, *newtextvp; > >> - cap_rights_t rights; > >> int credential_changing; > >> int textset; > >> #ifdef MAC > >> @@ -455,8 +454,7 @@ interpret: > >> /* > >> * Descriptors opened only with O_EXEC or O_RDONLY are > >> allowed. > >> */ > >> - error = fgetvp_exec(td, args->fd, > >> - cap_rights_init(&rights, CAP_FEXECVE), &newtextvp); > >> + error = fgetvp_exec(td, args->fd, &cap_fexecve_rights, > >> &newtextvp); > >> if (error) > >> goto exec_fail; > >> vn_lock(newtextvp, LK_EXCLUSIVE | LK_RETRY); > >> > >> Modified: head/sys/kern/kern_sendfile.c > >> > >> ============================================================ > ================== > >> --- head/sys/kern/kern_sendfile.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/kern/kern_sendfile.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -511,7 +511,6 @@ static int > >> sendfile_getsock(struct thread *td, int s, struct file **sock_fp, > >> struct socket **so) > >> { > >> - cap_rights_t rights; > >> int error; > >> > >> *sock_fp = NULL; > >> @@ -520,7 +519,7 @@ sendfile_getsock(struct thread *td, int s, struct > file > >> /* > >> * The socket must be a stream socket and connected. > >> */ > >> - error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SEND), > >> + error = getsock_cap(td, s, &cap_send_rights, > >> sock_fp, NULL, NULL); > >> if (error != 0) > >> return (error); > >> @@ -949,7 +948,6 @@ sendfile(struct thread *td, struct sendfile_args > *uap, > >> struct sf_hdtr hdtr; > >> struct uio *hdr_uio, *trl_uio; > >> struct file *fp; > >> - cap_rights_t rights; > >> off_t sbytes; > >> int error; > >> > >> @@ -1000,10 +998,8 @@ sendfile(struct thread *td, struct sendfile_args > >> *uap, > >> * sendfile(2) can start at any offset within a file so we > require > >> * CAP_READ+CAP_SEEK = CAP_PREAD. > >> */ > >> - if ((error = fget_read(td, uap->fd, > >> - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { > >> + if ((error = fget_read(td, uap->fd, &cap_pread_rights, &fp)) != > 0) > >> goto out; > >> - } > >> > >> error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, > >> uap->nbytes, &sbytes, uap->flags, td); > >> > >> Modified: head/sys/kern/kern_sig.c > >> > >> ============================================================ > ================== > >> --- head/sys/kern/kern_sig.c Wed May 9 18:41:04 2018 > (r333424) > >> +++ head/sys/kern/kern_sig.c Wed May 9 18:47:24 2018 > (r333425) > >> @@ -1789,7 +1789,6 @@ int > >> sys_pdkill(struct thread *td, struct pdkill_args *uap) > >> { > >> struct proc *p; > >> - cap_rights_t rights; > >> int error; > >> > >> AUDIT_ARG_SIGNUM(uap->signum); > >> @@ -1797,8 +1796,7 @@ sys_pdkill(struct thread *td, struct pdkill_args > >> *uap) > >> if ((u_int)uap->signum > _SIG_MAXSIG) > >> return (EINVAL); > >> > >> - error = procdesc_find(td, uap->fd, > >> - cap_rights_init(&rights, CAP_PDKILL), &p); > >> + error = procdesc_find(td, uap->fd, &cap_pdkill_rights, &p); > >> if (error) > >> return (error); > >> AUDIT_ARG_PROCESS(p); > >> > >> Modified: head/sys/kern/subr_capability.c > >> > >> ============================================================ > ================== > >> --- head/sys/kern/subr_capability.c Wed May 9 18:41:04 2018 > >> (r333424) > >> +++ head/sys/kern/subr_capability.c Wed May 9 18:47:24 2018 > >> (r333425) > >> @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); > >> > >> #ifdef _KERNEL > >> #include > >> - > >> +#include > >> #include > >> #else /* !_KERNEL */ > >> #include > >> @@ -53,6 +53,38 @@ __FBSDID("$FreeBSD$"); > >> > >> #ifdef _KERNEL > >> #define assert(exp) KASSERT((exp), ("%s:%u", __func__, > >> __LINE__)) > >> + > >> +CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT); > >> +CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND); > >> +CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT); > >> +CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT); > >> +CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR); > >> +CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL); > >> +CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE); > >> +CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK); > >> +CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF); > >> +CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT); > >> +CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC); > >> +CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE); > >> +CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME); > >> +CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME); > >> +CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT); > >> +CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL); > >> +CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN); > >> +CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP); > >> +CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID); > >> +CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL); > >> +CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD); > >> +CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE); > >> +CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ); > >> +CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV); > >> +CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND); > >> +CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT); > >> +CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN); > >> +CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE); > >> + > >> +__read_mostly cap_rights_t cap_no_rights; > >> +CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights); > >> #endif > >> > >> #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) > >> > >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > >> > > > > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat May 19 07:16:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8A5EF1B9D; Sat, 19 May 2018 07:16:03 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE80483633; Sat, 19 May 2018 07:16:02 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 8012521A67; Sat, 19 May 2018 07:16:02 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f175.google.com with SMTP id d11-v6so8833315iof.11; Sat, 19 May 2018 00:16:02 -0700 (PDT) X-Gm-Message-State: ALKqPwfrrz5aLdYJ3vDgfGzPtC1K//wH89jQ+PWA8T/pSxBa7lBYtUA1 RzGlvvxfnh7zEe1g2BfbIfTJMznfk/EqH5tpweo= X-Google-Smtp-Source: AB8JxZq2LwOMYcB8TQ9enlSPrfxgPUe2vgr4s4fXB3/U2bTVRtOQTjQrrawfZpqbqqXbo9bepEr9NQSSnWcXiFIzZ20= X-Received: by 2002:a6b:3b42:: with SMTP id i63-v6mr3261087ioa.133.1526714160763; Sat, 19 May 2018 00:16:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Sat, 19 May 2018 00:16:00 -0700 (PDT) In-Reply-To: References: <201805091847.w49IlPPa014617@repo.freebsd.org> From: Matthew Macy Date: Sat, 19 May 2018 00:16:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333425 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/cloudabi compat/linux compat/linuxkpi/common/include/linux dev/filemon dev/hwpmc fs/... To: Mateusz Guzik Cc: Ilya Bakulin , manu@freebsd.org, Warner Losh , src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 07:16:03 -0000 I can do that tomorrow. But point is that something else will push it over soon. On Sat, May 19, 2018 at 12:14 AM, Mateusz Guzik wrote: > imo all these sysinits can and shoud be collapsed into one, which will have > a side effect of getting rid of the problem. > > On Sat, May 19, 2018 at 9:13 AM, Matthew Macy wrote: >> >> I guess we'll need to allocate more pages at boot. We must have been >> on the edge already if that pushed us over. >> -M >> >> On Fri, May 18, 2018 at 12:03 PM, Ilya Bakulin wrote: >> > Hi Matt, >> > seems this commit has broken at least BeagleBone Black booting process. >> > On >> > all revisions after it the kernel panics with this message: >> > http://dl.bakulin.de/bbb_panic.txt >> > My suspicion is that there are quite a few new SYSINIT objects that are >> > created on startup, and as a result some kind of memory reservation gets >> > exhausted. I don't have immediate idea how to debug this further; just >> > can >> > confirm that patching out this change allows the board to boot again. >> > >> > >> > On Wed, May 9, 2018 at 8:47 PM Matt Macy wrote: >> >> >> >> Author: mmacy >> >> Date: Wed May 9 18:47:24 2018 >> >> New Revision: 333425 >> >> URL: https://svnweb.freebsd.org/changeset/base/333425 >> >> >> >> Log: >> >> Eliminate the overhead of gratuitous repeated reinitialization of >> >> cap_rights >> >> >> >> - Add macros to allow preinitialization of cap_rights_t. >> >> >> >> - Convert most commonly used code paths to use preinitialized >> >> cap_rights_t. >> >> A 3.6% speedup in fstat was measured with this change. >> >> >> >> Reported by: mjg >> >> Reviewed by: oshogbo >> >> Approved by: sbruno >> >> MFC after: 1 month >> >> >> >> Modified: >> >> head/sys/cddl/compat/opensolaris/sys/file.h >> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> >> head/sys/compat/cloudabi/cloudabi_file.c >> >> head/sys/compat/linux/linux_event.c >> >> head/sys/compat/linux/linux_file.c >> >> head/sys/compat/linux/linux_ioctl.c >> >> head/sys/compat/linux/linux_mmap.c >> >> head/sys/compat/linux/linux_socket.c >> >> head/sys/compat/linux/linux_stats.c >> >> head/sys/compat/linuxkpi/common/include/linux/file.h >> >> head/sys/dev/filemon/filemon.c >> >> head/sys/dev/hwpmc/hwpmc_logging.c >> >> head/sys/fs/fdescfs/fdesc_vnops.c >> >> head/sys/fs/fuse/fuse_vfsops.c >> >> head/sys/kern/kern_descrip.c >> >> head/sys/kern/kern_event.c >> >> head/sys/kern/kern_exec.c >> >> head/sys/kern/kern_sendfile.c >> >> head/sys/kern/kern_sig.c >> >> head/sys/kern/subr_capability.c >> >> head/sys/kern/sys_generic.c >> >> head/sys/kern/sys_procdesc.c >> >> head/sys/kern/uipc_mqueue.c >> >> head/sys/kern/uipc_sem.c >> >> head/sys/kern/uipc_syscalls.c >> >> head/sys/kern/vfs_aio.c >> >> head/sys/kern/vfs_syscalls.c >> >> head/sys/netsmb/smb_dev.c >> >> head/sys/sys/capsicum.h >> >> >> >> Modified: head/sys/cddl/compat/opensolaris/sys/file.h >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:41:04 >> >> 2018 >> >> (r333424) >> >> +++ head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:47:24 >> >> 2018 >> >> (r333425) >> >> @@ -52,10 +52,9 @@ static __inline void >> >> releasef(int fd) >> >> { >> >> struct file *fp; >> >> - cap_rights_t rights; >> >> >> >> /* No CAP_ rights required, as we're only releasing. */ >> >> - if (fget(curthread, fd, cap_rights_init(&rights), &fp) == 0) { >> >> + if (fget(curthread, fd, &cap_no_rights, &fp) == 0) { >> >> fdrop(fp, curthread); >> >> fdrop(fp, curthread); >> >> } >> >> >> >> Modified: >> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> >> Wed May 9 18:41:04 2018 (r333424) >> >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >> >> Wed May 9 18:47:24 2018 (r333425) >> >> @@ -4446,7 +4446,6 @@ zfs_ioc_recv(zfs_cmd_t *zc) >> >> char *origin = NULL; >> >> char *tosnap; >> >> char tofs[ZFS_MAX_DATASET_NAME_LEN]; >> >> - cap_rights_t rights; >> >> boolean_t first_recvd_props = B_FALSE; >> >> >> >> if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || >> >> @@ -4467,7 +4466,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) >> >> #ifdef illumos >> >> fp = getf(fd); >> >> #else >> >> - fget_read(curthread, fd, cap_rights_init(&rights, CAP_PREAD), >> >> &fp); >> >> + fget_read(curthread, fd, &cap_pread_rights, &fp); >> >> #endif >> >> if (fp == NULL) { >> >> nvlist_free(props); >> >> @@ -4744,13 +4743,11 @@ zfs_ioc_send(zfs_cmd_t *zc) >> >> dsl_pool_rele(dp, FTAG); >> >> } else { >> >> file_t *fp; >> >> - cap_rights_t rights; >> >> >> >> #ifdef illumos >> >> fp = getf(zc->zc_cookie); >> >> #else >> >> - fget_write(curthread, zc->zc_cookie, >> >> - cap_rights_init(&rights, CAP_WRITE), &fp); >> >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, >> >> &fp); >> >> #endif >> >> if (fp == NULL) >> >> return (SET_ERROR(EBADF)); >> >> @@ -5387,15 +5384,13 @@ static int >> >> zfs_ioc_diff(zfs_cmd_t *zc) >> >> { >> >> file_t *fp; >> >> - cap_rights_t rights; >> >> offset_t off; >> >> int error; >> >> >> >> #ifdef illumos >> >> fp = getf(zc->zc_cookie); >> >> #else >> >> - fget_write(curthread, zc->zc_cookie, >> >> - cap_rights_init(&rights, CAP_WRITE), &fp); >> >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, &fp); >> >> #endif >> >> if (fp == NULL) >> >> return (SET_ERROR(EBADF)); >> >> @@ -5787,7 +5782,6 @@ zfs_ioc_unjail(zfs_cmd_t *zc) >> >> static int >> >> zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t >> >> *outnvl) >> >> { >> >> - cap_rights_t rights; >> >> file_t *fp; >> >> int error; >> >> offset_t off; >> >> @@ -5815,7 +5809,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t >> >> *innvl >> >> #ifdef illumos >> >> file_t *fp = getf(fd); >> >> #else >> >> - fget_write(curthread, fd, cap_rights_init(&rights, CAP_WRITE), >> >> &fp); >> >> + fget_write(curthread, fd, &cap_write_rights, &fp); >> >> #endif >> >> if (fp == NULL) >> >> return (SET_ERROR(EBADF)); >> >> >> >> Modified: >> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> >> Wed May 9 18:41:04 2018 (r333424) >> >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >> >> Wed May 9 18:47:24 2018 (r333425) >> >> @@ -126,7 +126,7 @@ zfs_onexit_fd_hold(int fd, minor_t *minorp) >> >> void *data; >> >> int error; >> >> >> >> - fp = getf(fd, cap_rights_init(&rights)); >> >> + fp = getf(fd, &cap_no_rights); >> >> if (fp == NULL) >> >> return (SET_ERROR(EBADF)); >> >> >> >> >> >> Modified: head/sys/compat/cloudabi/cloudabi_file.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:41:04 >> >> 2018 >> >> (r333424) >> >> +++ head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:47:24 >> >> 2018 >> >> (r333425) >> >> @@ -390,12 +390,11 @@ cloudabi_sys_file_readdir(struct thread *td, >> >> struct file *fp; >> >> struct vnode *vp; >> >> void *readbuf; >> >> - cap_rights_t rights; >> >> cloudabi_dircookie_t offset; >> >> int error; >> >> >> >> /* Obtain directory vnode. */ >> >> - error = getvnode(td, uap->fd, cap_rights_init(&rights, >> >> CAP_READ), >> >> &fp); >> >> + error = getvnode(td, uap->fd, &cap_read_rights, &fp); >> >> if (error != 0) { >> >> if (error == EINVAL) >> >> return (ENOTDIR); >> >> @@ -559,14 +558,13 @@ cloudabi_sys_file_stat_fget(struct thread *td, >> >> struct stat sb; >> >> cloudabi_filestat_t csb; >> >> struct file *fp; >> >> - cap_rights_t rights; >> >> cloudabi_filetype_t filetype; >> >> int error; >> >> >> >> memset(&csb, 0, sizeof(csb)); >> >> >> >> /* Fetch file descriptor attributes. */ >> >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), >> >> &fp); >> >> + error = fget(td, uap->fd, &cap_fstat_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = fo_stat(fp, &sb, td->td_ucred, td); >> >> >> >> Modified: head/sys/compat/linux/linux_event.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linux/linux_event.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/compat/linux/linux_event.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -1190,14 +1190,13 @@ linux_timerfd_curval(struct timerfd *tfd, >> >> struct >> >> itime >> >> int >> >> linux_timerfd_gettime(struct thread *td, struct >> >> linux_timerfd_gettime_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct l_itimerspec lots; >> >> struct itimerspec ots; >> >> struct timerfd *tfd; >> >> struct file *fp; >> >> int error; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_READ), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_read_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> tfd = fp->f_data; >> >> @@ -1225,7 +1224,6 @@ linux_timerfd_settime(struct thread *td, struct >> >> linux_ >> >> struct l_itimerspec lots; >> >> struct itimerspec nts, ots; >> >> struct timespec cts, ts; >> >> - cap_rights_t rights; >> >> struct timerfd *tfd; >> >> struct timeval tv; >> >> struct file *fp; >> >> @@ -1241,7 +1239,7 @@ linux_timerfd_settime(struct thread *td, struct >> >> linux_ >> >> if (error != 0) >> >> return (error); >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_WRITE), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_write_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> tfd = fp->f_data; >> >> >> >> Modified: head/sys/compat/linux/linux_file.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linux/linux_file.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/compat/linux/linux_file.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -89,7 +89,6 @@ linux_creat(struct thread *td, struct >> >> linux_creat_args >> >> static int >> >> linux_common_open(struct thread *td, int dirfd, char *path, int >> >> l_flags, >> >> int mode) >> >> { >> >> - cap_rights_t rights; >> >> struct proc *p = td->td_proc; >> >> struct file *fp; >> >> int fd; >> >> @@ -144,7 +143,7 @@ linux_common_open(struct thread *td, int dirfd, >> >> char * >> >> * checking below. >> >> */ >> >> fd = td->td_retval[0]; >> >> - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == >> >> 0) { >> >> + if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { >> >> if (fp->f_type != DTYPE_VNODE) { >> >> fdrop(fp, td); >> >> goto done; >> >> @@ -263,13 +262,12 @@ linux_llseek(struct thread *td, struct >> >> linux_llseek_ar >> >> static int >> >> linux_getdents_error(struct thread *td, int fd, int err) >> >> { >> >> - cap_rights_t rights; >> >> struct vnode *vp; >> >> struct file *fp; >> >> int error; >> >> >> >> /* Linux return ENOTDIR in case when fd is not a directory. */ >> >> - error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), >> >> &fp); >> >> + error = getvnode(td, fd, &cap_read_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> vp = fp->f_vnode; >> >> @@ -985,15 +983,13 @@ linux_fdatasync(td, uap) >> >> int >> >> linux_pread(struct thread *td, struct linux_pread_args *uap) >> >> { >> >> - cap_rights_t rights; >> >> struct vnode *vp; >> >> int error; >> >> >> >> error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, >> >> uap->offset); >> >> if (error == 0) { >> >> /* This seems to violate POSIX but Linux does it. */ >> >> - error = fgetvp(td, uap->fd, >> >> - cap_rights_init(&rights, CAP_PREAD), &vp); >> >> + error = fgetvp(td, uap->fd, &cap_pread_rights, &vp); >> >> if (error != 0) >> >> return (error); >> >> if (vp->v_type == VDIR) { >> >> @@ -1275,7 +1271,6 @@ fcntl_common(struct thread *td, struct >> >> linux_fcntl_arg >> >> { >> >> struct l_flock linux_flock; >> >> struct flock bsd_flock; >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> long arg; >> >> int error, result; >> >> @@ -1379,7 +1374,7 @@ fcntl_common(struct thread *td, struct >> >> linux_fcntl_arg >> >> * pipes under Linux-2.2.35 at least). >> >> */ >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_FCNTL), &fp); >> >> + &cap_fcntl_rights, &fp); >> >> if (error) >> >> return (error); >> >> if (fp->f_type == DTYPE_PIPE) { >> >> >> >> Modified: head/sys/compat/linux/linux_ioctl.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linux/linux_ioctl.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/compat/linux/linux_ioctl.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -194,13 +194,12 @@ struct linux_hd_big_geometry { >> >> static int >> >> linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> u_int sectorsize, fwcylinders, fwheads, fwsectors; >> >> off_t mediasize, bytespercyl; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> switch (args->cmd & 0xffff) { >> >> @@ -278,13 +277,12 @@ linux_ioctl_hdio(struct thread *td, struct >> >> linux_ioctl >> >> static int >> >> linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> u_int sectorsize; >> >> off_t mediasize; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> switch (args->cmd & 0xffff) { >> >> @@ -717,11 +715,10 @@ linux_ioctl_termio(struct thread *td, struct >> >> linux_ioc >> >> struct termios bios; >> >> struct linux_termios lios; >> >> struct linux_termio lio; >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> >> >> @@ -1461,11 +1458,10 @@ bsd_to_linux_dvd_authinfo(struct dvd_authinfo >> >> *bp, >> >> l_d >> >> static int >> >> linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> switch (args->cmd & 0xffff) { >> >> @@ -1998,11 +1994,10 @@ linux_ioctl_sound(struct thread *td, struct >> >> linux_ioct >> >> static int >> >> linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> switch (args->cmd & 0xffff) { >> >> @@ -2411,7 +2406,6 @@ static int >> >> linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> char lifname[LINUX_IFNAMSIZ], ifname[IFNAMSIZ]; >> >> - cap_rights_t rights; >> >> struct ifnet *ifp; >> >> struct file *fp; >> >> int error, type; >> >> @@ -2419,7 +2413,7 @@ linux_ioctl_socket(struct thread *td, struct >> >> linux_ioc >> >> ifp = NULL; >> >> error = 0; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> type = fp->f_type; >> >> @@ -2649,11 +2643,10 @@ linux_ioctl_socket(struct thread *td, struct >> >> linux_ioc >> >> static int >> >> linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error, type; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> type = fp->f_type; >> >> @@ -2685,11 +2678,10 @@ linux_ioctl_sg_io(struct thread *td, struct >> >> linux_ioct >> >> { >> >> struct sg_io_hdr io; >> >> struct sg_io_hdr32 io32; >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) { >> >> printf("sg_linux_ioctl: fget returned %d\n", error); >> >> return (error); >> >> @@ -2997,7 +2989,6 @@ linux_v4l_cliplist_copy(struct l_video_window >> >> *lvw, >> >> st >> >> static int >> >> linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> struct video_tuner vtun; >> >> @@ -3016,7 +3007,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCGTUNER: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = copyin((void *) args->arg, &l_vtun, >> >> sizeof(l_vtun)); >> >> @@ -3036,7 +3027,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCSTUNER: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = copyin((void *) args->arg, &l_vtun, >> >> sizeof(l_vtun)); >> >> @@ -3055,7 +3046,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCGWIN: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, >> >> td); >> >> @@ -3069,7 +3060,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCSWIN: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = copyin((void *) args->arg, &l_vwin, >> >> sizeof(l_vwin)); >> >> @@ -3094,7 +3085,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCGFBUF: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, >> >> td); >> >> @@ -3108,7 +3099,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCSFBUF: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = copyin((void *) args->arg, &l_vbuf, >> >> sizeof(l_vbuf)); >> >> @@ -3138,7 +3129,7 @@ linux_ioctl_v4l(struct thread *td, struct >> >> linux_ioctl_ >> >> >> >> case LINUX_VIDIOCSMICROCODE: >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = copyin((void *) args->arg, &l_vcode, >> >> sizeof(l_vcode)); >> >> @@ -3302,7 +3293,6 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, >> >> struc >> >> static int >> >> linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> int error; >> >> struct v4l2_format vformat; >> >> @@ -3395,7 +3385,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> >> linux_ioctl >> >> if (error) >> >> return (error); >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error) >> >> return (error); >> >> if (linux_to_bsd_v4l2_format(&l_vformat, &vformat) != >> >> 0) >> >> @@ -3420,7 +3410,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> >> linux_ioctl >> >> return (error); >> >> linux_to_bsd_v4l2_standard(&l_vstd, &vstd); >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error) >> >> return (error); >> >> error = fo_ioctl(fp, VIDIOC_ENUMSTD, (caddr_t)&vstd, >> >> @@ -3444,7 +3434,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> >> linux_ioctl >> >> if (error != 0) >> >> return (error); >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> error = fo_ioctl(fp, VIDIOC_ENUMINPUT, (caddr_t)&vinp, >> >> @@ -3465,7 +3455,7 @@ linux_ioctl_v4l2(struct thread *td, struct >> >> linux_ioctl >> >> if (error) >> >> return (error); >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error) >> >> return (error); >> >> linux_to_bsd_v4l2_buffer(&l_vbuf, &vbuf); >> >> @@ -3640,7 +3630,6 @@ linux_ioctl_fbsd_usb(struct thread *td, struct >> >> linux_i >> >> static int >> >> linux_ioctl_evdev(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> clockid_t clock; >> >> int error; >> >> @@ -3668,7 +3657,7 @@ linux_ioctl_evdev(struct thread *td, struct >> >> linux_ioct >> >> return (error); >> >> >> >> error = fget(td, args->fd, >> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >> >> + &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> >> >> @@ -3694,7 +3683,6 @@ linux_ioctl_evdev(struct thread *td, struct >> >> linux_ioct >> >> int >> >> linux_ioctl(struct thread *td, struct linux_ioctl_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct file *fp; >> >> struct handler_element *he; >> >> int error, cmd; >> >> @@ -3705,7 +3693,7 @@ linux_ioctl(struct thread *td, struct >> >> linux_ioctl_args >> >> (unsigned long)args->cmd); >> >> #endif >> >> >> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >> >> &fp); >> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> if ((fp->f_flag & (FREAD|FWRITE)) == 0) { >> >> >> >> Modified: head/sys/compat/linux/linux_mmap.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linux/linux_mmap.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/compat/linux/linux_mmap.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -72,7 +72,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, >> >> s >> >> int bsd_flags, error; >> >> struct file *fp; >> >> >> >> - cap_rights_t rights; >> >> LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", >> >> addr, len, prot, flags, fd, pos); >> >> >> >> @@ -126,7 +125,7 @@ linux_mmap_common(struct thread *td, uintptr_t >> >> addr, s >> >> * protection options specified. >> >> */ >> >> >> >> - error = fget(td, fd, cap_rights_init(&rights, >> >> CAP_MMAP), >> >> &fp); >> >> + error = fget(td, fd, &cap_mmap_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> if (fp->f_type != DTYPE_VNODE && fp->f_type != >> >> DTYPE_DEV) >> >> { >> >> >> >> Modified: head/sys/compat/linux/linux_socket.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linux/linux_socket.c Wed May 9 18:41:04 >> >> 2018 >> >> (r333424) >> >> +++ head/sys/compat/linux/linux_socket.c Wed May 9 18:47:24 >> >> 2018 >> >> (r333425) >> >> @@ -766,7 +766,6 @@ linux_bind(struct thread *td, struct >> >> linux_bind_args * >> >> int >> >> linux_connect(struct thread *td, struct linux_connect_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct socket *so; >> >> struct sockaddr *sa; >> >> struct file *fp; >> >> @@ -788,7 +787,7 @@ linux_connect(struct thread *td, struct >> >> linux_connect_ >> >> * when on a non-blocking socket. Instead it returns the >> >> * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. >> >> */ >> >> - error = getsock_cap(td, args->s, cap_rights_init(&rights, >> >> CAP_CONNECT), >> >> + error = getsock_cap(td, args->s, &cap_connect_rights, >> >> &fp, &fflag, NULL); >> >> if (error != 0) >> >> return (error); >> >> @@ -824,7 +823,6 @@ linux_accept_common(struct thread *td, int s, >> >> l_uintpt >> >> socklen_t * __restrict anamelen; >> >> int flags; >> >> } */ bsd_args; >> >> - cap_rights_t rights; >> >> struct socket *so; >> >> struct file *fp; >> >> int error, error1; >> >> @@ -842,8 +840,7 @@ linux_accept_common(struct thread *td, int s, >> >> l_uintpt >> >> if (error == EFAULT && namelen != sizeof(struct >> >> sockaddr_in)) >> >> return (EINVAL); >> >> if (error == EINVAL) { >> >> - error1 = getsock_cap(td, s, >> >> - cap_rights_init(&rights, CAP_ACCEPT), &fp, >> >> NULL, NULL); >> >> + error1 = getsock_cap(td, s, &cap_accept_rights, >> >> &fp, NULL, NULL); >> >> if (error1 != 0) >> >> return (error1); >> >> so = fp->f_data; >> >> >> >> Modified: head/sys/compat/linux/linux_stats.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linux/linux_stats.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/compat/linux/linux_stats.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -103,14 +103,13 @@ translate_fd_major_minor(struct thread *td, int >> >> fd, >> >> st >> >> { >> >> struct file *fp; >> >> struct vnode *vp; >> >> - cap_rights_t rights; >> >> int major, minor; >> >> >> >> /* >> >> * No capability rights required here. >> >> */ >> >> if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || >> >> - fget(td, fd, cap_rights_init(&rights), &fp) != 0) >> >> + fget(td, fd, &cap_no_rights, &fp) != 0) >> >> return; >> >> vp = fp->f_vnode; >> >> if (vp != NULL && vp->v_rdev != NULL && >> >> @@ -680,12 +679,11 @@ linux_newfstatat(struct thread *td, struct >> >> linux_newfs >> >> int >> >> linux_syncfs(struct thread *td, struct linux_syncfs_args *args) >> >> { >> >> - cap_rights_t rights; >> >> struct mount *mp; >> >> struct vnode *vp; >> >> int error, save; >> >> >> >> - error = fgetvp(td, args->fd, cap_rights_init(&rights, >> >> CAP_FSYNC), >> >> &vp); >> >> + error = fgetvp(td, args->fd, &cap_fsync_rights, &vp); >> >> if (error != 0) >> >> /* >> >> * Linux syncfs() returns only EBADF, however fgetvp() >> >> >> >> Modified: head/sys/compat/linuxkpi/common/include/linux/file.h >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/compat/linuxkpi/common/include/linux/file.h Wed May >> >> 9 >> >> 18:41:04 2018 (r333424) >> >> +++ head/sys/compat/linuxkpi/common/include/linux/file.h Wed May >> >> 9 >> >> 18:47:24 2018 (r333425) >> >> @@ -50,12 +50,11 @@ extern struct fileops linuxfileops; >> >> static inline struct linux_file * >> >> linux_fget(unsigned int fd) >> >> { >> >> - cap_rights_t rights; >> >> struct file *file; >> >> >> >> /* lookup file pointer by file descriptor index */ >> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >> >> - cap_rights_init(&rights), &file, NULL) != 0) >> >> + &cap_no_rights, &file, NULL) != 0) >> >> return (NULL); >> >> >> >> /* check if file handle really belongs to us */ >> >> @@ -88,11 +87,10 @@ file_count(struct linux_file *filp) >> >> static inline void >> >> put_unused_fd(unsigned int fd) >> >> { >> >> - cap_rights_t rights; >> >> struct file *file; >> >> >> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >> >> - cap_rights_init(&rights), &file, NULL) != 0) { >> >> + &cap_no_rights, &file, NULL) != 0) { >> >> return; >> >> } >> >> /* >> >> @@ -109,11 +107,10 @@ put_unused_fd(unsigned int fd) >> >> static inline void >> >> fd_install(unsigned int fd, struct linux_file *filp) >> >> { >> >> - cap_rights_t rights; >> >> struct file *file; >> >> >> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >> >> - cap_rights_init(&rights), &file, NULL) != 0) { >> >> + &cap_no_rights, &file, NULL) != 0) { >> >> filp->_file = NULL; >> >> } else { >> >> filp->_file = file; >> >> >> >> Modified: head/sys/dev/filemon/filemon.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/dev/filemon/filemon.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/dev/filemon/filemon.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -361,7 +361,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t >> >> da >> >> int error = 0; >> >> struct filemon *filemon; >> >> struct proc *p; >> >> - cap_rights_t rights; >> >> >> >> if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) >> >> return (error); >> >> @@ -377,7 +376,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t >> >> da >> >> } >> >> >> >> error = fget_write(td, *(int *)data, >> >> - cap_rights_init(&rights, CAP_PWRITE), >> >> + &cap_pwrite_rights, >> >> &filemon->fp); >> >> if (error == 0) >> >> /* Write the file header. */ >> >> >> >> Modified: head/sys/dev/hwpmc/hwpmc_logging.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -638,7 +638,6 @@ int >> >> pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int >> >> logfd) >> >> { >> >> struct proc *p; >> >> - cap_rights_t rights; >> >> int error; >> >> >> >> sx_assert(&pmc_sx, SA_XLOCKED); >> >> @@ -655,8 +654,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct >> >> pmc_o >> >> po->po_file)); >> >> >> >> /* get a reference to the file state */ >> >> - error = fget_write(curthread, logfd, >> >> - cap_rights_init(&rights, CAP_WRITE), &po->po_file); >> >> + error = fget_write(curthread, logfd, &cap_write_rights, >> >> &po->po_file); >> >> if (error) >> >> goto error; >> >> >> >> >> >> Modified: head/sys/fs/fdescfs/fdesc_vnops.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -286,7 +286,6 @@ fdesc_lookup(struct vop_lookup_args *ap) >> >> struct thread *td = cnp->cn_thread; >> >> struct file *fp; >> >> struct fdesc_get_ino_args arg; >> >> - cap_rights_t rights; >> >> int nlen = cnp->cn_namelen; >> >> u_int fd, fd1; >> >> int error; >> >> @@ -331,7 +330,7 @@ fdesc_lookup(struct vop_lookup_args *ap) >> >> /* >> >> * No rights to check since 'fp' isn't actually used. >> >> */ >> >> - if ((error = fget(td, fd, cap_rights_init(&rights), &fp)) != 0) >> >> + if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0) >> >> goto bad; >> >> >> >> /* Check if we're looking up ourselves. */ >> >> @@ -613,7 +612,6 @@ static int >> >> fdesc_readlink(struct vop_readlink_args *va) >> >> { >> >> struct vnode *vp, *vn; >> >> - cap_rights_t rights; >> >> struct thread *td; >> >> struct uio *uio; >> >> struct file *fp; >> >> @@ -631,7 +629,7 @@ fdesc_readlink(struct vop_readlink_args *va) >> >> VOP_UNLOCK(vn, 0); >> >> >> >> td = curthread; >> >> - error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, >> >> NULL); >> >> + error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); >> >> if (error != 0) >> >> goto out; >> >> >> >> >> >> Modified: head/sys/fs/fuse/fuse_vfsops.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -222,7 +222,6 @@ fuse_vfsop_mount(struct mount *mp) >> >> struct file *fp, *fptmp; >> >> char *fspec, *subtype; >> >> struct vfsoptlist *opts; >> >> - cap_rights_t rights; >> >> >> >> subtype = NULL; >> >> max_read_set = 0; >> >> @@ -292,7 +291,7 @@ fuse_vfsop_mount(struct mount *mp) >> >> >> >> FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); >> >> >> >> - err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp); >> >> + err = fget(td, fd, &cap_read_rights, &fp); >> >> if (err != 0) { >> >> FS_DEBUG("invalid or not opened device: data=%p\n", >> >> data); >> >> goto out; >> >> >> >> Modified: head/sys/kern/kern_descrip.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/kern/kern_descrip.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/kern/kern_descrip.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -490,7 +490,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> struct filedescent *fde; >> >> struct proc *p; >> >> struct vnode *vp; >> >> - cap_rights_t rights; >> >> int error, flg, tmp; >> >> uint64_t bsize; >> >> off_t foffset; >> >> @@ -548,8 +547,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> break; >> >> >> >> case F_GETFL: >> >> - error = fget_fcntl(td, fd, >> >> - cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp); >> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETFL, >> >> &fp); >> >> if (error != 0) >> >> break; >> >> td->td_retval[0] = OFLAGS(fp->f_flag); >> >> @@ -557,8 +555,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> break; >> >> >> >> case F_SETFL: >> >> - error = fget_fcntl(td, fd, >> >> - cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp); >> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, >> >> &fp); >> >> if (error != 0) >> >> break; >> >> do { >> >> @@ -585,8 +582,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> break; >> >> >> >> case F_GETOWN: >> >> - error = fget_fcntl(td, fd, >> >> - cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, >> >> &fp); >> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETOWN, >> >> &fp); >> >> if (error != 0) >> >> break; >> >> error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, >> >> td); >> >> @@ -596,8 +592,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> break; >> >> >> >> case F_SETOWN: >> >> - error = fget_fcntl(td, fd, >> >> - cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, >> >> &fp); >> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETOWN, >> >> &fp); >> >> if (error != 0) >> >> break; >> >> tmp = arg; >> >> @@ -618,8 +613,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> >> >> case F_SETLK: >> >> do_setlk: >> >> - cap_rights_init(&rights, CAP_FLOCK); >> >> - error = fget_unlocked(fdp, fd, &rights, &fp, NULL); >> >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, >> >> NULL); >> >> if (error != 0) >> >> break; >> >> if (fp->f_type != DTYPE_VNODE) { >> >> @@ -711,7 +705,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> * that the closing thread was a bit slower and that >> >> the >> >> * advisory lock succeeded before the close. >> >> */ >> >> - error = fget_unlocked(fdp, fd, &rights, &fp2, NULL); >> >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2, >> >> NULL); >> >> if (error != 0) { >> >> fdrop(fp, td); >> >> break; >> >> @@ -729,8 +723,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> break; >> >> >> >> case F_GETLK: >> >> - error = fget_unlocked(fdp, fd, >> >> - cap_rights_init(&rights, CAP_FLOCK), &fp, NULL); >> >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, >> >> NULL); >> >> if (error != 0) >> >> break; >> >> if (fp->f_type != DTYPE_VNODE) { >> >> @@ -767,8 +760,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >> >> intptr_ >> >> arg = arg ? 128 * 1024: 0; >> >> /* FALLTHROUGH */ >> >> case F_READAHEAD: >> >> - error = fget_unlocked(fdp, fd, >> >> - cap_rights_init(&rights), &fp, NULL); >> >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, >> >> NULL); >> >> if (error != 0) >> >> break; >> >> if (fp->f_type != DTYPE_VNODE) { >> >> @@ -1363,12 +1355,11 @@ int >> >> kern_fstat(struct thread *td, int fd, struct stat *sbp) >> >> { >> >> struct file *fp; >> >> - cap_rights_t rights; >> >> int error; >> >> >> >> AUDIT_ARG_FD(fd); >> >> >> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FSTAT), &fp); >> >> + error = fget(td, fd, &cap_fstat_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> >> >> @@ -1445,10 +1436,9 @@ kern_fpathconf(struct thread *td, int fd, int >> >> name, >> >> lo >> >> { >> >> struct file *fp; >> >> struct vnode *vp; >> >> - cap_rights_t rights; >> >> int error; >> >> >> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FPATHCONF), >> >> &fp); >> >> + error = fget(td, fd, &cap_fpathconf_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> >> >> @@ -2982,10 +2972,9 @@ sys_flock(struct thread *td, struct flock_args >> >> *uap) >> >> struct file *fp; >> >> struct vnode *vp; >> >> struct flock lf; >> >> - cap_rights_t rights; >> >> int error; >> >> >> >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FLOCK), >> >> &fp); >> >> + error = fget(td, uap->fd, &cap_flock_rights, &fp); >> >> if (error != 0) >> >> return (error); >> >> if (fp->f_type != DTYPE_VNODE) { >> >> @@ -3633,7 +3622,7 @@ kern_proc_filedesc_out(struct proc *p, struct >> >> sbuf >> >> *s >> >> #ifdef CAPABILITIES >> >> rights = *cap_rights(fdp, i); >> >> #else /* !CAPABILITIES */ >> >> - cap_rights_init(&rights); >> >> + rights = cap_no_rights; >> >> #endif >> >> /* >> >> * Create sysctl entry. It is OK to drop the filedesc >> >> >> >> Modified: head/sys/kern/kern_event.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/kern/kern_event.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/kern/kern_event.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -1286,7 +1286,6 @@ kqueue_register(struct kqueue *kq, struct kevent >> >> *kev, >> >> struct file *fp; >> >> struct knote *kn, *tkn; >> >> struct knlist *knl; >> >> - cap_rights_t rights; >> >> int error, filt, event; >> >> int haskqglobal, filedesc_unlock; >> >> >> >> @@ -1322,8 +1321,7 @@ findkn: >> >> if (kev->ident > INT_MAX) >> >> error = EBADF; >> >> else >> >> - error = fget(td, kev->ident, >> >> - cap_rights_init(&rights, CAP_EVENT), &fp); >> >> + error = fget(td, kev->ident, &cap_event_rights, >> >> &fp); >> >> if (error) >> >> goto done; >> >> >> >> >> >> Modified: head/sys/kern/kern_exec.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/kern/kern_exec.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/kern/kern_exec.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -374,7 +374,6 @@ do_execve(struct thread *td, struct image_args >> >> *args, >> >> struct ucred *tracecred = NULL; >> >> #endif >> >> struct vnode *oldtextvp = NULL, *newtextvp; >> >> - cap_rights_t rights; >> >> int credential_changing; >> >> int textset; >> >> #ifdef MAC >> >> @@ -455,8 +454,7 @@ interpret: >> >> /* >> >> * Descriptors opened only with O_EXEC or O_RDONLY are >> >> allowed. >> >> */ >> >> - error = fgetvp_exec(td, args->fd, >> >> - cap_rights_init(&rights, CAP_FEXECVE), &newtextvp); >> >> + error = fgetvp_exec(td, args->fd, &cap_fexecve_rights, >> >> &newtextvp); >> >> if (error) >> >> goto exec_fail; >> >> vn_lock(newtextvp, LK_EXCLUSIVE | LK_RETRY); >> >> >> >> Modified: head/sys/kern/kern_sendfile.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/kern/kern_sendfile.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/kern/kern_sendfile.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -511,7 +511,6 @@ static int >> >> sendfile_getsock(struct thread *td, int s, struct file **sock_fp, >> >> struct socket **so) >> >> { >> >> - cap_rights_t rights; >> >> int error; >> >> >> >> *sock_fp = NULL; >> >> @@ -520,7 +519,7 @@ sendfile_getsock(struct thread *td, int s, struct >> >> file >> >> /* >> >> * The socket must be a stream socket and connected. >> >> */ >> >> - error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SEND), >> >> + error = getsock_cap(td, s, &cap_send_rights, >> >> sock_fp, NULL, NULL); >> >> if (error != 0) >> >> return (error); >> >> @@ -949,7 +948,6 @@ sendfile(struct thread *td, struct sendfile_args >> >> *uap, >> >> struct sf_hdtr hdtr; >> >> struct uio *hdr_uio, *trl_uio; >> >> struct file *fp; >> >> - cap_rights_t rights; >> >> off_t sbytes; >> >> int error; >> >> >> >> @@ -1000,10 +998,8 @@ sendfile(struct thread *td, struct sendfile_args >> >> *uap, >> >> * sendfile(2) can start at any offset within a file so we >> >> require >> >> * CAP_READ+CAP_SEEK = CAP_PREAD. >> >> */ >> >> - if ((error = fget_read(td, uap->fd, >> >> - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { >> >> + if ((error = fget_read(td, uap->fd, &cap_pread_rights, &fp)) != >> >> 0) >> >> goto out; >> >> - } >> >> >> >> error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, >> >> uap->nbytes, &sbytes, uap->flags, td); >> >> >> >> Modified: head/sys/kern/kern_sig.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/kern/kern_sig.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/kern/kern_sig.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -1789,7 +1789,6 @@ int >> >> sys_pdkill(struct thread *td, struct pdkill_args *uap) >> >> { >> >> struct proc *p; >> >> - cap_rights_t rights; >> >> int error; >> >> >> >> AUDIT_ARG_SIGNUM(uap->signum); >> >> @@ -1797,8 +1796,7 @@ sys_pdkill(struct thread *td, struct pdkill_args >> >> *uap) >> >> if ((u_int)uap->signum > _SIG_MAXSIG) >> >> return (EINVAL); >> >> >> >> - error = procdesc_find(td, uap->fd, >> >> - cap_rights_init(&rights, CAP_PDKILL), &p); >> >> + error = procdesc_find(td, uap->fd, &cap_pdkill_rights, &p); >> >> if (error) >> >> return (error); >> >> AUDIT_ARG_PROCESS(p); >> >> >> >> Modified: head/sys/kern/subr_capability.c >> >> >> >> >> >> ============================================================================== >> >> --- head/sys/kern/subr_capability.c Wed May 9 18:41:04 2018 >> >> (r333424) >> >> +++ head/sys/kern/subr_capability.c Wed May 9 18:47:24 2018 >> >> (r333425) >> >> @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); >> >> >> >> #ifdef _KERNEL >> >> #include >> >> - >> >> +#include >> >> #include >> >> #else /* !_KERNEL */ >> >> #include >> >> @@ -53,6 +53,38 @@ __FBSDID("$FreeBSD$"); >> >> >> >> #ifdef _KERNEL >> >> #define assert(exp) KASSERT((exp), ("%s:%u", __func__, >> >> __LINE__)) >> >> + >> >> +CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT); >> >> +CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND); >> >> +CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT); >> >> +CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT); >> >> +CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR); >> >> +CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL); >> >> +CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE); >> >> +CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK); >> >> +CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF); >> >> +CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT); >> >> +CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC); >> >> +CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE); >> >> +CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME); >> >> +CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME); >> >> +CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT); >> >> +CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL); >> >> +CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN); >> >> +CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP); >> >> +CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID); >> >> +CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL); >> >> +CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD); >> >> +CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE); >> >> +CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ); >> >> +CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV); >> >> +CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND); >> >> +CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT); >> >> +CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN); >> >> +CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE); >> >> + >> >> +__read_mostly cap_rights_t cap_no_rights; >> >> +CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights); >> >> #endif >> >> >> >> #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) >> >> >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> >> >> > >> > > > > -- > Mateusz Guzik From owner-svn-src-all@freebsd.org Sat May 19 07:31:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C48EF2035; Sat, 19 May 2018 07:31:36 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A788F83D77; Sat, 19 May 2018 07:31:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88BEB24096; Sat, 19 May 2018 07:31:35 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4J7VZQd026914; Sat, 19 May 2018 07:31:35 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4J7VZRS026913; Sat, 19 May 2018 07:31:35 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805190731.w4J7VZRS026913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 07:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333874 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 07:31:36 -0000 Author: mmacy Date: Sat May 19 07:31:35 2018 New Revision: 333874 URL: https://svnweb.freebsd.org/changeset/base/333874 Log: Unbreak BeagleBone Black boot by collapsing 29 SYSINITs in to 1 Reported by: ilya at bakulin.de Modified: head/sys/kern/subr_capability.c Modified: head/sys/kern/subr_capability.c ============================================================================== --- head/sys/kern/subr_capability.c Sat May 19 07:04:43 2018 (r333873) +++ head/sys/kern/subr_capability.c Sat May 19 07:31:35 2018 (r333874) @@ -53,38 +53,73 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #define assert(exp) KASSERT((exp), ("%s:%u", __func__, __LINE__)) +__read_mostly cap_rights_t cap_accept_rights; +__read_mostly cap_rights_t cap_bind_rights; +__read_mostly cap_rights_t cap_connect_rights; +__read_mostly cap_rights_t cap_event_rights; +__read_mostly cap_rights_t cap_fchdir_rights; +__read_mostly cap_rights_t cap_fcntl_rights; +__read_mostly cap_rights_t cap_fexecve_rights; +__read_mostly cap_rights_t cap_flock_rights; +__read_mostly cap_rights_t cap_fpathconf_rights; +__read_mostly cap_rights_t cap_fstat_rights; +__read_mostly cap_rights_t cap_ftruncate_rights; +__read_mostly cap_rights_t cap_getpeername_rights; +__read_mostly cap_rights_t cap_getsockopt_rights; +__read_mostly cap_rights_t cap_getsockname_rights; +__read_mostly cap_rights_t cap_ioctl_rights; +__read_mostly cap_rights_t cap_listen_rights; +__read_mostly cap_rights_t cap_mmap_rights; +__read_mostly cap_rights_t cap_no_rights; +__read_mostly cap_rights_t cap_fsync_rights; +__read_mostly cap_rights_t cap_pdgetpid_rights; +__read_mostly cap_rights_t cap_pdkill_rights; +__read_mostly cap_rights_t cap_pread_rights; +__read_mostly cap_rights_t cap_pwrite_rights; +__read_mostly cap_rights_t cap_read_rights; +__read_mostly cap_rights_t cap_recv_rights; +__read_mostly cap_rights_t cap_send_rights; +__read_mostly cap_rights_t cap_setsockopt_rights; +__read_mostly cap_rights_t cap_shutdown_rights; +__read_mostly cap_rights_t cap_write_rights; +__read_mostly cap_rights_t cap_no_rights; -CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT); -CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND); -CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT); -CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT); -CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR); -CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL); -CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE); -CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK); -CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF); -CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT); -CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC); -CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE); -CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME); -CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME); -CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT); -CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL); -CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN); -CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP); -CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID); -CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL); -CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD); -CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE); -CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ); -CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV); -CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND); -CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT); -CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN); -CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE); +static void +__cap_rights_sysinit1(void *arg) +{ + cap_rights_init(&cap_accept_rights, CAP_ACCEPT); + cap_rights_init(&cap_bind_rights, CAP_BIND); + cap_rights_init(&cap_connect_rights, CAP_CONNECT); + cap_rights_init(&cap_event_rights, CAP_EVENT); + cap_rights_init(&cap_fchdir_rights, CAP_FCHDIR); + cap_rights_init(&cap_fcntl_rights, CAP_FCNTL); + cap_rights_init(&cap_fexecve_rights, CAP_FEXECVE); + cap_rights_init(&cap_flock_rights, CAP_FLOCK); + cap_rights_init(&cap_fpathconf_rights, CAP_FPATHCONF); + cap_rights_init(&cap_fstat_rights, CAP_FSTAT); + cap_rights_init(&cap_fsync_rights, CAP_FSYNC); + cap_rights_init(&cap_ftruncate_rights, CAP_FTRUNCATE); + cap_rights_init(&cap_getpeername_rights, CAP_GETPEERNAME); + cap_rights_init(&cap_getsockname_rights, CAP_GETSOCKNAME); + cap_rights_init(&cap_getsockopt_rights, CAP_GETSOCKOPT); + cap_rights_init(&cap_ioctl_rights, CAP_IOCTL); + cap_rights_init(&cap_listen_rights, CAP_LISTEN); + cap_rights_init(&cap_mmap_rights, CAP_MMAP); + cap_rights_init(&cap_pdgetpid_rights, CAP_PDGETPID); + cap_rights_init(&cap_pdkill_rights, CAP_PDKILL); + cap_rights_init(&cap_pread_rights, CAP_PREAD); + cap_rights_init(&cap_pwrite_rights, CAP_PWRITE); + cap_rights_init(&cap_read_rights, CAP_READ); + cap_rights_init(&cap_recv_rights, CAP_RECV); + cap_rights_init(&cap_send_rights, CAP_SEND); + cap_rights_init(&cap_setsockopt_rights, CAP_SETSOCKOPT); + cap_rights_init(&cap_shutdown_rights, CAP_SHUTDOWN); + cap_rights_init(&cap_write_rights, CAP_WRITE); + cap_rights_init(&cap_no_rights); +} +SYSINIT(cap_rights1_sysinit, SI_SUB_COPYRIGHT, SI_ORDER_ANY, \ + __cap_rights_sysinit1, NULL); -__read_mostly cap_rights_t cap_no_rights; -CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights); #endif #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) From owner-svn-src-all@freebsd.org Sat May 19 07:31:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BC71EF2054; Sat, 19 May 2018 07:31:45 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7AD283E74; Sat, 19 May 2018 07:31:44 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 9430621C5C; Sat, 19 May 2018 07:31:44 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f175.google.com with SMTP id d11-v6so8861129iof.11; Sat, 19 May 2018 00:31:44 -0700 (PDT) X-Gm-Message-State: ALKqPwetOIqGIdVCCYoC9cVV5oeHgJSvHMK14/1TfvEEbm9H+TnHQKZs NxGs6TxW/6BeLdQZwEtZxYl4LaDMn3ts3qFepbI= X-Google-Smtp-Source: AB8JxZrvU1avFnTv98s7/hcCeoDolzHrEE/YHb3f4y0ROfnxbM6y9gjhS9hym9bT94wvbrMoTzX5G/v0aTeVLjxw6V8= X-Received: by 2002:a6b:a712:: with SMTP id q18-v6mr13255896ioe.237.1526715103204; Sat, 19 May 2018 00:31:43 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Sat, 19 May 2018 00:31:42 -0700 (PDT) In-Reply-To: References: <201805091847.w49IlPPa014617@repo.freebsd.org> From: Matthew Macy Date: Sat, 19 May 2018 00:31:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333425 - in head/sys: cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/cloudabi compat/linux compat/linuxkpi/common/include/linux dev/filemon dev/hwpmc fs/... To: Mateusz Guzik Cc: Ilya Bakulin , manu@freebsd.org, Warner Losh , src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 07:31:45 -0000 r333874 On Sat, May 19, 2018 at 12:16 AM, Matthew Macy wrote: > I can do that tomorrow. But point is that something else will push it over soon. > > On Sat, May 19, 2018 at 12:14 AM, Mateusz Guzik wrote: >> imo all these sysinits can and shoud be collapsed into one, which will have >> a side effect of getting rid of the problem. >> >> On Sat, May 19, 2018 at 9:13 AM, Matthew Macy wrote: >>> >>> I guess we'll need to allocate more pages at boot. We must have been >>> on the edge already if that pushed us over. >>> -M >>> >>> On Fri, May 18, 2018 at 12:03 PM, Ilya Bakulin wrote: >>> > Hi Matt, >>> > seems this commit has broken at least BeagleBone Black booting process. >>> > On >>> > all revisions after it the kernel panics with this message: >>> > http://dl.bakulin.de/bbb_panic.txt >>> > My suspicion is that there are quite a few new SYSINIT objects that are >>> > created on startup, and as a result some kind of memory reservation gets >>> > exhausted. I don't have immediate idea how to debug this further; just >>> > can >>> > confirm that patching out this change allows the board to boot again. >>> > >>> > >>> > On Wed, May 9, 2018 at 8:47 PM Matt Macy wrote: >>> >> >>> >> Author: mmacy >>> >> Date: Wed May 9 18:47:24 2018 >>> >> New Revision: 333425 >>> >> URL: https://svnweb.freebsd.org/changeset/base/333425 >>> >> >>> >> Log: >>> >> Eliminate the overhead of gratuitous repeated reinitialization of >>> >> cap_rights >>> >> >>> >> - Add macros to allow preinitialization of cap_rights_t. >>> >> >>> >> - Convert most commonly used code paths to use preinitialized >>> >> cap_rights_t. >>> >> A 3.6% speedup in fstat was measured with this change. >>> >> >>> >> Reported by: mjg >>> >> Reviewed by: oshogbo >>> >> Approved by: sbruno >>> >> MFC after: 1 month >>> >> >>> >> Modified: >>> >> head/sys/cddl/compat/opensolaris/sys/file.h >>> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >>> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >>> >> head/sys/compat/cloudabi/cloudabi_file.c >>> >> head/sys/compat/linux/linux_event.c >>> >> head/sys/compat/linux/linux_file.c >>> >> head/sys/compat/linux/linux_ioctl.c >>> >> head/sys/compat/linux/linux_mmap.c >>> >> head/sys/compat/linux/linux_socket.c >>> >> head/sys/compat/linux/linux_stats.c >>> >> head/sys/compat/linuxkpi/common/include/linux/file.h >>> >> head/sys/dev/filemon/filemon.c >>> >> head/sys/dev/hwpmc/hwpmc_logging.c >>> >> head/sys/fs/fdescfs/fdesc_vnops.c >>> >> head/sys/fs/fuse/fuse_vfsops.c >>> >> head/sys/kern/kern_descrip.c >>> >> head/sys/kern/kern_event.c >>> >> head/sys/kern/kern_exec.c >>> >> head/sys/kern/kern_sendfile.c >>> >> head/sys/kern/kern_sig.c >>> >> head/sys/kern/subr_capability.c >>> >> head/sys/kern/sys_generic.c >>> >> head/sys/kern/sys_procdesc.c >>> >> head/sys/kern/uipc_mqueue.c >>> >> head/sys/kern/uipc_sem.c >>> >> head/sys/kern/uipc_syscalls.c >>> >> head/sys/kern/vfs_aio.c >>> >> head/sys/kern/vfs_syscalls.c >>> >> head/sys/netsmb/smb_dev.c >>> >> head/sys/sys/capsicum.h >>> >> >>> >> Modified: head/sys/cddl/compat/opensolaris/sys/file.h >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:41:04 >>> >> 2018 >>> >> (r333424) >>> >> +++ head/sys/cddl/compat/opensolaris/sys/file.h Wed May 9 18:47:24 >>> >> 2018 >>> >> (r333425) >>> >> @@ -52,10 +52,9 @@ static __inline void >>> >> releasef(int fd) >>> >> { >>> >> struct file *fp; >>> >> - cap_rights_t rights; >>> >> >>> >> /* No CAP_ rights required, as we're only releasing. */ >>> >> - if (fget(curthread, fd, cap_rights_init(&rights), &fp) == 0) { >>> >> + if (fget(curthread, fd, &cap_no_rights, &fp) == 0) { >>> >> fdrop(fp, curthread); >>> >> fdrop(fp, curthread); >>> >> } >>> >> >>> >> Modified: >>> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >>> >> Wed May 9 18:41:04 2018 (r333424) >>> >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c >>> >> Wed May 9 18:47:24 2018 (r333425) >>> >> @@ -4446,7 +4446,6 @@ zfs_ioc_recv(zfs_cmd_t *zc) >>> >> char *origin = NULL; >>> >> char *tosnap; >>> >> char tofs[ZFS_MAX_DATASET_NAME_LEN]; >>> >> - cap_rights_t rights; >>> >> boolean_t first_recvd_props = B_FALSE; >>> >> >>> >> if (dataset_namecheck(zc->zc_value, NULL, NULL) != 0 || >>> >> @@ -4467,7 +4466,7 @@ zfs_ioc_recv(zfs_cmd_t *zc) >>> >> #ifdef illumos >>> >> fp = getf(fd); >>> >> #else >>> >> - fget_read(curthread, fd, cap_rights_init(&rights, CAP_PREAD), >>> >> &fp); >>> >> + fget_read(curthread, fd, &cap_pread_rights, &fp); >>> >> #endif >>> >> if (fp == NULL) { >>> >> nvlist_free(props); >>> >> @@ -4744,13 +4743,11 @@ zfs_ioc_send(zfs_cmd_t *zc) >>> >> dsl_pool_rele(dp, FTAG); >>> >> } else { >>> >> file_t *fp; >>> >> - cap_rights_t rights; >>> >> >>> >> #ifdef illumos >>> >> fp = getf(zc->zc_cookie); >>> >> #else >>> >> - fget_write(curthread, zc->zc_cookie, >>> >> - cap_rights_init(&rights, CAP_WRITE), &fp); >>> >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, >>> >> &fp); >>> >> #endif >>> >> if (fp == NULL) >>> >> return (SET_ERROR(EBADF)); >>> >> @@ -5387,15 +5384,13 @@ static int >>> >> zfs_ioc_diff(zfs_cmd_t *zc) >>> >> { >>> >> file_t *fp; >>> >> - cap_rights_t rights; >>> >> offset_t off; >>> >> int error; >>> >> >>> >> #ifdef illumos >>> >> fp = getf(zc->zc_cookie); >>> >> #else >>> >> - fget_write(curthread, zc->zc_cookie, >>> >> - cap_rights_init(&rights, CAP_WRITE), &fp); >>> >> + fget_write(curthread, zc->zc_cookie, &cap_write_rights, &fp); >>> >> #endif >>> >> if (fp == NULL) >>> >> return (SET_ERROR(EBADF)); >>> >> @@ -5787,7 +5782,6 @@ zfs_ioc_unjail(zfs_cmd_t *zc) >>> >> static int >>> >> zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t >>> >> *outnvl) >>> >> { >>> >> - cap_rights_t rights; >>> >> file_t *fp; >>> >> int error; >>> >> offset_t off; >>> >> @@ -5815,7 +5809,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t >>> >> *innvl >>> >> #ifdef illumos >>> >> file_t *fp = getf(fd); >>> >> #else >>> >> - fget_write(curthread, fd, cap_rights_init(&rights, CAP_WRITE), >>> >> &fp); >>> >> + fget_write(curthread, fd, &cap_write_rights, &fp); >>> >> #endif >>> >> if (fp == NULL) >>> >> return (SET_ERROR(EBADF)); >>> >> >>> >> Modified: >>> >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >>> >> Wed May 9 18:41:04 2018 (r333424) >>> >> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c >>> >> Wed May 9 18:47:24 2018 (r333425) >>> >> @@ -126,7 +126,7 @@ zfs_onexit_fd_hold(int fd, minor_t *minorp) >>> >> void *data; >>> >> int error; >>> >> >>> >> - fp = getf(fd, cap_rights_init(&rights)); >>> >> + fp = getf(fd, &cap_no_rights); >>> >> if (fp == NULL) >>> >> return (SET_ERROR(EBADF)); >>> >> >>> >> >>> >> Modified: head/sys/compat/cloudabi/cloudabi_file.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:41:04 >>> >> 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/cloudabi/cloudabi_file.c Wed May 9 18:47:24 >>> >> 2018 >>> >> (r333425) >>> >> @@ -390,12 +390,11 @@ cloudabi_sys_file_readdir(struct thread *td, >>> >> struct file *fp; >>> >> struct vnode *vp; >>> >> void *readbuf; >>> >> - cap_rights_t rights; >>> >> cloudabi_dircookie_t offset; >>> >> int error; >>> >> >>> >> /* Obtain directory vnode. */ >>> >> - error = getvnode(td, uap->fd, cap_rights_init(&rights, >>> >> CAP_READ), >>> >> &fp); >>> >> + error = getvnode(td, uap->fd, &cap_read_rights, &fp); >>> >> if (error != 0) { >>> >> if (error == EINVAL) >>> >> return (ENOTDIR); >>> >> @@ -559,14 +558,13 @@ cloudabi_sys_file_stat_fget(struct thread *td, >>> >> struct stat sb; >>> >> cloudabi_filestat_t csb; >>> >> struct file *fp; >>> >> - cap_rights_t rights; >>> >> cloudabi_filetype_t filetype; >>> >> int error; >>> >> >>> >> memset(&csb, 0, sizeof(csb)); >>> >> >>> >> /* Fetch file descriptor attributes. */ >>> >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FSTAT), >>> >> &fp); >>> >> + error = fget(td, uap->fd, &cap_fstat_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = fo_stat(fp, &sb, td->td_ucred, td); >>> >> >>> >> Modified: head/sys/compat/linux/linux_event.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linux/linux_event.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/linux/linux_event.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -1190,14 +1190,13 @@ linux_timerfd_curval(struct timerfd *tfd, >>> >> struct >>> >> itime >>> >> int >>> >> linux_timerfd_gettime(struct thread *td, struct >>> >> linux_timerfd_gettime_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct l_itimerspec lots; >>> >> struct itimerspec ots; >>> >> struct timerfd *tfd; >>> >> struct file *fp; >>> >> int error; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_READ), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_read_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> tfd = fp->f_data; >>> >> @@ -1225,7 +1224,6 @@ linux_timerfd_settime(struct thread *td, struct >>> >> linux_ >>> >> struct l_itimerspec lots; >>> >> struct itimerspec nts, ots; >>> >> struct timespec cts, ts; >>> >> - cap_rights_t rights; >>> >> struct timerfd *tfd; >>> >> struct timeval tv; >>> >> struct file *fp; >>> >> @@ -1241,7 +1239,7 @@ linux_timerfd_settime(struct thread *td, struct >>> >> linux_ >>> >> if (error != 0) >>> >> return (error); >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_WRITE), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_write_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> tfd = fp->f_data; >>> >> >>> >> Modified: head/sys/compat/linux/linux_file.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linux/linux_file.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/linux/linux_file.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -89,7 +89,6 @@ linux_creat(struct thread *td, struct >>> >> linux_creat_args >>> >> static int >>> >> linux_common_open(struct thread *td, int dirfd, char *path, int >>> >> l_flags, >>> >> int mode) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct proc *p = td->td_proc; >>> >> struct file *fp; >>> >> int fd; >>> >> @@ -144,7 +143,7 @@ linux_common_open(struct thread *td, int dirfd, >>> >> char * >>> >> * checking below. >>> >> */ >>> >> fd = td->td_retval[0]; >>> >> - if (fget(td, fd, cap_rights_init(&rights, CAP_IOCTL), &fp) == >>> >> 0) { >>> >> + if (fget(td, fd, &cap_ioctl_rights, &fp) == 0) { >>> >> if (fp->f_type != DTYPE_VNODE) { >>> >> fdrop(fp, td); >>> >> goto done; >>> >> @@ -263,13 +262,12 @@ linux_llseek(struct thread *td, struct >>> >> linux_llseek_ar >>> >> static int >>> >> linux_getdents_error(struct thread *td, int fd, int err) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct vnode *vp; >>> >> struct file *fp; >>> >> int error; >>> >> >>> >> /* Linux return ENOTDIR in case when fd is not a directory. */ >>> >> - error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), >>> >> &fp); >>> >> + error = getvnode(td, fd, &cap_read_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> vp = fp->f_vnode; >>> >> @@ -985,15 +983,13 @@ linux_fdatasync(td, uap) >>> >> int >>> >> linux_pread(struct thread *td, struct linux_pread_args *uap) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct vnode *vp; >>> >> int error; >>> >> >>> >> error = kern_pread(td, uap->fd, uap->buf, uap->nbyte, >>> >> uap->offset); >>> >> if (error == 0) { >>> >> /* This seems to violate POSIX but Linux does it. */ >>> >> - error = fgetvp(td, uap->fd, >>> >> - cap_rights_init(&rights, CAP_PREAD), &vp); >>> >> + error = fgetvp(td, uap->fd, &cap_pread_rights, &vp); >>> >> if (error != 0) >>> >> return (error); >>> >> if (vp->v_type == VDIR) { >>> >> @@ -1275,7 +1271,6 @@ fcntl_common(struct thread *td, struct >>> >> linux_fcntl_arg >>> >> { >>> >> struct l_flock linux_flock; >>> >> struct flock bsd_flock; >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> long arg; >>> >> int error, result; >>> >> @@ -1379,7 +1374,7 @@ fcntl_common(struct thread *td, struct >>> >> linux_fcntl_arg >>> >> * pipes under Linux-2.2.35 at least). >>> >> */ >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_FCNTL), &fp); >>> >> + &cap_fcntl_rights, &fp); >>> >> if (error) >>> >> return (error); >>> >> if (fp->f_type == DTYPE_PIPE) { >>> >> >>> >> Modified: head/sys/compat/linux/linux_ioctl.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linux/linux_ioctl.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/linux/linux_ioctl.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -194,13 +194,12 @@ struct linux_hd_big_geometry { >>> >> static int >>> >> linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> u_int sectorsize, fwcylinders, fwheads, fwsectors; >>> >> off_t mediasize, bytespercyl; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> switch (args->cmd & 0xffff) { >>> >> @@ -278,13 +277,12 @@ linux_ioctl_hdio(struct thread *td, struct >>> >> linux_ioctl >>> >> static int >>> >> linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> u_int sectorsize; >>> >> off_t mediasize; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> switch (args->cmd & 0xffff) { >>> >> @@ -717,11 +715,10 @@ linux_ioctl_termio(struct thread *td, struct >>> >> linux_ioc >>> >> struct termios bios; >>> >> struct linux_termios lios; >>> >> struct linux_termio lio; >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> >>> >> @@ -1461,11 +1458,10 @@ bsd_to_linux_dvd_authinfo(struct dvd_authinfo >>> >> *bp, >>> >> l_d >>> >> static int >>> >> linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> switch (args->cmd & 0xffff) { >>> >> @@ -1998,11 +1994,10 @@ linux_ioctl_sound(struct thread *td, struct >>> >> linux_ioct >>> >> static int >>> >> linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> switch (args->cmd & 0xffff) { >>> >> @@ -2411,7 +2406,6 @@ static int >>> >> linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> char lifname[LINUX_IFNAMSIZ], ifname[IFNAMSIZ]; >>> >> - cap_rights_t rights; >>> >> struct ifnet *ifp; >>> >> struct file *fp; >>> >> int error, type; >>> >> @@ -2419,7 +2413,7 @@ linux_ioctl_socket(struct thread *td, struct >>> >> linux_ioc >>> >> ifp = NULL; >>> >> error = 0; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> type = fp->f_type; >>> >> @@ -2649,11 +2643,10 @@ linux_ioctl_socket(struct thread *td, struct >>> >> linux_ioc >>> >> static int >>> >> linux_ioctl_private(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error, type; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> type = fp->f_type; >>> >> @@ -2685,11 +2678,10 @@ linux_ioctl_sg_io(struct thread *td, struct >>> >> linux_ioct >>> >> { >>> >> struct sg_io_hdr io; >>> >> struct sg_io_hdr32 io32; >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) { >>> >> printf("sg_linux_ioctl: fget returned %d\n", error); >>> >> return (error); >>> >> @@ -2997,7 +2989,6 @@ linux_v4l_cliplist_copy(struct l_video_window >>> >> *lvw, >>> >> st >>> >> static int >>> >> linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> struct video_tuner vtun; >>> >> @@ -3016,7 +3007,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCGTUNER: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = copyin((void *) args->arg, &l_vtun, >>> >> sizeof(l_vtun)); >>> >> @@ -3036,7 +3027,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCSTUNER: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = copyin((void *) args->arg, &l_vtun, >>> >> sizeof(l_vtun)); >>> >> @@ -3055,7 +3046,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCGWIN: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, >>> >> td); >>> >> @@ -3069,7 +3060,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCSWIN: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = copyin((void *) args->arg, &l_vwin, >>> >> sizeof(l_vwin)); >>> >> @@ -3094,7 +3085,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCGFBUF: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, >>> >> td); >>> >> @@ -3108,7 +3099,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCSFBUF: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = copyin((void *) args->arg, &l_vbuf, >>> >> sizeof(l_vbuf)); >>> >> @@ -3138,7 +3129,7 @@ linux_ioctl_v4l(struct thread *td, struct >>> >> linux_ioctl_ >>> >> >>> >> case LINUX_VIDIOCSMICROCODE: >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = copyin((void *) args->arg, &l_vcode, >>> >> sizeof(l_vcode)); >>> >> @@ -3302,7 +3293,6 @@ bsd_to_linux_v4l2_format(struct v4l2_format *vf, >>> >> struc >>> >> static int >>> >> linux_ioctl_v4l2(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> int error; >>> >> struct v4l2_format vformat; >>> >> @@ -3395,7 +3385,7 @@ linux_ioctl_v4l2(struct thread *td, struct >>> >> linux_ioctl >>> >> if (error) >>> >> return (error); >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error) >>> >> return (error); >>> >> if (linux_to_bsd_v4l2_format(&l_vformat, &vformat) != >>> >> 0) >>> >> @@ -3420,7 +3410,7 @@ linux_ioctl_v4l2(struct thread *td, struct >>> >> linux_ioctl >>> >> return (error); >>> >> linux_to_bsd_v4l2_standard(&l_vstd, &vstd); >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error) >>> >> return (error); >>> >> error = fo_ioctl(fp, VIDIOC_ENUMSTD, (caddr_t)&vstd, >>> >> @@ -3444,7 +3434,7 @@ linux_ioctl_v4l2(struct thread *td, struct >>> >> linux_ioctl >>> >> if (error != 0) >>> >> return (error); >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> error = fo_ioctl(fp, VIDIOC_ENUMINPUT, (caddr_t)&vinp, >>> >> @@ -3465,7 +3455,7 @@ linux_ioctl_v4l2(struct thread *td, struct >>> >> linux_ioctl >>> >> if (error) >>> >> return (error); >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error) >>> >> return (error); >>> >> linux_to_bsd_v4l2_buffer(&l_vbuf, &vbuf); >>> >> @@ -3640,7 +3630,6 @@ linux_ioctl_fbsd_usb(struct thread *td, struct >>> >> linux_i >>> >> static int >>> >> linux_ioctl_evdev(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> clockid_t clock; >>> >> int error; >>> >> @@ -3668,7 +3657,7 @@ linux_ioctl_evdev(struct thread *td, struct >>> >> linux_ioct >>> >> return (error); >>> >> >>> >> error = fget(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_IOCTL), &fp); >>> >> + &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> >>> >> @@ -3694,7 +3683,6 @@ linux_ioctl_evdev(struct thread *td, struct >>> >> linux_ioct >>> >> int >>> >> linux_ioctl(struct thread *td, struct linux_ioctl_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *fp; >>> >> struct handler_element *he; >>> >> int error, cmd; >>> >> @@ -3705,7 +3693,7 @@ linux_ioctl(struct thread *td, struct >>> >> linux_ioctl_args >>> >> (unsigned long)args->cmd); >>> >> #endif >>> >> >>> >> - error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), >>> >> &fp); >>> >> + error = fget(td, args->fd, &cap_ioctl_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> if ((fp->f_flag & (FREAD|FWRITE)) == 0) { >>> >> >>> >> Modified: head/sys/compat/linux/linux_mmap.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linux/linux_mmap.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/linux/linux_mmap.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -72,7 +72,6 @@ linux_mmap_common(struct thread *td, uintptr_t addr, >>> >> s >>> >> int bsd_flags, error; >>> >> struct file *fp; >>> >> >>> >> - cap_rights_t rights; >>> >> LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", >>> >> addr, len, prot, flags, fd, pos); >>> >> >>> >> @@ -126,7 +125,7 @@ linux_mmap_common(struct thread *td, uintptr_t >>> >> addr, s >>> >> * protection options specified. >>> >> */ >>> >> >>> >> - error = fget(td, fd, cap_rights_init(&rights, >>> >> CAP_MMAP), >>> >> &fp); >>> >> + error = fget(td, fd, &cap_mmap_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> if (fp->f_type != DTYPE_VNODE && fp->f_type != >>> >> DTYPE_DEV) >>> >> { >>> >> >>> >> Modified: head/sys/compat/linux/linux_socket.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linux/linux_socket.c Wed May 9 18:41:04 >>> >> 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/linux/linux_socket.c Wed May 9 18:47:24 >>> >> 2018 >>> >> (r333425) >>> >> @@ -766,7 +766,6 @@ linux_bind(struct thread *td, struct >>> >> linux_bind_args * >>> >> int >>> >> linux_connect(struct thread *td, struct linux_connect_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct socket *so; >>> >> struct sockaddr *sa; >>> >> struct file *fp; >>> >> @@ -788,7 +787,7 @@ linux_connect(struct thread *td, struct >>> >> linux_connect_ >>> >> * when on a non-blocking socket. Instead it returns the >>> >> * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. >>> >> */ >>> >> - error = getsock_cap(td, args->s, cap_rights_init(&rights, >>> >> CAP_CONNECT), >>> >> + error = getsock_cap(td, args->s, &cap_connect_rights, >>> >> &fp, &fflag, NULL); >>> >> if (error != 0) >>> >> return (error); >>> >> @@ -824,7 +823,6 @@ linux_accept_common(struct thread *td, int s, >>> >> l_uintpt >>> >> socklen_t * __restrict anamelen; >>> >> int flags; >>> >> } */ bsd_args; >>> >> - cap_rights_t rights; >>> >> struct socket *so; >>> >> struct file *fp; >>> >> int error, error1; >>> >> @@ -842,8 +840,7 @@ linux_accept_common(struct thread *td, int s, >>> >> l_uintpt >>> >> if (error == EFAULT && namelen != sizeof(struct >>> >> sockaddr_in)) >>> >> return (EINVAL); >>> >> if (error == EINVAL) { >>> >> - error1 = getsock_cap(td, s, >>> >> - cap_rights_init(&rights, CAP_ACCEPT), &fp, >>> >> NULL, NULL); >>> >> + error1 = getsock_cap(td, s, &cap_accept_rights, >>> >> &fp, NULL, NULL); >>> >> if (error1 != 0) >>> >> return (error1); >>> >> so = fp->f_data; >>> >> >>> >> Modified: head/sys/compat/linux/linux_stats.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linux/linux_stats.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/compat/linux/linux_stats.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -103,14 +103,13 @@ translate_fd_major_minor(struct thread *td, int >>> >> fd, >>> >> st >>> >> { >>> >> struct file *fp; >>> >> struct vnode *vp; >>> >> - cap_rights_t rights; >>> >> int major, minor; >>> >> >>> >> /* >>> >> * No capability rights required here. >>> >> */ >>> >> if ((!S_ISCHR(buf->st_mode) && !S_ISBLK(buf->st_mode)) || >>> >> - fget(td, fd, cap_rights_init(&rights), &fp) != 0) >>> >> + fget(td, fd, &cap_no_rights, &fp) != 0) >>> >> return; >>> >> vp = fp->f_vnode; >>> >> if (vp != NULL && vp->v_rdev != NULL && >>> >> @@ -680,12 +679,11 @@ linux_newfstatat(struct thread *td, struct >>> >> linux_newfs >>> >> int >>> >> linux_syncfs(struct thread *td, struct linux_syncfs_args *args) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct mount *mp; >>> >> struct vnode *vp; >>> >> int error, save; >>> >> >>> >> - error = fgetvp(td, args->fd, cap_rights_init(&rights, >>> >> CAP_FSYNC), >>> >> &vp); >>> >> + error = fgetvp(td, args->fd, &cap_fsync_rights, &vp); >>> >> if (error != 0) >>> >> /* >>> >> * Linux syncfs() returns only EBADF, however fgetvp() >>> >> >>> >> Modified: head/sys/compat/linuxkpi/common/include/linux/file.h >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/compat/linuxkpi/common/include/linux/file.h Wed May >>> >> 9 >>> >> 18:41:04 2018 (r333424) >>> >> +++ head/sys/compat/linuxkpi/common/include/linux/file.h Wed May >>> >> 9 >>> >> 18:47:24 2018 (r333425) >>> >> @@ -50,12 +50,11 @@ extern struct fileops linuxfileops; >>> >> static inline struct linux_file * >>> >> linux_fget(unsigned int fd) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *file; >>> >> >>> >> /* lookup file pointer by file descriptor index */ >>> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >>> >> - cap_rights_init(&rights), &file, NULL) != 0) >>> >> + &cap_no_rights, &file, NULL) != 0) >>> >> return (NULL); >>> >> >>> >> /* check if file handle really belongs to us */ >>> >> @@ -88,11 +87,10 @@ file_count(struct linux_file *filp) >>> >> static inline void >>> >> put_unused_fd(unsigned int fd) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *file; >>> >> >>> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >>> >> - cap_rights_init(&rights), &file, NULL) != 0) { >>> >> + &cap_no_rights, &file, NULL) != 0) { >>> >> return; >>> >> } >>> >> /* >>> >> @@ -109,11 +107,10 @@ put_unused_fd(unsigned int fd) >>> >> static inline void >>> >> fd_install(unsigned int fd, struct linux_file *filp) >>> >> { >>> >> - cap_rights_t rights; >>> >> struct file *file; >>> >> >>> >> if (fget_unlocked(curthread->td_proc->p_fd, fd, >>> >> - cap_rights_init(&rights), &file, NULL) != 0) { >>> >> + &cap_no_rights, &file, NULL) != 0) { >>> >> filp->_file = NULL; >>> >> } else { >>> >> filp->_file = file; >>> >> >>> >> Modified: head/sys/dev/filemon/filemon.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/dev/filemon/filemon.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/dev/filemon/filemon.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -361,7 +361,6 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t >>> >> da >>> >> int error = 0; >>> >> struct filemon *filemon; >>> >> struct proc *p; >>> >> - cap_rights_t rights; >>> >> >>> >> if ((error = devfs_get_cdevpriv((void **) &filemon)) != 0) >>> >> return (error); >>> >> @@ -377,7 +376,7 @@ filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t >>> >> da >>> >> } >>> >> >>> >> error = fget_write(td, *(int *)data, >>> >> - cap_rights_init(&rights, CAP_PWRITE), >>> >> + &cap_pwrite_rights, >>> >> &filemon->fp); >>> >> if (error == 0) >>> >> /* Write the file header. */ >>> >> >>> >> Modified: head/sys/dev/hwpmc/hwpmc_logging.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -638,7 +638,6 @@ int >>> >> pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int >>> >> logfd) >>> >> { >>> >> struct proc *p; >>> >> - cap_rights_t rights; >>> >> int error; >>> >> >>> >> sx_assert(&pmc_sx, SA_XLOCKED); >>> >> @@ -655,8 +654,7 @@ pmclog_configure_log(struct pmc_mdep *md, struct >>> >> pmc_o >>> >> po->po_file)); >>> >> >>> >> /* get a reference to the file state */ >>> >> - error = fget_write(curthread, logfd, >>> >> - cap_rights_init(&rights, CAP_WRITE), &po->po_file); >>> >> + error = fget_write(curthread, logfd, &cap_write_rights, >>> >> &po->po_file); >>> >> if (error) >>> >> goto error; >>> >> >>> >> >>> >> Modified: head/sys/fs/fdescfs/fdesc_vnops.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/fs/fdescfs/fdesc_vnops.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -286,7 +286,6 @@ fdesc_lookup(struct vop_lookup_args *ap) >>> >> struct thread *td = cnp->cn_thread; >>> >> struct file *fp; >>> >> struct fdesc_get_ino_args arg; >>> >> - cap_rights_t rights; >>> >> int nlen = cnp->cn_namelen; >>> >> u_int fd, fd1; >>> >> int error; >>> >> @@ -331,7 +330,7 @@ fdesc_lookup(struct vop_lookup_args *ap) >>> >> /* >>> >> * No rights to check since 'fp' isn't actually used. >>> >> */ >>> >> - if ((error = fget(td, fd, cap_rights_init(&rights), &fp)) != 0) >>> >> + if ((error = fget(td, fd, &cap_no_rights, &fp)) != 0) >>> >> goto bad; >>> >> >>> >> /* Check if we're looking up ourselves. */ >>> >> @@ -613,7 +612,6 @@ static int >>> >> fdesc_readlink(struct vop_readlink_args *va) >>> >> { >>> >> struct vnode *vp, *vn; >>> >> - cap_rights_t rights; >>> >> struct thread *td; >>> >> struct uio *uio; >>> >> struct file *fp; >>> >> @@ -631,7 +629,7 @@ fdesc_readlink(struct vop_readlink_args *va) >>> >> VOP_UNLOCK(vn, 0); >>> >> >>> >> td = curthread; >>> >> - error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, >>> >> NULL); >>> >> + error = fget_cap(td, fd_fd, &cap_no_rights, &fp, NULL); >>> >> if (error != 0) >>> >> goto out; >>> >> >>> >> >>> >> Modified: head/sys/fs/fuse/fuse_vfsops.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/fs/fuse/fuse_vfsops.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -222,7 +222,6 @@ fuse_vfsop_mount(struct mount *mp) >>> >> struct file *fp, *fptmp; >>> >> char *fspec, *subtype; >>> >> struct vfsoptlist *opts; >>> >> - cap_rights_t rights; >>> >> >>> >> subtype = NULL; >>> >> max_read_set = 0; >>> >> @@ -292,7 +291,7 @@ fuse_vfsop_mount(struct mount *mp) >>> >> >>> >> FS_DEBUG2G("mntopts 0x%jx\n", (uintmax_t)mntopts); >>> >> >>> >> - err = fget(td, fd, cap_rights_init(&rights, CAP_READ), &fp); >>> >> + err = fget(td, fd, &cap_read_rights, &fp); >>> >> if (err != 0) { >>> >> FS_DEBUG("invalid or not opened device: data=%p\n", >>> >> data); >>> >> goto out; >>> >> >>> >> Modified: head/sys/kern/kern_descrip.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/kern/kern_descrip.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/kern/kern_descrip.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -490,7 +490,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> struct filedescent *fde; >>> >> struct proc *p; >>> >> struct vnode *vp; >>> >> - cap_rights_t rights; >>> >> int error, flg, tmp; >>> >> uint64_t bsize; >>> >> off_t foffset; >>> >> @@ -548,8 +547,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> break; >>> >> >>> >> case F_GETFL: >>> >> - error = fget_fcntl(td, fd, >>> >> - cap_rights_init(&rights, CAP_FCNTL), F_GETFL, &fp); >>> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETFL, >>> >> &fp); >>> >> if (error != 0) >>> >> break; >>> >> td->td_retval[0] = OFLAGS(fp->f_flag); >>> >> @@ -557,8 +555,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> break; >>> >> >>> >> case F_SETFL: >>> >> - error = fget_fcntl(td, fd, >>> >> - cap_rights_init(&rights, CAP_FCNTL), F_SETFL, &fp); >>> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETFL, >>> >> &fp); >>> >> if (error != 0) >>> >> break; >>> >> do { >>> >> @@ -585,8 +582,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> break; >>> >> >>> >> case F_GETOWN: >>> >> - error = fget_fcntl(td, fd, >>> >> - cap_rights_init(&rights, CAP_FCNTL), F_GETOWN, >>> >> &fp); >>> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_GETOWN, >>> >> &fp); >>> >> if (error != 0) >>> >> break; >>> >> error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, >>> >> td); >>> >> @@ -596,8 +592,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> break; >>> >> >>> >> case F_SETOWN: >>> >> - error = fget_fcntl(td, fd, >>> >> - cap_rights_init(&rights, CAP_FCNTL), F_SETOWN, >>> >> &fp); >>> >> + error = fget_fcntl(td, fd, &cap_fcntl_rights, F_SETOWN, >>> >> &fp); >>> >> if (error != 0) >>> >> break; >>> >> tmp = arg; >>> >> @@ -618,8 +613,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> >>> >> case F_SETLK: >>> >> do_setlk: >>> >> - cap_rights_init(&rights, CAP_FLOCK); >>> >> - error = fget_unlocked(fdp, fd, &rights, &fp, NULL); >>> >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, >>> >> NULL); >>> >> if (error != 0) >>> >> break; >>> >> if (fp->f_type != DTYPE_VNODE) { >>> >> @@ -711,7 +705,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> * that the closing thread was a bit slower and that >>> >> the >>> >> * advisory lock succeeded before the close. >>> >> */ >>> >> - error = fget_unlocked(fdp, fd, &rights, &fp2, NULL); >>> >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp2, >>> >> NULL); >>> >> if (error != 0) { >>> >> fdrop(fp, td); >>> >> break; >>> >> @@ -729,8 +723,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> break; >>> >> >>> >> case F_GETLK: >>> >> - error = fget_unlocked(fdp, fd, >>> >> - cap_rights_init(&rights, CAP_FLOCK), &fp, NULL); >>> >> + error = fget_unlocked(fdp, fd, &cap_flock_rights, &fp, >>> >> NULL); >>> >> if (error != 0) >>> >> break; >>> >> if (fp->f_type != DTYPE_VNODE) { >>> >> @@ -767,8 +760,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, >>> >> intptr_ >>> >> arg = arg ? 128 * 1024: 0; >>> >> /* FALLTHROUGH */ >>> >> case F_READAHEAD: >>> >> - error = fget_unlocked(fdp, fd, >>> >> - cap_rights_init(&rights), &fp, NULL); >>> >> + error = fget_unlocked(fdp, fd, &cap_no_rights, &fp, >>> >> NULL); >>> >> if (error != 0) >>> >> break; >>> >> if (fp->f_type != DTYPE_VNODE) { >>> >> @@ -1363,12 +1355,11 @@ int >>> >> kern_fstat(struct thread *td, int fd, struct stat *sbp) >>> >> { >>> >> struct file *fp; >>> >> - cap_rights_t rights; >>> >> int error; >>> >> >>> >> AUDIT_ARG_FD(fd); >>> >> >>> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FSTAT), &fp); >>> >> + error = fget(td, fd, &cap_fstat_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> >>> >> @@ -1445,10 +1436,9 @@ kern_fpathconf(struct thread *td, int fd, int >>> >> name, >>> >> lo >>> >> { >>> >> struct file *fp; >>> >> struct vnode *vp; >>> >> - cap_rights_t rights; >>> >> int error; >>> >> >>> >> - error = fget(td, fd, cap_rights_init(&rights, CAP_FPATHCONF), >>> >> &fp); >>> >> + error = fget(td, fd, &cap_fpathconf_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> >>> >> @@ -2982,10 +2972,9 @@ sys_flock(struct thread *td, struct flock_args >>> >> *uap) >>> >> struct file *fp; >>> >> struct vnode *vp; >>> >> struct flock lf; >>> >> - cap_rights_t rights; >>> >> int error; >>> >> >>> >> - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FLOCK), >>> >> &fp); >>> >> + error = fget(td, uap->fd, &cap_flock_rights, &fp); >>> >> if (error != 0) >>> >> return (error); >>> >> if (fp->f_type != DTYPE_VNODE) { >>> >> @@ -3633,7 +3622,7 @@ kern_proc_filedesc_out(struct proc *p, struct >>> >> sbuf >>> >> *s >>> >> #ifdef CAPABILITIES >>> >> rights = *cap_rights(fdp, i); >>> >> #else /* !CAPABILITIES */ >>> >> - cap_rights_init(&rights); >>> >> + rights = cap_no_rights; >>> >> #endif >>> >> /* >>> >> * Create sysctl entry. It is OK to drop the filedesc >>> >> >>> >> Modified: head/sys/kern/kern_event.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/kern/kern_event.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/kern/kern_event.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -1286,7 +1286,6 @@ kqueue_register(struct kqueue *kq, struct kevent >>> >> *kev, >>> >> struct file *fp; >>> >> struct knote *kn, *tkn; >>> >> struct knlist *knl; >>> >> - cap_rights_t rights; >>> >> int error, filt, event; >>> >> int haskqglobal, filedesc_unlock; >>> >> >>> >> @@ -1322,8 +1321,7 @@ findkn: >>> >> if (kev->ident > INT_MAX) >>> >> error = EBADF; >>> >> else >>> >> - error = fget(td, kev->ident, >>> >> - cap_rights_init(&rights, CAP_EVENT), &fp); >>> >> + error = fget(td, kev->ident, &cap_event_rights, >>> >> &fp); >>> >> if (error) >>> >> goto done; >>> >> >>> >> >>> >> Modified: head/sys/kern/kern_exec.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/kern/kern_exec.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/kern/kern_exec.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -374,7 +374,6 @@ do_execve(struct thread *td, struct image_args >>> >> *args, >>> >> struct ucred *tracecred = NULL; >>> >> #endif >>> >> struct vnode *oldtextvp = NULL, *newtextvp; >>> >> - cap_rights_t rights; >>> >> int credential_changing; >>> >> int textset; >>> >> #ifdef MAC >>> >> @@ -455,8 +454,7 @@ interpret: >>> >> /* >>> >> * Descriptors opened only with O_EXEC or O_RDONLY are >>> >> allowed. >>> >> */ >>> >> - error = fgetvp_exec(td, args->fd, >>> >> - cap_rights_init(&rights, CAP_FEXECVE), &newtextvp); >>> >> + error = fgetvp_exec(td, args->fd, &cap_fexecve_rights, >>> >> &newtextvp); >>> >> if (error) >>> >> goto exec_fail; >>> >> vn_lock(newtextvp, LK_EXCLUSIVE | LK_RETRY); >>> >> >>> >> Modified: head/sys/kern/kern_sendfile.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/kern/kern_sendfile.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/kern/kern_sendfile.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -511,7 +511,6 @@ static int >>> >> sendfile_getsock(struct thread *td, int s, struct file **sock_fp, >>> >> struct socket **so) >>> >> { >>> >> - cap_rights_t rights; >>> >> int error; >>> >> >>> >> *sock_fp = NULL; >>> >> @@ -520,7 +519,7 @@ sendfile_getsock(struct thread *td, int s, struct >>> >> file >>> >> /* >>> >> * The socket must be a stream socket and connected. >>> >> */ >>> >> - error = getsock_cap(td, s, cap_rights_init(&rights, CAP_SEND), >>> >> + error = getsock_cap(td, s, &cap_send_rights, >>> >> sock_fp, NULL, NULL); >>> >> if (error != 0) >>> >> return (error); >>> >> @@ -949,7 +948,6 @@ sendfile(struct thread *td, struct sendfile_args >>> >> *uap, >>> >> struct sf_hdtr hdtr; >>> >> struct uio *hdr_uio, *trl_uio; >>> >> struct file *fp; >>> >> - cap_rights_t rights; >>> >> off_t sbytes; >>> >> int error; >>> >> >>> >> @@ -1000,10 +998,8 @@ sendfile(struct thread *td, struct sendfile_args >>> >> *uap, >>> >> * sendfile(2) can start at any offset within a file so we >>> >> require >>> >> * CAP_READ+CAP_SEEK = CAP_PREAD. >>> >> */ >>> >> - if ((error = fget_read(td, uap->fd, >>> >> - cap_rights_init(&rights, CAP_PREAD), &fp)) != 0) { >>> >> + if ((error = fget_read(td, uap->fd, &cap_pread_rights, &fp)) != >>> >> 0) >>> >> goto out; >>> >> - } >>> >> >>> >> error = fo_sendfile(fp, uap->s, hdr_uio, trl_uio, uap->offset, >>> >> uap->nbytes, &sbytes, uap->flags, td); >>> >> >>> >> Modified: head/sys/kern/kern_sig.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/kern/kern_sig.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/kern/kern_sig.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -1789,7 +1789,6 @@ int >>> >> sys_pdkill(struct thread *td, struct pdkill_args *uap) >>> >> { >>> >> struct proc *p; >>> >> - cap_rights_t rights; >>> >> int error; >>> >> >>> >> AUDIT_ARG_SIGNUM(uap->signum); >>> >> @@ -1797,8 +1796,7 @@ sys_pdkill(struct thread *td, struct pdkill_args >>> >> *uap) >>> >> if ((u_int)uap->signum > _SIG_MAXSIG) >>> >> return (EINVAL); >>> >> >>> >> - error = procdesc_find(td, uap->fd, >>> >> - cap_rights_init(&rights, CAP_PDKILL), &p); >>> >> + error = procdesc_find(td, uap->fd, &cap_pdkill_rights, &p); >>> >> if (error) >>> >> return (error); >>> >> AUDIT_ARG_PROCESS(p); >>> >> >>> >> Modified: head/sys/kern/subr_capability.c >>> >> >>> >> >>> >> ============================================================================== >>> >> --- head/sys/kern/subr_capability.c Wed May 9 18:41:04 2018 >>> >> (r333424) >>> >> +++ head/sys/kern/subr_capability.c Wed May 9 18:47:24 2018 >>> >> (r333425) >>> >> @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); >>> >> >>> >> #ifdef _KERNEL >>> >> #include >>> >> - >>> >> +#include >>> >> #include >>> >> #else /* !_KERNEL */ >>> >> #include >>> >> @@ -53,6 +53,38 @@ __FBSDID("$FreeBSD$"); >>> >> >>> >> #ifdef _KERNEL >>> >> #define assert(exp) KASSERT((exp), ("%s:%u", __func__, >>> >> __LINE__)) >>> >> + >>> >> +CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT); >>> >> +CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND); >>> >> +CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT); >>> >> +CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT); >>> >> +CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR); >>> >> +CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL); >>> >> +CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE); >>> >> +CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK); >>> >> +CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF); >>> >> +CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT); >>> >> +CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC); >>> >> +CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE); >>> >> +CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME); >>> >> +CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME); >>> >> +CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT); >>> >> +CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL); >>> >> +CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN); >>> >> +CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP); >>> >> +CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID); >>> >> +CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL); >>> >> +CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD); >>> >> +CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE); >>> >> +CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ); >>> >> +CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV); >>> >> +CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND); >>> >> +CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT); >>> >> +CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN); >>> >> +CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE); >>> >> + >>> >> +__read_mostly cap_rights_t cap_no_rights; >>> >> +CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights); >>> >> #endif >>> >> >>> >> #define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2) >>> >> >>> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>> >> >>> > >>> >> >> >> >> -- >> Mateusz Guzik From owner-svn-src-all@freebsd.org Sat May 19 09:33:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E329EF4860; Sat, 19 May 2018 09:33:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84608874A9; Sat, 19 May 2018 09:33:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w4J9XjlM065857 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 19 May 2018 12:33:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w4J9XjlM065857 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w4J9XjuM065856; Sat, 19 May 2018 12:33:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 May 2018 12:33:45 +0300 From: Konstantin Belousov To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333840 - head/sys/kern Message-ID: <20180519093345.GH6887@kib.kiev.ua> References: <201805190407.w4J470xC021897@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201805190407.w4J470xC021897@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 09:33:56 -0000 On Sat, May 19, 2018 at 04:07:00AM +0000, Matt Macy wrote: > Author: mmacy > Date: Sat May 19 04:07:00 2018 > New Revision: 333840 > URL: https://svnweb.freebsd.org/changeset/base/333840 > > Log: > filt_timerdetach: only assign to old if we're going to check it in > a KASSERT You also removed the decrement from non-debug builds. > > Modified: > head/sys/kern/kern_event.c > > Modified: head/sys/kern/kern_event.c > ============================================================================== > --- head/sys/kern/kern_event.c Sat May 19 04:05:36 2018 (r333839) > +++ head/sys/kern/kern_event.c Sat May 19 04:07:00 2018 (r333840) > @@ -751,12 +751,14 @@ static void > filt_timerdetach(struct knote *kn) > { > struct kq_timer_cb_data *kc; > +#ifdef INVARIANTS > unsigned int old; > +#endif > > kc = kn->kn_ptr.p_v; > callout_drain(&kc->c); > free(kc, M_KQUEUE); > - old = atomic_fetchadd_int(&kq_ncallouts, -1); > + DBGSET(old, atomic_fetchadd_int(&kq_ncallouts, -1)); > KASSERT(old > 0, ("Number of callouts cannot become negative")); > kn->kn_status |= KN_DETACHED; /* knlist_remove sets it */ > } From owner-svn-src-all@freebsd.org Sat May 19 10:23:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06F0EF56AD; Sat, 19 May 2018 10:23:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CC946879A; Sat, 19 May 2018 10:23:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 269E4260112; Sat, 19 May 2018 12:22:59 +0200 (CEST) Subject: Re: svn commit: r333844 - head/sys/kern To: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201805190413.w4J4DLag027044@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <1c2b35bf-4dbb-6aec-fdde-43f91edc8b69@selasky.org> Date: Sat, 19 May 2018 12:22:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201805190413.w4J4DLag027044@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 10:23:05 -0000 On 05/19/18 06:13, Matt Macy wrote: > va_start(ap, fmt); > - res = make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap); > + DBGSET(res, make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap)); Is the make_dev_credv() called stubbed for non-debug builds? --HPS From owner-svn-src-all@freebsd.org Sat May 19 10:24:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC03EF5755 for ; Sat, 19 May 2018 10:24:26 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x234.google.com (mail-yb0-x234.google.com [IPv6:2607:f8b0:4002:c09::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 EF1A068900 for ; Sat, 19 May 2018 10:24:25 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x234.google.com with SMTP id l2-v6so2292944ybp.8 for ; Sat, 19 May 2018 03:24:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LG4Id8XuhBEeFbcCNma3eK6FITIfitLbE45NJFPCPoM=; b=kVbs5Foy5x1JtjXIJDDDSLzckQETc5Tn3P58/PeX62v/mVmb48qHf9izAJFlISS65+ FcEXfjF+vDGDhH0yP/nEQvtcxRG1bsxHL9TeRJmBzoDCMfEn0pHIENgWbb6fdcSvcPr4 ajGHkF0VZZgPXjm6vQBumICIjwwFGIRhDE7QU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LG4Id8XuhBEeFbcCNma3eK6FITIfitLbE45NJFPCPoM=; b=FLXvaxnsabL8gBTeqh2uYriWmOyALxKLFao5D/B/YtQC3SQIxX9kThTlSBEuPLpjTn X+qgekmNg40tBgABVUa2CtNmLgas3n96sow4DmOrLdkoMtytdNuLYVrhWaL4ZjB/cA9n oTyrEzVS9BVOsKP9LPT96/9YwcxrAh7fNQ98igUtlhuesQXSrvA3RzAtHsxa/KcdjNDX 3vF7omo0q2geyhyGhM88bDy9bm3VrT+4WS3DHQZWTccLZ5/uFo+epm+9IdqErDpYI+yn 5kwFUT1EpdepSNKF7uhTj3jpA7+pMNg75L96WS4dIOw9m4Xmqk2CUf7UrR9gC47oe/Ml ygZw== X-Gm-Message-State: ALKqPwct2gqi4/Cs8M4sLakl0MOJ45V9szCFsY0KTqIYHMdQSIMmTjhj pLZtfM7kq2uG0Rhb53GHCK+UI+cBq93YCNjdzhAlTg== X-Google-Smtp-Source: AB8JxZr5AkLrR78SbH4lCum/b4xSZK5Pnf+RTLVnIMvW7c2X6o/4VfTslOA9cwn//Lt04pcOK/zoGW/XHn7blcal+0M= X-Received: by 2002:a25:bfc4:: with SMTP id q4-v6mr93326ybm.460.1526725465149; Sat, 19 May 2018 03:24:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:c709:0:0:0:0:0 with HTTP; Sat, 19 May 2018 03:23:54 -0700 (PDT) In-Reply-To: <201805190631.w4J6VHhr094225@repo.freebsd.org> References: <201805190631.w4J6VHhr094225@repo.freebsd.org> From: Eitan Adler Date: Sat, 19 May 2018 03:23:54 -0700 Message-ID: Subject: Re: svn commit: r333872 - head/cddl/contrib/opensolaris/tools/ctf/cvt To: Matt Macy Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 10:24:26 -0000 On 18 May 2018 at 23:31, Matt Macy wrote: > Author: mmacy > Date: Sat May 19 06:31:17 2018 > New Revision: 333872 > URL: https://svnweb.freebsd.org/changeset/base/333872 > > Log: > ctfconvert: silence useless enum has too many values warning Thank you! -- Eitan Adler From owner-svn-src-all@freebsd.org Sat May 19 10:42:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC0D2EF5EE7; Sat, 19 May 2018 10:42:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 229D76939F; Sat, 19 May 2018 10:42:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w4JAgaNO081348 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 19 May 2018 13:42:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w4JAgaNO081348 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w4JAga1u081347; Sat, 19 May 2018 13:42:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 May 2018 13:42:36 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333844 - head/sys/kern Message-ID: <20180519104236.GI6887@kib.kiev.ua> References: <201805190413.w4J4DLag027044@repo.freebsd.org> <1c2b35bf-4dbb-6aec-fdde-43f91edc8b69@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c2b35bf-4dbb-6aec-fdde-43f91edc8b69@selasky.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 10:42:47 -0000 On Sat, May 19, 2018 at 12:22:48PM +0200, Hans Petter Selasky wrote: > On 05/19/18 06:13, Matt Macy wrote: > > va_start(ap, fmt); > > - res = make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap); > > + DBGSET(res, make_dev_credv(0, &dev, devsw, unit, cr, uid, gid, mode, fmt, ap)); > > Is the make_dev_credv() called stubbed for non-debug builds? Apparently not. And my note about timer filter was also wrong. But this is indeed very unusual and error-prone macro, which seems to be removed in r333862. From owner-svn-src-all@freebsd.org Sat May 19 10:49:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A33D1EA906A; Sat, 19 May 2018 10:49:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 427BE69578; Sat, 19 May 2018 10:49:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1E14F25FD3; Sat, 19 May 2018 10:49:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JAnpUe026378; Sat, 19 May 2018 10:49:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JAnpKx026377; Sat, 19 May 2018 10:49:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805191049.w4JAnpKx026377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 19 May 2018 10:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333875 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 333875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 10:49:52 -0000 Author: trasz Date: Sat May 19 10:49:51 2018 New Revision: 333875 URL: https://svnweb.freebsd.org/changeset/base/333875 Log: Permit "(", ")", ":", and "/" in USB string descriptors. This way we can properly show descriptors with URLs in them. Reviewed by: hselasky@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Sat May 19 07:31:35 2018 (r333874) +++ head/sys/dev/usb/usb_request.c Sat May 19 10:49:51 2018 (r333875) @@ -1155,7 +1155,11 @@ usbd_req_get_string_any(struct usb_device *udev, struc *s == '+' || *s == ' ' || *s == '.' || - *s == ',') { + *s == ',' || + *s == ':' || + *s == '/' || + *s == '(' || + *s == ')') { /* allowed */ s++; } From owner-svn-src-all@freebsd.org Sat May 19 11:27:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D48EAA614; Sat, 19 May 2018 11:27:25 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::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 BA21F6BD9F; Sat, 19 May 2018 11:27:24 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x243.google.com with SMTP id e20-v6so9252045iof.4; Sat, 19 May 2018 04:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4E49AlHL6p+r2JRrTQBdPc84pepmSs1PJUKvNNsHFXw=; b=snPXJ58D/yoOvebloJVN50DhflmWS/g8qm7mhc1SRE8pWvuO4qpyEMOuyTYgG+HEaN fV2n7S1BRmsP+6Hq3VX3kAR2Gab7VVL6YXjLe6yRZ/E0Q5A/tMQrC6DLcpL/Fkqrk/1n ppL76U4hXHWQzO/wQ7/Buz9vkRiCF6kFYYfsve01rotg3i8qym+mIQsR9cY0bOVQtt/j PTv1R/+LjamCXMYJlSseqYugV8xFRVowaYArtt6RGG6FbMyeO7HT+RlfI5IWDd+E8p/r kxDuYlJMan8F3NOkXtUj31OaUp2kBa5expF+mx2O/rCFHIeYTg9VxoAjKdkLtfrQSc1S 4SqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4E49AlHL6p+r2JRrTQBdPc84pepmSs1PJUKvNNsHFXw=; b=choIG9CDNPMnXULWS9YQFdVURkZRkEcVyN55VGQZ1We74Z5LaiKL2ykZRd/smsmZsk qL0lmzd9glCU98geTMaMBB/ZRADO8ep2TV/tApNi3cZdVE18CWZ3OmeDuS0YmIqsq4cC 7hwmF6XRWAYTVAKfeyW86x7Y3a7CxslYK1V24QAzxkCnLG44NgFhP1vfGPgYwIGN8Cml +qpU4H/YC2nnpnwJT7Vg8yHFDKz2pQX9ehMTC4G76h6J+OqrWsodYHXs0HiXGHKE08Ca k2OecUvgUOy8rHAU3TR+AT3nrH5xQSMtvi7f/nLWdujPt0m3Ko6y0zb+UEcpiI71eq5L kOZw== X-Gm-Message-State: ALKqPwcaG6kIdsPwaDdK//29G8aTduZQRjq78wCYTG1UNf40BLqwp9ON UOCiRxXuYfGAU5ZvUxHoTpdPtprfJlP2QJ5i9FNbrQ== X-Google-Smtp-Source: AB8JxZqNFH8cU0gtYuS8dStsFFbCuTLZ2wHsOficfYOPZLMXYvliJXLsW3Ld4+Qg8RxqpiiUufg26Pr0IK+F/+1jzhA= X-Received: by 2002:a6b:1c84:: with SMTP id c126-v6mr13845843ioc.210.1526729244112; Sat, 19 May 2018 04:27:24 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.167 with HTTP; Sat, 19 May 2018 04:27:03 -0700 (PDT) In-Reply-To: <201805190004.w4J0419B099140@repo.freebsd.org> References: <201805190004.w4J0419B099140@repo.freebsd.org> From: Ed Maste Date: Sat, 19 May 2018 07:27:03 -0400 X-Google-Sender-Auth: -bdBeJwbfAFXdGVC9rEaN_8OI-k Message-ID: Subject: Re: svn commit: r333819 - in head/sys: conf modules/blake2 modules/crypto modules/drm2/i915kms modules/ipfilter To: Matt Macy Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 11:27:25 -0000 On 18 May 2018 at 20:04, Matt Macy wrote: > Author: mmacy > Date: Sat May 19 00:04:01 2018 > New Revision: 333819 > URL: https://svnweb.freebsd.org/changeset/base/333819 > > Log: > Silence non-actionable warnings in vendor code ... > Modified: head/sys/conf/kern.mk > ============================================================================== > --- head/sys/conf/kern.mk Fri May 18 23:42:08 2018 (r333818) > +++ head/sys/conf/kern.mk Sat May 19 00:04:01 2018 (r333819) > @@ -18,12 +18,13 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs > # a false positive. > .if ${COMPILER_TYPE} == "clang" > NO_WCONSTANT_CONVERSION= -Wno-error-constant-conversion > -NO_WSHIFT_COUNT_NEGATIVE= -Wno-error-shift-count-negative > -NO_WSHIFT_COUNT_OVERFLOW= -Wno-error-shift-count-overflow > -NO_WSELF_ASSIGN= -Wno-error-self-assign > +NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative > +NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow > +NO_WSELF_ASSIGN= -Wno-self-assign This silences the warning across the tree, not just vendor code. From owner-svn-src-all@freebsd.org Sat May 19 11:37:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DEC0EAA997; Sat, 19 May 2018 11:37:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE92D6C276; Sat, 19 May 2018 11:37:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDFA1267EC; Sat, 19 May 2018 11:37:02 +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 w4JBb21u054833; Sat, 19 May 2018 11:37:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JBb2hP054832; Sat, 19 May 2018 11:37:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805191137.w4JBb2hP054832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 19 May 2018 11:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333876 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 11:37:03 -0000 Author: emaste Date: Sat May 19 11:37:02 2018 New Revision: 333876 URL: https://svnweb.freebsd.org/changeset/base/333876 Log: Remove duplicate cap_no_rights from r333874 Archs using in-tree gcc were broken with `warning: redundant redeclaration of 'cap_no_rights' [-Wredundant-decls]`. Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_capability.c Modified: head/sys/kern/subr_capability.c ============================================================================== --- head/sys/kern/subr_capability.c Sat May 19 10:49:51 2018 (r333875) +++ head/sys/kern/subr_capability.c Sat May 19 11:37:02 2018 (r333876) @@ -70,7 +70,6 @@ __read_mostly cap_rights_t cap_getsockname_rights; __read_mostly cap_rights_t cap_ioctl_rights; __read_mostly cap_rights_t cap_listen_rights; __read_mostly cap_rights_t cap_mmap_rights; -__read_mostly cap_rights_t cap_no_rights; __read_mostly cap_rights_t cap_fsync_rights; __read_mostly cap_rights_t cap_pdgetpid_rights; __read_mostly cap_rights_t cap_pdkill_rights; From owner-svn-src-all@freebsd.org Sat May 19 11:49:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22CC5EAAEF1; Sat, 19 May 2018 11:49:45 +0000 (UTC) (envelope-from carpeddiem@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 937F26C9A6; Sat, 19 May 2018 11:49:44 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x232.google.com with SMTP id e12-v6so9285642iob.8; Sat, 19 May 2018 04:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=F9K9nj/KjasSVccIaE7IsHsksGH6vwCiyvImJB9vn5M=; b=Faxps8lV1gJ0byoiBn7f0ogo3bYuhETS/em2Vuw7LdYkNeADXT+cEchumappjkD6Ev ibA4leIQ18HlQT90tObgb7LZ2hYvq11tUIchMMblezb8h9Gl/ZJ3h87D1qretv3v0Kz0 imY50HG+Kn6md87+ogrX/I0ArWWXzADmFyzmWtRAlWWlM4hQ8L6zOScK017A3HPTd0O4 OCgQpno8KsUr6qmKdiUHQxz8ip9dmAa64WsZlOBJmvzKkI0NvsQOArecio8eA0lgSLy0 6IMyo+CR9q694OmSZgO8dwbRO9ZMK8LHTDHQx+6Y5pi90GD1MjfS0SdjxdThOnY8aZLZ 3OgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=F9K9nj/KjasSVccIaE7IsHsksGH6vwCiyvImJB9vn5M=; b=RqcQc4i0XvlG1qY+3tofvVDAv0EyptUVE6BAi5gkHi6VkOFWcI10h0AOD73cVF7DjA I9ef12wnRVODeBRUY3APvRwDSjSN5gofIu4ybdhIiRXOsmD0k6jQSxd27eE0ckZBjuqf g9yHKy6TsRVEsywTFZLh/7i3CZ2fgTcY+5iKvGwfkpydvoC3zIR5odflIsAZgPl5QR5B 9BhDCyB4WuPYqGlBU47NTLVnsGss7Bj0zOVgmMNO0Bdc74FaAcMfU3e3yl5bSWcES4Kj 9klXtKe6qsTp0k1e7GGcYWkVJYXnK2yLXveRoDJ1wgakRlS9wXQk8aifmX3fisr/COUl kwVw== X-Gm-Message-State: ALKqPwdZqUyJIuUCkefi/RHLF7ONCObS7mUDXLttGF9qyNP4049wiACb CQo+Mz8+Q3mh+xXZOEVYQKrOSyium8AbTJOnQM6IgtYz X-Google-Smtp-Source: AB8JxZqGrByUi6hNdL2hUa2+2fQEC30DIziLIubq6PMisqTs+DfcrKVl8pbLnRithj4lsIGs46Z74APQVdhD2rsZrcM= X-Received: by 2002:a6b:2fe8:: with SMTP id v101-v6mr14984130iov.239.1526730583923; Sat, 19 May 2018 04:49:43 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.130.167 with HTTP; Sat, 19 May 2018 04:49:23 -0700 (PDT) In-Reply-To: <201805190631.w4J6VHhr094225@repo.freebsd.org> References: <201805190631.w4J6VHhr094225@repo.freebsd.org> From: Ed Maste Date: Sat, 19 May 2018 07:49:23 -0400 X-Google-Sender-Auth: SGNhZx3Lg6kD59OJqIOzLEWyKFM Message-ID: Subject: Re: svn commit: r333872 - head/cddl/contrib/opensolaris/tools/ctf/cvt To: Matt Macy Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 11:49:45 -0000 On 19 May 2018 at 02:31, Matt Macy wrote: > Author: mmacy > Date: Sat May 19 06:31:17 2018 > New Revision: 333872 > URL: https://svnweb.freebsd.org/changeset/base/333872 > > Log: > ctfconvert: silence useless enum has too many values warning I agree it's reasonable to silence this warning as it is not actionable for almost everyone who encounters it. It does indicate a real problem in our tool chain though and I added an entry to https://wiki.freebsd.org/DTraceTODO. From owner-svn-src-all@freebsd.org Sat May 19 12:30:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66C3EAC6EE; Sat, 19 May 2018 12:30:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 754E76DC3C; Sat, 19 May 2018 12:30:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com [209.85.223.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 3265923944; Sat, 19 May 2018 12:30:19 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f174.google.com with SMTP id e78-v6so9356613iod.0; Sat, 19 May 2018 05:30:19 -0700 (PDT) X-Gm-Message-State: ALKqPwcr6Js8764jKEoIy8LKzBxGSkCZR25OqXgGVnWSkEhEsags/ixd q+CBo7PiKbi/nhDKL818vjmgavL8qdvfJaUUI90= X-Google-Smtp-Source: AB8JxZp7+nmogJqoUPmCyYBMEIokT4SHaDErDtY0lg2kAS828sWb1bZHbokSvkLZloGPmhY7vssTrdXFnfKqLtdalyY= X-Received: by 2002:a6b:a712:: with SMTP id q18-v6mr14054239ioe.237.1526733018446; Sat, 19 May 2018 05:30:18 -0700 (PDT) MIME-Version: 1.0 References: <201805190004.w4J0419B099140@repo.freebsd.org> In-Reply-To: From: Matthew Macy Date: Sat, 19 May 2018 05:30:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333819 - in head/sys: conf modules/blake2 modules/crypto modules/drm2/i915kms modules/ipfilter To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 12:30:20 -0000 Oops I=E2=80=99ll add a separate define for that On Sat, May 19, 2018 at 04:27 Ed Maste wrote: > On 18 May 2018 at 20:04, Matt Macy wrote: > > Author: mmacy > > Date: Sat May 19 00:04:01 2018 > > New Revision: 333819 > > URL: https://svnweb.freebsd.org/changeset/base/333819 > > > > Log: > > Silence non-actionable warnings in vendor code > ... > > Modified: head/sys/conf/kern.mk > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/kern.mk Fri May 18 23:42:08 2018 > (r333818) > > +++ head/sys/conf/kern.mk Sat May 19 00:04:01 2018 > (r333819) > > @@ -18,12 +18,13 @@ CWARNFLAGS?=3D -Wall -Wredundant-decls > -Wnested-externs > > # a false positive. > > .if ${COMPILER_TYPE} =3D=3D "clang" > > NO_WCONSTANT_CONVERSION=3D -Wno-error-constant-conversion > > -NO_WSHIFT_COUNT_NEGATIVE=3D -Wno-error-shift-count-negative > > -NO_WSHIFT_COUNT_OVERFLOW=3D -Wno-error-shift-count-overflow > > -NO_WSELF_ASSIGN=3D -Wno-error-self-assign > > +NO_WSHIFT_COUNT_NEGATIVE=3D -Wno-shift-count-negative > > +NO_WSHIFT_COUNT_OVERFLOW=3D -Wno-shift-count-overflow > > +NO_WSELF_ASSIGN=3D -Wno-self-assign > > This silences the warning across the tree, not just vendor code. > From owner-svn-src-all@freebsd.org Sat May 19 13:35:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B95CEAE010; Sat, 19 May 2018 13:35:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B077D6FA2F; Sat, 19 May 2018 13:35:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JDZs5F015980; Sat, 19 May 2018 06:35:54 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JDZq9b015979; Sat, 19 May 2018 06:35:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333822 - head/sys/kern In-Reply-To: <201805190215.w4J2FeB9064558@repo.freebsd.org> To: Matt Macy Date: Sat, 19 May 2018 06:35:52 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 13:35:59 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mmacy > Date: Sat May 19 02:15:40 2018 > New Revision: 333822 > URL: https://svnweb.freebsd.org/changeset/base/333822 > > Log: > fix gcc8 unused variable and set but not used variable in unix sockets > add copyright from lock rewrite while here > > Modified: > head/sys/kern/uipc_usrreq.c > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 (r333821) > +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 (r333822) > @@ -4,7 +4,7 @@ > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > * The Regents of the University of California. > * Copyright (c) 2004-2009 Robert N. M. Watson > - * All rights reserved. Did you have permission from Robert Watson to remove this? > + * Copyright (c) 2018 Matthew Macy > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 14:17:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BE2BEAF180; Sat, 19 May 2018 14:17:53 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5733C70F0D; Sat, 19 May 2018 14:17:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id b099a416; Sat, 19 May 2018 16:17:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=Ckf4Bo XeoFHKP2PtvCoNmjsKskk=; b=JZlHzCHD5/DeysiNJvwz+TEvvFXUGoij9Qi/6R eZgX9Gb5zskH+D+MuxjYbEb2zcQGpMY+ZrVDBfBJhDbT8Vtm0KJVdbwwXK+3fCMC oOPNnadkSjNAgaY23Q59bjMR5HHix6BkYNUV2we8mgv6wDeqv/+6T9kS3yxQ5t3P SNd00= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= ZUC+IjjgUGKrh3gG/lyLOzJr9F4s50tLZX+E07BJVwY4WfRCaeN5RwJTXz3I65pZ ECfhWiJdGzyPYtF71PEtC0uyhcZZlmdFJqyD1+EKjNUE4slaoYX/JAnXJPI5ikdO gpMbhkqFgRyJdUTXuohC9y9VYnop2FdNw+f9gGY5iLE= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id c1d6adab; Sat, 19 May 2018 16:17:44 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 19 May 2018 16:17:44 +0200 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: Matt Macy , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r333822 - head/sys/kern Organization: Bidouilliste In-Reply-To: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> References: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> Message-ID: <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 14:17:53 -0000 On 2018-05-19 15:35, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: mmacy >> Date: Sat May 19 02:15:40 2018 >> New Revision: 333822 >> URL: https://svnweb.freebsd.org/changeset/base/333822 >> >> Log: >> fix gcc8 unused variable and set but not used variable in unix >> sockets >> add copyright from lock rewrite while here >> >> Modified: >> head/sys/kern/uipc_usrreq.c >> >> Modified: head/sys/kern/uipc_usrreq.c >> ============================================================================== >> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 (r333821) >> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 (r333822) >> @@ -4,7 +4,7 @@ >> * Copyright (c) 1982, 1986, 1989, 1991, 1993 >> * The Regents of the University of California. >> * Copyright (c) 2004-2009 Robert N. M. Watson >> - * All rights reserved. > > Did you have permission from Robert Watson to remove this? > >> + * Copyright (c) 2018 Matthew Macy >> * >> * Redistribution and use in source and binary forms, with or without >> * modification, are permitted provided that the following conditions > ... That also seems a small patch to add your name in the copyright. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat May 19 15:11:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A274EB06E4; Sat, 19 May 2018 15:11:27 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F25B572919; Sat, 19 May 2018 15:11:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D37C7B85; Sat, 19 May 2018 15:11:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JFBQi9064327; Sat, 19 May 2018 15:11:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JFBOJ2064314; Sat, 19 May 2018 15:11:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805191511.w4JFBOJ2064314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 19 May 2018 15:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333877 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 333877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 15:11:27 -0000 Author: trasz Date: Sat May 19 15:11:24 2018 New Revision: 333877 URL: https://svnweb.freebsd.org/changeset/base/333877 Log: Add #defines for vendor/product USB IDs. No functional changes. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_midi.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/template/usb_template_multi.c head/sys/dev/usb/template/usb_template_phone.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_audio.c Sat May 19 15:11:24 2018 (r333877) @@ -78,6 +78,8 @@ enum { AUDIO_MAX_INDEX, }; +#define AUDIO_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define AUDIO_DEFAULT_PRODUCT_ID 0x000A #define AUDIO_DEFAULT_MIXER "Mixer interface" #define AUDIO_DEFAULT_RECORD "Record interface" #define AUDIO_DEFAULT_PLAYBACK "Playback interface" @@ -364,8 +366,8 @@ static usb_temp_get_string_desc_t audio_get_string_des struct usb_temp_device_desc usb_template_audio = { .getStringDesc = &audio_get_string_desc, .ppConfigDesc = audio_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x000A, + .idVendor = AUDIO_DEFAULT_VENDOR_ID, + .idProduct = AUDIO_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_cdce.c Sat May 19 15:11:24 2018 (r333877) @@ -79,6 +79,8 @@ enum { ETH_MAX_INDEX, }; +#define ETH_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define ETH_DEFAULT_PRODUCT_ID 0x0001 #define ETH_DEFAULT_MAC "2A02030405060789AB" #define ETH_DEFAULT_CONTROL "USB Ethernet Comm Interface" #define ETH_DEFAULT_DATA "USB Ethernet Data Interface" @@ -230,8 +232,8 @@ static const struct usb_temp_config_desc *eth_configs[ struct usb_temp_device_desc usb_template_cdce = { .getStringDesc = ð_get_string_desc, .ppConfigDesc = eth_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x0001, + .idVendor = ETH_DEFAULT_VENDOR_ID, + .idProduct = ETH_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_kbd.c Sat May 19 15:11:24 2018 (r333877) @@ -76,6 +76,8 @@ enum { KBD_MAX_INDEX, }; +#define KBD_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define KBD_DEFAULT_PRODUCT_ID 0x00CB #define KBD_DEFAULT_INTERFACE "Keyboard Interface" #define KBD_DEFAULT_MANUFACTURER "FreeBSD foundation" #define KBD_DEFAULT_PRODUCT "Keyboard Test Device" @@ -172,8 +174,8 @@ struct usb_temp_device_desc usb_template_kbd = { .getStringDesc = &keyboard_get_string_desc, .getVendorDesc = &keyboard_get_vendor_desc, .ppConfigDesc = keyboard_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x00CB, + .idVendor = KBD_DEFAULT_VENDOR_ID, + .idProduct = KBD_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_midi.c Sat May 19 15:11:24 2018 (r333877) @@ -75,6 +75,8 @@ enum { MIDI_MAX_INDEX, }; +#define MIDI_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define MIDI_DEFAULT_PRODUCT_ID 0x00BB #define MIDI_DEFAULT_INTERFACE "MIDI interface" #define MIDI_DEFAULT_MANUFACTURER "FreeBSD foundation" #define MIDI_DEFAULT_PRODUCT "MIDI Test Device" @@ -212,8 +214,8 @@ static usb_temp_get_string_desc_t midi_get_string_desc struct usb_temp_device_desc usb_template_midi = { .getStringDesc = &midi_get_string_desc, .ppConfigDesc = midi_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x00BB, + .idVendor = MIDI_DEFAULT_VENDOR_ID, + .idProduct = MIDI_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = 0, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_modem.c Sat May 19 15:11:24 2018 (r333877) @@ -76,6 +76,8 @@ enum { MODEM_MAX_INDEX, }; +#define MODEM_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define MODEM_DEFAULT_PRODUCT_ID 0x000E #define MODEM_DEFAULT_INTERFACE "Modem interface" #define MODEM_DEFAULT_MANUFACTURER "FreeBSD foundation" #define MODEM_DEFAULT_PRODUCT "Modem Test Device" @@ -207,8 +209,8 @@ struct usb_temp_device_desc usb_template_modem = { .getStringDesc = &modem_get_string_desc, .getVendorDesc = &modem_get_vendor_desc, .ppConfigDesc = modem_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x000E, + .idVendor = MODEM_DEFAULT_VENDOR_ID, + .idProduct = MODEM_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_mouse.c Sat May 19 15:11:24 2018 (r333877) @@ -76,6 +76,8 @@ enum { MOUSE_MAX_INDEX, }; +#define MOUSE_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define MOUSE_DEFAULT_PRODUCT_ID 0x00AE #define MOUSE_DEFAULT_INTERFACE "Mouse interface" #define MOUSE_DEFAULT_MANUFACTURER "FreeBSD foundation" #define MOUSE_DEFAULT_PRODUCT "Mouse Test Interface" @@ -170,8 +172,8 @@ struct usb_temp_device_desc usb_template_mouse = { .getStringDesc = &mouse_get_string_desc, .getVendorDesc = &mouse_get_vendor_desc, .ppConfigDesc = mouse_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x00AE, + .idVendor = MOUSE_DEFAULT_VENDOR_ID, + .idProduct = MOUSE_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_msc.c Sat May 19 15:11:24 2018 (r333877) @@ -76,6 +76,8 @@ enum { MSC_MAX_INDEX, }; +#define MSC_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define MSC_DEFAULT_PRODUCT_ID 0x0012 #define MSC_DEFAULT_INTERFACE "USB Mass Storage Interface" #define MSC_DEFAULT_CONFIGURATION "Default Config" #define MSC_DEFAULT_MANUFACTURER "FreeBSD foundation" @@ -153,8 +155,8 @@ static const struct usb_temp_config_desc *msc_configs[ struct usb_temp_device_desc usb_template_msc = { .getStringDesc = &msc_get_string_desc, .ppConfigDesc = msc_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x0012, + .idVendor = MSC_DEFAULT_VENDOR_ID, + .idProduct = MSC_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_mtp.c Sat May 19 15:11:24 2018 (r333877) @@ -85,6 +85,8 @@ enum { MTP_MAX_INDEX, }; +#define MTP_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define MTP_DEFAULT_PRODUCT_ID 0x0011 #define MTP_DEFAULT_INTERFACE "USB MTP Interface" #define MTP_DEFAULT_CONFIGURATION "Default Config" #define MTP_DEFAULT_MANUFACTURER "FreeBSD foundation" @@ -176,8 +178,8 @@ struct usb_temp_device_desc usb_template_mtp = { .getStringDesc = &mtp_get_string_desc, .getVendorDesc = &mtp_get_vendor_desc, .ppConfigDesc = mtp_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x0011, + .idVendor = MTP_DEFAULT_VENDOR_ID, + .idProduct = MTP_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = 0, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_multi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_multi.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_multi.c Sat May 19 15:11:24 2018 (r333877) @@ -89,6 +89,8 @@ enum { MULTI_MAX_INDEX, }; +#define MULTI_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define MULTI_DEFAULT_PRODUCT_ID 0x0001 #define MULTI_DEFAULT_MODEM "Virtual serial console" #define MULTI_DEFAULT_ETH_MAC "2A02030405060789AB" #define MULTI_DEFAULT_ETH_CONTROL "Ethernet Comm Interface" @@ -374,8 +376,8 @@ static const struct usb_temp_config_desc *multi_config struct usb_temp_device_desc usb_template_multi = { .getStringDesc = &multi_get_string_desc, .ppConfigDesc = multi_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x0001, + .idVendor = MULTI_DEFAULT_VENDOR_ID, + .idProduct = MULTI_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_IN_INTERFACE, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- head/sys/dev/usb/template/usb_template_phone.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_phone.c Sat May 19 15:11:24 2018 (r333877) @@ -79,6 +79,8 @@ enum { PHONE_MAX_INDEX, }; +#define PHONE_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define PHONE_DEFAULT_PRODUCT_ID 0xb001 #define PHONE_DEFAULT_MIXER "Mixer interface" #define PHONE_DEFAULT_RECORD "Record interface" #define PHONE_DEFAULT_PLAYBACK "Playback interface" @@ -362,8 +364,8 @@ struct usb_temp_device_desc usb_template_phone = { .getStringDesc = &phone_get_string_desc, .getVendorDesc = &phone_get_vendor_desc, .ppConfigDesc = phone_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0xb001, + .idVendor = PHONE_DEFAULT_VENDOR_ID, + .idProduct = PHONE_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_IN_INTERFACE, .bDeviceSubClass = 0, Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Sat May 19 11:37:02 2018 (r333876) +++ head/sys/dev/usb/template/usb_template_serialnet.c Sat May 19 15:11:24 2018 (r333877) @@ -88,6 +88,8 @@ enum { SERIALNET_MAX_INDEX, }; +#define SERIALNET_DEFAULT_VENDOR_ID USB_TEMPLATE_VENDOR +#define SERIALNET_DEFAULT_PRODUCT_ID 0x0001 #define SERIALNET_DEFAULT_MODEM "USB Modem Interface" #define SERIALNET_DEFAULT_ETH_MAC "2A02030405060789AB" #define SERIALNET_DEFAULT_ETH_CONTROL "USB Ethernet Comm Interface" @@ -331,8 +333,8 @@ static const struct usb_temp_config_desc *serialnet_co struct usb_temp_device_desc usb_template_serialnet = { .getStringDesc = &serialnet_get_string_desc, .ppConfigDesc = serialnet_configs, - .idVendor = USB_TEMPLATE_VENDOR, - .idProduct = 0x0001, + .idVendor = SERIALNET_DEFAULT_VENDOR_ID, + .idProduct = SERIALNET_DEFAULT_PRODUCT_ID, .bcdDevice = 0x0100, .bDeviceClass = UDCLASS_COMM, .bDeviceSubClass = 0, From owner-svn-src-all@freebsd.org Sat May 19 15:18:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25D62EB09C1; Sat, 19 May 2018 15:18:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEA3C72CB3; Sat, 19 May 2018 15:18:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 976D2BD5; Sat, 19 May 2018 15:18:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JFIGdH065406; Sat, 19 May 2018 15:18:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JFIGCv065402; Sat, 19 May 2018 15:18:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201805191518.w4JFIGCv065402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 19 May 2018 15:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333878 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 333878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 15:18:17 -0000 Author: trasz Date: Sat May 19 15:18:15 2018 New Revision: 333878 URL: https://svnweb.freebsd.org/changeset/base/333878 Log: Fix whitespace; no functional changes. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_multi.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Sat May 19 15:11:24 2018 (r333877) +++ head/sys/dev/usb/template/usb_template_modem.c Sat May 19 15:18:15 2018 (r333878) @@ -80,7 +80,7 @@ enum { #define MODEM_DEFAULT_PRODUCT_ID 0x000E #define MODEM_DEFAULT_INTERFACE "Modem interface" #define MODEM_DEFAULT_MANUFACTURER "FreeBSD foundation" -#define MODEM_DEFAULT_PRODUCT "Modem Test Device" +#define MODEM_DEFAULT_PRODUCT "Modem Test Device" #define MODEM_DEFAULT_SERIAL_NUMBER "March 2008" static struct usb_string_descriptor modem_interface; Modified: head/sys/dev/usb/template/usb_template_multi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_multi.c Sat May 19 15:11:24 2018 (r333877) +++ head/sys/dev/usb/template/usb_template_multi.c Sat May 19 15:18:15 2018 (r333878) @@ -98,8 +98,8 @@ enum { #define MULTI_DEFAULT_STORAGE "Mass Storage Interface" #define MULTI_DEFAULT_CONFIGURATION "Default configuration" #define MULTI_DEFAULT_MANUFACTURER "The FreeBSD Project" -#define MULTI_DEFAULT_PRODUCT "Multifunction Device" -#define MULTI_DEFAULT_SERIAL_NUMBER "May 2018" +#define MULTI_DEFAULT_PRODUCT "Multifunction Device" +#define MULTI_DEFAULT_SERIAL_NUMBER "May 2018" static struct usb_string_descriptor multi_modem; static struct usb_string_descriptor multi_eth_mac; Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Sat May 19 15:11:24 2018 (r333877) +++ head/sys/dev/usb/template/usb_template_serialnet.c Sat May 19 15:18:15 2018 (r333878) @@ -96,8 +96,8 @@ enum { #define SERIALNET_DEFAULT_ETH_DATA "USB Ethernet Data Interface" #define SERIALNET_DEFAULT_CONFIGURATION "Default configuration" #define SERIALNET_DEFAULT_MANUFACTURER "The FreeBSD Project" -#define SERIALNET_DEFAULT_PRODUCT "SERIALNET" -#define SERIALNET_DEFAULT_SERIAL_NUMBER "January 2015" +#define SERIALNET_DEFAULT_PRODUCT "SERIALNET" +#define SERIALNET_DEFAULT_SERIAL_NUMBER "January 2015" static struct usb_string_descriptor serialnet_modem; static struct usb_string_descriptor serialnet_eth_mac; From owner-svn-src-all@freebsd.org Sat May 19 15:40:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2782EB1017; Sat, 19 May 2018 15:40:09 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A54F073831; Sat, 19 May 2018 15:40:09 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com [209.85.214.45]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 686C524C3A; Sat, 19 May 2018 15:40:09 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f45.google.com with SMTP id z6-v6so16628387iti.4; Sat, 19 May 2018 08:40:09 -0700 (PDT) X-Gm-Message-State: ALKqPweKQWL6lGoiwDH4LKMYaCgrE8olqakgCPhCvaSYGDLzgvlcxWUi bOix0hDjlqrQ+qfZfI/9wclKB2Pr3SOy4J4yWrA= X-Google-Smtp-Source: AB8JxZplfHv/8LD9fAvPEiK0QM+Lig1abakqXm0E72lcw6dAb7uDwgIpIi0ACWS8LncZVdTBJjWSCyQyTK6BfjRKupg= X-Received: by 2002:a24:f9cc:: with SMTP id l195-v6mr11259973ith.132.1526744408864; Sat, 19 May 2018 08:40:08 -0700 (PDT) MIME-Version: 1.0 References: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> In-Reply-To: <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> From: Matthew Macy Date: Sat, 19 May 2018 08:39:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333822 - head/sys/kern To: Emmanuel Vadot Cc: owner-src-committers@freebsd.org, rgrimes@freebsd.org, 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.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 15:40:10 -0000 On Sat, May 19, 2018 at 07:17 Emmanuel Vadot wrote: > On 2018-05-19 15:35, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: mmacy > >> Date: Sat May 19 02:15:40 2018 > >> New Revision: 333822 > >> URL: https://svnweb.freebsd.org/changeset/base/333822 > >> > >> Log: > >> fix gcc8 unused variable and set but not used variable in unix > >> sockets > >> add copyright from lock rewrite while here > >> > >> Modified: > >> head/sys/kern/uipc_usrreq.c > >> > >> Modified: head/sys/kern/uipc_usrreq.c > >> > ============================================================================== > >> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 > (r333821) > >> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 > (r333822) > >> @@ -4,7 +4,7 @@ > >> * Copyright (c) 1982, 1986, 1989, 1991, 1993 > >> * The Regents of the University of California. > >> * Copyright (c) 2004-2009 Robert N. M. Watson > >> - * All rights reserved. > > > > Did you have permission from Robert Watson to remove this? > > > >> + * Copyright (c) 2018 Matthew Macy > >> * > >> * Redistribution and use in source and binary forms, with or without > >> * modification, are permitted provided that the following conditions > > ... > > That also seems a small patch to add your name in the copyright. > Uhh... Locking rewrite was a small patch? Really? > > -- > Emmanuel Vadot > From owner-svn-src-all@freebsd.org Sat May 19 15:49:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 530FDEB1327 for ; Sat, 19 May 2018 15:49:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::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 D817B73C75 for ; Sat, 19 May 2018 15:48:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x244.google.com with SMTP id p124-v6so9709561iod.1 for ; Sat, 19 May 2018 08:48:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XTjCy0Z/Y7PJhYhPvWcFGTRItzOSPWLo6xakY7gyOqQ=; b=gwKgtgOuplFRKXA4RxGvrtyYQyjkf4RY9zsmEbE8usQtfNF4C0J+N6HZUQHeJRKc1d pJzpuBb9ABZQKz+lE7WdYpfflCrWQHhVdSGeRJJHmaett6CHxi30luk+a2fhmqI/fmXO 4huXroWd7bGzd/EAoXlwdMDHXW+yrL6VlnJpvPO7HeQa1ywHqziNyRVoLWrT9x0V/O/P amVVM95PozUKAcnRcEyMwIltBzmvv0Y4mbEmw8Yu05YsJWCBJuHy4g4hFcApYQgeq5jV h5vylc8NjSFDCHXy4SsUMENj+1GkaZfd02imP2xyVxGqD1LDMffa0ZBmw5BBnsU+LsL6 biWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XTjCy0Z/Y7PJhYhPvWcFGTRItzOSPWLo6xakY7gyOqQ=; b=BfAJzWCX/vP286hnGkYCDxFVojzKOhSUxWEduyoEZEulXdjARRQC+oeb88SZORknnP 2A9Dt97E9efatKqR/+boMxDX17z9CxQyn2ZM6ecOINnbecc2sjyuLv3tgt0wriyEEGd6 xfTVCthW0nss3G8w9EDJYDL6Raz6TMt3RkttTLJ+yy5bqs/iENET6d+QqfxcCW+f54+n Cj5eexiIMfOAeOo1PvR9Jevu9FxH3aqinVG8O5b6XnNU4FxZ5sZEgZNMpFyjdbZzdX9K UFO8wsg3kTUHxM9DEJi0O0Phh6GU60XZ3cFMSbu0I1+A1oE+867VJWp0wfLNnbXTIulT 9dWg== X-Gm-Message-State: ALKqPwfGaPIy855L2RTRJitEaYVmzXpArRArvtMgGqI8WkEJAb4gVLSA a+kruunITryrvZezKw+wqAYE9L9DCiFZxKASyWLZlg== X-Google-Smtp-Source: AB8JxZr7h7YmPdXhs0tljag6qR+R1bKvwsnxg8h5Yob2mqQ31iFTEXfvX2fLpYjQGCCrITKf9ERgKwiqkBFvDBzQ9/g= X-Received: by 2002:a6b:3846:: with SMTP id f67-v6mr14902294ioa.117.1526744938767; Sat, 19 May 2018 08:48:58 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Sat, 19 May 2018 08:48:57 -0700 (PDT) X-Originating-IP: [172.58.56.82] In-Reply-To: References: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> From: Warner Losh Date: Sat, 19 May 2018 09:48:57 -0600 X-Google-Sender-Auth: ujD2yIzbSzitEP9A8hLteu5bVxY Message-ID: Subject: Re: svn commit: r333822 - head/sys/kern To: Matthew Macy Cc: Emmanuel Vadot , owner-src-committers@freebsd.org, "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 15:49:00 -0000 On Sat, May 19, 2018 at 9:39 AM, Matthew Macy wrote: > > On Sat, May 19, 2018 at 07:17 Emmanuel Vadot > wrote: > >> On 2018-05-19 15:35, Rodney W. Grimes wrote: >> > [ Charset UTF-8 unsupported, converting... ] >> >> Author: mmacy >> >> Date: Sat May 19 02:15:40 2018 >> >> New Revision: 333822 >> >> URL: https://svnweb.freebsd.org/changeset/base/333822 >> >> >> >> Log: >> >> fix gcc8 unused variable and set but not used variable in unix >> >> sockets >> >> add copyright from lock rewrite while here >> >> >> >> Modified: >> >> head/sys/kern/uipc_usrreq.c >> >> >> >> Modified: head/sys/kern/uipc_usrreq.c >> >> ============================================================ >> ================== >> >> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 >> (r333821) >> >> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 >> (r333822) >> >> @@ -4,7 +4,7 @@ >> >> * Copyright (c) 1982, 1986, 1989, 1991, 1993 >> >> * The Regents of the University of California. >> >> * Copyright (c) 2004-2009 Robert N. M. Watson >> >> - * All rights reserved. >> > >> > Did you have permission from Robert Watson to remove this? >> > >> >> + * Copyright (c) 2018 Matthew Macy >> >> * >> >> * Redistribution and use in source and binary forms, with or without >> >> * modification, are permitted provided that the following conditions >> > ... >> >> That also seems a small patch to add your name in the copyright. >> > > Uhh... Locking rewrite was a small patch? Really? > This specific change was trivial. However, rewriting the locking here was non-trivial. The normal rule of thumb is about 25%, but that's flexible. mmacy is responsible for about 14% of the file according to git blame (a number that would be closer to 20% if you omitted the boilerplate parts of the file). If all his changes were trivial variable initializations, then I'd agree this fall short. But the new locking stuff is substantial enough to meet our traditional requirements for adding a copyright line. It affects the majority of the files and is a core functional feature of this file. Warner From owner-svn-src-all@freebsd.org Sat May 19 15:50:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 579EAEB1746 for ; Sat, 19 May 2018 15:50:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::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 DAFDC73F12 for ; Sat, 19 May 2018 15:50:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x244.google.com with SMTP id p3-v6so16693714itc.0 for ; Sat, 19 May 2018 08:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=e98AQo9/u5zDtp36kcxqJxvoSZqco8b6Q48NFPuK/qc=; b=omTm6R0OqOj3dcYA+agES4Da1Qav24I5empQQOLJp8UhR8nhShMLyFIprl2jdNjz7w CZ5YIkgiSODqODARRjt4XQEoY6JZQdMwh+MRngEcBkxb4WRIrjB7zF1aGHfrFqnLeBMs 42tY7efNN+Zz+/sXACk7XhMH8t3d6/jtt/q7C+4M2I78CKBnoYgGJCszQxo1sUWN9sIh 6u7OlD38R/H9XaVmztnUKuhbNZdT1iGRV52p3Q1ckTt+w+Mlqp96aGnjiH+sfxEuJPDP rsaGXC4ek+ec28EAd4NxjSPyYuQrK3eVnrFr812GI0Si6uuEWk3ivLfvsDR2mcANDxpC /vHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=e98AQo9/u5zDtp36kcxqJxvoSZqco8b6Q48NFPuK/qc=; b=fExxVhr1eHTwM0EbJ4xGmMH0+IAcqgFlIqa/OINlXajSVRgm3yz1Ezxu7oK2QlfWcF aNjXNkPAbXVLQ+vON+Bfe4eHCe8baBZfGPi2VG+dLT3UdHkKmDs/7chgu6x/Ui0iSEFg SccMhxRMKtqvzIhg9pon9zcU8K2ZdFlHZjI7Vn6S6fFMbpX3GdmnzxLn6sbLWh7JAMri 2hqURVah7jgPi4EskmLGUW3dFjMq7OatPvLPPoA8jWtFfn4P5mOpGt/UaENLE8tGZ5D/ L9ygRh6lN2mKEktu0MDXb29G+HNMH//ILTeAmdl8cZrS7XTkJZUQVqd94ws1965SAdC7 /W5w== X-Gm-Message-State: ALKqPwfo6BeSeZbWu13wnqcZChQbjqjZwGCBf2auHS2JGLqhvjT+50/8 SOLnXEJKGid2BHKR8B0GACx13S9nZl81Q6H+/Ow0OA== X-Google-Smtp-Source: AB8JxZoinp4RUOJ0Jj3brNR/9jA2qc+ZA/xR+GdGW8/2BzkW3+YTAe4vR2WZW+yAvtLB9QkLhg2tU+hN/nXvRtShTrc= X-Received: by 2002:a24:4c55:: with SMTP id a82-v6mr11200426itb.1.1526745056239; Sat, 19 May 2018 08:50:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Sat, 19 May 2018 08:50:55 -0700 (PDT) X-Originating-IP: [172.58.56.82] In-Reply-To: References: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> From: Warner Losh Date: Sat, 19 May 2018 09:50:55 -0600 X-Google-Sender-Auth: bOSeiZdDSn2-BREvDTSGvGhOEWg Message-ID: Subject: Re: svn commit: r333822 - head/sys/kern To: Matthew Macy Cc: Emmanuel Vadot , owner-src-committers@freebsd.org, "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 15:50:57 -0000 On Sat, May 19, 2018 at 9:48 AM, Warner Losh wrote: > > > On Sat, May 19, 2018 at 9:39 AM, Matthew Macy wrote: > >> >> On Sat, May 19, 2018 at 07:17 Emmanuel Vadot >> wrote: >> >>> On 2018-05-19 15:35, Rodney W. Grimes wrote: >>> > [ Charset UTF-8 unsupported, converting... ] >>> >> Author: mmacy >>> >> Date: Sat May 19 02:15:40 2018 >>> >> New Revision: 333822 >>> >> URL: https://svnweb.freebsd.org/changeset/base/333822 >>> >> >>> >> Log: >>> >> fix gcc8 unused variable and set but not used variable in unix >>> >> sockets >>> >> add copyright from lock rewrite while here >>> >> >>> >> Modified: >>> >> head/sys/kern/uipc_usrreq.c >>> >> >>> >> Modified: head/sys/kern/uipc_usrreq.c >>> >> ============================================================ >>> ================== >>> >> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 >>> (r333821) >>> >> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 >>> (r333822) >>> >> @@ -4,7 +4,7 @@ >>> >> * Copyright (c) 1982, 1986, 1989, 1991, 1993 >>> >> * The Regents of the University of California. >>> >> * Copyright (c) 2004-2009 Robert N. M. Watson >>> >> - * All rights reserved. >>> > >>> > Did you have permission from Robert Watson to remove this? >>> > >>> >> + * Copyright (c) 2018 Matthew Macy >>> >> * >>> >> * Redistribution and use in source and binary forms, with or without >>> >> * modification, are permitted provided that the following conditions >>> > ... >>> >>> That also seems a small patch to add your name in the copyright. >>> >> >> Uhh... Locking rewrite was a small patch? Really? >> > > This specific change was trivial. However, rewriting the locking here was > non-trivial. The normal rule of thumb is about 25%, but that's flexible. > mmacy is responsible for about 14% of the file according to git blame (a > number that would be closer to 20% if you omitted the boilerplate parts of > the file). If all his changes were trivial variable initializations, then > I'd agree this fall short. But the new locking stuff is substantial enough > to meet our traditional requirements for adding a copyright line. It > affects the majority of the files and is a core functional feature of this > file. > Sigh... s/affects the majority of the files/affects the majority of the functions in this file/ Normally I wouldn't make this small a correction, but i materially affects my argument. Warner From owner-svn-src-all@freebsd.org Sat May 19 15:56:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56BDCEB1B0B; Sat, 19 May 2018 15:56:32 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 44EDE74473; Sat, 19 May 2018 15:56:30 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 382d5cfc; Sat, 19 May 2018 17:56:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=XEEcDC AXo3ZsnZzgF/p0fp11DBA=; b=IFXezPiTg9x6xR1EiINpLaQtRIFW0U2Va0ptYv qXXMXVofoz9P9AZwhg9TiiTNjPVFKsnu8eVUfETlN64uUdfx0/O7u9YRjwm8XQii JP/KBV2D5cMzjI7Zw31Of+lq3F4x+RXu/n0Tr42Lv3IzJE1pVH//h12sBX6QZfvw jAPQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= sPbz79OQcwQaY6d2nlnKZnYrKbNghp0nlu42WlRs0itXkB5MeJfk6tvAdGxLy7lY 6O+aAvYH3+uhc8Fp5NLTIXl9R/4VqvjKefMnPplj8s4MQmDreCtUM0FZJH8j/Lcn +qkhXUIlJFSLQqZuCdoYY28uRumQjpq2GsHqPdcjHr4= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 90cc7196; Sat, 19 May 2018 17:56:28 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 19 May 2018 17:56:28 +0200 From: Emmanuel Vadot To: Matthew Macy Cc: owner-src-committers@freebsd.org, rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333822 - head/sys/kern Organization: Bidouilliste In-Reply-To: References: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> Message-ID: <838f63057df1cd9bc430ed76328c28b5@megadrive.org> X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 15:56:32 -0000 On 2018-05-19 17:39, Matthew Macy wrote: > On Sat, May 19, 2018 at 07:17 Emmanuel Vadot > wrote: > >> On 2018-05-19 15:35, Rodney W. Grimes wrote: >>> [ Charset UTF-8 unsupported, converting... ] >>>> Author: mmacy >>>> Date: Sat May 19 02:15:40 2018 >>>> New Revision: 333822 >>>> URL: https://svnweb.freebsd.org/changeset/base/333822 [1] >>>> >>>> Log: >>>> fix gcc8 unused variable and set but not used variable in unix >> >>>> sockets >>>> add copyright from lock rewrite while here >>>> >>>> Modified: >>>> head/sys/kern/uipc_usrreq.c >>>> >>>> Modified: head/sys/kern/uipc_usrreq.c >>>> >> > ============================================================================== >>>> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 >> (r333821) >>>> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 >> (r333822) >>>> @@ -4,7 +4,7 @@ >>>> * Copyright (c) 1982, 1986, 1989, 1991, 1993 >>>> * The Regents of the University of California. >>>> * Copyright (c) 2004-2009 Robert N. M. Watson >>>> - * All rights reserved. >>> >>> Did you have permission from Robert Watson to remove this? >>> >>>> + * Copyright (c) 2018 Matthew Macy >>>> * >>>> * Redistribution and use in source and binary forms, with or >> without >>>> * modification, are permitted provided that the following >> conditions >>> ... >> >> That also seems a small patch to add your name in the copyright. > > Uhh... Locking rewrite was a small patch? Really? Maybe I should I read the previous commits and the full log here :) sorry. > >> -- >> Emmanuel Vadot > > > Links: > ------ > [1] https://svnweb.freebsd.org/changeset/base/333822 -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat May 19 16:44:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F7E9ED6F2B; Sat, 19 May 2018 16:44:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 103B775FFE; Sat, 19 May 2018 16:44:13 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E09EB1B39; Sat, 19 May 2018 16:44:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JGiCJK011904; Sat, 19 May 2018 16:44:12 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JGiC5A011903; Sat, 19 May 2018 16:44:12 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805191644.w4JGiC5A011903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 16:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333879 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 16:44:13 -0000 Author: mmacy Date: Sat May 19 16:44:12 2018 New Revision: 333879 URL: https://svnweb.freebsd.org/changeset/base/333879 Log: mp_ring: fix i386 Even though 64-bit atomics are supported on i386 there are panics indicating that the code does not work correctly there. Switch to mutex based variant (and fix that while we're here). Reported by: pho, kib Modified: head/sys/net/mp_ring.c Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Sat May 19 15:18:15 2018 (r333878) +++ head/sys/net/mp_ring.c Sat May 19 16:44:12 2018 (r333879) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__powerpc__) || defined(__mips__) +#if defined(__powerpc__) || defined(__mips__) || defined(__i386__) #define NO_64BIT_ATOMICS #endif @@ -345,6 +345,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, i if (n >= space_available(r, os)) { counter_u64_add(r->drops, n); MPASS(os.flags != IDLE); + mtx_unlock(&r->lock); if (os.flags == STALLED) ifmp_ring_check_drainage(r, 0); return (ENOBUFS); From owner-svn-src-all@freebsd.org Sat May 19 16:49:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B22AAEDA042; Sat, 19 May 2018 16:49:40 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E47976192; Sat, 19 May 2018 16:49:40 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 21F2825338; Sat, 19 May 2018 16:49:40 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f44.google.com with SMTP id q4-v6so16816595ite.3; Sat, 19 May 2018 09:49:40 -0700 (PDT) X-Gm-Message-State: ALKqPwd0eO8JKhB/Sy1PyfamwmDj1N0k+EuPQkrh0zi/YsSsQrz2Gw4j j/rdKCuyvXpA/UrhuQa70GoEu1/BpkNtKMz5u60= X-Google-Smtp-Source: AB8JxZpusEUQrXo7u1PAiXLpOJlfuxAXTK/Q8ezBDadRULqxyndph/8ccIkmt5MrXjeS7bSewYwDUaAr9kx8K4zDyBs= X-Received: by 2002:a24:5b54:: with SMTP id g81-v6mr11431156itb.7.1526748579496; Sat, 19 May 2018 09:49:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Sat, 19 May 2018 09:49:39 -0700 (PDT) In-Reply-To: References: <201805190004.w4J0419B099140@repo.freebsd.org> From: Matthew Macy Date: Sat, 19 May 2018 09:49:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333819 - in head/sys: conf modules/blake2 modules/crypto modules/drm2/i915kms modules/ipfilter To: Ed Maste Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 16:49:41 -0000 As I suspected, we fix warnings on non-contrib code. These are only used on contrib code. -M mmacy@anarchy [~/devel/upstream|9:46|26] find sys | xargs grep NO_WSELF_ASS= IGN sys/modules/ipfilter/Makefile:CWARNFLAGS.fil.c=3D ${NO_WSELF_ASSIGN} -Wno-unused sys/modules/ipfilter/Makefile:CWARNFLAGS.ip_lookup.c=3D ${NO_WSELF_ASSIGN} -Wno-unused sys/modules/ipfilter/Makefile:CWARNFLAGS.ip_proxy.c=3D ${NO_WSELF_ASSIGN} -Wno-unused sys/conf/kern.mk:NO_WSELF_ASSIGN=3D -Wno-self-assign sys/conf/files: compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter" sys/conf/files: compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -I$S/contrib/ipfilter" sys/conf/files: compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-unused -Wno-error -I$S/contrib/ipfilter" mmacy@anarchy [~/devel/upstream|9:47|27] find sys | xargs grep NO_WSHIFT_COUNT_NEGATIVE sys/modules/ath_hal/Makefile:CWARNFLAGS.ah_regdomain.c=3D ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} sys/conf/kern.mk:NO_WSHIFT_COUNT_NEGATIVE=3D -Wno-shift-count-negative sys/conf/files: compile-with "${NORMAL_C} ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -I$S/dev/ath" mmacy@anarchy [~/devel/upstream|9:47|28] find sys | xargs grep NO_WSHIFT_COUNT_OVERFLOW sys/modules/ath_hal/Makefile:CWARNFLAGS.ah_regdomain.c=3D ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} sys/conf/kern.mk:NO_WSHIFT_COUNT_OVERFLOW=3D -Wno-shift-count-overflow sys/conf/files: compile-with "${NORMAL_C} ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -I$S/dev/ath" On Sat, May 19, 2018 at 5:30 AM, Matthew Macy wrote: > Oops I=E2=80=99ll add a separate define for that > > On Sat, May 19, 2018 at 04:27 Ed Maste wrote: >> >> On 18 May 2018 at 20:04, Matt Macy wrote: >> > Author: mmacy >> > Date: Sat May 19 00:04:01 2018 >> > New Revision: 333819 >> > URL: https://svnweb.freebsd.org/changeset/base/333819 >> > >> > Log: >> > Silence non-actionable warnings in vendor code >> ... >> > Modified: head/sys/conf/kern.mk >> > >> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=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/conf/kern.mk Fri May 18 23:42:08 2018 >> > (r333818) >> > +++ head/sys/conf/kern.mk Sat May 19 00:04:01 2018 >> > (r333819) >> > @@ -18,12 +18,13 @@ CWARNFLAGS?=3D -Wall -Wredundant-decls >> > -Wnested-externs >> > # a false positive. >> > .if ${COMPILER_TYPE} =3D=3D "clang" >> > NO_WCONSTANT_CONVERSION=3D -Wno-error-constant-conversion >> > -NO_WSHIFT_COUNT_NEGATIVE=3D -Wno-error-shift-count-negative >> > -NO_WSHIFT_COUNT_OVERFLOW=3D -Wno-error-shift-count-overflow >> > -NO_WSELF_ASSIGN=3D -Wno-error-self-assign >> > +NO_WSHIFT_COUNT_NEGATIVE=3D -Wno-shift-count-negative >> > +NO_WSHIFT_COUNT_OVERFLOW=3D -Wno-shift-count-overflow >> > +NO_WSELF_ASSIGN=3D -Wno-self-assign >> >> This silences the warning across the tree, not just vendor code. From owner-svn-src-all@freebsd.org Sat May 19 16:57:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9240DEDA4E0; Sat, 19 May 2018 16:57:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04CE4766C3; Sat, 19 May 2018 16:57:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JGvIYr016606; Sat, 19 May 2018 09:57:18 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JGvIdr016605; Sat, 19 May 2018 09:57:18 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805191657.w4JGvIdr016605@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333822 - head/sys/kern In-Reply-To: To: Matthew Macy Date: Sat, 19 May 2018 09:57:18 -0700 (PDT) CC: Emmanuel Vadot , owner-src-committers@freebsd.org, rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 16:57:28 -0000 [ Charset UTF-8 unsupported, converting... ] > On Sat, May 19, 2018 at 07:17 Emmanuel Vadot wrote: > > > On 2018-05-19 15:35, Rodney W. Grimes wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > >> Author: mmacy > > >> Date: Sat May 19 02:15:40 2018 > > >> New Revision: 333822 > > >> URL: https://svnweb.freebsd.org/changeset/base/333822 > > >> > > >> Log: > > >> fix gcc8 unused variable and set but not used variable in unix > > >> sockets > > >> add copyright from lock rewrite while here > > >> > > >> Modified: > > >> head/sys/kern/uipc_usrreq.c > > >> > > >> Modified: head/sys/kern/uipc_usrreq.c > > >> > > ============================================================================== > > >> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 > > (r333821) > > >> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 > > (r333822) > > >> @@ -4,7 +4,7 @@ > > >> * Copyright (c) 1982, 1986, 1989, 1991, 1993 > > >> * The Regents of the University of California. > > >> * Copyright (c) 2004-2009 Robert N. M. Watson > > >> - * All rights reserved. > > > > > > Did you have permission from Robert Watson to remove this? This issue seems to be getting ignored? > > >> + * Copyright (c) 2018 Matthew Macy > > >> * > > >> * Redistribution and use in source and binary forms, with or without > > >> * modification, are permitted provided that the following conditions > > > ... > > > > That also seems a small patch to add your name in the copyright. > > > > Uhh... Locking rewrite was a small patch? Really? I agree with Matt, he has done plenty of work to this code to justify his copyright claim. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 16:58:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E886EDA5C6; Sat, 19 May 2018 16:58:56 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B99276832; Sat, 19 May 2018 16:58:56 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) (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)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 1697925449; Sat, 19 May 2018 16:58:56 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f179.google.com with SMTP id t23-v6so9841385ioc.10; Sat, 19 May 2018 09:58:56 -0700 (PDT) X-Gm-Message-State: ALKqPwdZ+z4b63WnrnzOwSd0AUIEEtdlJdh0yjzlF2/GywiIUnc2roZL /C/ZCn6w/pc1X22BQoWNGWI7xLG2UJ3YkpoiF7c= X-Google-Smtp-Source: AB8JxZrTDzJJQHFzPHoIxopaa5Ng2Wcn/EBSQI7CshBIrH2PSPKUz5H5QxqoMz7LAiRAd7uLDFTpuI5/LQFGMR6mdAE= X-Received: by 2002:a6b:a712:: with SMTP id q18-v6mr14854281ioe.237.1526749135378; Sat, 19 May 2018 09:58:55 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Sat, 19 May 2018 09:58:55 -0700 (PDT) In-Reply-To: <838f63057df1cd9bc430ed76328c28b5@megadrive.org> References: <201805191335.w4JDZq9b015979@pdx.rh.CN85.dnsmgr.net> <29252c55ea65fe53b9ab4e673ec6726c@megadrive.org> <838f63057df1cd9bc430ed76328c28b5@megadrive.org> From: Matthew Macy Date: Sat, 19 May 2018 09:58:55 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333822 - head/sys/kern To: Emmanuel Vadot Cc: owner-src-committers@freebsd.org, rgrimes@freebsd.org, src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 16:58:56 -0000 On Sat, May 19, 2018 at 8:56 AM, Emmanuel Vadot wrote: > On 2018-05-19 17:39, Matthew Macy wrote: >> >> On Sat, May 19, 2018 at 07:17 Emmanuel Vadot >> wrote: >> >>> On 2018-05-19 15:35, Rodney W. Grimes wrote: >>>> >>>> [ Charset UTF-8 unsupported, converting... ] >>>>> >>>>> Author: mmacy >>>>> Date: Sat May 19 02:15:40 2018 >>>>> New Revision: 333822 >>>>> URL: https://svnweb.freebsd.org/changeset/base/333822 [1] >>>>> >>>>> >>>>> Log: >>>>> fix gcc8 unused variable and set but not used variable in unix >>> >>> >>>>> sockets >>>>> add copyright from lock rewrite while here >>>>> >>>>> Modified: >>>>> head/sys/kern/uipc_usrreq.c >>>>> >>>>> Modified: head/sys/kern/uipc_usrreq.c >>>>> >>> >> >> ============================================================================== >>>>> >>>>> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 >>> >>> (r333821) >>>>> >>>>> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 >>> >>> (r333822) >>>>> >>>>> @@ -4,7 +4,7 @@ >>>>> * Copyright (c) 1982, 1986, 1989, 1991, 1993 >>>>> * The Regents of the University of California. >>>>> * Copyright (c) 2004-2009 Robert N. M. Watson >>>>> - * All rights reserved. >>>> >>>> >>>> Did you have permission from Robert Watson to remove this? >>>> >>>>> + * Copyright (c) 2018 Matthew Macy >>>>> * >>>>> * Redistribution and use in source and binary forms, with or >>> >>> without >>>>> >>>>> * modification, are permitted provided that the following >>> >>> conditions >>>> >>>> ... >>> >>> >>> That also seems a small patch to add your name in the copyright. >> >> >> Uhh... Locking rewrite was a small patch? Really? > > > Maybe I should I read the previous commits and the full log here :) sorry. No problem. Thanks Warner for stepping up. I probably shouldn't respond before I've had my coffee. Just to be clear - I wasn't upset, just a bit flabbergasted. I clearly mentioned "locking rewrite" in the message and there were clearly no locking changes in this particular commit. The awake thing to do would have been to send a link to the commit itself and clarify that, although in pure line count was < 25%, it was a material change with substantial impact. https://svnweb.freebsd.org/base?view=revision&revision=333744 Cheers -M > >> >>> -- >>> Emmanuel Vadot >> >> >> >> Links: >> ------ >> [1] https://svnweb.freebsd.org/changeset/base/333822 > > > -- > Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat May 19 17:23:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84D68EDB3C0 for ; Sat, 19 May 2018 17:23:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1231E774FB for ; Sat, 19 May 2018 17:23:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id r9-v6so9875916iod.6 for ; Sat, 19 May 2018 10:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=18/7UaimAEbFIMfyXW/8WmfJMzHxxYBhAAeJVwJR8hI=; b=ufEDaHdTbFl7iyeGnZ7N5mAdlVFiEumnZsGf0YJrxleuQ5YK/rhcxVVpYt4h7jwdtw J3WO734N20NoECWXIx35+9MpnU0lthMEpIdSdqgZDvSjE2eUTSEn/CoSSghvxvsID7eh eIGFGfkP1jCD1TkzHnhpeRH4w5p9fgCHnnNDAds7IQJaI6XwIcZKSaovJjynfW6YI9Sk iX1V1LRynuiBRexPT+DC2o1eibVXVxWXzXwZYKc2vMJ1Dnl+FPUEYHAE7kHMPo9lns+g mvxGqT9eEjlhLczQTmB0zwuS7XpD8gxL2/uZNl1r0Hi5Qa14R2MW1lkBCiz6bUHAmIYN tUMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=18/7UaimAEbFIMfyXW/8WmfJMzHxxYBhAAeJVwJR8hI=; b=tNyLhRQY2D2LfPVjADxy3qVR8g6G9BapIoUXJdMT9sOPMEKmozElWCvi2gnjQ3+Bj0 j+Pn8gnLPEIOmydg4+MwMDw68UnnCuONfPyW/9XZUugtxIndv2StTpw1jSAKET+9m0xw BGHReIgUBT4gb0gO07dcecPbRPF7bVdRFcF4Sq1h7ojQF2id7lke2f3H+TgLA7GlmYyu PCsGmH592O9wP7FQOYS8wwjv1GMOTuGKclDDFdPTQwGFHCgbj435yhIZXrSY0x+zPbmh CWg/kq7PyDbMUkGNrEPOKPdrdT/QRupvhqcbXTGdhMO4CM/KW25Q1YQSa4L09MoFpB0a QDoQ== X-Gm-Message-State: ALKqPwdKNLJONsFyKK19zLPQsQ7enR3QiZJmukwSikfLYTuNBR99wh7j ixuPDNB0N3vGwbf0DslWln8QCgXU/UNToG5cLHpMOw== X-Google-Smtp-Source: AB8JxZoXakIzz6pGF1yBNRS3yF3QV6iLsb9Fd5xsQdeKGSMjBsNv0faMGi8PClEs7RlJSQGN4+OUDesh0/z4ak2C8hc= X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr14686571iof.299.1526750625449; Sat, 19 May 2018 10:23:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Sat, 19 May 2018 10:23:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201805191657.w4JGvIdr016605@pdx.rh.CN85.dnsmgr.net> References: <201805191657.w4JGvIdr016605@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sat, 19 May 2018 11:23:44 -0600 X-Google-Sender-Auth: KirmhP8tjnxDCgBCF1gaFn3GPI8 Message-ID: Subject: Re: svn commit: r333822 - head/sys/kern To: "Rodney W. Grimes" Cc: Matthew Macy , Emmanuel Vadot , owner-src-committers@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 17:23:46 -0000 On Sat, May 19, 2018 at 10:57 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Sat, May 19, 2018 at 07:17 Emmanuel Vadot > wrote: > > > > > On 2018-05-19 15:35, Rodney W. Grimes wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > >> Author: mmacy > > > >> Date: Sat May 19 02:15:40 2018 > > > >> New Revision: 333822 > > > >> URL: https://svnweb.freebsd.org/changeset/base/333822 > > > >> > > > >> Log: > > > >> fix gcc8 unused variable and set but not used variable in unix > > > >> sockets > > > >> add copyright from lock rewrite while here > > > >> > > > >> Modified: > > > >> head/sys/kern/uipc_usrreq.c > > > >> > > > >> Modified: head/sys/kern/uipc_usrreq.c > > > >> > > > ============================================================ > ================== > > > >> --- head/sys/kern/uipc_usrreq.c Sat May 19 00:47:24 2018 > > > (r333821) > > > >> +++ head/sys/kern/uipc_usrreq.c Sat May 19 02:15:40 2018 > > > (r333822) > > > >> @@ -4,7 +4,7 @@ > > > >> * Copyright (c) 1982, 1986, 1989, 1991, 1993 > > > >> * The Regents of the University of California. > > > >> * Copyright (c) 2004-2009 Robert N. M. Watson > > > >> - * All rights reserved. > > > > > > > > Did you have permission from Robert Watson to remove this? > > This issue seems to be getting ignored? > Well, you'd need permission from the regents too, since it originated there before rwatson inserted his copyright. I've talked to Matt online and will be reverting this one line of his change. Thanks for the eagle eye. Warner From owner-svn-src-all@freebsd.org Sat May 19 17:29:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8659BEDB627; Sat, 19 May 2018 17:29:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BBC37777D; Sat, 19 May 2018 17:29:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07F3B221F; Sat, 19 May 2018 17:29:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JHTvjK032117; Sat, 19 May 2018 17:29:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JHTvOo032116; Sat, 19 May 2018 17:29:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201805191729.w4JHTvOo032116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 19 May 2018 17:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333880 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 333880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 17:29:58 -0000 Author: imp Date: Sat May 19 17:29:57 2018 New Revision: 333880 URL: https://svnweb.freebsd.org/changeset/base/333880 Log: Restore the all rights reserved language. Put it on each of the prior two copyrights. The line originated with the Berkeely Regents, who we have not approached about removing it (it's honestly too trivial to be worth that fight). Restore it to rwatson's line as well. He can decide if he wants it or not on his own. Matt clearly doesn't want it, per project preference and his own statements on IRC. Noticed by: rgrimes@ Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sat May 19 16:44:12 2018 (r333879) +++ head/sys/kern/uipc_usrreq.c Sat May 19 17:29:57 2018 (r333880) @@ -2,8 +2,8 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1982, 1986, 1989, 1991, 1993 - * The Regents of the University of California. - * Copyright (c) 2004-2009 Robert N. M. Watson + * The Regents of the University of California. All Rights Reserved. + * Copyright (c) 2004-2009 Robert N. M. Watson All Rights Reserved. * Copyright (c) 2018 Matthew Macy * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Sat May 19 18:00:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99117EDC265; Sat, 19 May 2018 18:00:23 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4916D784B9; Sat, 19 May 2018 18:00:23 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id 10EE625A37; Sat, 19 May 2018 18:00:23 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f171.google.com with SMTP id z4-v6so9937903iof.5; Sat, 19 May 2018 11:00:23 -0700 (PDT) X-Gm-Message-State: ALKqPwcsZkkpN2K1K5vUsLIme7I3/oRAxAYjvWsS7Tv6vbjXxuxYUkmA C2FeFKNkXur73wNd24cuvXIpE3iDwHxG7i8eTyg= X-Google-Smtp-Source: AB8JxZqD5eZSePwVT8+lvrrRfoLAo/UwzrRYhVZbzNKjHIYh2Pnp+eIjO0o7PY5Cri6eIRBOfsf8x1OlvtfTQSUiXyA= X-Received: by 2002:a6b:3b42:: with SMTP id i63-v6mr5090025ioa.133.1526752822607; Sat, 19 May 2018 11:00:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:85ae:0:0:0:0:0 with HTTP; Sat, 19 May 2018 11:00:22 -0700 (PDT) In-Reply-To: References: <201805190631.w4J6VHhr094225@repo.freebsd.org> From: Matthew Macy Date: Sat, 19 May 2018 11:00:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333872 - head/cddl/contrib/opensolaris/tools/ctf/cvt To: Ed Maste Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 18:00:23 -0000 On Sat, May 19, 2018 at 4:49 AM, Ed Maste wrote: > On 19 May 2018 at 02:31, Matt Macy wrote: >> Author: mmacy >> Date: Sat May 19 06:31:17 2018 >> New Revision: 333872 >> URL: https://svnweb.freebsd.org/changeset/base/333872 >> >> Log: >> ctfconvert: silence useless enum has too many values warning > > I agree it's reasonable to silence this warning as it is not > actionable for almost everyone who encounters it. It does indicate a > real problem in our tool chain though and I added an entry to > https://wiki.freebsd.org/DTraceTODO. Conrad brought up the need to change the CTF ABI on IRC. This will involve an on-disk format change which he and I believe to be acceptable, but perhaps interoperability with other operating systems is still considered important. -M From owner-svn-src-all@freebsd.org Sat May 19 18:02:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE179EDC512; Sat, 19 May 2018 18:02:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92282788DB; Sat, 19 May 2018 18:02:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 539FA288C; Sat, 19 May 2018 18:02:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JI2lre051713; Sat, 19 May 2018 18:02:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JI2l3i051712; Sat, 19 May 2018 18:02:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805191802.w4JI2l3i051712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 19 May 2018 18:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333881 - stable/11/tools/test/vm86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/tools/test/vm86 X-SVN-Commit-Revision: 333881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 18:02:48 -0000 Author: kib Date: Sat May 19 18:02:46 2018 New Revision: 333881 URL: https://svnweb.freebsd.org/changeset/base/333881 Log: MFC r333534: Add a test for vm86(2). Approved by: re (gjb) Added: stable/11/tools/test/vm86/ - copied from r333534, head/tools/test/vm86/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Sat May 19 18:15:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9E9CEDCFAD; Sat, 19 May 2018 18:15:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F8FA79040; Sat, 19 May 2018 18:15:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AD532A2A; Sat, 19 May 2018 18:15:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JIFgTc056858; Sat, 19 May 2018 18:15:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JIFgmx056857; Sat, 19 May 2018 18:15:42 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805191815.w4JIFgmx056857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 18:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333882 - head/sys/dev/bhnd/tools X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/dev/bhnd/tools X-SVN-Commit-Revision: 333882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 18:15:42 -0000 Author: mmacy Date: Sat May 19 18:15:41 2018 New Revision: 333882 URL: https://svnweb.freebsd.org/changeset/base/333882 Log: bhnd nvram map: don't write "variable records written" to standard out by default Add -v (verbose) option for the developers. The rest of us derive no value from this information. Modified: head/sys/dev/bhnd/tools/nvram_map_gen.awk Modified: head/sys/dev/bhnd/tools/nvram_map_gen.awk ============================================================================== --- head/sys/dev/bhnd/tools/nvram_map_gen.awk Sat May 19 18:02:46 2018 (r333881) +++ head/sys/dev/bhnd/tools/nvram_map_gen.awk Sat May 19 18:15:41 2018 (r333882) @@ -56,6 +56,7 @@ function main(_i) { OUT_T = null OUT_T_HEADER = "HEADER" OUT_T_DATA = "DATA" + VERBOSE = 0 # Tab width to use when calculating output alignment TAB_WIDTH = 8 @@ -77,6 +78,8 @@ function main(_i) { OUT_T = OUT_T_DATA } else if (ARGV[_i] == "-h" && OUT_T == null) { OUT_T = OUT_T_HEADER + } else if (ARGV[_i] == "-v") { + VERBOSE = 1 } else if (ARGV[_i] == "-o") { _i++ if (_i >= ARGC) @@ -488,9 +491,10 @@ function at_exit(_block_start, _state, _output_vars, _ } else if (OUT_T == OUT_T_HEADER) { write_header(_output_vars) } - - printf("%u variable records written to %s\n", array_size(_output_vars), - OUTPUT_FILE) >> "/dev/stderr" + if (VERBOSE == 1) { + printf("%u variable records written to %s\n", array_size(_output_vars), + OUTPUT_FILE) >> "/dev/stderr" + } } # Write the public header (output type HEADER) From owner-svn-src-all@freebsd.org Sat May 19 18:27:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C991AEDD5C7; Sat, 19 May 2018 18:27:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DA5F79701; Sat, 19 May 2018 18:27:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 494292BC6; Sat, 19 May 2018 18:27:15 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JIRFtK062112; Sat, 19 May 2018 18:27:15 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JIRF6h062111; Sat, 19 May 2018 18:27:15 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805191827.w4JIRF6h062111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 18:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333883 - head/sys/crypto/skein/amd64 X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/crypto/skein/amd64 X-SVN-Commit-Revision: 333883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 18:27:16 -0000 Author: mmacy Date: Sat May 19 18:27:14 2018 New Revision: 333883 URL: https://svnweb.freebsd.org/changeset/base/333883 Log: disable printing value of SKEIN_LOOP during standard out, not useful information Modified: head/sys/crypto/skein/amd64/skein_block_asm.s Modified: head/sys/crypto/skein/amd64/skein_block_asm.s ============================================================================== --- head/sys/crypto/skein/amd64/skein_block_asm.s Sat May 19 18:15:41 2018 (r333882) +++ head/sys/crypto/skein/amd64/skein_block_asm.s Sat May 19 18:27:14 2018 (r333883) @@ -27,7 +27,7 @@ _SKEIN_LOOP = 2 #default i .else _SKEIN_LOOP = SKEIN_LOOP .irp _NN_,%_SKEIN_LOOP #only display loop unrolling if default changed on command line -.print "+++ SKEIN_LOOP = \_NN_" +#.print "+++ SKEIN_LOOP = \_NN_" .endr .endif # the unroll counts (0 --> fully unrolled) From owner-svn-src-all@freebsd.org Sat May 19 18:44:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF93EDE277; Sat, 19 May 2018 18:44:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FBD07A688; Sat, 19 May 2018 18:44: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D6392F59; Sat, 19 May 2018 18:44: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 w4JIiTQI072423; Sat, 19 May 2018 18:44:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JIiTcB072422; Sat, 19 May 2018 18:44:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201805191844.w4JIiTcB072422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 19 May 2018 18:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333884 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 333884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 18:44:30 -0000 Author: emaste Date: Sat May 19 18:44:29 2018 New Revision: 333884 URL: https://svnweb.freebsd.org/changeset/base/333884 Log: muge(4): chase r333813 if_addr_lock rwlock to epoch + mutex muge was committed to the tree in r333713 but not yet connected to the tree, and it crossed paths with the migration to using ck. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/usb/net/if_muge.c Modified: head/sys/dev/usb/net/if_muge.c ============================================================================== --- head/sys/dev/usb/net/if_muge.c Sat May 19 18:27:14 2018 (r333883) +++ head/sys/dev/usb/net/if_muge.c Sat May 19 18:44:29 2018 (r333884) @@ -1816,9 +1816,10 @@ muge_setmulti(struct usb_ether *ue) } else { /* Lock the mac address list before hashing each of them. */ if_maddr_rlock(ifp); - if (!TAILQ_EMPTY(&ifp->if_multiaddrs)) { + if (!CK_STAILQ_EMPTY(&ifp->if_multiaddrs)) { i = 1; - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, + ifma_link) { /* First fill up the perfect address table. */ addr = LLADDR((struct sockaddr_dl *) ifma->ifma_addr); From owner-svn-src-all@freebsd.org Sat May 19 18:50:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93F2FEDE6BC; Sat, 19 May 2018 18:50:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A2097AB3A; Sat, 19 May 2018 18:50:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CD292F7E; Sat, 19 May 2018 18:50:59 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JIoxAX073534; Sat, 19 May 2018 18:50:59 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JIoxrv073533; Sat, 19 May 2018 18:50:59 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805191850.w4JIoxrv073533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 18:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333885 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 333885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 18:50:59 -0000 Author: mmacy Date: Sat May 19 18:50:58 2018 New Revision: 333885 URL: https://svnweb.freebsd.org/changeset/base/333885 Log: ctf dwarf: don't report "no dwarf entry" as if it were an error Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat May 19 18:44:29 2018 (r333884) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat May 19 18:50:58 2018 (r333885) @@ -1941,9 +1941,12 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused } if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) - terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); - + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) + exit(0); + else + terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); + } if ((cu = die_sibling(&dw, NULL)) == NULL || (((child = die_child(&dw, cu)) == NULL) && should_have_dwarf(elf))) { From owner-svn-src-all@freebsd.org Sat May 19 19:00:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83BB1EDEC27; Sat, 19 May 2018 19:00:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3447F7B055; Sat, 19 May 2018 19:00:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15C1830FF; Sat, 19 May 2018 19:00:05 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JJ04Mp078250; Sat, 19 May 2018 19:00:04 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JJ04DG078248; Sat, 19 May 2018 19:00:04 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805191900.w4JJ04DG078248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 19:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333886 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 333886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:00:05 -0000 Author: mmacy Date: Sat May 19 19:00:04 2018 New Revision: 333886 URL: https://svnweb.freebsd.org/changeset/base/333886 Log: net: fix uninitialized variable warning Modified: head/sys/net/if.c head/sys/net/iflib.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat May 19 18:50:58 2018 (r333885) +++ head/sys/net/if.c Sat May 19 19:00:04 2018 (r333886) @@ -2967,7 +2967,7 @@ int ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) { #ifdef COMPAT_FREEBSD32 - caddr_t saved_data; + caddr_t saved_data = NULL; struct ifmediareq ifmr; #endif struct ifmediareq *ifmrp; Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat May 19 18:50:58 2018 (r333885) +++ head/sys/net/iflib.c Sat May 19 19:00:04 2018 (r333886) @@ -2599,8 +2599,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) iflib_fl_t fl; struct ifnet *ifp; int lro_enabled; - bool lro_possible = false; - bool v4_forwarding, v6_forwarding; + bool v4_forwarding, v6_forwarding, lro_possible; /* * XXX early demux data packets so that if_input processing only handles @@ -2608,6 +2607,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) */ struct mbuf *m, *mh, *mt, *mf; + lro_possible = v4_forwarding = v6_forwarding = false; ifp = ctx->ifc_ifp; mh = mt = NULL; MPASS(budget > 0); From owner-svn-src-all@freebsd.org Sat May 19 19:09:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10F52EE0147; Sat, 19 May 2018 19:09:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B92717B6B0; Sat, 19 May 2018 19:09: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 963D632AD; Sat, 19 May 2018 19:09: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 w4JJ9fgB083558; Sat, 19 May 2018 19:09:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JJ9fqE083557; Sat, 19 May 2018 19:09:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201805191909.w4JJ9fqE083557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 19 May 2018 19:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r333887 - stable/11/sys/contrib/rdma/krping X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/contrib/rdma/krping X-SVN-Commit-Revision: 333887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:09:42 -0000 Author: hselasky Date: Sat May 19 19:09:41 2018 New Revision: 333887 URL: https://svnweb.freebsd.org/changeset/base/333887 Log: MFC r333623: Add support for setting type of service, TOS, for outgoing RDMA connections in the krping kernel test utility. Approved by: re (gjb) Sponsored by: Mellanox Technologies Modified: stable/11/sys/contrib/rdma/krping/krping.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/11/sys/contrib/rdma/krping/krping.c Sat May 19 19:00:04 2018 (r333886) +++ stable/11/sys/contrib/rdma/krping/krping.c Sat May 19 19:09:41 2018 (r333887) @@ -96,6 +96,7 @@ static const struct krping_option krping_opts[] = { {"rlat", OPT_NOPARAM, 'L'}, {"bw", OPT_NOPARAM, 'B'}, {"duplex", OPT_NOPARAM, 'd'}, + {"tos", OPT_INT, 't'}, {"txdepth", OPT_INT, 'T'}, {"poll", OPT_NOPARAM, 'P'}, {"local_dma_lkey", OPT_NOPARAM, 'Z'}, @@ -234,6 +235,7 @@ struct krping_cb { int txdepth; /* SQ depth */ int local_dma_lkey; /* use 0 for lkey */ int frtest; /* reg test */ + int tos; /* type of service */ /* CM stuff */ struct rdma_cm_id *cm_id; /* connection on client side,*/ @@ -1918,6 +1920,10 @@ static void krping_run_client(struct krping_cb *cb) struct ib_recv_wr *bad_wr; int ret; + /* set type of service, if any */ + if (cb->tos != 0) + rdma_set_service_type(cb->cm_id, cb->tos); + ret = krping_bind_client(cb); if (ret) return; @@ -2096,6 +2102,10 @@ int krping_doit(char *cmd) break; case 'I': cb->server_invalidate = 1; + break; + case 't': + cb->tos = optint; + DEBUG_LOG("type of service, tos=%d\n", (int) cb->tos); break; case 'T': cb->txdepth = optint; From owner-svn-src-all@freebsd.org Sat May 19 19:12:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 197F5EE03A0; Sat, 19 May 2018 19:12:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 AA5557BA38; Sat, 19 May 2018 19:12:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id g14-v6so10031515ioc.7; Sat, 19 May 2018 12:12:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=1EZ7DjtLmSw+lI/ADwh2kLGknNLRNpOYQ+1MD44LFbk=; b=t1jps2fvY6KM0SAc9MHgtEpkMYAOvsw1jx99TDvgA8yyplEL9G/CkBPruH1a8aRA57 5zKFt9LO+iT0oSEfMsNDDST1HvcPnx+xfcpboOZ/GFBa81qCtnNv41d3MWCn0eKsSkfI aRcDEfGtJ54j4ZCcJhg4SYGuQXLWf1Y/Z3jVh2kOE35kNaOFoWMpF58fKWQAq2mxphvx UO8duTnZ5nCoJVs3ZC88OpYjFBOqauZdzqvHsd0C3uesDSzfxXLG/UfIwIMvIDpiD4ae zXx81eqKYmgZaxFPcAJmBMLYjX6dTIvHom4GDV/FbMsu7jZLFR9vPv7e6wA1qCBw+ISz 7PDQ== X-Gm-Message-State: ALKqPweeWgisWTM7ze80CfwdXwNIh+p5FuFJJZfIkBMo79XTiGTcuXak Fx2NcZJKmstXok8EQDO+GKLvLJih X-Google-Smtp-Source: AB8JxZoVIzSjasRHZqoazglSGz1UtpKvwVOX0GaOxq9VbeeJwcSiN540/xh9Bt5FWLpFzfhRnRwtDg== X-Received: by 2002:a6b:1fd2:: with SMTP id f201-v6mr16369212iof.74.1526757131143; Sat, 19 May 2018 12:12:11 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id a69-v6sm6177404ioa.56.2018.05.19.12.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 May 2018 12:12:11 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id q72-v6so17070709itc.0; Sat, 19 May 2018 12:12:10 -0700 (PDT) X-Received: by 2002:a24:1f4a:: with SMTP id d71-v6mr12035123itd.53.1526757130656; Sat, 19 May 2018 12:12:10 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:d81:0:0:0:0:0 with HTTP; Sat, 19 May 2018 12:12:10 -0700 (PDT) In-Reply-To: <20180519093345.GH6887@kib.kiev.ua> References: <201805190407.w4J470xC021897@repo.freebsd.org> <20180519093345.GH6887@kib.kiev.ua> From: Conrad Meyer Date: Sat, 19 May 2018 12:12:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333840 - head/sys/kern To: Konstantin Belousov Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:12:18 -0000 On Sat, May 19, 2018 at 2:33 AM, Konstantin Belousov wrote: > On Sat, May 19, 2018 at 04:07:00AM +0000, Matt Macy wrote: >> Author: mmacy >> Date: Sat May 19 04:07:00 2018 >> New Revision: 333840 >> URL: https://svnweb.freebsd.org/changeset/base/333840 >> >> Log: >> filt_timerdetach: only assign to old if we're going to check it in >> a KASSERT > You also removed the decrement from non-debug builds. Nope =E2=80=94 non-INVARIANTS DBGSET(a,b) was defined as (b). But reverted later in r333856 anyway. Conrad From owner-svn-src-all@freebsd.org Sat May 19 19:30:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 312B7EE0F32; Sat, 19 May 2018 19:30:43 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA52C7C34F; Sat, 19 May 2018 19:30:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC850396B; Sat, 19 May 2018 19:30:42 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JJUgiU095098; Sat, 19 May 2018 19:30:42 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JJUgMY094880; Sat, 19 May 2018 19:30:42 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201805191930.w4JJUgMY094880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 19 May 2018 19:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333888 - in head/sys/ufs: ffs ufs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys/ufs: ffs ufs X-SVN-Commit-Revision: 333888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:30:43 -0000 Author: mmacy Date: Sat May 19 19:30:42 2018 New Revision: 333888 URL: https://svnweb.freebsd.org/changeset/base/333888 Log: ufs: remove cgbno variable where unused Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ufs/ufs_gjournal.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat May 19 19:09:41 2018 (r333887) +++ head/sys/ufs/ffs/ffs_alloc.c Sat May 19 19:30:42 2018 (r333888) @@ -2438,7 +2438,6 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd) { struct cg *cgp; struct buf *bp; - ufs2_daddr_t cgbno; int error; u_int cg; u_int8_t *inosused; @@ -2449,11 +2448,9 @@ ffs_freefile(ump, fs, devvp, ino, mode, wkhd) /* devvp is a snapshot */ MPASS(devvp->v_mount->mnt_data == ump); dev = ump->um_devvp->v_rdev; - cgbno = fragstoblks(fs, cgtod(fs, cg)); } else if (devvp->v_type == VCHR) { /* devvp is a normal disk device */ dev = devvp->v_rdev; - cgbno = fsbtodb(fs, cgtod(fs, cg)); } else { bp = NULL; return (0); @@ -2505,21 +2502,13 @@ ffs_checkfreefile(fs, devvp, ino) { struct cg *cgp; struct buf *bp; - ufs2_daddr_t cgbno; int ret, error; u_int cg; u_int8_t *inosused; cg = ino_to_cg(fs, ino); - if (devvp->v_type == VREG) { - /* devvp is a snapshot */ - cgbno = fragstoblks(fs, cgtod(fs, cg)); - } else if (devvp->v_type == VCHR) { - /* devvp is a normal disk device */ - cgbno = fsbtodb(fs, cgtod(fs, cg)); - } else { + if ((devvp->v_type != VREG) && (devvp->v_type != VCHR)) return (1); - } if (ino >= fs->fs_ipg * fs->fs_ncg) return (1); if ((error = ffs_getcg(fs, devvp, cg, &bp, &cgp)) != 0) Modified: head/sys/ufs/ufs/ufs_gjournal.c ============================================================================== --- head/sys/ufs/ufs/ufs_gjournal.c Sat May 19 19:09:41 2018 (r333887) +++ head/sys/ufs/ufs/ufs_gjournal.c Sat May 19 19:30:42 2018 (r333888) @@ -57,7 +57,6 @@ ufs_gjournal_modref(struct vnode *vp, int count) { struct cg *cgp; struct buf *bp; - ufs2_daddr_t cgbno; int error, cg; struct cdev *dev; struct inode *ip; @@ -76,11 +75,9 @@ ufs_gjournal_modref(struct vnode *vp, int count) if (devvp->v_type == VREG) { /* devvp is a snapshot */ dev = VFSTOUFS(devvp->v_mount)->um_devvp->v_rdev; - cgbno = fragstoblks(fs, cgtod(fs, cg)); } else if (devvp->v_type == VCHR) { /* devvp is a normal disk device */ dev = devvp->v_rdev; - cgbno = fsbtodb(fs, cgtod(fs, cg)); } else { bp = NULL; return (EIO); From owner-svn-src-all@freebsd.org Sat May 19 19:44:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E9C9EE16DD; Sat, 19 May 2018 19:44:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::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 0CE1F7CC9C; Sat, 19 May 2018 19:44:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x241.google.com with SMTP id az12-v6so6476079plb.8; Sat, 19 May 2018 12:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jNVwiX8P8CmnOGsMA0853yl1SVpfCnlbMJkQZ+XihRs=; b=UeS+MsvF1FCdd0H4hFo/HF1BjHOw+SIGifWkcb6EQ4JfyzGsy03NW377oRjgOW3Atd LNzvvzsQZyRdbpFTcmvhQGylgUOCNBFWbelmly/TdKvrBbz578aAUI0MedoC+SAxTm0w /LUkX5UUFWg7hS0EskVOHpWWuxLh/hS1vRQ6jjh3RU0Yd9HeKmiRYIrJ9OKzydl+jyLu qMnvhfLyYK8Rgnd1WITq7RIhO9puK7wpjeZMEXJcBahkel3kGzoQzPsUHdZeXS8nab7q yjQkpmCDrIPEpnYyMIGt5tBOm66xWwKnyrX2I/EZMGwerpSUiTSEat6LXg5WHdhEuElC PB5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=jNVwiX8P8CmnOGsMA0853yl1SVpfCnlbMJkQZ+XihRs=; b=rXxytoAjzLjSzSiEc01nwd0nlAKte7y3dY6jV5/yhF9BapEntCc70CYn3EDcTfRJwm 35tp184iHgWgssAgrv1ZYLZcyMKj8MIVBQOLFDtHrf//jHMZNgjy4tsUkIYeaHh7DLc7 Ucyp1eL0dvl9QglSwhbKbAm6VJZk0GiP+cZKmvxzv74tlSWseVFMRCQjC/Q0Khn5UdfR LnNU0oPLyX8RuZG3zayp34Vge5afTMqbsps2hIyKXntT23/qJ3+svPs5niz2RAR/tHX3 7/28qb5P983A0965OMhHpgp3PdxE6FhW9gaaz1f5kLpIT4nNJqVwjVsfW9mjUvtlF+YP QjuQ== X-Gm-Message-State: ALKqPwfAQ2KujBCCm8ZJnV/yp+jPVmrSsfwFWGP0T0zAEOolOqDNpTC5 qvWSp4PumG2OhyOqAygfLwIHIg== X-Google-Smtp-Source: AB8JxZojlPlKuLiFTAG74Olym0H4nuVowr1RVvHnr/Tu532/iiVBwp45PqWJQrXBxw8x4eLONDR8lg== X-Received: by 2002:a17:902:40d:: with SMTP id 13-v6mr14575839ple.117.1526759087810; Sat, 19 May 2018 12:44:47 -0700 (PDT) Received: from raichu (toroon0560w-lp140-02-70-49-169-130.dsl.bell.ca. [70.49.169.130]) by smtp.gmail.com with ESMTPSA id q64-v6sm17213765pfg.180.2018.05.19.12.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 May 2018 12:44:46 -0700 (PDT) Sender: Mark Johnston Date: Sat, 19 May 2018 15:44:37 -0400 From: Mark Johnston To: Matthew Macy Cc: Ed Maste , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333872 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180519194437.GA21485@raichu> References: <201805190631.w4J6VHhr094225@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:44:49 -0000 On Sat, May 19, 2018 at 11:00:22AM -0700, Matthew Macy wrote: > On Sat, May 19, 2018 at 4:49 AM, Ed Maste wrote: > > On 19 May 2018 at 02:31, Matt Macy wrote: > >> Author: mmacy > >> Date: Sat May 19 06:31:17 2018 > >> New Revision: 333872 > >> URL: https://svnweb.freebsd.org/changeset/base/333872 > >> > >> Log: > >> ctfconvert: silence useless enum has too many values warning > > > > I agree it's reasonable to silence this warning as it is not > > actionable for almost everyone who encounters it. It does indicate a > > real problem in our tool chain though and I added an entry to > > https://wiki.freebsd.org/DTraceTODO. > > Conrad brought up the need to change the CTF ABI on IRC. This will > involve an on-disk format change which he and I believe to be > acceptable, but perhaps interoperability with other operating systems > is still considered important. I don't really think it's important. The main consideration is the toolchain. We use illumos as an upstream, which is pretty inactive at this point. Joyent's illumos fork has put a lot of work into the CTF toolchain, and OpenBSD has made some progress towards an ISC-licensed ctfconvert utility. I'd like to import the latter, since the permissive license means that we can use it in DDB. It requires more work because of some missing functionality, though. At some point I think we'd like to pursue one of these two upstreams, so it becomes a question of whether they're amenable to modifying the CTF binary format (and there are some other limitations that ought to be fixed in the process), and if not, whether it's painful to maintain the local modifications needed to support large enums. From owner-svn-src-all@freebsd.org Sat May 19 19:45:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0683BEE1743; Sat, 19 May 2018 19:45:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 860C37CDE5; Sat, 19 May 2018 19:45:26 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JJjMJm017156; Sat, 19 May 2018 12:45:22 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JJjMlk017155; Sat, 19 May 2018 12:45:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805191945.w4JJjMlk017155@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333880 - head/sys/kern In-Reply-To: <201805191729.w4JHTvOo032116@repo.freebsd.org> To: Warner Losh Date: Sat, 19 May 2018 12:45:22 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:45:27 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: imp > Date: Sat May 19 17:29:57 2018 > New Revision: 333880 > URL: https://svnweb.freebsd.org/changeset/base/333880 > > Log: > Restore the all rights reserved language. Put it on each of the prior > two copyrights. The line originated with the Berkeely Regents, who > we have not approached about removing it (it's honestly too trivial > to be worth that fight). Restore it to rwatson's line as well. He I actually doubt it would be much of a fight. > can decide if he wants it or not on his own. Matt clearly doesn't > want it, per project preference and his own statements on IRC. > > Noticed by: rgrimes@ Thank you. > > Modified: > head/sys/kern/uipc_usrreq.c > > Modified: head/sys/kern/uipc_usrreq.c > ============================================================================== > --- head/sys/kern/uipc_usrreq.c Sat May 19 16:44:12 2018 (r333879) > +++ head/sys/kern/uipc_usrreq.c Sat May 19 17:29:57 2018 (r333880) > @@ -2,8 +2,8 @@ > * SPDX-License-Identifier: BSD-3-Clause > * > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > - * The Regents of the University of California. > - * Copyright (c) 2004-2009 Robert N. M. Watson > + * The Regents of the University of California. All Rights Reserved. > + * Copyright (c) 2004-2009 Robert N. M. Watson All Rights Reserved. > * Copyright (c) 2018 Matthew Macy > * > * Redistribution and use in source and binary forms, with or without > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 19:52:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C143EE1C30; Sat, 19 May 2018 19:52:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 B0BEC7D47A; Sat, 19 May 2018 19:52:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id g1-v6so10112987iob.2; Sat, 19 May 2018 12:52:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=3L3ljYnXFjEgUrbjymcenWEs4HTui7CFseeF4xjKb5w=; b=cjAiaCnVciY1XRfmrykJMnqqxGy+goLyMf9DsjOVwA5yqZfAzCo0723FeWoRrXQczL 49PWPdF1R8EncIUx5Hpkq7+ngv0fdufBYdUN6WqGqcOdCW4fKK/WFVjeq2qiDDDqZodV NBkSsWgMciIRmQ4ANmVdD0kRitEu4Ui2r9TuhT49gEEwzUnkHKNeTmZwMpwjh6osZmsT CfTDOv88wBUdNaecud/RHpZfvzKiRdbO4owWv5kw6zotQArdHJjBv9fcYYkJvCro4ixv HOGal+V9QdNLAHppSwcHd+dERZGImQU8mc/WKMLxwBG4Ak5Pl3XsObA6NVqPw1+hqCpX 8PQg== X-Gm-Message-State: ALKqPwdJW/w/g57jMSLNGH29St6ve4bod38Tnti7GBQnhXF+XWfj7soG /lbuQvDHTkJ3tH5qD8gNkQwfgUzm X-Google-Smtp-Source: AB8JxZrQTIWBf7JG88mvcG4FW4T3WudZAAtEmH3Z7FpdJNYFs+eoB+EMu8gzSezuGxy2UqFxw8Umow== X-Received: by 2002:a6b:cd49:: with SMTP id d70-v6mr15580557iog.150.1526757800491; Sat, 19 May 2018 12:23:20 -0700 (PDT) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com. [209.85.223.178]) by smtp.gmail.com with ESMTPSA id t9-v6sm5939516ioa.82.2018.05.19.12.23.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 May 2018 12:23:19 -0700 (PDT) Received: by mail-io0-f178.google.com with SMTP id e20-v6so10055431iof.4; Sat, 19 May 2018 12:23:19 -0700 (PDT) X-Received: by 2002:a6b:545:: with SMTP id 66-v6mr15474684iof.173.1526757799746; Sat, 19 May 2018 12:23:19 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:d81:0:0:0:0:0 with HTTP; Sat, 19 May 2018 12:23:19 -0700 (PDT) In-Reply-To: <201805191850.w4JIoxrv073533@repo.freebsd.org> References: <201805191850.w4JIoxrv073533@repo.freebsd.org> From: Conrad Meyer Date: Sat, 19 May 2018 12:23:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r333885 - head/cddl/contrib/opensolaris/tools/ctf/cvt To: Matt Macy Cc: src-committers , 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:52:41 -0000 This is super nitpicky, and apologies, but: On Sat, May 19, 2018 at 11:50 AM, Matt Macy wrote: > Author: mmacy > Date: Sat May 19 18:50:58 2018 > New Revision: 333885 > URL: https://svnweb.freebsd.org/changeset/base/333885 > > Log: > ctf dwarf: don't report "no dwarf entry" as if it were an error > > Modified: > head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > > Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > ============================================================================== > --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat May 19 18:44:29 2018 (r333884) > +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat May 19 18:50:58 2018 (r333885) > @@ -1941,9 +1941,12 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > } > > if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, > - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) > - terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); > - > + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { The above line's indentation was correct before, and now isn't. > + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) There is some funky whitespace going on here. Thanks, Conrad > + exit(0); > + else > + terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); > + } > if ((cu = die_sibling(&dw, NULL)) == NULL || > (((child = die_child(&dw, cu)) == NULL) && > should_have_dwarf(elf))) { > From owner-svn-src-all@freebsd.org Sat May 19 19:53:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC059EE1CC5; Sat, 19 May 2018 19:53:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 916647D5D3; Sat, 19 May 2018 19:53:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5941D3F05; Sat, 19 May 2018 19:53:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JJrPDL009858; Sat, 19 May 2018 19:53:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JJrOfR009851; Sat, 19 May 2018 19:53:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805191953.w4JJrOfR009851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 19 May 2018 19:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333890 - in head/sys: amd64/conf arm64/conf i386/conf powerpc/conf sparc64/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/conf arm64/conf i386/conf powerpc/conf sparc64/conf X-SVN-Commit-Revision: 333890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:53:26 -0000 Author: markj Date: Sat May 19 19:53:23 2018 New Revision: 333890 URL: https://svnweb.freebsd.org/changeset/base/333890 Log: Enable kernel dump features in GENERIC for most platforms. This turns on support for kernel dump encryption and compression, and netdump. arm and mips platforms are omitted for now, since they are more constrained and don't benefit as much from these features. Reviewed by: cem, manu, rgrimes Tested by: manu (arm64) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D15465 Modified: head/sys/amd64/conf/GENERIC head/sys/arm64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sat May 19 19:46:57 2018 (r333889) +++ head/sys/amd64/conf/GENERIC Sat May 19 19:53:23 2018 (r333890) @@ -99,6 +99,12 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# Kernel dump features. +options EKCD # Support for encrypted kernel dumps +options GZIO # gzip-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps +options NETDUMP # netdump(4) client support + # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel options EARLY_AP_STARTUP Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Sat May 19 19:46:57 2018 (r333889) +++ head/sys/arm64/conf/GENERIC Sat May 19 19:53:23 2018 (r333890) @@ -93,6 +93,12 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence options USB_DEBUG # enable debug msgs +# Kernel dump features. +options EKCD # Support for encrypted kernel dumps +options GZIO # gzip-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps +options NETDUMP # netdump(4) client support + # SoC support options SOC_ALLWINNER_A64 options SOC_ALLWINNER_H5 Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sat May 19 19:46:57 2018 (r333889) +++ head/sys/i386/conf/GENERIC Sat May 19 19:53:23 2018 (r333890) @@ -95,6 +95,12 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# Kernel dump features. +options EKCD # Support for encrypted kernel dumps +options GZIO # gzip-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps +options NETDUMP # netdump(4) client support + # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel device apic # I/O APIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sat May 19 19:46:57 2018 (r333889) +++ head/sys/powerpc/conf/GENERIC Sat May 19 19:53:23 2018 (r333890) @@ -98,6 +98,12 @@ options WITNESS #Enable checks to detect deadlocks options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# Kernel dump features. +options EKCD # Support for encrypted kernel dumps +options GZIO # gzip-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps +options NETDUMP # netdump(4) client support + # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sat May 19 19:46:57 2018 (r333889) +++ head/sys/powerpc/conf/GENERIC64 Sat May 19 19:53:23 2018 (r333890) @@ -95,6 +95,12 @@ options WITNESS #Enable checks to detect deadlocks options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# Kernel dump features. +options EKCD # Support for encrypted kernel dumps +options GZIO # gzip-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps +options NETDUMP # netdump(4) client support + # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sat May 19 19:46:57 2018 (r333889) +++ head/sys/sparc64/conf/GENERIC Sat May 19 19:53:23 2018 (r333890) @@ -89,6 +89,12 @@ options WITNESS # Enable checks to detect deadlocks options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +# Kernel dump features. +options EKCD # Support for encrypted kernel dumps +options GZIO # gzip-compressed kernel and user dumps +options ZSTDIO # zstd-compressed kernel and user dumps +options NETDUMP # netdump(4) client support + # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-all@freebsd.org Sat May 19 19:55:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C953EE1E90 for ; Sat, 19 May 2018 19:55:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C18A67D7A3 for ; Sat, 19 May 2018 19:55:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id 144-v6so17004974iti.5 for ; Sat, 19 May 2018 12:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HnfwoxXh26+fwz2jYhlD4uOPSvjQtcuLbnT4UEjHOpM=; b=qefbbehMTPDtjdpAvRH8wUdQC5v/cAs9du64SQdFNeoyjX1FyAFCaplIxjtpCk66gB ZlTCNp5lvKPlpR7Mvx/tnz7kLUImjqvLt//q+YHw1TFiaIZoTujpyIPkUQ+IaPB/liqW QJQTq9G5vhx3nTrhwbnIPOFNuywSo0GEqZoBpVYSjyS931pqRnuuDYWQ2Q5wg/KHv8f3 oRc013D2HL4FETB67/WV7LRr20ggiQKQBUKjv3poI6R1biNzp+1r9413HJWymQ/IfahB hbWw09oJYkAf6kE2TPcKGJnDkbN8cZo/CIrOWLBhpulMG6gXtx1yDA9eQJbCbBb/tnKI zIEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=HnfwoxXh26+fwz2jYhlD4uOPSvjQtcuLbnT4UEjHOpM=; b=qL2Ovhh5kibXTw2y67XZeUATQVZNv/JJZUjd3mgLZlJYiwrY6XfJtgYSFfaMYg6EHc fWsoaySjZRJDva9OFBLlkV/KsbWx18f+M16oV2NREYyHh7VaV1m6ySlJyOBSEUexeYii FGt506pUSB8n8ZaOEFwG/AP8oqo2meYnyp9rtyOweDERXPfwfIXqAnnFBZsRla6rmv96 YngoEJrS3qPOMEn6HZPrfWq3/okO1aq3p5N0HTnezUXOH8o4CcHfzNz8mJ5ONOKaeZs/ ZXvi0fxpI2vgTf/CWcCDHBv+y9nHzykYTA77YaRTgM0frEYAt13YrI/RLKeN3FOfYgh9 XcDQ== X-Gm-Message-State: ALKqPwdib57wKs0HxkpJVwhBKLRfi2PXcGK9CRapOkGkZ1dM0lBT7u6o niDVptogKpHtWgv9fuhlaV/1SL4Luh7DaYAijnB82A== X-Google-Smtp-Source: AB8JxZovm31q7x9Fm1hglYEICYXDfDi0mTZdPf1a1B+/lNvk8xQngj2jZgCoxGEgL+pQPiOUK9zHfdMsyHRJiiMCBB4= X-Received: by 2002:a24:42c6:: with SMTP id i189-v6mr11979410itb.73.1526759756822; Sat, 19 May 2018 12:55:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Sat, 19 May 2018 12:55:56 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201805191945.w4JJjMlk017155@pdx.rh.CN85.dnsmgr.net> References: <201805191729.w4JHTvOo032116@repo.freebsd.org> <201805191945.w4JJjMlk017155@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sat, 19 May 2018 13:55:56 -0600 X-Google-Sender-Auth: Jn26nP9pAvnloz7oh82DX3yRfDE Message-ID: Subject: Re: svn commit: r333880 - head/sys/kern To: "Rodney W. Grimes" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 19:55:58 -0000 On Sat, May 19, 2018 at 1:45 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: imp > > Date: Sat May 19 17:29:57 2018 > > New Revision: 333880 > > URL: https://svnweb.freebsd.org/changeset/base/333880 > > > > Log: > > Restore the all rights reserved language. Put it on each of the prior > > two copyrights. The line originated with the Berkeely Regents, who > > we have not approached about removing it (it's honestly too trivial > > to be worth that fight). Restore it to rwatson's line as well. He > > I actually doubt it would be much of a fight. The hard part would be finding the right person to ask to get their OK, then getting their lawyers to sign off on it. At a time when University budgets are under extreme pressure, I'm pessimistic that people would want to spend any money to fix this largely cosmetic issue. It seems like too much of a hassle, though I'd welcome anybody with the right connections proving me wrong by securing permission :) Warner > can decide if he wants it or not on his own. Matt clearly doesn't > > want it, per project preference and his own statements on IRC. > > > > Noticed by: rgrimes@ > > Thank you. > > > > > Modified: > > head/sys/kern/uipc_usrreq.c > > > > Modified: head/sys/kern/uipc_usrreq.c > > ============================================================ > ================== > > --- head/sys/kern/uipc_usrreq.c Sat May 19 16:44:12 2018 > (r333879) > > +++ head/sys/kern/uipc_usrreq.c Sat May 19 17:29:57 2018 > (r333880) > > @@ -2,8 +2,8 @@ > > * SPDX-License-Identifier: BSD-3-Clause > > * > > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > > - * The Regents of the University of California. > > - * Copyright (c) 2004-2009 Robert N. M. Watson > > + * The Regents of the University of California. All Rights Reserved. > > + * Copyright (c) 2004-2009 Robert N. M. Watson All Rights Reserved. > > * Copyright (c) 2018 Matthew Macy > > * > > * Redistribution and use in source and binary forms, with or without > > > > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Sat May 19 20:02:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EEA6EE2393; Sat, 19 May 2018 20:02:29 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE6E7DD7D; Sat, 19 May 2018 20:02:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JK2OrH017231; Sat, 19 May 2018 13:02:24 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JK2Oua017230; Sat, 19 May 2018 13:02:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805192002.w4JK2Oua017230@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333880 - head/sys/kern In-Reply-To: To: Warner Losh Date: Sat, 19 May 2018 13:02:24 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:02:29 -0000 [ Charset UTF-8 unsupported, converting... ] > On Sat, May 19, 2018 at 1:45 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > > Author: imp > > > Date: Sat May 19 17:29:57 2018 > > > New Revision: 333880 > > > URL: https://svnweb.freebsd.org/changeset/base/333880 > > > > > > Log: > > > Restore the all rights reserved language. Put it on each of the prior > > > two copyrights. The line originated with the Berkeely Regents, who > > > we have not approached about removing it (it's honestly too trivial > > > to be worth that fight). Restore it to rwatson's line as well. He > > > > I actually doubt it would be much of a fight. > > > The hard part would be finding the right person to ask to get their OK, > then getting their lawyers to sign off on it. At a time when University > budgets are under extreme pressure, I'm pessimistic that people would want > to spend any money to fix this largely cosmetic issue. It seems like too > much of a hassle, though I'd welcome anybody with the right connections > proving me wrong by securing permission :) I'll try to verify that the information I have is still current and correct, I believe it is a mater of contacting the "Office of Technology Licensing" at the University. That would be who issues the changes to reduce the 4 clauses licenses, etc. > > Warner > > > can decide if he wants it or not on his own. Matt clearly doesn't > > > want it, per project preference and his own statements on IRC. > > > > > > Noticed by: rgrimes@ > > > > Thank you. > > > > > > > > Modified: > > > head/sys/kern/uipc_usrreq.c > > > > > > Modified: head/sys/kern/uipc_usrreq.c > > > ============================================================ > > ================== > > > --- head/sys/kern/uipc_usrreq.c Sat May 19 16:44:12 2018 > > (r333879) > > > +++ head/sys/kern/uipc_usrreq.c Sat May 19 17:29:57 2018 > > (r333880) > > > @@ -2,8 +2,8 @@ > > > * SPDX-License-Identifier: BSD-3-Clause > > > * > > > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > > > - * The Regents of the University of California. > > > - * Copyright (c) 2004-2009 Robert N. M. Watson > > > + * The Regents of the University of California. All Rights Reserved. > > > + * Copyright (c) 2004-2009 Robert N. M. Watson All Rights Reserved. > > > * Copyright (c) 2018 Matthew Macy > > > * > > > * Redistribution and use in source and binary forms, with or without > > > > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 20:15:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1154EEE278B; Sat, 19 May 2018 20:15:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 740877E280; Sat, 19 May 2018 20:15:02 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JKExbC017284; Sat, 19 May 2018 13:14:59 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JKEx9J017283; Sat, 19 May 2018 13:14:59 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805192014.w4JKEx9J017283@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333880 - head/sys/kern In-Reply-To: <201805192002.w4JK2Oua017230@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Sat, 19 May 2018 13:14:59 -0700 (PDT) CC: Warner Losh , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:15:04 -0000 > [ Charset UTF-8 unsupported, converting... ] > > On Sat, May 19, 2018 at 1:45 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > Author: imp > > > > Date: Sat May 19 17:29:57 2018 > > > > New Revision: 333880 > > > > URL: https://svnweb.freebsd.org/changeset/base/333880 > > > > > > > > Log: > > > > Restore the all rights reserved language. Put it on each of the prior > > > > two copyrights. The line originated with the Berkeely Regents, who > > > > we have not approached about removing it (it's honestly too trivial > > > > to be worth that fight). Restore it to rwatson's line as well. He > > > > > > I actually doubt it would be much of a fight. > > > > > > The hard part would be finding the right person to ask to get their OK, > > then getting their lawyers to sign off on it. At a time when University > > budgets are under extreme pressure, I'm pessimistic that people would want > > to spend any money to fix this largely cosmetic issue. It seems like too > > much of a hassle, though I'd welcome anybody with the right connections > > proving me wrong by securing permission :) > > I'll try to verify that the information I have is still current and > correct, I believe it is a mater of contacting the "Office of Technology > Licensing" at the University. > > That would be who issues the changes to reduce the 4 clauses licenses, etc. As a further footnote, I have already searched the source code for UCB Copyrights that could of fallen in the odd area of requireing this clause by the nature of being initially published (oldest copyright) by the university before the US signed the Berne convention in 1989, iirc the only files this turned up are actually copyrighted University of Utah. > > Warner > > > can decide if he wants it or not on his own. Matt clearly doesn't > > > > want it, per project preference and his own statements on IRC. > > > > > > > > Noticed by: rgrimes@ > > > > > > Thank you. > > > > > > > > > > > Modified: > > > > head/sys/kern/uipc_usrreq.c > > > > > > > > Modified: head/sys/kern/uipc_usrreq.c > > > > ============================================================ > > > ================== > > > > --- head/sys/kern/uipc_usrreq.c Sat May 19 16:44:12 2018 > > > (r333879) > > > > +++ head/sys/kern/uipc_usrreq.c Sat May 19 17:29:57 2018 > > > (r333880) > > > > @@ -2,8 +2,8 @@ > > > > * SPDX-License-Identifier: BSD-3-Clause > > > > * > > > > * Copyright (c) 1982, 1986, 1989, 1991, 1993 > > > > - * The Regents of the University of California. > > > > - * Copyright (c) 2004-2009 Robert N. M. Watson > > > > + * The Regents of the University of California. All Rights Reserved. > > > > + * Copyright (c) 2004-2009 Robert N. M. Watson All Rights Reserved. > > > > * Copyright (c) 2018 Matthew Macy > > > > * > > > > * Redistribution and use in source and binary forms, with or without > > > -- > > > Rod Grimes > > > rgrimes@freebsd.org > -- > Rod Grimes rgrimes@freebsd.org -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 20:26:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D92C2EE2CAC; Sat, 19 May 2018 20:26:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C7887E951; Sat, 19 May 2018 20:26: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DA34444C; Sat, 19 May 2018 20:26: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 w4JKQXxj025686; Sat, 19 May 2018 20:26:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JKQXVQ025685; Sat, 19 May 2018 20:26:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805192026.w4JKQXVQ025685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 19 May 2018 20:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333891 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:26:34 -0000 Author: kib Date: Sat May 19 20:26:33 2018 New Revision: 333891 URL: https://svnweb.freebsd.org/changeset/base/333891 Log: Fix IBRS handling around MWAIT. The intent was to disable IBPB and IBRS around MWAIT, and re-enable on the sleep end. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 19 19:53:23 2018 (r333890) +++ head/sys/x86/x86/cpu_machdep.c Sat May 19 20:26:33 2018 (r333891) @@ -166,11 +166,11 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) KASSERT(atomic_load_int(state) == STATE_SLEEPING, ("cpu_mwait_cx: wrong monitorbuf state")); atomic_store_int(state, STATE_MWAIT); - handle_ibrs_entry(); + handle_ibrs_exit(); cpu_monitor(state, 0, 0); if (atomic_load_int(state) == STATE_MWAIT) cpu_mwait(MWAIT_INTRBREAK, mwait_hint); - handle_ibrs_exit(); + handle_ibrs_entry(); /* * We should exit on any event that interrupts mwait, because From owner-svn-src-all@freebsd.org Sat May 19 20:29:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E95AFEE2E06; Sat, 19 May 2018 20:28:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90CBB7EB12; Sat, 19 May 2018 20:28:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C4C34451; Sat, 19 May 2018 20:28:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JKSxdu025849; Sat, 19 May 2018 20:28:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JKSxRE025848; Sat, 19 May 2018 20:28:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805192028.w4JKSxRE025848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 19 May 2018 20:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333892 - head/sys/x86/xen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/xen X-SVN-Commit-Revision: 333892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:29:00 -0000 Author: kib Date: Sat May 19 20:28:59 2018 New Revision: 333892 URL: https://svnweb.freebsd.org/changeset/base/333892 Log: Fix PCID+PTI pmap operations on Xen/HVM. Install appropriate pti-aware shootdown IPI handlers, otherwise user page tables do not get enough invalidations. The non-pti handlers were used so far. Reported and tested by: cperciva Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/xen/xen_apic.c Modified: head/sys/x86/xen/xen_apic.c ============================================================================== --- head/sys/x86/xen/xen_apic.c Sat May 19 20:26:33 2018 (r333891) +++ head/sys/x86/xen/xen_apic.c Sat May 19 20:28:59 2018 (r333892) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -439,6 +440,46 @@ xen_invltlb_pcid(void *arg) invltlb_pcid_handler(); return (FILTER_HANDLED); } + +static int +xen_invltlb_invpcid_pti(void *arg) +{ + + invltlb_invpcid_pti_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlpg_invpcid_handler(void *arg) +{ + + invlpg_invpcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlpg_pcid_handler(void *arg) +{ + + invlpg_pcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlrng_invpcid_handler(void *arg) +{ + + invlrng_invpcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlrng_pcid_handler(void *arg) +{ + + invlrng_pcid_handler(); + return (FILTER_HANDLED); +} #endif static int @@ -529,8 +570,18 @@ xen_setup_cpus(void) #ifdef __amd64__ if (pmap_pcid_enabled) { - xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = invpcid_works ? - xen_invltlb_invpcid : xen_invltlb_pcid; + if (pti) + xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = + invpcid_works ? xen_invltlb_invpcid_pti : + xen_invltlb_pcid; + else + xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = + invpcid_works ? xen_invltlb_invpcid : + xen_invltlb_pcid; + xen_ipis[IPI_TO_IDX(IPI_INVLPG)].filter = invpcid_works ? + xen_invlpg_invpcid_handler : xen_invlpg_pcid_handler; + xen_ipis[IPI_TO_IDX(IPI_INVLRNG)].filter = invpcid_works ? + xen_invlrng_invpcid_handler : xen_invlrng_pcid_handler; } #endif CPU_FOREACH(i) From owner-svn-src-all@freebsd.org Sat May 19 20:33:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B299EE329A; Sat, 19 May 2018 20:33:01 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id C4C317EF9B; Sat, 19 May 2018 20:33:00 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 3A27E14882; Sat, 19 May 2018 20:32:54 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w4JKWrVj006816 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 19 May 2018 20:32:53 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w4JKWqNF006815; Sat, 19 May 2018 20:32:52 GMT (envelope-from phk) To: Warner Losh cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333880 - head/sys/kern In-reply-to: From: "Poul-Henning Kamp" References: <201805191729.w4JHTvOo032116@repo.freebsd.org> <201805191945.w4JJjMlk017155@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6813.1526761972.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sat, 19 May 2018 20:32:52 +0000 Message-ID: <6814.1526761972@critter.freebsd.dk> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:33:01 -0000 -------- In message , Warner Losh writes: >> > Log: >> > Restore the all rights reserved language. "All Rights Reserved" is boilerplate from the old "Buenos Aires" copyright convention, (a purely N+S American affair) and it lost all meaning and relevance for UCB when USA ratified the Berne Convention 60 years ago. The final Buenos Aires signatory joined Berne a couple of decades ago, rendering the convention null and void, and therefore this boilerplate has no meaning or relevance for anybody. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-all@freebsd.org Sat May 19 20:35:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC586EE3412; Sat, 19 May 2018 20:35:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54E247F13A; Sat, 19 May 2018 20:35:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17FFE45E8; Sat, 19 May 2018 20:35:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JKZGAI030801; Sat, 19 May 2018 20:35:16 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JKZG5D030797; Sat, 19 May 2018 20:35:16 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192035.w4JKZG5D030797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 20:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333893 - in head: share/man/man4 share/man/man7 usr.bin/ssh-copy-id X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: share/man/man4 share/man/man7 usr.bin/ssh-copy-id X-SVN-Commit-Revision: 333893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:35:17 -0000 Author: eadler Date: Sat May 19 20:35:15 2018 New Revision: 333893 URL: https://svnweb.freebsd.org/changeset/base/333893 Log: my copyright: some minor adjustments - remove "all rights reserved" from my copyright on my extensive contributions - belatedly add my name to tuning.7 which I was a large contributor to several years ago This commit can also serve as implicit permission for any formatting or non-substantive changes that FreeBSD wishes to make in the future. Modified: head/share/man/man4/full.4 head/share/man/man7/tuning.7 head/usr.bin/ssh-copy-id/ssh-copy-id.1 head/usr.bin/ssh-copy-id/ssh-copy-id.sh Modified: head/share/man/man4/full.4 ============================================================================== --- head/share/man/man4/full.4 Sat May 19 20:28:59 2018 (r333892) +++ head/share/man/man4/full.4 Sat May 19 20:35:15 2018 (r333893) @@ -1,5 +1,5 @@ .\" Copyright (c) 2014 -.\" Eitan Adler . All rights reserved. +.\" Eitan Adler . .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Sat May 19 20:28:59 2018 (r333892) +++ head/share/man/man7/tuning.7 Sat May 19 20:35:15 2018 (r333893) @@ -1,4 +1,5 @@ .\" Copyright (C) 2001 Matthew Dillon. All rights reserved. +.\" Copyright (C) 2012 Eitan Adler. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.1 ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.1 Sat May 19 20:28:59 2018 (r333892) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.1 Sat May 19 20:35:15 2018 (r333893) @@ -1,6 +1,5 @@ .\"- .\" Copyright (c) 2012 Eitan Adler -.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions Modified: head/usr.bin/ssh-copy-id/ssh-copy-id.sh ============================================================================== --- head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat May 19 20:28:59 2018 (r333892) +++ head/usr.bin/ssh-copy-id/ssh-copy-id.sh Sat May 19 20:35:15 2018 (r333893) @@ -3,7 +3,6 @@ # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # # Copyright (c) 2012 Eitan Adler -# All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Sat May 19 20:56:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5DB1EE3C1C; Sat, 19 May 2018 20:56:55 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0812C7FA74; Sat, 19 May 2018 20:56:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JKuoXK017439; Sat, 19 May 2018 13:56:50 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JKumb8017438; Sat, 19 May 2018 13:56:48 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805192056.w4JKumb8017438@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333880 - head/sys/kern In-Reply-To: <6814.1526761972@critter.freebsd.dk> To: Poul-Henning Kamp Date: Sat, 19 May 2018 13:56:48 -0700 (PDT) CC: Warner Losh , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:56:55 -0000 > -------- > In message > , Warner Losh writes: > > >> > Log: > >> > Restore the all rights reserved language. > > "All Rights Reserved" is boilerplate from the old "Buenos Aires" I believe that boilerplate is the wrong term here, it was a requirement of that convention to use this phrase if you wanted to be protected by the Buenos Aires convention. > copyright convention, (a purely N+S American affair) and it lost > all meaning and relevance for UCB when USA ratified the Berne > Convention 60 years ago. The US ratify Berne in 1989 would not mean you should stop asserting this clause, as if you wanted protection to apply in non-Berne, but Buenos Aires contries you would need the "All rights reserved." The only point at which you would really want to stop applying this would be after 2000 when all countries of the Buenos Aires convention had signed onto the Berne, thus making the Buenos Aires truely obsolete. I know these are fine hair splitting details, but that is how law tends to work out. > The final Buenos Aires signatory joined Berne a couple of decades > ago, rendering the convention null and void, and therefore this > boilerplate has no meaning or relevance for anybody. We understand that, but to remove it you technically do need the permission of the person who placed it there, as though the conventions in copyright no longer recognise this as having any meaning, law, especially US law, do recognize this as a valid assertion of rights. This would especially hold true as UCB placed this on these files *after* the us adopted the Berne convention, and before Nicaragu signed it in 2000. > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 20:57:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60988EE3C8A; Sat, 19 May 2018 20:57:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F6B57FBB3; Sat, 19 May 2018 20:57:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E65844942; Sat, 19 May 2018 20:57:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JKvMhn041201; Sat, 19 May 2018 20:57:22 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JKvMPZ041199; Sat, 19 May 2018 20:57:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192057.w4JKvMPZ041199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 20:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333894 - head/usr.sbin/mtest X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.sbin/mtest X-SVN-Commit-Revision: 333894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 20:57:23 -0000 Author: eadler Date: Sat May 19 20:57:22 2018 New Revision: 333894 URL: https://svnweb.freebsd.org/changeset/base/333894 Log: mtest: build with WARNS=3 Modified: head/usr.sbin/mtest/Makefile head/usr.sbin/mtest/mtest.c Modified: head/usr.sbin/mtest/Makefile ============================================================================== --- head/usr.sbin/mtest/Makefile Sat May 19 20:35:15 2018 (r333893) +++ head/usr.sbin/mtest/Makefile Sat May 19 20:57:22 2018 (r333894) @@ -6,7 +6,7 @@ PROG= mtest MAN= mtest.8 BINMODE= 555 -WARNS?= 2 +WARNS?= 3 # XXX This assumes INET support in the base system. CFLAGS+=-DINET Modified: head/usr.sbin/mtest/mtest.c ============================================================================== --- head/usr.sbin/mtest/mtest.c Sat May 19 20:35:15 2018 (r333893) +++ head/usr.sbin/mtest/mtest.c Sat May 19 20:57:22 2018 (r333894) @@ -388,6 +388,7 @@ process_cmd(char *cmd, int s, int s6, FILE *fp __unuse void *optval; uint32_t fmode, ifindex; socklen_t optlen; + size_t j; int af, error, f, flags, i, level, n, optname; af = AF_UNSPEC; @@ -736,8 +737,8 @@ process_cmd(char *cmd, int s, int s6, FILE *fp __unuse nsrc = MIN(nreqsrc, nsrc); fprintf(stderr, "hexdump of sources:\n"); uint8_t *bp = (uint8_t *)&sources[0]; - for (i = 0; i < (nsrc * sizeof(sources[0])); i++) { - fprintf(stderr, "%02x", bp[i]); + for (j = 0; j < (nsrc * sizeof(sources[0])); j++) { + fprintf(stderr, "%02x", bp[j]); } fprintf(stderr, "\nend hexdump\n"); From owner-svn-src-all@freebsd.org Sat May 19 21:02:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B05BEE4002 for ; Sat, 19 May 2018 21:02:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B7EF80098 for ; Sat, 19 May 2018 21:02:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22a.google.com with SMTP id t23-v6so10211433ioc.10 for ; Sat, 19 May 2018 14:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=daSmASm28ytttzCNCCtoB6LKTYAuOjHLqYdYL2S9kKA=; b=rdAi2xxDeouUwhWD/ZqgJg4Kmtv1oT6cUgu/khlf7hTAzdLcwEHN5MLCLDTAU5ADjn z0qbZQbjbjDjqGifjFn6hpsSOqZGzgAjviDfWHDeYSkG8B8xquUM9nY+oYVpqvGVO9Fm 9uaKQVinN/Ahu2i25au2JRtEPtIw1ZOjGFjRIDJa21I2gvu1aq46PZi0/oPTYslj9M/l 61HQ/2mvF5PTMrYsfhIbC9uM/TEP9R1cRO78bomErNoI5ANmlNdoWGzN+JOimy4TvD9B rbJ6eWmYN1ePCjSTzF7TJN45ZY/25znubM6+hmOdk48TnKjcw/194dPDC0l7UQuc7yXs IC9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=daSmASm28ytttzCNCCtoB6LKTYAuOjHLqYdYL2S9kKA=; b=GpEgT7xtyz4s34+OoOqlBfaV05R0JzgE24oVa0h7COAfVUSTJoAXF5k1LhWe5E8Vgp XqDzsL6eCQfqGEmW4HttHE+e14cmg2pmLkcumKpouO3JV0mpS/Y/zM1oKvvyBOR085cv U58him9W1tneXUaGDefmkF/e/j+BFZ4dhaehqpSjI0l6hYjd55qVD6vUXRst6qxapOrL ZvC953iW92pI159sSFs0e+IJxhKjWWmckjB/JAeqDwRNvNrjtN2DX7Tq2Nu9efnkRS6y 3Vi6HXGMsPd6JOQ+5x5ms7+gDGcffj81mDHYDKBgEwRV+zu6eggqA5+aIdlGPOWf2/0p HWHw== X-Gm-Message-State: ALKqPwedSRtylmCM0iTP+vCzlI5VJtyumJg0/orvdEi9U8gDPhMOIZ6a U+66z9m8S2S0DFrv7EnG1HvPHl03m5OYUdmj3hPuJQ== X-Google-Smtp-Source: AB8JxZoxHNukO9NN3ZzKmwzs+4j5R8kFfq4Y39uSOgQRy0xgparHR2uw1Vn+JE5uBv6DPcDlq5XtB8R1V9KhxBcVTao= X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr15155867iof.299.1526763748533; Sat, 19 May 2018 14:02:28 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:a649:0:0:0:0:0 with HTTP; Sat, 19 May 2018 14:02:27 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <6814.1526761972@critter.freebsd.dk> References: <201805191729.w4JHTvOo032116@repo.freebsd.org> <201805191945.w4JJjMlk017155@pdx.rh.CN85.dnsmgr.net> <6814.1526761972@critter.freebsd.dk> From: Warner Losh Date: Sat, 19 May 2018 15:02:27 -0600 X-Google-Sender-Auth: XqsepSzRrhzkuZ7uCyUqGhph7rk Message-ID: Subject: Re: svn commit: r333880 - head/sys/kern To: Poul-Henning Kamp Cc: "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 21:02:29 -0000 On Sat, May 19, 2018 at 2:32 PM, Poul-Henning Kamp wrote: > -------- > In message mail.gmail.com> > , Warner Losh writes: > > >> > Log: > >> > Restore the all rights reserved language. > > "All Rights Reserved" is boilerplate from the old "Buenos Aires" > copyright convention, (a purely N+S American affair) and it lost > all meaning and relevance for UCB when USA ratified the Berne > Convention 60 years ago. > The US ratified the Berne Convention in 1989, which falls in the middle of the 4.x BSD releases... Relevant for 4.3, but not 4.4. > The final Buenos Aires signatory joined Berne a couple of decades > ago, rendering the convention null and void, and therefore this > boilerplate has no meaning or relevance for anybody. > Right, I get that. However, someone removed it. Even though it's useless at this point, I don't believe we can remove it. Warner From owner-svn-src-all@freebsd.org Sat May 19 21:09:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 586EDEE42A8; Sat, 19 May 2018 21:09:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA91A803DA; Sat, 19 May 2018 21:09:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4JL9tfx017501; Sat, 19 May 2018 14:09:55 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4JL9ti7017500; Sat, 19 May 2018 14:09:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805192109.w4JL9ti7017500@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r333880 - head/sys/kern In-Reply-To: To: Warner Losh Date: Sat, 19 May 2018 14:09:55 -0700 (PDT) CC: Poul-Henning Kamp , "Rodney W. Grimes" , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 21:09:59 -0000 > On Sat, May 19, 2018 at 2:32 PM, Poul-Henning Kamp > wrote: > > > -------- > > In message > mail.gmail.com> > > , Warner Losh writes: > > > > >> > Log: > > >> > Restore the all rights reserved language. > > > > "All Rights Reserved" is boilerplate from the old "Buenos Aires" > > copyright convention, (a purely N+S American affair) and it lost > > all meaning and relevance for UCB when USA ratified the Berne > > Convention 60 years ago. > > > > The US ratified the Berne Convention in 1989, which falls in the middle of > the 4.x BSD releases... Relevant for 4.3, but not 4.4. It is not just that the US ratified in 1989 thats important, it is actually more important that the *last* member of the Buenos Aires convention adopted Berne in 2000, until then if you wanted protection, in say Nicaragua, you would need this phrase in your work to be protected by those who are members of Buenos Aires, but not Berne. > > The final Buenos Aires signatory joined Berne a couple of decades > > ago, rendering the convention null and void, and therefore this > > boilerplate has no meaning or relevance for anybody. > > > > Right, I get that. However, someone removed it. Even though it's useless at > this point, I don't believe we can remove it. I fully agree with that. There may however be an issue of ever removing it from works first published between 1989 and 2000, though I do not believe that to be the case, it is certainly a grey area. > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat May 19 21:26:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C224EE4B9B; Sat, 19 May 2018 21:26:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41ABB80E10; Sat, 19 May 2018 21:26:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 224674E32; Sat, 19 May 2018 21:26:08 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JLQ8qq056322; Sat, 19 May 2018 21:26:08 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JLQ8CS056321; Sat, 19 May 2018 21:26:08 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201805192126.w4JLQ8CS056321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 19 May 2018 21:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333895 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 333895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 21:26:08 -0000 Author: cy Date: Sat May 19 21:26:07 2018 New Revision: 333895 URL: https://svnweb.freebsd.org/changeset/base/333895 Log: Conform to Berne Convention. Prompted by: Recent discussion MFC after: 3 days Modified: head/lib/libc/stdio/gets_s.c Modified: head/lib/libc/stdio/gets_s.c ============================================================================== --- head/lib/libc/stdio/gets_s.c Sat May 19 20:57:22 2018 (r333894) +++ head/lib/libc/stdio/gets_s.c Sat May 19 21:26:07 2018 (r333895) @@ -4,7 +4,7 @@ * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 2017, 2018 - * Cyril S. E. Schubert. All rights reserved. + * Cyril S. E. Schubert * * This code is derived from software contributed to Berkeley by * Chris Torek. From owner-svn-src-all@freebsd.org Sat May 19 21:36:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D75EEE50AE; Sat, 19 May 2018 21:36:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F31981337; Sat, 19 May 2018 21:36:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E46374FF0; Sat, 19 May 2018 21:36:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JLatIs061325; Sat, 19 May 2018 21:36:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JLatNT061324; Sat, 19 May 2018 21:36:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201805192136.w4JLatNT061324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 19 May 2018 21:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333896 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 333896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 21:36:56 -0000 Author: kib Date: Sat May 19 21:36:55 2018 New Revision: 333896 URL: https://svnweb.freebsd.org/changeset/base/333896 Log: Style. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/x86/cpu_machdep.c Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Sat May 19 21:26:07 2018 (r333895) +++ head/sys/x86/x86/cpu_machdep.c Sat May 19 21:36:55 2018 (r333896) @@ -773,11 +773,11 @@ hw_ibrs_recalculate(void) if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) { if (hw_ibrs_disable) { - v= rdmsr(MSR_IA32_SPEC_CTRL); + v = rdmsr(MSR_IA32_SPEC_CTRL); v &= ~(uint64_t)IA32_SPEC_CTRL_IBRS; wrmsr(MSR_IA32_SPEC_CTRL, v); } else { - v= rdmsr(MSR_IA32_SPEC_CTRL); + v = rdmsr(MSR_IA32_SPEC_CTRL); v |= IA32_SPEC_CTRL_IBRS; wrmsr(MSR_IA32_SPEC_CTRL, v); } From owner-svn-src-all@freebsd.org Sat May 19 21:47:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7B64EE5635; Sat, 19 May 2018 21:47:29 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 666EF81870; Sat, 19 May 2018 21:47:28 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id D71C31484E; Sat, 19 May 2018 21:47:27 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w4JLlRbc007158 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 19 May 2018 21:47:27 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w4JLlQSG007157; Sat, 19 May 2018 21:47:26 GMT (envelope-from phk) To: rgrimes@freebsd.org, "Rodney W. Grimes" cc: Warner Losh , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333880 - head/sys/kern In-reply-to: <201805192056.w4JKumb8017438@pdx.rh.CN85.dnsmgr.net> From: "Poul-Henning Kamp" References: <201805192056.w4JKumb8017438@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7155.1526766446.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sat, 19 May 2018 21:47:26 +0000 Message-ID: <7156.1526766446@critter.freebsd.dk> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 21:47:30 -0000 -------- In message <201805192056.w4JKumb8017438@pdx.rh.CN85.dnsmgr.net>, "Rodney W= . Grimes" writes: >> -------- >> In message >> , Warner Losh writes: >> = >> >> > Log: >> >> > Restore the all rights reserved language. >> = >> "All Rights Reserved" is boilerplate from the old "Buenos Aires" > >I believe that boilerplate is the wrong term here, it was a >requirement of that convention to use this phrase if you wanted >to be protected by the Buenos Aires convention. The term "boilerplate" refers to technical and regulatory information all boilers were required to have affixed to them by law, when lawmakers tried to stem the carnage boiler-explosions caused. The labelling requirement turned into a machinist joke, where the old hand cermoneously would point out the boilerplate to the new man and tell him "That one prevents explosions." Largely because of that joke, the term "boilerplate" became synonymous with mandatory information which is present to satisfy regulations & lawyers, but doesn't serve any (other) useful purpose. So yes, boilerplate is exactly what it is. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-all@freebsd.org Sat May 19 22:04:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117C6EE5ECF; Sat, 19 May 2018 22:04:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BABBC8218D; Sat, 19 May 2018 22:04:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8249554C8; Sat, 19 May 2018 22:04:54 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JM4slH076120; Sat, 19 May 2018 22:04:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JM4sIM076119; Sat, 19 May 2018 22:04:54 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201805192204.w4JM4sIM076119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 19 May 2018 22:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333897 - head/sys/dev/vt/hw/ofwfb X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/dev/vt/hw/ofwfb X-SVN-Commit-Revision: 333897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 22:04:55 -0000 Author: nwhitehorn Date: Sat May 19 22:04:54 2018 New Revision: 333897 URL: https://svnweb.freebsd.org/changeset/base/333897 Log: Avoid writing to the frame buffer in early boot on PowerPC if the CPU's MMU is disabled. This expands some earlier logic and avoids a number of potential problems: 1. The CPU may not be able to access the framebuffer in real mode (real mode does not necessarily encompass all available memory, especially under a hypervisor). 2. Real mode accesses generally assume cacheability, so it might not even have worked. 3. The difference in cacheability between real mode and later (and potentially earlier) points in the boot with the MMU on may cause ERAT parity problems, resulting in a machine check. This fixes real-mode (usefdt=1) early boot on the G5 iMac, which was previously broken as a result of issue #3. Late boot will require some other fixups. Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Sat May 19 21:36:55 2018 (r333896) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Sat May 19 22:04:54 2018 (r333897) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #ifdef __sparc64__ #include #endif +#include #include #include @@ -138,6 +139,7 @@ ofwfb_bitblt_bitmap(struct vt_device *vd, const struct if (pmap_bootstrapped) { sc->fb_flags &= ~FB_FLAG_NOWRITE; ofwfb_initialize(vd); + vd->vd_driver->vd_blank(vd, TC_BLACK); } else { return; } @@ -490,11 +492,6 @@ ofwfb_init(struct vt_device *vd) OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase, NULL); sc->fb.fb_pbase = sc->fb.fb_vbase & ~DMAP_BASE_ADDRESS; - #ifdef __powerpc64__ - /* Real mode under a hypervisor probably doesn't cover FB */ - if (!(mfmsr() & (PSL_HV | PSL_DR))) - sc->fb.fb_flags |= FB_FLAG_NOWRITE; - #endif #else /* No ability to interpret assigned-addresses otherwise */ return (CN_DEAD); @@ -502,6 +499,17 @@ ofwfb_init(struct vt_device *vd) } + #if defined(__powerpc__) + /* + * If we are running on PowerPC in real mode (supported only on AIM + * CPUs), the frame buffer may be inaccessible (real mode does not + * necessarily cover all RAM) and may also be mapped with the wrong + * cache properties (all real mode accesses are assumed cacheable). + * Just don't write to it for the time being. + */ + if (!(cpu_features & PPC_FEATURE_BOOKE) && !(mfmsr() & PSL_DR)) + sc->fb.fb_flags |= FB_FLAG_NOWRITE; + #endif ofwfb_initialize(vd); vt_fb_init(vd); From owner-svn-src-all@freebsd.org Sat May 19 22:40:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5387EE6CFD; Sat, 19 May 2018 22:40:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 832D88305A; Sat, 19 May 2018 22:40:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F69259A5; Sat, 19 May 2018 22:40:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JMeOlQ091575; Sat, 19 May 2018 22:40:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JMeNDr091569; Sat, 19 May 2018 22:40:23 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192240.w4JMeNDr091569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 22:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333898 - in head: contrib/top usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in head: contrib/top usr.bin/top X-SVN-Commit-Revision: 333898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 22:40:25 -0000 Author: eadler Date: Sat May 19 22:40:23 2018 New Revision: 333898 URL: https://svnweb.freebsd.org/changeset/base/333898 Log: top(1): Migrate top to usr.bin We've been maintaining top(1) for a long time, and the upstream hasn't existed/been used in similarly as long. Make it clear that we own top(1) Tested with 'make universe'. Everything passed except MIPS which failed for unrelated reasons. Install also tested for amd64. Reviewed by: sbruno No objections: imp, mmacy Differential Revision: https://reviews.freebsd.org/D15387 Added: - copied unchanged from r333897, head/contrib/top/boolean.h - copied unchanged from r333897, head/contrib/top/commands.c head/usr.bin/top/commands.h - copied unchanged from r333897, head/contrib/top/commands.h - copied unchanged from r333897, head/contrib/top/display.c - copied unchanged from r333897, head/contrib/top/display.h - copied unchanged from r333897, head/contrib/top/getopt.c - copied unchanged from r333897, head/contrib/top/layout.h - copied unchanged from r333897, head/contrib/top/loadavg.h - copied unchanged from r333897, head/contrib/top/machine.h - copied unchanged from r333897, head/contrib/top/os.h - copied unchanged from r333897, head/contrib/top/patchlevel.h - copied unchanged from r333897, head/contrib/top/prime.c - copied unchanged from r333897, head/contrib/top/screen.c - copied unchanged from r333897, head/contrib/top/screen.h - copied unchanged from r333897, head/contrib/top/sigconv.awk head/usr.bin/top/top.1 (contents, props changed) - copied unchanged from r333897, head/contrib/top/top.c - copied unchanged from r333897, head/contrib/top/top.h - copied unchanged from r333897, head/contrib/top/top.local.hs - copied unchanged from r333897, head/contrib/top/top.xs - copied unchanged from r333897, head/contrib/top/username.c head/usr.bin/top/username.h - copied unchanged from r333897, head/contrib/top/username.h - copied unchanged from r333897, head/contrib/top/utils.c - copied unchanged from r333897, head/contrib/top/utils.h - copied unchanged from r333897, head/contrib/top/version.c Directory Properties: head/usr.bin/top/boolean.h (props changed) head/usr.bin/top/commands.c (props changed) head/usr.bin/top/display.c (props changed) head/usr.bin/top/display.h (props changed) head/usr.bin/top/getopt.c (props changed) head/usr.bin/top/layout.h (props changed) head/usr.bin/top/loadavg.h (props changed) head/usr.bin/top/machine.h (props changed) head/usr.bin/top/os.h (props changed) head/usr.bin/top/patchlevel.h (props changed) head/usr.bin/top/prime.c (props changed) head/usr.bin/top/screen.c (props changed) head/usr.bin/top/screen.h (props changed) head/usr.bin/top/sigconv.awk (props changed) head/usr.bin/top/top.c (props changed) head/usr.bin/top/top.h (props changed) head/usr.bin/top/top.local.hs (props changed) head/usr.bin/top/top.xs (props changed) head/usr.bin/top/username.c (props changed) head/usr.bin/top/utils.c (props changed) head/usr.bin/top/utils.h (props changed) head/usr.bin/top/version.c (props changed) Deleted: head/contrib/top/ head/usr.bin/top/top.local.1 Modified: head/usr.bin/top/Makefile (contents, props changed) Directory Properties: head/usr.bin/top/machine.c (props changed) Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sat May 19 22:04:54 2018 (r333897) +++ head/usr.bin/top/Makefile Sat May 19 22:40:23 2018 (r333898) @@ -1,36 +1,21 @@ # $FreeBSD$ -TOPDIR= ${SRCTOP}/contrib/top -.PATH: ${TOPDIR} - PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ - username.c utils.c version.c + username.c utils.c version.c SRCS+= sigdesc.h top.local.h -CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -DORDER -CFLAGS+= -I${.CURDIR} -I${TOPDIR} -I. +CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -DORDER -I ${.OBJDIR} +MAN= top.1 WARNS?= 0 -# -# The table size should be a prime number approximately twice as -# large as the number of lines in /etc/passwd. The default number -# is 20011; use /etc/make.conf to override this. -# -.if defined(TOP_TABLE_SIZE) -CFLAGS+= -D"Table_size=${TOP_TABLE_SIZE}" -.endif - LIBADD= ncursesw m kvm jail CLEANFILES= sigdesc.h -SIGCONV_AWK= ${SRCTOP}/contrib/top/sigconv.awk -STAGED_INCLUDE_DIR?= ${DESTDIR}/usr/include -SIGNAL_H= ${STAGED_INCLUDE_DIR}/sys/signal.h -sigdesc.h: ${SIGCONV_AWK} ${SIGNAL_H} - awk -f ${SIGCONV_AWK} < ${SIGNAL_H} > ${.TARGET} +SIGNAL_H= ${SRCTOP}/sys/sys/signal.h +sigdesc.h: sigconv.awk ${SIGNAL_H} + awk -f ${SRCTOP}/usr.bin/top/sigconv.awk < ${SIGNAL_H} > ${.TARGET} -CLEANFILES+= top.local.h top.x .SUFFIXES: .xs .x .hs .h .xs.x .hs.h: @${ECHO} Making ${.TARGET} from ${.IMPSRC} @@ -41,9 +26,5 @@ CLEANFILES+= top.local.h top.x -e's,%delay%,2,g' \ -e's,%random%,1,g' \ ${.IMPSRC} > ${.TARGET} - -CLEANFILES+= top.1 -top.1: top.x top.local.1 - cat ${.ALLSRC} > ${.TARGET} .include Copied: head/usr.bin/top/boolean.h (from r333897, head/contrib/top/boolean.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/top/boolean.h Sat May 19 22:40:23 2018 (r333898, copy of r333897, head/contrib/top/boolean.h) @@ -0,0 +1,5 @@ +/* My favorite names for boolean values */ +#define No 0 +#define Yes 1 +#define Maybe 2 /* tri-state boolean, actually */ + Copied: head/usr.bin/top/commands.c (from r333897, head/contrib/top/commands.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/top/commands.c Sat May 19 22:40:23 2018 (r333898, copy of r333897, head/contrib/top/commands.c) @@ -0,0 +1,542 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * + * $FreeBSD$ + */ + +/* + * This file contains the routines that implement some of the interactive + * mode commands. Note that some of the commands are implemented in-line + * in "main". This is necessary because they change the global state of + * "top" (i.e.: changing the number of processes to display). + */ + +#include "os.h" + +#include +#include + +#include +#include +#include +#include + +#include "commands.h" +#include "sigdesc.h" /* generated automatically */ +#include "top.h" +#include "boolean.h" +#include "utils.h" +#include "machine.h" + +extern int errno; + +extern char *copyright; + +/* imported from screen.c */ +extern int overstrike; + +int err_compar(); +char *err_string(); +static int str_adderr(char *str, int len, int err); +static int str_addarg(char *str, int len, char *arg, int first); + +/* + * show_help() - display the help screen; invoked in response to + * either 'h' or '?'. + */ + +void +show_help() + +{ + printf("Top version %s, %s\n", version_string(), copyright); + fputs("\n\n\ +A top users display for Unix\n\ +\n\ +These single-character commands are available:\n\ +\n\ +^L - redraw screen\n\ +q - quit\n\ +h or ? - help; show this text\n", stdout); + + /* not all commands are availalbe with overstrike terminals */ + if (overstrike) + { + fputs("\n\ +Other commands are also available, but this terminal is not\n\ +sophisticated enough to handle those commands gracefully.\n\n", stdout); + } + else + { + fputs("\ +C - toggle the displaying of weighted CPU percentage\n\ +d - change number of displays to show\n\ +e - list errors generated by last \"kill\" or \"renice\" command\n\ +H - toggle the displaying of threads\n\ +i or I - toggle the displaying of idle processes\n\ +j - toggle the displaying of jail ID\n\ +J - display processes for only one jail (+ selects all jails)\n\ +k - kill processes; send a signal to a list of processes\n\ +m - toggle the display between 'cpu' and 'io' modes\n\ +n or # - change number of processes to display\n", stdout); +#ifdef ORDER + if (displaymode == DISP_CPU) + fputs("\ +o - specify sort order (pri, size, res, cpu, time, threads, jid, pid)\n", + stdout); + else + fputs("\ +o - specify sort order (vcsw, ivcsw, read, write, fault, total, jid, pid)\n", + stdout); +#endif + fputs("\ +P - toggle the displaying of per-CPU statistics\n\ +r - renice a process\n\ +s - change number of seconds to delay between updates\n\ +S - toggle the displaying of system processes\n\ +a - toggle the displaying of process titles\n\ +t - toggle the display of this process\n\ +u - display processes for only one user (+ selects all users)\n\ +w - toggle the display of swap use for each process\n\ +z - toggle the displaying of the system idle process\n\ +\n\ +\n", stdout); + } +} + +/* + * Utility routines that help with some of the commands. + */ + +char *next_field(str) + +register char *str; + +{ + if ((str = strchr(str, ' ')) == NULL) + { + return(NULL); + } + *str = '\0'; + while (*++str == ' ') /* loop */; + + /* if there is nothing left of the string, return NULL */ + /* This fix is dedicated to Greg Earle */ + return(*str == '\0' ? NULL : str); +} + +int +scanint(str, intp) + +char *str; +int *intp; + +{ + register int val = 0; + register char ch; + + /* if there is nothing left of the string, flag it as an error */ + /* This fix is dedicated to Greg Earle */ + if (*str == '\0') + { + return(-1); + } + + while ((ch = *str++) != '\0') + { + if (isdigit(ch)) + { + val = val * 10 + (ch - '0'); + } + else if (isspace(ch)) + { + break; + } + else + { + return(-1); + } + } + *intp = val; + return(0); +} + +/* + * Some of the commands make system calls that could generate errors. + * These errors are collected up in an array of structures for later + * contemplation and display. Such routines return a string containing an + * error message, or NULL if no errors occurred. The next few routines are + * for manipulating and displaying these errors. We need an upper limit on + * the number of errors, so we arbitrarily choose 20. + */ + +#define ERRMAX 20 + +struct errs /* structure for a system-call error */ +{ + int errnum; /* value of errno (that is, the actual error) */ + char *arg; /* argument that caused the error */ +}; + +static struct errs errs[ERRMAX]; +static int errcnt; +static char *err_toomany = " too many errors occurred"; +static char *err_listem = + " Many errors occurred. Press `e' to display the list of errors."; + +/* These macros get used to reset and log the errors */ +#define ERR_RESET errcnt = 0 +#define ERROR(p, e) if (errcnt >= ERRMAX) \ + { \ + return(err_toomany); \ + } \ + else \ + { \ + errs[errcnt].arg = (p); \ + errs[errcnt++].errnum = (e); \ + } + +/* + * err_string() - return an appropriate error string. This is what the + * command will return for displaying. If no errors were logged, then + * return NULL. The maximum length of the error string is defined by + * "STRMAX". + */ + +#define STRMAX 80 + +char *err_string() + +{ + register struct errs *errp; + register int cnt = 0; + register int first = Yes; + register int currerr = -1; + int stringlen; /* characters still available in "string" */ + static char string[STRMAX]; + + /* if there are no errors, return NULL */ + if (errcnt == 0) + { + return(NULL); + } + + /* sort the errors */ + qsort((char *)errs, errcnt, sizeof(struct errs), err_compar); + + /* need a space at the front of the error string */ + string[0] = ' '; + string[1] = '\0'; + stringlen = STRMAX - 2; + + /* loop thru the sorted list, building an error string */ + while (cnt < errcnt) + { + errp = &(errs[cnt++]); + if (errp->errnum != currerr) + { + if (currerr != -1) + { + if ((stringlen = str_adderr(string, stringlen, currerr)) < 2) + { + return(err_listem); + } + (void) strcat(string, "; "); /* we know there's more */ + } + currerr = errp->errnum; + first = Yes; + } + if ((stringlen = str_addarg(string, stringlen, errp->arg, first)) ==0) + { + return(err_listem); + } + first = No; + } + + /* add final message */ + stringlen = str_adderr(string, stringlen, currerr); + + /* return the error string */ + return(stringlen == 0 ? err_listem : string); +} + +/* + * str_adderr(str, len, err) - add an explanation of error "err" to + * the string "str". + */ + +static int +str_adderr(str, len, err) + +char *str; +int len; +int err; + +{ + register char *msg; + register int msglen; + + msg = err == 0 ? "Not a number" : errmsg(err); + msglen = strlen(msg) + 2; + if (len <= msglen) + { + return(0); + } + (void) strcat(str, ": "); + (void) strcat(str, msg); + return(len - msglen); +} + +/* + * str_addarg(str, len, arg, first) - add the string argument "arg" to + * the string "str". This is the first in the group when "first" + * is set (indicating that a comma should NOT be added to the front). + */ + +static int +str_addarg(str, len, arg, first) + +char *str; +int len; +char *arg; +int first; + +{ + register int arglen; + + arglen = strlen(arg); + if (!first) + { + arglen += 2; + } + if (len <= arglen) + { + return(0); + } + if (!first) + { + (void) strcat(str, ", "); + } + (void) strcat(str, arg); + return(len - arglen); +} + +/* + * err_compar(p1, p2) - comparison routine used by "qsort" + * for sorting errors. + */ + +int +err_compar(p1, p2) + +register struct errs *p1, *p2; + +{ + register int result; + + if ((result = p1->errnum - p2->errnum) == 0) + { + return(strcmp(p1->arg, p2->arg)); + } + return(result); +} + +/* + * error_count() - return the number of errors currently logged. + */ + +int +error_count() + +{ + return(errcnt); +} + +/* + * show_errors() - display on stdout the current log of errors. + */ + +void +show_errors() + +{ + register int cnt = 0; + register struct errs *errp = errs; + + printf("%d error%s:\n\n", errcnt, errcnt == 1 ? "" : "s"); + while (cnt++ < errcnt) + { + printf("%5s: %s\n", errp->arg, + errp->errnum == 0 ? "Not a number" : errmsg(errp->errnum)); + errp++; + } +} + +/* + * kill_procs(str) - send signals to processes, much like the "kill" + * command does; invoked in response to 'k'. + */ + +char *kill_procs(str) + +char *str; + +{ + register char *nptr; + int signum = SIGTERM; /* default */ + int procnum; + struct sigdesc *sigp; + int uid; + + /* reset error array */ + ERR_RESET; + + /* remember our uid */ + uid = getuid(); + + /* skip over leading white space */ + while (isspace(*str)) str++; + + if (str[0] == '-') + { + /* explicit signal specified */ + if ((nptr = next_field(str)) == NULL) + { + return(" kill: no processes specified"); + } + + if (isdigit(str[1])) + { + (void) scanint(str + 1, &signum); + if (signum <= 0 || signum >= NSIG) + { + return(" invalid signal number"); + } + } + else + { + /* translate the name into a number */ + for (sigp = sigdesc; sigp->name != NULL; sigp++) + { + if (strcmp(sigp->name, str + 1) == 0) + { + signum = sigp->number; + break; + } + } + + /* was it ever found */ + if (sigp->name == NULL) + { + return(" bad signal name"); + } + } + /* put the new pointer in place */ + str = nptr; + } + + /* loop thru the string, killing processes */ + do + { + if (scanint(str, &procnum) == -1) + { + ERROR(str, 0); + } + else + { + /* check process owner if we're not root */ + if (uid && (uid != proc_owner(procnum))) + { + ERROR(str, EACCES); + } + /* go in for the kill */ + else if (kill(procnum, signum) == -1) + { + /* chalk up an error */ + ERROR(str, errno); + } + } + } while ((str = next_field(str)) != NULL); + + /* return appropriate error string */ + return(err_string()); +} + +/* + * renice_procs(str) - change the "nice" of processes, much like the + * "renice" command does; invoked in response to 'r'. + */ + +char *renice_procs(str) + +char *str; + +{ + register char negate; + int prio; + int procnum; + int uid; + + ERR_RESET; + uid = getuid(); + + /* allow for negative priority values */ + if ((negate = (*str == '-')) != 0) + { + /* move past the minus sign */ + str++; + } + + /* use procnum as a temporary holding place and get the number */ + procnum = scanint(str, &prio); + + /* negate if necessary */ + if (negate) + { + prio = -prio; + } + +#if defined(PRIO_MIN) && defined(PRIO_MAX) + /* check for validity */ + if (procnum == -1 || prio < PRIO_MIN || prio > PRIO_MAX) + { + return(" bad priority value"); + } +#endif + + /* move to the first process number */ + if ((str = next_field(str)) == NULL) + { + return(" no processes specified"); + } + + /* loop thru the process numbers, renicing each one */ + do + { + if (scanint(str, &procnum) == -1) + { + ERROR(str, 0); + } + + /* check process owner if we're not root */ + else if (uid && (uid != proc_owner(procnum))) + { + ERROR(str, EACCES); + } + else if (setpriority(PRIO_PROCESS, procnum, prio) == -1) + { + ERROR(str, errno); + } + } while ((str = next_field(str)) != NULL); + + /* return appropriate error string */ + return(err_string()); +} + Copied: head/usr.bin/top/commands.h (from r333897, head/contrib/top/commands.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/top/commands.h Sat May 19 22:40:23 2018 (r333898, copy of r333897, head/contrib/top/commands.h) @@ -0,0 +1,21 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * Copyright (c) 2016, Randy Westlund + * + * $FreeBSD$ + */ +#ifndef COMMANDS_H +#define COMMANDS_H + +void show_errors(void); +int error_count(void); +void show_help(void); + +#endif /* COMMANDS_H */ Copied: head/usr.bin/top/display.c (from r333897, head/contrib/top/display.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/top/display.c Sat May 19 22:40:23 2018 (r333898, copy of r333897, head/contrib/top/display.c) @@ -0,0 +1,1455 @@ +/* + * Top users/processes display for Unix + * Version 3 + * + * This program may be freely redistributed, + * but this entire comment MUST remain intact. + * + * Copyright (c) 1984, 1989, William LeFebvre, Rice University + * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University + * + * $FreeBSD$ + */ + +/* + * This file contains the routines that display information on the screen. + * Each section of the screen has two routines: one for initially writing + * all constant and dynamic text, and one for only updating the text that + * changes. The prefix "i_" is used on all the "initial" routines and the + * prefix "u_" is used for all the "updating" routines. + * + * ASSUMPTIONS: + * None of the "i_" routines use any of the termcap capabilities. + * In this way, those routines can be safely used on terminals that + * have minimal (or nonexistant) terminal capabilities. + * + * The routines are called in this order: *_loadave, i_timeofday, + * *_procstates, *_cpustates, *_memory, *_message, *_header, + * *_process, u_endscreen. + */ + +#include "os.h" + +#include + +#include +#include +#include +#include +#include + +#include "screen.h" /* interface to screen package */ +#include "layout.h" /* defines for screen position layout */ +#include "display.h" +#include "top.h" +#include "top.local.h" +#include "boolean.h" +#include "machine.h" /* we should eliminate this!!! */ +#include "utils.h" + +#ifdef DEBUG +FILE *debug; +#endif + +/* imported from screen.c */ +extern int overstrike; + +static int lmpid = 0; +static int last_hi = 0; /* used in u_process and u_endscreen */ +static int lastline = 0; +static int display_width = MAX_COLS; + +#define lineindex(l) ((l)*display_width) + + +/* things initialized by display_init and used thruout */ + +/* buffer of proc information lines for display updating */ +char *screenbuf = NULL; + +static char **procstate_names; +static char **cpustate_names; +static char **memory_names; +static char **arc_names; +static char **carc_names; +static char **swap_names; + +static int num_procstates; +static int num_cpustates; +static int num_memory; +static int num_swap; + +static int *lprocstates; +static int *lcpustates; +static int *lmemory; +static int *lswap; + +static int num_cpus; +static int *cpustate_columns; +static int cpustate_total_length; +static int cpustates_column; + +static enum { OFF, ON, ERASE } header_status = ON; + +static int string_count(); +static void summary_format(); +static void line_update(); + +int x_lastpid = 10; +int y_lastpid = 0; +int x_loadave = 33; +int x_loadave_nompid = 15; +int y_loadave = 0; +int x_procstate = 0; +int y_procstate = 1; +int x_brkdn = 15; +int y_brkdn = 1; +int x_mem = 5; +int y_mem = 3; +int x_arc = 5; +int y_arc = 4; +int x_carc = 5; +int y_carc = 5; +int x_swap = 6; +int y_swap = 4; +int y_message = 5; +int x_header = 0; +int y_header = 6; +int x_idlecursor = 0; +int y_idlecursor = 5; +int y_procs = 7; + +int y_cpustates = 2; +int Header_lines = 7; + +int display_resize() + +{ + register int lines; + + /* first, deallocate any previous buffer that may have been there */ + if (screenbuf != NULL) + { + free(screenbuf); + } + + /* calculate the current dimensions */ + /* if operating in "dumb" mode, we only need one line */ + lines = smart_terminal ? screen_length - Header_lines : 1; + + if (lines < 0) + lines = 0; + /* we don't want more than MAX_COLS columns, since the machine-dependent + modules make static allocations based on MAX_COLS and we don't want + to run off the end of their buffers */ + display_width = screen_width; + if (display_width >= MAX_COLS) + { + display_width = MAX_COLS - 1; + } + + /* now, allocate space for the screen buffer */ + screenbuf = (char *)malloc(lines * display_width); + if (screenbuf == (char *)NULL) + { + /* oops! */ + return(-1); + } + + /* return number of lines available */ + /* for dumb terminals, pretend like we can show any amount */ + return(smart_terminal ? lines : Largest); +} + +int display_updatecpus(statics) + +struct statics *statics; + +{ + register int *lp; + register int lines; + register int i; + + /* call resize to do the dirty work */ + lines = display_resize(); + if (pcpu_stats) + num_cpus = statics->ncpus; + else + num_cpus = 1; + cpustates_column = 5; /* CPU: */ + if (num_cpus != 1) + cpustates_column += 2; /* CPU 0: */ + for (i = num_cpus; i > 9; i /= 10) + cpustates_column++; + + /* fill the "last" array with all -1s, to insure correct updating */ + lp = lcpustates; + i = num_cpustates * num_cpus; + while (--i >= 0) + { + *lp++ = -1; + } + + return(lines); +} + +int display_init(statics) + +struct statics *statics; + +{ + register int lines; + register char **pp; + register int *ip; + register int i; + + lines = display_updatecpus(statics); + + /* only do the rest if we need to */ + if (lines > -1) + { + /* save pointers and allocate space for names */ + procstate_names = statics->procstate_names; + num_procstates = string_count(procstate_names); + lprocstates = (int *)malloc(num_procstates * sizeof(int)); + + cpustate_names = statics->cpustate_names; + + swap_names = statics->swap_names; + num_swap = string_count(swap_names); + lswap = (int *)malloc(num_swap * sizeof(int)); + num_cpustates = string_count(cpustate_names); + lcpustates = (int *)malloc(num_cpustates * sizeof(int) * statics->ncpus); + cpustate_columns = (int *)malloc(num_cpustates * sizeof(int)); + + memory_names = statics->memory_names; + num_memory = string_count(memory_names); + lmemory = (int *)malloc(num_memory * sizeof(int)); + + arc_names = statics->arc_names; + carc_names = statics->carc_names; + + /* calculate starting columns where needed */ + cpustate_total_length = 0; + pp = cpustate_names; + ip = cpustate_columns; + while (*pp != NULL) + { + *ip++ = cpustate_total_length; + if ((i = strlen(*pp++)) > 0) + { + cpustate_total_length += i + 8; + } + } + } + + /* return number of lines available */ + return(lines); +} + +void +i_loadave(mpid, avenrun) + +int mpid; +double *avenrun; + +{ + register int i; + + /* i_loadave also clears the screen, since it is first */ + top_clear(); + + /* mpid == -1 implies this system doesn't have an _mpid */ + if (mpid != -1) + { + printf("last pid: %5d; ", mpid); + } + + printf("load averages"); + + for (i = 0; i < 3; i++) + { + printf("%c %5.2f", + i == 0 ? ':' : ',', + avenrun[i]); + } + lmpid = mpid; +} + +void +u_loadave(mpid, avenrun) + +int mpid; +double *avenrun; + +{ + register int i; + + if (mpid != -1) + { + /* change screen only when value has really changed */ + if (mpid != lmpid) + { + Move_to(x_lastpid, y_lastpid); + printf("%5d", mpid); + lmpid = mpid; + } + + /* i remembers x coordinate to move to */ + i = x_loadave; + } + else + { + i = x_loadave_nompid; + } + + /* move into position for load averages */ + Move_to(i, y_loadave); + + /* display new load averages */ + /* we should optimize this and only display changes */ + for (i = 0; i < 3; i++) + { + printf("%s%5.2f", + i == 0 ? "" : ", ", + avenrun[i]); + } +} + +void +i_timeofday(tod) + +time_t *tod; + +{ + /* + * Display the current time. + * "ctime" always returns a string that looks like this: + * + * Sun Sep 16 01:03:52 1973 + * 012345678901234567890123 + * 1 2 + * + * We want indices 11 thru 18 (length 8). + */ + + if (smart_terminal) + { + Move_to(screen_width - 8, 0); + } + else + { + fputs(" ", stdout); + } +#ifdef DEBUG + { + char *foo; + foo = ctime(tod); + fputs(foo, stdout); + } +#endif + printf("%-8.8s\n", &(ctime(tod)[11])); + lastline = 1; +} + +static int ltotal = 0; +static char procstates_buffer[MAX_COLS]; + +/* + * *_procstates(total, brkdn, names) - print the process summary line + * + * Assumptions: cursor is at the beginning of the line on entry + * lastline is valid + */ + +void *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat May 19 22:45:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35585EE7083; Sat, 19 May 2018 22:45:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7D8D834D0; Sat, 19 May 2018 22:45:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7DCE5B52; Sat, 19 May 2018 22:45:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JMjh73096169; Sat, 19 May 2018 22:45:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JMjhpY096168; Sat, 19 May 2018 22:45:43 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192245.w4JMjhpY096168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 22:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333899 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 22:45:44 -0000 Author: eadler Date: Sat May 19 22:45:43 2018 New Revision: 333899 URL: https://svnweb.freebsd.org/changeset/base/333899 Log: top(1): bump WARNS to 1 Nothing else builds without errors yet, but 1 is better than 0 Modified: head/usr.bin/top/Makefile Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sat May 19 22:40:23 2018 (r333898) +++ head/usr.bin/top/Makefile Sat May 19 22:45:43 2018 (r333899) @@ -7,7 +7,7 @@ SRCS+= sigdesc.h top.local.h CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -DORDER -I ${.OBJDIR} MAN= top.1 -WARNS?= 0 +WARNS?= 1 LIBADD= ncursesw m kvm jail From owner-svn-src-all@freebsd.org Sat May 19 23:00:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7B2FEE7839; Sat, 19 May 2018 23:00:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 687E583AF4; Sat, 19 May 2018 23:00:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 497385CEF; Sat, 19 May 2018 23:00:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JN00MK001734; Sat, 19 May 2018 23:00:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JMxw5l001678; Sat, 19 May 2018 22:59:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192259.w4JMxw5l001678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 22:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333900 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 23:00:01 -0000 Author: eadler Date: Sat May 19 22:59:58 2018 New Revision: 333900 URL: https://svnweb.freebsd.org/changeset/base/333900 Log: top(1): assume that we're building on FreeBSD This allows us to avoid the ifdefs that we set unconditionally. Deleted: head/usr.bin/top/getopt.c Modified: head/usr.bin/top/Makefile head/usr.bin/top/commands.c head/usr.bin/top/display.c head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/top.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/Makefile Sat May 19 22:59:58 2018 (r333900) @@ -4,7 +4,7 @@ PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ username.c utils.c version.c SRCS+= sigdesc.h top.local.h -CFLAGS+= -DHAVE_GETOPT -DHAVE_STRERROR -DORDER -I ${.OBJDIR} +CFLAGS+= -I ${.OBJDIR} MAN= top.1 WARNS?= 1 Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/commands.c Sat May 19 22:59:58 2018 (r333900) @@ -86,7 +86,6 @@ J - display processes for only one jail (+ selec k - kill processes; send a signal to a list of processes\n\ m - toggle the display between 'cpu' and 'io' modes\n\ n or # - change number of processes to display\n", stdout); -#ifdef ORDER if (displaymode == DISP_CPU) fputs("\ o - specify sort order (pri, size, res, cpu, time, threads, jid, pid)\n", @@ -95,7 +94,6 @@ o - specify sort order (pri, size, res, cpu, tim fputs("\ o - specify sort order (vcsw, ivcsw, read, write, fault, total, jid, pid)\n", stdout); -#endif fputs("\ P - toggle the displaying of per-CPU statistics\n\ r - renice a process\n\ Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/display.c Sat May 19 22:59:58 2018 (r333900) @@ -1220,7 +1220,6 @@ register char **names; register char *p; register int num; register char *thisname; - register int useM = No; char rbuf[6]; /* format each number followed by its string */ Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/machine.c Sat May 19 22:59:58 2018 (r333900) @@ -243,7 +243,6 @@ static int pageshift; /* log base 2 of the pagesize * /* useful externals */ long percentages(int cnt, int *out, long *new, long *old, long *diffs); -#ifdef ORDER /* * Sorting orders. The first element is the default. */ @@ -252,7 +251,6 @@ char *ordernames[] = { "total", "read", "write", "fault", "vcsw", "ivcsw", "jid", "swap", "pid", NULL }; -#endif /* Per-cpu time states */ static int maxcpu; @@ -400,9 +398,7 @@ machine_init(struct statics *statics, char do_unames) else statics->carc_names = NULL; statics->swap_names = swapnames; -#ifdef ORDER statics->order_names = ordernames; -#endif /* Allocate state for per-CPU stats. */ cpumask = 0; @@ -491,7 +487,6 @@ extern struct timeval timeout; void get_system_info(struct system_info *si) { - long total; struct loadavg sysload; int mib[2]; struct timeval boottime; @@ -1382,11 +1377,7 @@ static int sorted_state[] = { /* compare_cpu - the comparison function for sorting by cpu percentage */ int -#ifdef ORDER compare_cpu(void *arg1, void *arg2) -#else -proc_compare(void *arg1, void *arg2) -#endif { struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; @@ -1401,7 +1392,6 @@ proc_compare(void *arg1, void *arg2) return (0); } -#ifdef ORDER /* "cpu" compare routines */ int compare_size(), compare_res(), compare_time(), compare_prio(), compare_threads(); @@ -1556,16 +1546,11 @@ compare_swap(const void *arg1, const void *arg2) return (0); } -#endif /* ORDER */ /* assorted comparison functions for sorting by i/o */ int -#ifdef ORDER compare_iototal(void *arg1, void *arg2) -#else -io_compare(void *arg1, void *arg2) -#endif { struct kinfo_proc *p1 = *(struct kinfo_proc **)arg1; struct kinfo_proc *p2 = *(struct kinfo_proc **)arg2; @@ -1573,7 +1558,6 @@ io_compare(void *arg1, void *arg2) return (get_io_total(p2) - get_io_total(p1)); } -#ifdef ORDER int compare_ioread(void *arg1, void *arg2) { @@ -1638,7 +1622,6 @@ compare_ivcsw(void *arg1, void *arg2) return (flp2 - flp1); } -#endif /* ORDER */ /* * proc_owner(pid) - returns the uid that owns process "pid", or -1 if Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/machine.h Sat May 19 22:59:58 2018 (r333900) @@ -23,9 +23,7 @@ struct statics char **arc_names; char **carc_names; char **swap_names; -#ifdef ORDER char **order_names; -#endif int ncpus; }; Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/top.c Sat May 19 22:59:58 2018 (r333900) @@ -105,12 +105,7 @@ char *ctime(); char *kill_procs(); char *renice_procs(); -#ifdef ORDER extern int (*compares[])(); -#else -extern int proc_compare(); -extern int io_compare(); -#endif time_t time(); caddr_t get_process_info(struct system_info *si, struct process_select *sel, @@ -281,10 +276,8 @@ char *argv[]; char *iptr; char no_command = 1; struct timeval timeout; -#ifdef ORDER char *order_name = NULL; int order_index = 0; -#endif #ifndef FD_SET /* FD_SET and friends are not present: fake it */ typedef int fd_set; @@ -293,11 +286,7 @@ char *argv[]; #endif fd_set readfds; -#ifdef ORDER static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJwo"; -#else - static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJw"; -#endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 #define CMD_update 1 @@ -326,9 +315,7 @@ char *argv[]; #define CMD_pcputog 23 #define CMD_jail 24 #define CMD_swaptog 25 -#ifdef ORDER #define CMD_order 26 -#endif /* set the buffer for stdout */ #ifdef DEBUG @@ -487,14 +474,7 @@ char *argv[]; break; case 'o': /* select sort order */ -#ifdef ORDER order_name = optarg; -#else - fprintf(stderr, - "%s: this platform does not support arbitrary ordering. Sorry.\n", - myname); - warnings++; -#endif break; case 't': @@ -582,7 +562,6 @@ char *argv[]; exit(1); } -#ifdef ORDER /* determine sorting order index, if necessary */ if (order_name != NULL) { @@ -602,7 +581,6 @@ char *argv[]; exit(1); } } -#endif #ifdef no_initialization_needed /* initialize the hashing stuff */ @@ -715,14 +693,7 @@ restart: /* get the current stats */ get_system_info(&system_info); -#ifdef ORDER compare = compares[order_index]; -#else - if (displaymode == DISP_CPU) - compare = proc_compare; - else - compare = io_compare; -#endif /* get the current set of processes */ processes = @@ -1144,7 +1115,6 @@ restart: case CMD_showargs: fmt_flags ^= FMT_SHOWARGS; break; -#ifdef ORDER case CMD_order: new_message(MT_standout, "Order to sort: "); @@ -1167,7 +1137,6 @@ restart: clear_message(); } break; -#endif case CMD_jidtog: ps.jail = !ps.jail; new_message(MT_standout | MT_delayed, Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sat May 19 22:45:43 2018 (r333899) +++ head/usr.bin/top/utils.c Sat May 19 22:59:58 2018 (r333900) @@ -337,32 +337,17 @@ long *diffs; /* externs referenced by errmsg */ -#ifndef HAVE_STRERROR -#ifndef SYS_ERRLIST_DECLARED -#define SYS_ERRLIST_DECLARED -extern char *sys_errlist[]; -#endif -extern int sys_nerr; -#endif - char *errmsg(errnum) int errnum; { -#ifdef HAVE_STRERROR char *msg = strerror(errnum); if (msg != NULL) { return msg; } -#else - if (errnum > 0 && errnum < sys_nerr) - { - return((char *)sys_errlist[errnum]); - } -#endif return("No error"); } From owner-svn-src-all@freebsd.org Sat May 19 23:04:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 160FBEE7AFE; Sat, 19 May 2018 23:04:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9EB83F7A; Sat, 19 May 2018 23:04:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40F385E7E; Sat, 19 May 2018 23:04:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JN4h34006469; Sat, 19 May 2018 23:04:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JN4gaI006465; Sat, 19 May 2018 23:04:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192304.w4JN4gaI006465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 23:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333901 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 23:04:44 -0000 Author: eadler Date: Sat May 19 23:04:42 2018 New Revision: 333901 URL: https://svnweb.freebsd.org/changeset/base/333901 Log: top(1): unconditionally provide 'FreeBSD' as a version Deleted: head/usr.bin/top/patchlevel.h head/usr.bin/top/version.c Modified: head/usr.bin/top/Makefile head/usr.bin/top/commands.c head/usr.bin/top/top.c head/usr.bin/top/top.h Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Sat May 19 22:59:58 2018 (r333900) +++ head/usr.bin/top/Makefile Sat May 19 23:04:42 2018 (r333901) @@ -2,7 +2,7 @@ PROG= top SRCS= commands.c display.c machine.c screen.c top.c \ - username.c utils.c version.c + username.c utils.c SRCS+= sigdesc.h top.local.h CFLAGS+= -I ${.OBJDIR} MAN= top.1 Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sat May 19 22:59:58 2018 (r333900) +++ head/usr.bin/top/commands.c Sat May 19 23:04:42 2018 (r333901) @@ -56,7 +56,7 @@ void show_help() { - printf("Top version %s, %s\n", version_string(), copyright); + printf("Top version FreeBSD, %s\n", copyright); fputs("\n\n\ A top users display for Unix\n\ \n\ Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat May 19 22:59:58 2018 (r333900) +++ head/usr.bin/top/top.c Sat May 19 23:04:42 2018 (r333901) @@ -380,8 +380,7 @@ char *argv[]; switch(i) { case 'v': /* show version number */ - fprintf(stderr, "%s: version %s\n", - myname, version_string()); + fprintf(stderr, "%s: version FreeBSD\n", myname); exit(1); break; @@ -516,10 +515,9 @@ char *argv[]; default: fprintf(stderr, -"Top version %s\n" "Usage: %s [-abCHIijnPqStuvwz] [-d count] [-m io | cpu] [-o field] [-s time]\n" " [-J jail] [-U username] [number]\n", - version_string(), myname); + myname); exit(1); } } Modified: head/usr.bin/top/top.h ============================================================================== --- head/usr.bin/top/top.h Sat May 19 22:59:58 2018 (r333900) +++ head/usr.bin/top/top.h Sat May 19 23:04:42 2018 (r333901) @@ -25,8 +25,6 @@ extern int Header_lines; /* 7 */ char *itoa(); char *itoa7(); -char *version_string(); - /* Special atoi routine returns either a non-negative number or one of: */ #define Infinity -1 #define Invalid -2 From owner-svn-src-all@freebsd.org Sat May 19 23:19:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF9FAEE80EC; Sat, 19 May 2018 23:19:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9044A844F0; Sat, 19 May 2018 23:19:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 719D06037; Sat, 19 May 2018 23:19:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JNJPWY011659; Sat, 19 May 2018 23:19:25 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JNJO7A011655; Sat, 19 May 2018 23:19:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201805192319.w4JNJO7A011655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 19 May 2018 23:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333902 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 333902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 23:19:26 -0000 Author: eadler Date: Sat May 19 23:19:24 2018 New Revision: 333902 URL: https://svnweb.freebsd.org/changeset/base/333902 Log: top(1): unconditionally assume we are running on FreeBSD This allows us to remove a special header and more specifically just the system headers we want. Deleted: head/usr.bin/top/os.h Modified: head/usr.bin/top/commands.c head/usr.bin/top/display.c head/usr.bin/top/screen.c head/usr.bin/top/top.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Sat May 19 23:04:42 2018 (r333901) +++ head/usr.bin/top/commands.c Sat May 19 23:19:24 2018 (r333902) @@ -18,14 +18,15 @@ * "top" (i.e.: changing the number of processes to display). */ -#include "os.h" - #include #include #include #include #include +#include +#include +#include #include #include "commands.h" Modified: head/usr.bin/top/display.c ============================================================================== --- head/usr.bin/top/display.c Sat May 19 23:04:42 2018 (r333901) +++ head/usr.bin/top/display.c Sat May 19 23:19:24 2018 (r333902) @@ -28,12 +28,13 @@ * *_process, u_endscreen. */ -#include "os.h" - #include #include #include +#include +#include +#include #include #include #include @@ -927,7 +928,7 @@ char *thisline; p = strecpy(base, thisline); /* zero fill the rest of it */ - memzero(p, display_width - (p - base)); + bzero(p, display_width - (p - base)); } void @@ -970,7 +971,7 @@ char *newline; optr = strecpy(bufferline, newline); /* zero fill the rest of it */ - memzero(optr, display_width - (optr - bufferline)); + bzero(optr, display_width - (optr - bufferline)); } else { @@ -1381,7 +1382,7 @@ int line; diff = display_width - newcol; if (diff > 0) { - memzero(old, diff); + bzero(old, diff); } /* remember where the current line is */ Modified: head/usr.bin/top/screen.c ============================================================================== --- head/usr.bin/top/screen.c Sat May 19 23:04:42 2018 (r333901) +++ head/usr.bin/top/screen.c Sat May 19 23:19:24 2018 (r333902) @@ -20,10 +20,10 @@ * preprocessor variable "TOStop". --wnl */ -#include "os.h" #include "top.h" #include +#include #ifdef CBREAK # include # define SGTTY Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat May 19 23:04:42 2018 (r333901) +++ head/usr.bin/top/top.c Sat May 19 23:19:24 2018 (r333902) @@ -33,8 +33,8 @@ char *copyright = * FD_SET - macros FD_SET and FD_ZERO are used when defined */ -#include "os.h" - +#include +#include #include #include @@ -43,7 +43,9 @@ char *copyright = #include #include #include +#include #include +#include #include /* includes specific to top */ @@ -59,6 +61,8 @@ char *copyright = /* Size of the stdio buffer given to stdout */ #define Buffersize 2048 + +typedef void sigret_t; /* The buffer that stdio will use */ char stdoutbuf[Buffersize]; Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Sat May 19 23:04:42 2018 (r333901) +++ head/usr.bin/top/utils.c Sat May 19 23:19:24 2018 (r333902) @@ -16,7 +16,10 @@ */ #include "top.h" -#include "os.h" + +#include +#include +#include int atoiwi(str) From owner-svn-src-all@freebsd.org Sat May 19 23:49:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF4BFEE8C9D; Sat, 19 May 2018 23:49:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C2D68504D; Sat, 19 May 2018 23:49:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A8DA650A; Sat, 19 May 2018 23:49:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4JNnEeg026424; Sat, 19 May 2018 23:49:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4JNnEnI026423; Sat, 19 May 2018 23:49:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201805192349.w4JNnEnI026423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 19 May 2018 23:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333903 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 333903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 May 2018 23:49:15 -0000 Author: markj Date: Sat May 19 23:49:13 2018 New Revision: 333903 URL: https://svnweb.freebsd.org/changeset/base/333903 Log: Use the canonical check for reservation support. Modified: head/sys/vm/vm_domainset.c Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Sat May 19 23:19:24 2018 (r333902) +++ head/sys/vm/vm_domainset.c Sat May 19 23:49:13 2018 (r333903) @@ -81,7 +81,7 @@ vm_domainset_iter_init(struct vm_domainset_iter *di, s } di->di_policy = di->di_domain->ds_policy; if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) { -#ifdef VM_LEVEL_0_ORDER +#if VM_NRESERVLEVEL > 0 if (vm_object_reserv(obj)) { /* * Color the pindex so we end up on the correct @@ -89,9 +89,8 @@ vm_domainset_iter_init(struct vm_domainset_iter *di, s */ pindex += obj->pg_color; pindex >>= VM_LEVEL_0_ORDER; - } - else -#endif + } else +#endif pindex /= vm_domainset_default_stride; /* * Offset pindex so the first page of each object does