From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 01:42:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77FF11065673; Sun, 26 Dec 2010 01:42:52 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6807A8FC1F; Sun, 26 Dec 2010 01:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQ1gqOC098846; Sun, 26 Dec 2010 01:42:52 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQ1gqjD098844; Sun, 26 Dec 2010 01:42:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012260142.oBQ1gqjD098844@svn.freebsd.org> From: Alan Cox Date: Sun, 26 Dec 2010 01:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216702 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 01:42:52 -0000 Author: alc Date: Sun Dec 26 01:42:52 2010 New Revision: 216702 URL: http://svn.freebsd.org/changeset/base/216702 Log: Correct the order of the arguments to vm_fault_quick_hold_pages(). Modified: head/sys/kern/uipc_cow.c Modified: head/sys/kern/uipc_cow.c ============================================================================== --- head/sys/kern/uipc_cow.c Sat Dec 25 23:54:50 2010 (r216701) +++ head/sys/kern/uipc_cow.c Sun Dec 26 01:42:52 2010 (r216702) @@ -115,7 +115,7 @@ socow_setup(struct mbuf *m0, struct uio /* * Verify that access to the given address is allowed from user-space. */ - if (vm_fault_quick_hold_pages(map, uva, len, &pp, 1, VM_PROT_READ) < + if (vm_fault_quick_hold_pages(map, uva, len, VM_PROT_READ, &pp, 1) < 0) { socow_stats.fail_not_mapped++; return(0); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 13:05:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDEA3106564A; Sun, 26 Dec 2010 13:05:43 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD95D8FC15; Sun, 26 Dec 2010 13:05:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQD5hnv086580; Sun, 26 Dec 2010 13:05:43 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQD5hDi086578; Sun, 26 Dec 2010 13:05:43 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012261305.oBQD5hDi086578@svn.freebsd.org> From: Colin Percival Date: Sun, 26 Dec 2010 13:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216703 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 13:05:43 -0000 Author: cperciva Date: Sun Dec 26 13:05:43 2010 New Revision: 216703 URL: http://svn.freebsd.org/changeset/base/216703 Log: Lock the vm page queue mutex in pmap_pte_release around the call to PMAP_SET_VA; this fixes a mutex-not-held panic when a process which called mlock(2) exits, and parallels a change made in pmap_pte 10 months ago (svn r204160). Note: The locking in this code is utterly broken. We should not be using the VM page queue mutex to protect the queue of pending Xen page mapping hypervisor calls. Even if it made sense to do so, this commit and r204160 introduce LORs between the vm page queue mutex and PMAP2mutex. (However, a possible deadlock is better than a guaranteed panic, and this change will hopefully make life easier for whoever fixes the Xen pmap locking in the future.) PR: kern/140313 MFC after: 3 days Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Sun Dec 26 01:42:52 2010 (r216702) +++ head/sys/i386/xen/pmap.c Sun Dec 26 13:05:43 2010 (r216703) @@ -1015,7 +1015,9 @@ pmap_pte_release(pt_entry_t *pte) if ((pt_entry_t *)((vm_offset_t)pte & ~PAGE_MASK) == PADDR2) { CTR1(KTR_PMAP, "pmap_pte_release: pte=0x%jx", *PMAP2); + vm_page_lock_queues(); PT_SET_VA(PMAP2, 0, TRUE); + vm_page_unlock_queues(); mtx_unlock(&PMAP2mutex); } } From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 13:14:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE33E106564A; Sun, 26 Dec 2010 13:14:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92DEF8FC08; Sun, 26 Dec 2010 13:14:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDEakO086823; Sun, 26 Dec 2010 13:14:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDEa2t086821; Sun, 26 Dec 2010 13:14:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261314.oBQDEa2t086821@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 13:14:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216704 - stable/8/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 13:14:36 -0000 Author: kib Date: Sun Dec 26 13:14:36 2010 New Revision: 216704 URL: http://svn.freebsd.org/changeset/base/216704 Log: MFC r216454: VOP_ISLOCKED() should not be used to determine if the vnode is locked. Explicitely track the locked status of the vnode. Approved by: re (bz) Modified: stable/8/sys/nfsserver/nfs_serv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Sun Dec 26 13:05:43 2010 (r216703) +++ stable/8/sys/nfsserver/nfs_serv.c Sun Dec 26 13:14:36 2010 (r216704) @@ -3037,6 +3037,7 @@ nfsrv_readdirplus(struct nfsrv_descript struct vattr va, at, *vap = &va; struct nfs_fattr *fp; int len, nlen, rem, xfer, tsiz, i, error = 0, error1, getret = 1; + int vp_locked; int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies; u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ @@ -3067,10 +3068,12 @@ nfsrv_readdirplus(struct nfsrv_descript fullsiz = siz; error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, &rdonly, TRUE); + vp_locked = 1; if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); vp = NULL; + vp_locked = 0; } if (error) { nfsm_reply(NFSX_UNSIGNED); @@ -3090,6 +3093,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = nfsrv_access(vp, VEXEC, cred, rdonly, 0); if (error) { vput(vp); + vp_locked = 0; vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR); nfsm_srvpostop_attr(getret, &at); @@ -3097,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript goto nfsmout; } VOP_UNLOCK(vp, 0); + vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; @@ -3110,6 +3115,7 @@ again: io.uio_td = NULL; eofflag = 0; vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3118,6 +3124,7 @@ again: off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, cred); VOP_UNLOCK(vp, 0); + vp_locked = 0; if (!cookies && !error) error = NFSERR_PERM; if (!error) @@ -3238,8 +3245,10 @@ again: } else { cn.cn_flags &= ~ISDOTDOT; } - if (!VOP_ISLOCKED(vp)) + if (!vp_locked) { vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; + } if ((vp->v_vflag & VV_ROOT) != 0 && (cn.cn_flags & ISDOTDOT) != 0) { vref(vp); @@ -3342,7 +3351,7 @@ invalid: cookiep++; ncookies--; } - if (!usevget && VOP_ISLOCKED(vp)) + if (!usevget && vp_locked) vput(vp); else vrele(vp); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 13:20:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACC691065670; Sun, 26 Dec 2010 13:20:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE308FC0A; Sun, 26 Dec 2010 13:20:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDKAOr087014; Sun, 26 Dec 2010 13:20:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDKAxa087012; Sun, 26 Dec 2010 13:20:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261320.oBQDKAxa087012@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 13:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216705 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 13:20:10 -0000 Author: kib Date: Sun Dec 26 13:20:10 2010 New Revision: 216705 URL: http://svn.freebsd.org/changeset/base/216705 Log: MFC r216572: Restore the ABI of struct kinfo_proc32 after r213536. Approved by: re (bz) Modified: stable/8/sys/compat/freebsd32/freebsd32.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Sun Dec 26 13:14:36 2010 (r216704) +++ stable/8/sys/compat/freebsd32/freebsd32.h Sun Dec 26 13:20:10 2010 (r216705) @@ -323,6 +323,7 @@ struct kinfo_proc32 { uint32_t ki_pcb; uint32_t ki_kstack; uint32_t ki_udata; + uint32_t ki_tdaddr; uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */ int ki_sparelongs[KI_NSPARE_LONG]; int ki_sflag; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 13:25:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38E2C106566B; Sun, 26 Dec 2010 13:25:48 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 281EE8FC1C; Sun, 26 Dec 2010 13:25:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDPmFS087183; Sun, 26 Dec 2010 13:25:48 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDPl5D087177; Sun, 26 Dec 2010 13:25:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012261325.oBQDPl5D087177@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Dec 2010 13:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216706 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 13:25:48 -0000 Author: jilles Date: Sun Dec 26 13:25:47 2010 New Revision: 216706 URL: http://svn.freebsd.org/changeset/base/216706 Log: sh: Allow arbitrary large numbers in CHECKSTRSPACE. Reduce "stack string" API somewhat and simplify code. Add a check for integer overflow of the "stack string" length (probably incomplete). Modified: head/bin/sh/exec.c head/bin/sh/expand.c head/bin/sh/memalloc.c head/bin/sh/memalloc.h head/bin/sh/parser.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Dec 26 13:20:10 2010 (r216705) +++ head/bin/sh/exec.c Sun Dec 26 13:25:47 2010 (r216706) @@ -190,9 +190,8 @@ padvance(const char **path, const char * for (p = start; *p && *p != ':' && *p != '%'; p++) ; /* nothing */ len = p - start + strlen(name) + 2; /* "2" is for '/' and '\0' */ - while (stackblocksize() < len) - growstackblock(); - q = stackblock(); + STARTSTACKSTR(q); + CHECKSTRSPACE(len, q); if (p != start) { memcpy(q, start, p - start); q += p - start; Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun Dec 26 13:20:10 2010 (r216705) +++ head/bin/sh/expand.c Sun Dec 26 13:25:47 2010 (r216706) @@ -502,13 +502,14 @@ expbackq(union node *cmd, int quoted, in if (lastc == '\n') { nnl++; } else { + CHECKSTRSPACE(nnl + 2, dest); while (nnl > 0) { nnl--; - STPUTC('\n', dest); + USTPUTC('\n', dest); } if (quotes && syntax[(int)lastc] == CCTL) - STPUTC(CTLESC, dest); - STPUTC(lastc, dest); + USTPUTC(CTLESC, dest); + USTPUTC(lastc, dest); } } } Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Sun Dec 26 13:20:10 2010 (r216705) +++ head/bin/sh/memalloc.c Sun Dec 26 13:25:47 2010 (r216706) @@ -218,8 +218,8 @@ popstackmark(struct stackmark *mark) * part of the block that has been used. */ -void -growstackblock(void) +static void +growstackblock(int min) { char *p; int newlen; @@ -229,8 +229,15 @@ growstackblock(void) struct stack_block *oldstackp; struct stackmark *xmark; - newlen = (stacknleft == 0) ? MINSIZE : stacknleft * 2 + 100; - newlen = ALIGN(newlen); + if (min < stacknleft) + min = stacknleft; + if (newlen >= INT_MAX / 2 - ALIGN(sizeof(struct stack_block))) + error("Out of space"); + min += stacknleft; + min += ALIGN(sizeof(struct stack_block)); + newlen = 512; + while (newlen < min) + newlen <<= 1; oldspace = stacknxt; oldlen = stacknleft; @@ -257,6 +264,7 @@ growstackblock(void) } INTON; } else { + newlen -= ALIGN(sizeof(struct stack_block)); p = stalloc(newlen); if (oldlen != 0) memcpy(p, oldspace, oldlen); @@ -295,9 +303,9 @@ grabstackblock(int len) */ static char * -growstrstackblock(int n) +growstrstackblock(int n, int min) { - growstackblock(); + growstackblock(min); sstrnleft = stackblocksize() - n; return stackblock() + n; } @@ -308,7 +316,7 @@ growstackstr(void) int len; len = stackblocksize(); - return growstrstackblock(len); + return (growstrstackblock(len, 0)); } @@ -317,12 +325,12 @@ growstackstr(void) */ char * -makestrspace(void) +makestrspace(int min) { int len; len = stackblocksize() - sstrnleft; - return growstrstackblock(len); + return (growstrstackblock(len, min)); } @@ -339,11 +347,10 @@ ungrabstackstr(char *s, char *p) char * stputbin(const char *data, int len, char *p) { - int i; - - for (i = 0; i < len; i++) - STPUTC(data[i], p); - return (p); + CHECKSTRSPACE(len, p); + memcpy(p, data, len); + sstrnleft -= len; + return (p + len); } char * Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Sun Dec 26 13:20:10 2010 (r216705) +++ head/bin/sh/memalloc.h Sun Dec 26 13:25:47 2010 (r216706) @@ -55,10 +55,9 @@ pointer stalloc(int); void stunalloc(pointer); void setstackmark(struct stackmark *); void popstackmark(struct stackmark *); -void growstackblock(void); void grabstackblock(int); char *growstackstr(void); -char *makestrspace(void); +char *makestrspace(int); void ungrabstackstr(char *, char *); char *stputbin(const char *data, int len, char *p); char *stputs(const char *data, char *p); @@ -69,7 +68,7 @@ char *stputs(const char *data, char *p); #define stackblocksize() stacknleft #define STARTSTACKSTR(p) p = stackblock(), sstrnleft = stackblocksize() #define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), --sstrnleft, *p++ = (c))) -#define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(); } +#define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(n); } #define USTPUTC(c, p) (--sstrnleft, *p++ = (c)) /* * STACKSTRNUL's use is where we want to be able to turn a stack Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun Dec 26 13:20:10 2010 (r216705) +++ head/bin/sh/parser.c Sun Dec 26 13:25:47 2010 (r216706) @@ -1093,9 +1093,8 @@ done: popfile(); tokpushback = 0; } - while (stackblocksize() <= savelen) - growstackblock(); STARTSTACKSTR(out); + CHECKSTRSPACE(savelen + 1, out); INTOFF; if (str) { memcpy(out, str, savelen); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 13:41:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EBE4106564A; Sun, 26 Dec 2010 13:41:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9788FC08; Sun, 26 Dec 2010 13:41:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDfsx6087590; Sun, 26 Dec 2010 13:41:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDfsZc087588; Sun, 26 Dec 2010 13:41:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012261341.oBQDfsZc087588@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Dec 2010 13:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216707 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 13:41:54 -0000 Author: jilles Date: Sun Dec 26 13:41:53 2010 New Revision: 216707 URL: http://svn.freebsd.org/changeset/base/216707 Log: sh: Fix integer overflow check, it checked an uninitialized variable. Modified: head/bin/sh/memalloc.c Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Sun Dec 26 13:25:47 2010 (r216706) +++ head/bin/sh/memalloc.c Sun Dec 26 13:41:53 2010 (r216707) @@ -231,7 +231,7 @@ growstackblock(int min) if (min < stacknleft) min = stacknleft; - if (newlen >= INT_MAX / 2 - ALIGN(sizeof(struct stack_block))) + if (min >= INT_MAX / 2 - ALIGN(sizeof(struct stack_block))) error("Out of space"); min += stacknleft; min += ALIGN(sizeof(struct stack_block)); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 13:57:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E46A5106564A; Sun, 26 Dec 2010 13:57:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3B398FC13; Sun, 26 Dec 2010 13:57:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQDv5Xl087987; Sun, 26 Dec 2010 13:57:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQDv5Sr087985; Sun, 26 Dec 2010 13:57:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261357.oBQDv5Sr087985@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 13:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216708 - stable/8/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 13:57:06 -0000 Author: kib Date: Sun Dec 26 13:57:05 2010 New Revision: 216708 URL: http://svn.freebsd.org/changeset/base/216708 Log: MFC r216453: Add the missed 'p' flag to getopt() optstring argument. Approved by: re (bz) Modified: stable/8/sbin/newfs/newfs.c Directory Properties: stable/8/sbin/newfs/ (props changed) Modified: stable/8/sbin/newfs/newfs.c ============================================================================== --- stable/8/sbin/newfs/newfs.c Sun Dec 26 13:41:53 2010 (r216707) +++ stable/8/sbin/newfs/newfs.c Sun Dec 26 13:57:05 2010 (r216708) @@ -136,7 +136,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) switch (ch) { case 'E': Eflag = 1; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 14:09:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 711DE1065670; Sun, 26 Dec 2010 14:09:06 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF8D8FC08; Sun, 26 Dec 2010 14:09:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQE96j5088406; Sun, 26 Dec 2010 14:09:06 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQE96n5088404; Sun, 26 Dec 2010 14:09:06 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012261409.oBQE96n5088404@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 26 Dec 2010 14:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216709 - stable/8/sys/dev/wpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 14:09:06 -0000 Author: bschmidt Date: Sun Dec 26 14:09:06 2010 New Revision: 216709 URL: http://svn.freebsd.org/changeset/base/216709 Log: MFC r216557: Fix panic while trying to use monitor mode. The iwn_cmd() calls issued by iwn_config() want to msleep() on the mutex. PR: kern/138427 Submitted by: Henry Hu Approved by: re (kib) Modified: stable/8/sys/dev/wpi/if_wpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sun Dec 26 13:57:05 2010 (r216708) +++ stable/8/sys/dev/wpi/if_wpi.c Sun Dec 26 14:09:06 2010 (r216709) @@ -3561,7 +3561,9 @@ wpi_set_channel(struct ieee80211com *ic) * are already taken care of by their respective firmware commands. */ if (ic->ic_opmode == IEEE80211_M_MONITOR) { + WPI_LOCK(sc); error = wpi_config(sc); + WPI_UNLOCK(sc); if (error != 0) device_printf(sc->sc_dev, "error %d settting channel\n", error); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 14:10:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B146106564A; Sun, 26 Dec 2010 14:10:13 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A93D8FC19; Sun, 26 Dec 2010 14:10:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQEACnN088475; Sun, 26 Dec 2010 14:10:12 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQEACQ6088473; Sun, 26 Dec 2010 14:10:12 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012261410.oBQEACQ6088473@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 26 Dec 2010 14:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216710 - releng/8.2/sys/dev/wpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 14:10:13 -0000 Author: bschmidt Date: Sun Dec 26 14:10:12 2010 New Revision: 216710 URL: http://svn.freebsd.org/changeset/base/216710 Log: MFC r216557: Fix panic while trying to use monitor mode. The iwn_cmd() calls issued by iwn_config() want to msleep() on the mutex. PR: kern/138427 Submitted by: Henry Hu Approved by: re (kib) Modified: releng/8.2/sys/dev/wpi/if_wpi.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/wpi/if_wpi.c ============================================================================== --- releng/8.2/sys/dev/wpi/if_wpi.c Sun Dec 26 14:09:06 2010 (r216709) +++ releng/8.2/sys/dev/wpi/if_wpi.c Sun Dec 26 14:10:12 2010 (r216710) @@ -3561,7 +3561,9 @@ wpi_set_channel(struct ieee80211com *ic) * are already taken care of by their respective firmware commands. */ if (ic->ic_opmode == IEEE80211_M_MONITOR) { + WPI_LOCK(sc); error = wpi_config(sc); + WPI_UNLOCK(sc); if (error != 0) device_printf(sc->sc_dev, "error %d settting channel\n", error); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 15:00:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A04FE106564A; Sun, 26 Dec 2010 15:00:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 798C48FC08; Sun, 26 Dec 2010 15:00:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQF0E7H089873; Sun, 26 Dec 2010 15:00:14 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQF0EFl089871; Sun, 26 Dec 2010 15:00:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261500.oBQF0EFl089871@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 15:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216711 - releng/8.2/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 15:00:14 -0000 Author: kib Date: Sun Dec 26 15:00:14 2010 New Revision: 216711 URL: http://svn.freebsd.org/changeset/base/216711 Log: MFC r216453: Add the missed 'p' flag to getopt() optstring argument. Approved by: re (bz) Modified: releng/8.2/sbin/newfs/newfs.c Directory Properties: releng/8.2/sbin/newfs/ (props changed) Modified: releng/8.2/sbin/newfs/newfs.c ============================================================================== --- releng/8.2/sbin/newfs/newfs.c Sun Dec 26 14:10:12 2010 (r216710) +++ releng/8.2/sbin/newfs/newfs.c Sun Dec 26 15:00:14 2010 (r216711) @@ -136,7 +136,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) switch (ch) { case 'E': Eflag = 1; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 15:13:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0365D1065672; Sun, 26 Dec 2010 15:13:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCCBC8FC08; Sun, 26 Dec 2010 15:13:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQFDSST090249; Sun, 26 Dec 2010 15:13:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQFDSct090247; Sun, 26 Dec 2010 15:13:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261513.oBQFDSct090247@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 15:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216712 - releng/8.2/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 15:13:29 -0000 Author: kib Date: Sun Dec 26 15:13:28 2010 New Revision: 216712 URL: http://svn.freebsd.org/changeset/base/216712 Log: MFC r216454: VOP_ISLOCKED() should not be used to determine if the vnode is locked. Explicitely track the locked status of the vnode. Approved by: re (bz) Modified: releng/8.2/sys/nfsserver/nfs_serv.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/nfsserver/nfs_serv.c ============================================================================== --- releng/8.2/sys/nfsserver/nfs_serv.c Sun Dec 26 15:00:14 2010 (r216711) +++ releng/8.2/sys/nfsserver/nfs_serv.c Sun Dec 26 15:13:28 2010 (r216712) @@ -3037,6 +3037,7 @@ nfsrv_readdirplus(struct nfsrv_descript struct vattr va, at, *vap = &va; struct nfs_fattr *fp; int len, nlen, rem, xfer, tsiz, i, error = 0, error1, getret = 1; + int vp_locked; int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies; u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ @@ -3067,10 +3068,12 @@ nfsrv_readdirplus(struct nfsrv_descript fullsiz = siz; error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, &rdonly, TRUE); + vp_locked = 1; if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); vp = NULL; + vp_locked = 0; } if (error) { nfsm_reply(NFSX_UNSIGNED); @@ -3090,6 +3093,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = nfsrv_access(vp, VEXEC, cred, rdonly, 0); if (error) { vput(vp); + vp_locked = 0; vp = NULL; nfsm_reply(NFSX_V3POSTOPATTR); nfsm_srvpostop_attr(getret, &at); @@ -3097,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript goto nfsmout; } VOP_UNLOCK(vp, 0); + vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); again: iv.iov_base = rbuf; @@ -3110,6 +3115,7 @@ again: io.uio_td = NULL; eofflag = 0; vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; @@ -3118,6 +3124,7 @@ again: off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, cred); VOP_UNLOCK(vp, 0); + vp_locked = 0; if (!cookies && !error) error = NFSERR_PERM; if (!error) @@ -3238,8 +3245,10 @@ again: } else { cn.cn_flags &= ~ISDOTDOT; } - if (!VOP_ISLOCKED(vp)) + if (!vp_locked) { vn_lock(vp, LK_SHARED | LK_RETRY); + vp_locked = 1; + } if ((vp->v_vflag & VV_ROOT) != 0 && (cn.cn_flags & ISDOTDOT) != 0) { vref(vp); @@ -3342,7 +3351,7 @@ invalid: cookiep++; ncookies--; } - if (!usevget && VOP_ISLOCKED(vp)) + if (!usevget && vp_locked) vput(vp); else vrele(vp); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 15:15:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 376471065670; Sun, 26 Dec 2010 15:15:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 270BB8FC1B; Sun, 26 Dec 2010 15:15:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQFFTXS090347; Sun, 26 Dec 2010 15:15:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQFFTTj090345; Sun, 26 Dec 2010 15:15:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012261515.oBQFFTTj090345@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Dec 2010 15:15:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216713 - releng/8.2/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 15:15:29 -0000 Author: kib Date: Sun Dec 26 15:15:28 2010 New Revision: 216713 URL: http://svn.freebsd.org/changeset/base/216713 Log: MFC r216572: Restore the ABI of struct kinfo_proc32 after r213536. Approved by: re (bz) Modified: releng/8.2/sys/compat/freebsd32/freebsd32.h Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/compat/freebsd32/freebsd32.h ============================================================================== --- releng/8.2/sys/compat/freebsd32/freebsd32.h Sun Dec 26 15:13:28 2010 (r216712) +++ releng/8.2/sys/compat/freebsd32/freebsd32.h Sun Dec 26 15:15:28 2010 (r216713) @@ -323,6 +323,7 @@ struct kinfo_proc32 { uint32_t ki_pcb; uint32_t ki_kstack; uint32_t ki_udata; + uint32_t ki_tdaddr; uint32_t ki_spareptrs[KI_NSPARE_PTR]; /* spare room for growth */ int ki_sparelongs[KI_NSPARE_LONG]; int ki_sflag; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 17:21:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06CBB106566B; Sun, 26 Dec 2010 17:21:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9F738FC0C; Sun, 26 Dec 2010 17:21:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQHLl6w093787; Sun, 26 Dec 2010 17:21:47 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQHLlwH093785; Sun, 26 Dec 2010 17:21:47 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012261721.oBQHLlwH093785@svn.freebsd.org> From: Michael Tuexen Date: Sun, 26 Dec 2010 17:21:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216714 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 17:21:48 -0000 Author: tuexen Date: Sun Dec 26 17:21:47 2010 New Revision: 216714 URL: http://svn.freebsd.org/changeset/base/216714 Log: MFC c216502: Fix a flightsize bug related to the processing of PKTDRP reports. Approved by: re Modified: stable/8/sys/netinet/sctp_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Sun Dec 26 15:15:28 2010 (r216713) +++ stable/8/sys/netinet/sctp_input.c Sun Dec 26 17:21:47 2010 (r216714) @@ -3156,7 +3156,6 @@ process_chunk_drop(struct sctp_tcb *stcb SCTP_STAT_INCR(sctps_pdrpmark); if (tp1->sent != SCTP_DATAGRAM_RESEND) sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - tp1->sent = SCTP_DATAGRAM_RESEND; /* * mark it as if we were doing a FR, since * we will be getting gap ack reports behind @@ -3191,6 +3190,7 @@ process_chunk_drop(struct sctp_tcb *stcb sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); } + tp1->sent = SCTP_DATAGRAM_RESEND; } { /* audit code */ unsigned int audit; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 17:29:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A365106564A; Sun, 26 Dec 2010 17:29:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C978FC08; Sun, 26 Dec 2010 17:29:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQHTQnA094020; Sun, 26 Dec 2010 17:29:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQHTQoH094018; Sun, 26 Dec 2010 17:29:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012261729.oBQHTQoH094018@svn.freebsd.org> From: Michael Tuexen Date: Sun, 26 Dec 2010 17:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216715 - releng/8.2/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 17:29:27 -0000 Author: tuexen Date: Sun Dec 26 17:29:26 2010 New Revision: 216715 URL: http://svn.freebsd.org/changeset/base/216715 Log: MFC c216502: Fix a flightsize bug related to the processing of PKTDRP reports. Approved by: re Modified: releng/8.2/sys/netinet/sctp_input.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/netinet/sctp_input.c ============================================================================== --- releng/8.2/sys/netinet/sctp_input.c Sun Dec 26 17:21:47 2010 (r216714) +++ releng/8.2/sys/netinet/sctp_input.c Sun Dec 26 17:29:26 2010 (r216715) @@ -3156,7 +3156,6 @@ process_chunk_drop(struct sctp_tcb *stcb SCTP_STAT_INCR(sctps_pdrpmark); if (tp1->sent != SCTP_DATAGRAM_RESEND) sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); - tp1->sent = SCTP_DATAGRAM_RESEND; /* * mark it as if we were doing a FR, since * we will be getting gap ack reports behind @@ -3191,6 +3190,7 @@ process_chunk_drop(struct sctp_tcb *stcb sctp_flight_size_decrease(tp1); sctp_total_flight_decrease(stcb, tp1); } + tp1->sent = SCTP_DATAGRAM_RESEND; } { /* audit code */ unsigned int audit; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 18:10:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B438D106566C; Sun, 26 Dec 2010 18:10:39 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A331B8FC0C; Sun, 26 Dec 2010 18:10:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQIAdCS095180; Sun, 26 Dec 2010 18:10:39 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQIAdmJ095178; Sun, 26 Dec 2010 18:10:39 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201012261810.oBQIAdmJ095178@svn.freebsd.org> From: Kai Wang Date: Sun, 26 Dec 2010 18:10:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216716 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 18:10:39 -0000 Author: kaiw Date: Sun Dec 26 18:10:39 2010 New Revision: 216716 URL: http://svn.freebsd.org/changeset/base/216716 Log: * Add mention of the `-f`, `-q`, `-S`, and `-V` options in the synopsis section. * Document the `-l`, `-M` and `-S` options. * Improve the text describing the behavior of the `-r` option. * Start a section on standard compliance. * Indicate in the synopsis that the `-S` and `-s` options are mutually exclusive. Obtained from: elftoolchain Modified: head/usr.bin/ar/ar.1 Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Sun Dec 26 17:29:26 2010 (r216715) +++ head/usr.bin/ar/ar.1 Sun Dec 26 18:10:39 2010 (r216716) @@ -34,28 +34,42 @@ .Nm .Fl d .Op Fl T +.Op Fl f .Op Fl j .Op Fl v .Op Fl z .Ar archive -.Ar files ... +.Ar .Nm .Fl m .Op Fl T .Op Fl a Ar position-after .Op Fl b Ar position-before +.Op Fl f .Op Fl i Ar position-before .Op Fl j -.Op Fl s +.Op Fl s | Fl S .Op Fl z .Ar archive -.Ar files ... +.Ar .Nm .Fl p .Op Fl T +.Op Fl f .Op Fl v .Ar archive -.Op Ar files ... +.Op Ar +.Nm +.Fl q +.Op Fl T +.Op Fl c +.Op Fl D +.Op Fl f +.Op Fl s | Fl S +.Op Fl v +.Op Fl z +.Ar archive +.Ar .Nm .Fl r .Op Fl T @@ -63,14 +77,15 @@ .Op Fl b Ar position-before .Op Fl c .Op Fl D +.Op Fl f .Op Fl i Ar position-before .Op Fl j -.Op Fl s +.Op Fl s | Fl S .Op Fl u .Op Fl v .Op Fl z .Ar archive -.Ar files ... +.Ar .Nm .Fl s .Op Fl j @@ -78,19 +93,23 @@ .Ar archive .Nm .Fl t +.Op Fl f .Op Fl T .Op Fl v .Ar archive -.Op Ar files ... +.Op Ar .Nm .Fl x .Op Fl C .Op Fl T +.Op Fl f .Op Fl o .Op Fl u .Op Fl v .Ar archive -.Op Ar files ... +.Op Ar +.Nm +.Fl M .Nm ranlib .Op Fl D .Ar archive ... @@ -141,13 +160,13 @@ When used with option .Fl m this option specifies that the archive members specified by arguments -.Ar files ... +.Ar are moved to after the archive member named by argument .Ar member-after . When used with option .Fl r this option specifies that the files specified by arguments -.Ar files ... +.Ar are added after the archive member named by argument .Ar member-after . .It Fl b Ar member-before @@ -155,13 +174,13 @@ When used with option .Fl m this option specifies that the archive members specified by arguments -.Ar files ... +.Ar are moved to before the archive member named by argument .Ar member-before . When used with option .Fl r this option specifies that the files specified by arguments -.Ar files ... +.Ar are added before the archive member named by argument .Ar member-before . .It Fl c @@ -176,7 +195,7 @@ Prevent extracted files from replacing l in the file system. .It Fl d Delete the members named by arguments -.Ar files ... +.Ar from the archive specified by argument .Ar archive . The archive's symbol table, if present, is updated to reflect @@ -188,7 +207,7 @@ or .Fl q option, insert 0's instead of the real mtime, uid and gid values and 0644 instead of file mode from the members named by arguments -.Ar files ... . +.Ar . This ensures that checksums on the resulting archives are reproducible when member contents are identical. .It Fl f @@ -199,9 +218,13 @@ Synonymous with option .Fl b . .It Fl j This option is accepted but ignored. +.It Fl l +This option is accepted for compatibility with GNU +.Xr ar 1 , +but is ignored. .It Fl m Move archive members specified by arguments -.Ar files ... +.Ar within the archive. If a position has been specified by one of the .Fl a , @@ -214,19 +237,21 @@ If no position has been specified, the s to the end of the archive. If the archive has a symbol table, it is updated to reflect the new contents of the archive. +.It Fl M +Read and execute MRI librarian commands from standard input. .It Fl o Preserve the original modification times of members when extracting them. .It Fl p Write the contents of the specified archive members named by arguments -.Ar files ... +.Ar to standard output. If no members were specified, the contents of all the files in the archive are written in the order they appear in the archive. .It Fl q Append the files specified by arguments -.Ar files ... +.Ar to the archive specified by argument .Ar archive without checking if the files already exist in the archive and @@ -241,14 +266,14 @@ option will update the archive's symbol table. .It Fl r Replace (add) the files specified by arguments -.Ar files ... +.Ar in the archive specified by argument .Ar archive , creating the archive if necessary. -Files that replace existing files do not change the order of files -within the archive. +Replacing existing members will not change the order of members within +the archive. If a file named in arguments -.Ar files ... +.Ar does not exist, existing members in the archive that match that name are not changed. New files are added to the end of the archive unless one of the @@ -271,9 +296,11 @@ with the .Fl s option alone is equivalent to invoking .Nm ranlib . +.It Fl S +Do not generate an archive symbol table. .It Fl t List the files specified by arguments -.Ar files ... +.Ar in the order in which they appear in the archive, one per line. If no files are specified, all files in the archive are listed. .It Fl T @@ -284,13 +311,13 @@ Conditionally update the archive or extr When used with the .Fl r option, files named by arguments -.Ar files ... +.Ar will be replaced in the archive if they are newer than their archived versions. When used with the .Fl x option, the members specified by arguments -.Ar files ... +.Ar will be extracted only if they are newer than the corresponding files in the file system. .It Fl v @@ -340,9 +367,11 @@ the file size in bytes, the file modific format .Dq "%b %e %H:%M %Y" , and the name of the file. +.It Fl V +Print a version string and exit. .It Fl x Extract archive members specified by arguments -.Ar files ... +.Ar into the current directory. If no members have been specified, extract all members of the archive. If the file corresponding to an extracted member does not exist it @@ -393,12 +422,27 @@ use: .Xr strftime 3 , .Xr strmode 3 , .Xr ar 5 -.\" .Sh COMPATIBILITY -.\" .Nm -.\" is expected to be compatible with GNU and SVR4 -.\" .Nm . -.\" .Sh STANDARDS -.\" Do the POSIX/SuSv3 standards have anything to say about AR(1)? +.Sh STANDARDS COMPLIANCE +The +.Nm +utility's support for the +.Fl a , +.Fl b , +.Fl c , +.Fl i , +.Fl m , +.Fl p , +.Fl q , +.Fl r , +.Fl s , +.Fl t , +.Fl u , +.Fl v , +.Fl C +and +.Fl T +options is believed to be compliant with +.St -p1003.2 . .Sh HISTORY An .Nm From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 18:12:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F2E106566B; Sun, 26 Dec 2010 18:12:13 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3B268FC17; Sun, 26 Dec 2010 18:12:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQICDGK095273; Sun, 26 Dec 2010 18:12:13 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQICDZY095271; Sun, 26 Dec 2010 18:12:13 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201012261812.oBQICDZY095271@svn.freebsd.org> From: Kai Wang Date: Sun, 26 Dec 2010 18:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216717 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 18:12:13 -0000 Author: kaiw Date: Sun Dec 26 18:12:13 2010 New Revision: 216717 URL: http://svn.freebsd.org/changeset/base/216717 Log: Improve the description of the `-q` option. Obtained from: elftoolchain Modified: head/usr.bin/ar/ar.1 Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Sun Dec 26 18:10:39 2010 (r216716) +++ head/usr.bin/ar/ar.1 Sun Dec 26 18:12:13 2010 (r216717) @@ -141,10 +141,7 @@ utility can create and manage an archive .Xr ar 5 ) used to speed up link editing operations. If a symbol table is present in an archive, it will be -kept up-to-date by subsequent operations on the archive (excepting -the quick update specified by the -.Fl q -option). +kept up-to-date by subsequent operations on the archive. .Pp The .Nm ranlib @@ -254,16 +251,11 @@ Append the files specified by arguments .Ar to the archive specified by argument .Ar archive -without checking if the files already exist in the archive and -without updating the archive's symbol table. -If the archive file +without checking if the files already exist in the archive. +The archive symbol table will be updated as needed. +If the file specified by the argument .Ar archive -does not already exist, a new archive is created. -However, to be compatible with GNU -.Nm , -option -.Fl q -will update the archive's symbol table. +does not already exist, a new archive will be created. .It Fl r Replace (add) the files specified by arguments .Ar From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 18:15:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D277106564A; Sun, 26 Dec 2010 18:15:18 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3CE8FC14; Sun, 26 Dec 2010 18:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQIFItc095388; Sun, 26 Dec 2010 18:15:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQIFI4P095386; Sun, 26 Dec 2010 18:15:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201012261815.oBQIFI4P095386@svn.freebsd.org> From: Andrew Thompson Date: Sun, 26 Dec 2010 18:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216718 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 18:15:18 -0000 Author: thompsa Date: Sun Dec 26 18:15:18 2010 New Revision: 216718 URL: http://svn.freebsd.org/changeset/base/216718 Log: MFC r216249 Re-add a status check which sneaked out during r214804. This change can fix some USB error messages showing up during bootup. Approved by: re (kib) Modified: stable/8/sys/dev/usb/usb_request.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Sun Dec 26 18:12:13 2010 (r216717) +++ stable/8/sys/dev/usb/usb_request.c Sun Dec 26 18:15:18 2010 (r216718) @@ -793,6 +793,10 @@ usbd_req_reset_port(struct usb_device *u if (err) { goto done; } + /* if the device disappeared, just give up */ + if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) { + goto done; + } /* check if reset is complete */ if (UGETW(ps.wPortChange) & UPS_C_PORT_RESET) { break; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 18:15:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15E7D10656A3; Sun, 26 Dec 2010 18:15:33 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 054528FC08; Sun, 26 Dec 2010 18:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQIFWFJ095433; Sun, 26 Dec 2010 18:15:32 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQIFWX7095431; Sun, 26 Dec 2010 18:15:32 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201012261815.oBQIFWX7095431@svn.freebsd.org> From: Kai Wang Date: Sun, 26 Dec 2010 18:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216719 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 18:15:33 -0000 Author: kaiw Date: Sun Dec 26 18:15:32 2010 New Revision: 216719 URL: http://svn.freebsd.org/changeset/base/216719 Log: Document the syntax accepted by the `-M` option. Obtained from: elftoolchain Modified: head/usr.bin/ar/ar.1 Modified: head/usr.bin/ar/ar.1 ============================================================================== --- head/usr.bin/ar/ar.1 Sun Dec 26 18:15:18 2010 (r216718) +++ head/usr.bin/ar/ar.1 Sun Dec 26 18:15:32 2010 (r216719) @@ -236,6 +236,10 @@ If the archive has a symbol table, it is new contents of the archive. .It Fl M Read and execute MRI librarian commands from standard input. +The commands understood by the +.Nm +utility are described in the section +.Sx "MRI Librarian Commands" . .It Fl o Preserve the original modification times of members when extracting them. @@ -378,6 +382,117 @@ option was specified. .It Fl z This option is accepted but ignored. .El +.Ss "MRI Librarian Commands" +If the +.Fl M +option is specified, the +.Nm +utility will read and execute commands from its standard input. +If standard input is a terminal, the +.Nm +utility will display the prompt +.Dq Li "AR >" +before reading a line, and will continue operation even if errors are +encountered. +If standard input is not a terminal, the +.Nm +utility will not display a prompt and will terminate execution on +encountering an error. +.Pp +Each input line contains a single command. +Words in an input line are separated by whitespace characters. +The first word of the line is the command, the remaining words are +the arguments to the command. +The command word may be specified in either case. +Arguments may be separated by commas or blanks. +.Pp +Empty lines are allowed and are ignored. +Long lines are continued by ending them with the +.Dq Li + +character. +.Pp +The +.Dq Li * +and +.Dq Li "\;" +characters start a comment. +Comments extend till the end of the line. +.Pp +When executing an MRI librarian script the +.Nm +utility works on a temporary copy of an archive. +Changes to the copy are made permanent using the +.Ic save +command. +.Pp +Commands understood by the +.Nm +utility are: +.Bl -tag -width indent +.It Ic addlib Ar archive | Ic addlib Ar archive Pq Ar member Oo Li , Ar member Oc Ns ... +Add the contents of the archive named by argument +.Ar archive +to the current archive. +If specific members are named using the arguments +.Ar member , +then those members are added to the current archive. +If no members are specified, the entire contents of the archive +are added to the current archive. +.It Ic addmod Ar member Oo Li , Ar member Oc Ns ... +Add the files named by arguments +.Ar member +to the current archive. +.It Ic clear +Discard all the contents of the current archive. +.It Ic create Ar archive +Create a new archive named by the argument +.Ar archive , +and makes it the current archive. +If the named archive already exists, it will be overwritten +when the +.Ic save +command is issued. +.It Ic delete Ar module Oo Li , Ar member Oc Ns ... +Delete the modules named by the arguments +.Ar member +from the current archive. +.It Ic directory Ar archive Po Ar member Oo Li , Ar member Oc Ns ... Pc Op Ar outputfile +List each named module in the archive. +The format of the output depends on the verbosity setting set using +the +.Ic verbose +command. +Output is sent to standard output, or to the file specified by +argument +.Ar outputfile . +.It Ic end +Exit successfully from the +.Nm +utility. +Any unsaved changes to the current archive will be discarded. +.It Ic extract Ar member Oo Li , Ar member Oc Ns ... +Extract the members named by the arguments +.Ar member +from the current archive. +.It Ic list +Display the contents of the current archive in verbose style. +.It Ic open Ar archive +Open the archive named by argument +.Ar archive +and make it the current archive. +.It Ic replace Ar member Oo Li , Ar member Oc Ns ... +Replace named members in the current archive with the files specified +by arguments +.Ar member . +The files must be present in the current directory and the named +modules must already exist in the current archive. +.It Ic save +Commit all changes to the current archive. +.It Ic verbose +Toggle the verbosity of the +.Ic directory +command. +.El .Sh EXAMPLES To create a new archive .Pa ex.a @@ -405,6 +520,20 @@ To verbosely list the contents of archiv .Pa ex.a , use: .D1 "ar -tv ex.a" +.Pp +To create a new archive +.Pa ex.a +containing the files +.Pa ex1.o , +and +.Pa ex2.o , +using MRI librarian commands, use the following script: +.Bd -literal -offset indent +create ex.a * specify the output archive +addmod ex1.o ex2.o * add modules +save * save pending changes +end * exit the utility +.Ed .Sh DIAGNOSTICS .Ex -std .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 18:15:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD721065672; Sun, 26 Dec 2010 18:15:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1DCC8FC21; Sun, 26 Dec 2010 18:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQIFvYZ095483; Sun, 26 Dec 2010 18:15:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQIFv45095481; Sun, 26 Dec 2010 18:15:57 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201012261815.oBQIFv45095481@svn.freebsd.org> From: Andrew Thompson Date: Sun, 26 Dec 2010 18:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216720 - releng/8.2/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 18:15:58 -0000 Author: thompsa Date: Sun Dec 26 18:15:57 2010 New Revision: 216720 URL: http://svn.freebsd.org/changeset/base/216720 Log: MFC r216249 Re-add a status check which sneaked out during r214804. This change can fix some USB error messages showing up during bootup. Approved by: re (kib) Modified: releng/8.2/sys/dev/usb/usb_request.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/usb/usb_request.c ============================================================================== --- releng/8.2/sys/dev/usb/usb_request.c Sun Dec 26 18:15:32 2010 (r216719) +++ releng/8.2/sys/dev/usb/usb_request.c Sun Dec 26 18:15:57 2010 (r216720) @@ -793,6 +793,10 @@ usbd_req_reset_port(struct usb_device *u if (err) { goto done; } + /* if the device disappeared, just give up */ + if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) { + goto done; + } /* check if reset is complete */ if (UGETW(ps.wPortChange) & UPS_C_PORT_RESET) { break; From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 19:07:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73463106564A; Sun, 26 Dec 2010 19:07:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 486D08FC08; Sun, 26 Dec 2010 19:07:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQJ7wUQ096780; Sun, 26 Dec 2010 19:07:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQJ7w4A096778; Sun, 26 Dec 2010 19:07:58 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012261907.oBQJ7w4A096778@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 26 Dec 2010 19:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216721 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 19:07:58 -0000 Author: pjd Date: Sun Dec 26 19:07:58 2010 New Revision: 216721 URL: http://svn.freebsd.org/changeset/base/216721 Log: When node-specific configuration is missing in resource section, provide more useful information. Instead of: hastd: remote address not configured for resource foo Print the following: No resource foo configuration for this node (acceptable node names: freefall, freefall.freebsd.org, 44333332-4c44-4e31-4a30-313920202020). MFC after: 3 days Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun Dec 26 18:15:57 2010 (r216720) +++ head/sbin/hastd/parse.y Sun Dec 26 19:07:58 2010 (r216721) @@ -55,7 +55,7 @@ extern char *yytext; static struct hastd_config *lconfig; static struct hast_resource *curres; -static bool mynode; +static bool mynode, hadmynode; static char depth0_control[HAST_ADDRSIZE]; static char depth0_listen[HAST_ADDRSIZE]; @@ -109,6 +109,44 @@ isitme(const char *name) return (0); } +static int +node_names(char **namesp) +{ + static char names[MAXHOSTNAMELEN * 3]; + char buf[MAXHOSTNAMELEN]; + char *pos; + size_t bufsize; + + if (gethostname(buf, sizeof(buf)) < 0) { + pjdlog_errno(LOG_ERR, "gethostname() failed"); + return (-1); + } + + /* First component of the host name. */ + pos = strchr(buf, '.'); + if (pos != NULL && pos != buf) { + (void)strlcpy(names, buf, MIN((size_t)(pos - buf + 1), + sizeof(names))); + (void)strlcat(names, ", ", sizeof(names)); + } + + /* Full host name. */ + (void)strlcat(names, buf, sizeof(names)); + (void)strlcat(names, ", ", sizeof(names)); + + /* Host UUID. */ + bufsize = sizeof(buf); + if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { + pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); + return (-1); + } + (void)strlcat(names, buf, sizeof(names)); + + *namesp = names; + + return (0); +} + void yyerror(const char *str) { @@ -424,6 +462,20 @@ resource_statement: RESOURCE resource_st { if (curres != NULL) { /* + * There must be section for this node, at least with + * remote address configuration. + */ + if (!hadmynode) { + char *names; + + if (node_names(&names) != 0) + return (1); + pjdlog_error("No resource %s configuration for this node (acceptable node names: %s).", + curres->hr_name, names); + return (1); + } + + /* * Let's see there are some resource-level settings * that we can use for node-level settings. */ @@ -489,6 +541,7 @@ resource_start: STR */ depth1_provname[0] = '\0'; depth1_localpath[0] = '\0'; + hadmynode = false; curres = calloc(1, sizeof(*curres)); if (curres == NULL) { @@ -614,7 +667,7 @@ resource_node_start: STR case 0: break; case 1: - mynode = true; + mynode = hadmynode = true; break; default: assert(!"invalid isitme() return value"); From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 19:08:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5531065675; Sun, 26 Dec 2010 19:08:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C70F8FC08; Sun, 26 Dec 2010 19:08:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQJ8fRb096840; Sun, 26 Dec 2010 19:08:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQJ8fjC096838; Sun, 26 Dec 2010 19:08:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012261908.oBQJ8fjC096838@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 26 Dec 2010 19:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216722 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 19:08:41 -0000 Author: pjd Date: Sun Dec 26 19:08:41 2010 New Revision: 216722 URL: http://svn.freebsd.org/changeset/base/216722 Log: Detect when resource is configured more than once. MFC after: 3 days Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun Dec 26 19:07:58 2010 (r216721) +++ head/sbin/hastd/parse.y Sun Dec 26 19:08:41 2010 (r216722) @@ -535,6 +535,16 @@ resource_statement: RESOURCE resource_st resource_start: STR { + /* Check if there is no duplicate entry. */ + TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { + if (strcmp(curres->hr_name, $1) == 0) { + pjdlog_error("Resource %s configured more than once.", + curres->hr_name); + free($1); + return (1); + } + } + /* * Clear those, so we can tell if they were set at * resource-level or not. From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 20:25:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFDF11065670; Sun, 26 Dec 2010 20:25:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6008FC12; Sun, 26 Dec 2010 20:25:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id EC22F41C690; Sun, 26 Dec 2010 21:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id MSnFVsMBpFPR; Sun, 26 Dec 2010 21:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 1359D41C677; Sun, 26 Dec 2010 21:25:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 0746D44490B; Sun, 26 Dec 2010 20:23:18 +0000 (UTC) Date: Sun, 26 Dec 2010 20:23:18 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Warner Losh In-Reply-To: <201012240455.oBO4tvJ4079108@svn.freebsd.org> Message-ID: <20101226202125.C6126@maildrop.int.zabbadoz.net> References: <201012240455.oBO4tvJ4079108@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216685 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 20:25:08 -0000 On Fri, 24 Dec 2010, Warner Losh wrote: > Author: imp > Date: Fri Dec 24 04:55:56 2010 > New Revision: 216685 > URL: http://svn.freebsd.org/changeset/base/216685 > > Log: > Redirect stderr from config to /dev/null. config -m is printing lots > of annoying warnings when dealing with arm. The arm config files need > to be fixed, but this restricts the output to a more useful place. I'll assume these are the warning about duplicate devices and options. Would we get the same warnings again when actually running config on the kernel config files and will they then go to the logs? > Modified: > head/Makefile > > Modified: head/Makefile > ============================================================================== > --- head/Makefile Fri Dec 24 04:52:53 2010 (r216684) > +++ head/Makefile Fri Dec 24 04:55:56 2010 (r216685) > @@ -350,8 +350,8 @@ KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/ > universe_kernconfs: > .for kernel in ${KERNCONFS} > TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ > - config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} | \ > - cut -f 2 > + config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ > + cut -f 2 > universe_kernconfs: universe_kernconf_${TARGET}_${kernel} > universe_kernconf_${TARGET}_${kernel}: > @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ > -- Bjoern A. Zeeb Welcome a new stage of life. Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 21:07:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5496A106566C; Sun, 26 Dec 2010 21:07:13 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447348FC08; Sun, 26 Dec 2010 21:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQL7DiM099896; Sun, 26 Dec 2010 21:07:13 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQL7Dkl099894; Sun, 26 Dec 2010 21:07:13 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201012262107.oBQL7Dkl099894@svn.freebsd.org> From: Ken Smith Date: Sun, 26 Dec 2010 21:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216724 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 21:07:13 -0000 Author: kensmith Date: Sun Dec 26 21:07:11 2010 New Revision: 216724 URL: http://svn.freebsd.org/changeset/base/216724 Log: End the Code Freeze on stable/7 and stable/8 - the release branches releng/7.4 and releng/8.2 now exist and will be used for the balance of the 7.4/8.2 release process. Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Sun Dec 26 20:18:50 2010 (r216723) +++ svnadmin/conf/approvers Sun Dec 26 21:07:11 2010 (r216724) @@ -17,8 +17,8 @@ # $FreeBSD$ # #^head/ re -^stable/8/ re -^stable/7/ re +#^stable/8/ re +#^stable/7/ re ^releng/8.2/ re ^releng/7.4/ re ^releng/8.[0-1]/ (security-officer|so) From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 22:29:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65C72106566B; Sun, 26 Dec 2010 22:29:44 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 556CA8FC23; Sun, 26 Dec 2010 22:29:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQMTiwd002016; Sun, 26 Dec 2010 22:29:44 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQMTiOB002014; Sun, 26 Dec 2010 22:29:44 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012262229.oBQMTiOB002014@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 26 Dec 2010 22:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216725 - head/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 22:29:44 -0000 Author: simon Date: Sun Dec 26 22:29:44 2010 New Revision: 216725 URL: http://svn.freebsd.org/changeset/base/216725 Log: Fix deprecated warning about -L which said -i was deprecated. MFC after: 3 days Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Sun Dec 26 21:07:11 2010 (r216724) +++ head/sbin/mount_nfs/mount_nfs.c Sun Dec 26 22:29:44 2010 (r216725) @@ -213,7 +213,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "intr", NULL, 0); break; case 'L': - printf("-i deprecated, use -o nolockd\n"); + printf("-L deprecated, use -o nolockd\n"); build_iovec(&iov, &iovlen, "nolockd", NULL, 0); break; case 'l': From owner-svn-src-all@FreeBSD.ORG Sun Dec 26 23:19:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 477121065673; Sun, 26 Dec 2010 23:19:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36EFE8FC12; Sun, 26 Dec 2010 23:19:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBQNJHF0003229; Sun, 26 Dec 2010 23:19:17 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBQNJHwd003227; Sun, 26 Dec 2010 23:19:17 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201012262319.oBQNJHwd003227@svn.freebsd.org> From: Ed Maste Date: Sun, 26 Dec 2010 23:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216726 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Dec 2010 23:19:17 -0000 Author: emaste Date: Sun Dec 26 23:19:16 2010 New Revision: 216726 URL: http://svn.freebsd.org/changeset/base/216726 Log: Remove commented-out test that's covered in plus-minus2.0 anyway. Discussed with: jilles Modified: head/tools/regression/bin/sh/expansion/plus-minus1.0 Modified: head/tools/regression/bin/sh/expansion/plus-minus1.0 ============================================================================== --- head/tools/regression/bin/sh/expansion/plus-minus1.0 Sun Dec 26 22:29:44 2010 (r216725) +++ head/tools/regression/bin/sh/expansion/plus-minus1.0 Sun Dec 26 23:19:16 2010 (r216726) @@ -49,8 +49,6 @@ testcase 'set -- ${w:+$w"$w"}' '3|a|b| testcase 'set -- "${s+a b}"' '1|a b' testcase 'set -- "${e:-a b}"' '1|a b' testcase 'set -- ${e:-\}}' '1|}' -# Currently broken in FreeBSD /bin/sh -#testcase 'set -- "${e:-\}}"' '1|}' testcase 'set -- ${e:+{}}' '1|}' testcase 'set -- "${e:+{}}"' '1|}' From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 00:30:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73E6F106566C; Mon, 27 Dec 2010 00:30:29 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63A908FC1A; Mon, 27 Dec 2010 00:30:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBR0UTFa004792; Mon, 27 Dec 2010 00:30:29 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBR0UTq9004790; Mon, 27 Dec 2010 00:30:29 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201012270030.oBR0UTq9004790@svn.freebsd.org> From: Alexander Kabaev Date: Mon, 27 Dec 2010 00:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216728 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 00:30:29 -0000 Author: kan Date: Mon Dec 27 00:30:29 2010 New Revision: 216728 URL: http://svn.freebsd.org/changeset/base/216728 Log: Fix an apparent cop-and-paste mistake in previous commit. This makes dlsym(RTLD_DEFAULT) work properly again. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Dec 27 00:12:57 2010 (r216727) +++ head/libexec/rtld-elf/rtld.c Mon Dec 27 00:30:29 2010 (r216728) @@ -2278,7 +2278,7 @@ do_dlsym(void *handle, const char *name, } } else { assert(handle == RTLD_DEFAULT); - res = symlook_obj(&req, obj); + res = symlook_default(&req, obj); if (res == 0) { defobj = req.defobj_out; def = req.sym_out; From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 06:59:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CD921065672; Mon, 27 Dec 2010 06:59:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3D88FC0A; Mon, 27 Dec 2010 06:59:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBR6xxUi014145; Mon, 27 Dec 2010 06:59:59 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBR6xxYv014142; Mon, 27 Dec 2010 06:59:59 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201012270659.oBR6xxYv014142@svn.freebsd.org> From: Oleg Bulyzhin Date: Mon, 27 Dec 2010 06:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216730 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 06:59:59 -0000 Author: oleg Date: Mon Dec 27 06:59:59 2010 New Revision: 216730 URL: http://svn.freebsd.org/changeset/base/216730 Log: MFC r203548: Propagate the vlan events to the underlying interfaces/members so they can do initialization of hw related features. PR: kern/141646 Modified: stable/8/sys/net/if_lagg.c stable/8/sys/net/if_lagg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Mon Dec 27 05:47:24 2010 (r216729) +++ stable/8/sys/net/if_lagg.c Mon Dec 27 06:59:59 2010 (r216730) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -204,6 +205,50 @@ static moduledata_t lagg_mod = { DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +#if __FreeBSD_version >= 800000 +/* + * This routine is run via an vlan + * config EVENT + */ +static void +lagg_register_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) +{ + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc); +} + +/* + * This routine is run via an vlan + * unconfig EVENT + */ +static void +lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) +{ + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc); +} +#endif + static int lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) { @@ -259,6 +304,13 @@ lagg_clone_create(struct if_clone *ifc, */ ether_ifattach(ifp, eaddr); +#if __FreeBSD_version >= 800000 + sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, + lagg_register_vlan, sc, EVENTHANDLER_PRI_FIRST); + sc->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, + lagg_unregister_vlan, sc, EVENTHANDLER_PRI_FIRST); +#endif + /* Insert into the global list of laggs */ mtx_lock(&lagg_list_mtx); SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); @@ -278,6 +330,11 @@ lagg_clone_destroy(struct ifnet *ifp) lagg_stop(sc); ifp->if_flags &= ~IFF_UP; +#if __FreeBSD_version >= 800000 + EVENTHANDLER_DEREGISTER(vlan_config, sc->vlan_attach); + EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); +#endif + /* Shutdown and remove lagg ports */ while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL) lagg_port_destroy(lp, 1); Modified: stable/8/sys/net/if_lagg.h ============================================================================== --- stable/8/sys/net/if_lagg.h Mon Dec 27 05:47:24 2010 (r216729) +++ stable/8/sys/net/if_lagg.h Mon Dec 27 06:59:59 2010 (r216730) @@ -198,6 +198,10 @@ struct lagg_softc { void (*sc_lladdr)(struct lagg_softc *); void (*sc_req)(struct lagg_softc *, caddr_t); void (*sc_portreq)(struct lagg_port *, caddr_t); +#if __FreeBSD_version >= 800000 + eventhandler_tag vlan_attach; + eventhandler_tag vlan_detach; +#endif }; struct lagg_port { From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 07:12:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4762106566B; Mon, 27 Dec 2010 07:12:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3E6B8FC13; Mon, 27 Dec 2010 07:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBR7CMvV014538; Mon, 27 Dec 2010 07:12:22 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBR7CM0e014535; Mon, 27 Dec 2010 07:12:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012270712.oBR7CM0e014535@svn.freebsd.org> From: Alan Cox Date: Mon, 27 Dec 2010 07:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216731 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 07:12:22 -0000 Author: alc Date: Mon Dec 27 07:12:22 2010 New Revision: 216731 URL: http://svn.freebsd.org/changeset/base/216731 Log: Move vm_object_print()'s prototype to the expected place. Modified: head/sys/vm/vm_extern.h head/sys/vm/vm_object.h Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Mon Dec 27 06:59:59 2010 (r216730) +++ head/sys/vm/vm_extern.h Mon Dec 27 07:12:22 2010 (r216731) @@ -83,8 +83,6 @@ void vmspace_exitfree(struct proc *); void vnode_pager_setsize(struct vnode *, vm_ooffset_t); int vslock(void *, size_t); void vsunlock(void *, size_t); -void vm_object_print(/* db_expr_t */ long, boolean_t, /* db_expr_t */ long, - char *); struct sf_buf *vm_imgact_map_page(vm_object_t object, vm_ooffset_t offset); void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Mon Dec 27 06:59:59 2010 (r216730) +++ head/sys/vm/vm_object.h Mon Dec 27 07:12:22 2010 (r216731) @@ -221,6 +221,7 @@ void vm_object_init (void); void vm_object_page_clean (vm_object_t, vm_pindex_t, vm_pindex_t, boolean_t); void vm_object_page_remove (vm_object_t, vm_pindex_t, vm_pindex_t, boolean_t); boolean_t vm_object_populate(vm_object_t, vm_pindex_t, vm_pindex_t); +void vm_object_print(long addr, boolean_t have_addr, long count, char *modif); void vm_object_reference (vm_object_t); void vm_object_reference_locked(vm_object_t); int vm_object_set_memattr(vm_object_t object, vm_memattr_t memattr); From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 12:06:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5C28106567A; Mon, 27 Dec 2010 12:06:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D584E8FC17; Mon, 27 Dec 2010 12:06:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRC6c8G023662; Mon, 27 Dec 2010 12:06:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRC6c9i023660; Mon, 27 Dec 2010 12:06:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012271206.oBRC6c9i023660@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 Dec 2010 12:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216733 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 12:06:39 -0000 Author: kib Date: Mon Dec 27 12:06:38 2010 New Revision: 216733 URL: http://svn.freebsd.org/changeset/base/216733 Log: Teach ddb "show mount" about MNTK_SUJ flag. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Dec 27 07:38:33 2010 (r216732) +++ head/sys/kern/vfs_subr.c Mon Dec 27 12:06:38 2010 (r216733) @@ -2877,6 +2877,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_REFEXPIRE); MNT_KERN_FLAG(MNTK_EXTENDED_SHARED); MNT_KERN_FLAG(MNTK_SHARED_WRITES); + MNT_KERN_FLAG(MNTK_SUJ); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); MNT_KERN_FLAG(MNTK_SUSPEND); From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 12:39:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 455A4106566B; Mon, 27 Dec 2010 12:39:25 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304728FC0C; Mon, 27 Dec 2010 12:39:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRCdP5k024531; Mon, 27 Dec 2010 12:39:25 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRCdOZ5024516; Mon, 27 Dec 2010 12:39:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012271239.oBRCdOZ5024516@svn.freebsd.org> From: Attilio Rao Date: Mon, 27 Dec 2010 12:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216734 - in stable/8: contrib/binutils/bfd contrib/binutils/binutils contrib/binutils/include/elf contrib/file contrib/gdb/gdb gnu/usr.bin/gdb/libgdb sys/compat/freebsd32 sys/kern sys/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 12:39:25 -0000 Author: attilio Date: Mon Dec 27 12:39:24 2010 New Revision: 216734 URL: http://svn.freebsd.org/changeset/base/216734 Log: MFC r215679: Add the ability for GDB to printout the thread name along with other thread specific informations. In order to achieve that, for both on-line debugging and core analysis, a new member to PT_LWPINFO ptrace(2) interface is added and a new ELF note (NT_THRMISC) as well. Sponsored by: Sandvine Incorporated Modified: stable/8/contrib/binutils/bfd/elf-bfd.h stable/8/contrib/binutils/bfd/elf.c stable/8/contrib/binutils/binutils/readelf.c stable/8/contrib/binutils/include/elf/common.h stable/8/contrib/file/readelf.h stable/8/contrib/gdb/gdb/fbsd-proc.c stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c stable/8/sys/compat/freebsd32/freebsd32.h stable/8/sys/kern/imgact_elf.c stable/8/sys/kern/sys_process.c stable/8/sys/sys/elf_common.h stable/8/sys/sys/procfs.h stable/8/sys/sys/ptrace.h stable/8/usr.bin/gcore/elfcore.c Directory Properties: stable/8/contrib/binutils/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/contrib/binutils/bfd/elf-bfd.h ============================================================================== --- stable/8/contrib/binutils/bfd/elf-bfd.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/bfd/elf-bfd.h Mon Dec 27 12:39:24 2010 (r216734) @@ -1673,6 +1673,8 @@ extern char * elfcore_write_pstatus (bfd *, char *, int *, long, int, const void *); extern char *elfcore_write_prfpreg (bfd *, char *, int *, const void *, int); +extern char *elfcore_write_thrmisc + (bfd *, char *, int *, const char *, int); extern char *elfcore_write_prxfpreg (bfd *, char *, int *, const void *, int); extern char *elfcore_write_lwpstatus Modified: stable/8/contrib/binutils/bfd/elf.c ============================================================================== --- stable/8/contrib/binutils/bfd/elf.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/bfd/elf.c Mon Dec 27 12:39:24 2010 (r216734) @@ -6316,6 +6316,12 @@ _bfd_elf_rel_vtable_reloc_fn #ifdef HAVE_SYS_PROCFS_H # include + +/* Define HAVE_THRMISC_T for consistency with other similar GNU-type stubs. */ +#undef HAVE_THRMISC_T +#if defined (THRMISC_VERSION) +#define HAVE_THRMISC_T 1 +#endif #endif /* FIXME: this is kinda wrong, but it's what gdb wants. */ @@ -6497,6 +6503,16 @@ elfcore_grok_prxfpreg (bfd *abfd, Elf_In return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note); } +#if defined (HAVE_THRMISC_T) + +static bfd_boolean +elfcore_grok_thrmisc (bfd *abfd, Elf_Internal_Note *note) +{ + return elfcore_make_note_pseudosection (abfd, ".tname", note); +} + +#endif /* defined (HAVE_THRMISC_T) */ + #if defined (HAVE_PRPSINFO_T) typedef prpsinfo_t elfcore_psinfo_t; #if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */ @@ -6863,6 +6879,12 @@ elfcore_grok_note (bfd *abfd, Elf_Intern return TRUE; } + +#if defined (HAVE_THRMISC_T) + case NT_THRMISC: + return elfcore_grok_thrmisc (abfd, note); +#endif + } } @@ -7245,6 +7267,22 @@ elfcore_write_prfpreg (bfd *abfd, } char * +elfcore_write_thrmisc (bfd *abfd, + char *buf, + int *bufsiz, + const char *tname, + int size) +{ +#if defined (HAVE_THRMISC_T) + char *note_name = "CORE"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_THRMISC, tname, size); +#else + return buf; +#endif +} + +char * elfcore_write_prxfpreg (bfd *abfd, char *buf, int *bufsiz, Modified: stable/8/contrib/binutils/binutils/readelf.c ============================================================================== --- stable/8/contrib/binutils/binutils/readelf.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/binutils/readelf.c Mon Dec 27 12:39:24 2010 (r216734) @@ -9908,6 +9908,7 @@ get_note_type (unsigned e_type) case NT_PSTATUS: return _("NT_PSTATUS (pstatus structure)"); case NT_FPREGS: return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); + case NT_THRMISC: return _("NT_THRMISC (thrmisc structure)"); case NT_LWPSTATUS: return _("NT_LWPSTATUS (lwpstatus_t structure)"); case NT_LWPSINFO: return _("NT_LWPSINFO (lwpsinfo_t structure)"); case NT_WIN32PSTATUS: return _("NT_WIN32PSTATUS (win32_pstatus structure)"); Modified: stable/8/contrib/binutils/include/elf/common.h ============================================================================== --- stable/8/contrib/binutils/include/elf/common.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/binutils/include/elf/common.h Mon Dec 27 12:39:24 2010 (r216734) @@ -366,6 +366,7 @@ #define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ #define NT_TASKSTRUCT 4 /* Contains copy of task struct */ #define NT_AUXV 6 /* Contains copy of Elfxx_auxv_t */ +#define NT_THRMISC 7 /* Contains copy of thrmisc struct */ #define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */ /* note name must be "LINUX". */ Modified: stable/8/contrib/file/readelf.h ============================================================================== --- stable/8/contrib/file/readelf.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/file/readelf.h Mon Dec 27 12:39:24 2010 (r216734) @@ -224,6 +224,7 @@ typedef struct { #define NT_TASKSTRUCT 4 #define NT_PLATFORM 5 #define NT_AUXV 6 +#define NT_THRMISC 7 /* Note types used in executables */ /* NetBSD executables (name = "NetBSD") */ Modified: stable/8/contrib/gdb/gdb/fbsd-proc.c ============================================================================== --- stable/8/contrib/gdb/gdb/fbsd-proc.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/contrib/gdb/gdb/fbsd-proc.c Mon Dec 27 12:39:24 2010 (r216734) @@ -124,6 +124,7 @@ fbsd_make_corefile_notes (bfd *obfd, int fpregset_t fpregs; char *note_data = NULL; Elf_Internal_Ehdr *i_ehdrp; + char fakename; /* Put a "FreeBSD" label in the ELF header. */ i_ehdrp = elf_elfheader (obfd); @@ -138,6 +139,10 @@ fbsd_make_corefile_notes (bfd *obfd, int note_data = elfcore_write_prfpreg (obfd, note_data, note_size, &fpregs, sizeof (fpregs)); + fakename = '\0'; + note_data = elfcore_write_thrmisc (obfd, note_data, note_size, + &fakename, sizeof (fakename)); + if (get_exec_file (0)) { char *fname = strrchr (get_exec_file (0), '/') + 1; Modified: stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c ============================================================================== --- stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/gnu/usr.bin/gdb/libgdb/fbsd-threads.c Mon Dec 27 12:39:24 2010 (r216734) @@ -426,6 +426,46 @@ fbsd_thread_deactivate (void) init_thread_list (); } +static char * +fbsd_thread_get_name (lwpid_t lwpid) +{ + static char last_thr_name[MAXCOMLEN + 1]; + char section_name[32]; + struct ptrace_lwpinfo lwpinfo; + bfd_size_type size; + struct bfd_section *section; + + if (target_has_execution) + { + if (ptrace (PT_LWPINFO, lwpid, (caddr_t)&lwpinfo, sizeof (lwpinfo)) == -1) + goto fail; + strncpy (last_thr_name, lwpinfo.pl_tdname, sizeof (last_thr_name) - 1); + } + else + { + snprintf (section_name, sizeof (section_name), ".tname/%u", lwpid); + section = bfd_get_section_by_name (core_bfd, section_name); + if (! section) + goto fail; + + /* Section size fix-up. */ + size = bfd_section_size (core_bfd, section); + if (size > sizeof (last_thr_name)) + size = sizeof (last_thr_name); + + if (! bfd_get_section_contents (core_bfd, section, last_thr_name, + (file_ptr)0, size)) + goto fail; + if (last_thr_name[0] == '\0') + goto fail; + } + last_thr_name[sizeof (last_thr_name) - 1] = '\0'; + return last_thr_name; +fail: + strcpy (last_thr_name, ""); + return last_thr_name; +} + static void fbsd_thread_new_objfile (struct objfile *objfile) { @@ -1158,7 +1198,7 @@ fbsd_thread_find_new_threads (void) static char * fbsd_thread_pid_to_str (ptid_t ptid) { - static char buf[64]; + static char buf[64 + MAXCOMLEN]; if (IS_THREAD (ptid)) { @@ -1178,8 +1218,9 @@ fbsd_thread_pid_to_str (ptid_t ptid) if (ti.ti_lid != 0) { - snprintf (buf, sizeof (buf), "Thread %llx (LWP %d)", - (unsigned long long)th.th_thread, ti.ti_lid); + snprintf (buf, sizeof (buf), "Thread %llx (LWP %d/%s)", + (unsigned long long)th.th_thread, ti.ti_lid, + fbsd_thread_get_name (ti.ti_lid)); } else { Modified: stable/8/sys/compat/freebsd32/freebsd32.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/compat/freebsd32/freebsd32.h Mon Dec 27 12:39:24 2010 (r216734) @@ -240,6 +240,11 @@ struct prpsinfo32 { char pr_psargs[PRARGSZ+1]; }; +struct thrmisc32 { + char pr_tname[MAXCOMLEN+1]; + u_int _pad; +}; + struct mq_attr32 { int mq_flags; int mq_maxmsg; Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/kern/imgact_elf.c Mon Dec 27 12:39:24 2010 (r216734) @@ -1213,12 +1213,14 @@ typedef struct prpsinfo32 elf_prpsinfo_t typedef struct fpreg32 elf_prfpregset_t; typedef struct fpreg32 elf_fpregset_t; typedef struct reg32 elf_gregset_t; +typedef struct thrmisc32 elf_thrmisc_t; #else typedef prstatus_t elf_prstatus_t; typedef prpsinfo_t elf_prpsinfo_t; typedef prfpregset_t elf_prfpregset_t; typedef prfpregset_t elf_fpregset_t; typedef gregset_t elf_gregset_t; +typedef thrmisc_t elf_thrmisc_t; #endif static void @@ -1228,10 +1230,12 @@ __elfN(puthdr)(struct thread *td, void * elf_prstatus_t status; elf_prfpregset_t fpregset; elf_prpsinfo_t psinfo; + elf_thrmisc_t thrmisc; } *tempdata; elf_prstatus_t *status; elf_prfpregset_t *fpregset; elf_prpsinfo_t *psinfo; + elf_thrmisc_t *thrmisc; struct proc *p; struct thread *thr; size_t ehoff, noteoff, notesz, phoff; @@ -1254,11 +1258,13 @@ __elfN(puthdr)(struct thread *td, void * status = &tempdata->status; fpregset = &tempdata->fpregset; psinfo = &tempdata->psinfo; + thrmisc = &tempdata->thrmisc; } else { tempdata = NULL; status = NULL; fpregset = NULL; psinfo = NULL; + thrmisc = NULL; } if (dst != NULL) { @@ -1298,11 +1304,15 @@ __elfN(puthdr)(struct thread *td, void * fill_regs(thr, &status->pr_reg); fill_fpregs(thr, fpregset); #endif + memset(&thrmisc->_pad, 0, sizeof (thrmisc->_pad)); + strcpy(thrmisc->pr_tname, thr->td_name); } __elfN(putnote)(dst, off, "FreeBSD", NT_PRSTATUS, status, sizeof *status); __elfN(putnote)(dst, off, "FreeBSD", NT_FPREGSET, fpregset, sizeof *fpregset); + __elfN(putnote)(dst, off, "FreeBSD", NT_THRMISC, thrmisc, + sizeof *thrmisc); /* * Allow for MD specific notes, as well as any MD * specific preparations for writing MI notes. Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/kern/sys_process.c Mon Dec 27 12:39:24 2010 (r216734) @@ -92,6 +92,7 @@ struct ptrace_lwpinfo32 { sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct siginfo32 pl_siginfo; /* siginfo for signal */ + char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */ }; #endif @@ -517,6 +518,7 @@ ptrace_lwpinfo_to32(const struct ptrace_ pl32->pl_sigmask = pl->pl_sigmask; pl32->pl_siglist = pl->pl_siglist; siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); + strcpy(pl32->pl_tdname, pl->pl_tdname); } #endif /* COMPAT_FREEBSD32 */ @@ -1172,6 +1174,7 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags |= PL_FLAG_EXEC; pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; + strcpy(pl->pl_tdname, td2->td_name); #ifdef COMPAT_FREEBSD32 if (wrap32) ptrace_lwpinfo_to32(pl, pl32); Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/sys/elf_common.h Mon Dec 27 12:39:24 2010 (r216734) @@ -480,6 +480,7 @@ typedef struct { #define NT_PRSTATUS 1 /* Process status. */ #define NT_FPREGSET 2 /* Floating point registers. */ #define NT_PRPSINFO 3 /* Process state info. */ +#define NT_THRMISC 7 /* Thread miscellaneous info. */ /* Symbol Binding - ELFNN_ST_BIND - st_info */ #define STB_LOCAL 0 /* Local symbol */ Modified: stable/8/sys/sys/procfs.h ============================================================================== --- stable/8/sys/sys/procfs.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/sys/procfs.h Mon Dec 27 12:39:24 2010 (r216734) @@ -80,6 +80,13 @@ typedef struct prpsinfo { char pr_psargs[PRARGSZ+1]; /* Arguments, null terminated (1) */ } prpsinfo_t; +#define THRMISC_VERSION 1 /* Current version of thrmisc_t */ + +typedef struct thrmisc { + char pr_tname[MAXCOMLEN+1]; /* Thread name, null terminated (1) */ + u_int _pad; /* Convenience pad, 0-filled (1) */ +} thrmisc_t; + typedef uint64_t psaddr_t; /* An address in the target process. */ #endif /* _SYS_PROCFS_H_ */ Modified: stable/8/sys/sys/ptrace.h ============================================================================== --- stable/8/sys/sys/ptrace.h Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/sys/sys/ptrace.h Mon Dec 27 12:39:24 2010 (r216734) @@ -34,6 +34,7 @@ #define _SYS_PTRACE_H_ #include +#include #include #define PT_TRACE_ME 0 /* child declares it's being traced */ @@ -106,6 +107,7 @@ struct ptrace_lwpinfo { sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ + char pl_tdname[MAXCOMLEN + 1]; /* LWP name */ }; /* Argument structure for PT_VM_ENTRY. */ Modified: stable/8/usr.bin/gcore/elfcore.c ============================================================================== --- stable/8/usr.bin/gcore/elfcore.c Mon Dec 27 12:06:38 2010 (r216733) +++ stable/8/usr.bin/gcore/elfcore.c Mon Dec 27 12:39:24 2010 (r216734) @@ -284,10 +284,12 @@ elf_getstatus(pid_t pid, prpsinfo_t *psi static void elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) { + struct ptrace_lwpinfo lwpinfo; struct { prstatus_t status; prfpregset_t fpregset; prpsinfo_t psinfo; + thrmisc_t thrmisc; } *tempdata; size_t ehoff; size_t phoff; @@ -300,6 +302,7 @@ elf_puthdr(pid_t pid, vm_map_entry_t map prstatus_t *status; prfpregset_t *fpregset; prpsinfo_t *psinfo; + thrmisc_t *thrmisc; ehoff = *off; *off += sizeof(Elf_Ehdr); @@ -315,11 +318,13 @@ elf_puthdr(pid_t pid, vm_map_entry_t map status = &tempdata->status; fpregset = &tempdata->fpregset; psinfo = &tempdata->psinfo; + thrmisc = &tempdata->thrmisc; } else { tempdata = NULL; status = NULL; fpregset = NULL; psinfo = NULL; + thrmisc = NULL; } errno = 0; @@ -356,11 +361,17 @@ elf_puthdr(pid_t pid, vm_map_entry_t map ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); + ptrace(PT_LWPINFO, tids[i], (void *)&lwpinfo, + sizeof(lwpinfo)); + memset(&thrmisc->_pad, 0, sizeof(thrmisc->_pad)); + strcpy(thrmisc->pr_tname, lwpinfo.pl_tdname); } elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, sizeof *status); elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, sizeof *fpregset); + elf_putnote(dst, off, "FreeBSD", NT_THRMISC, thrmisc, + sizeof *thrmisc); } notesz = *off - noteoff; From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 12:52:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE49106564A; Mon, 27 Dec 2010 12:52:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED0938FC16; Mon, 27 Dec 2010 12:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRCqZlw024968; Mon, 27 Dec 2010 12:52:35 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRCqZLG024965; Mon, 27 Dec 2010 12:52:35 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012271252.oBRCqZLG024965@svn.freebsd.org> From: Attilio Rao Date: Mon, 27 Dec 2010 12:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216735 - stable/8/sys/dev/ichwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 12:52:36 -0000 Author: attilio Date: Mon Dec 27 12:52:35 2010 New Revision: 216735 URL: http://svn.freebsd.org/changeset/base/216735 Log: MFC r215868, 215918, 216266, 216298: - Advertise when the reboot came from a watchdog-induced reset - Fix a bug where TCO_BOOT_STS was supposed to be cleared after TCO_SECOND_TO_STS - Use macros for max and min value capping when re-arming the watchdog timeout Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/ichwd/ichwd.c stable/8/sys/dev/ichwd/ichwd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.c Mon Dec 27 12:39:24 2010 (r216734) +++ stable/8/sys/dev/ichwd/ichwd.c Mon Dec 27 12:52:35 2010 (r216735) @@ -179,12 +179,12 @@ ichwd_sts_reset(struct ichwd_softc *sc) * by writing a 1, not a 0. */ ichwd_write_tco_2(sc, TCO1_STS, TCO_TIMEOUT); - /* - * XXX The datasheet says that TCO_SECOND_TO_STS must be cleared - * before TCO_BOOT_STS, not the other way around. + /* + * According to Intel's docs, clearing SECOND_TO_STS and BOOT_STS must + * be done in two separate operations. */ - ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); + ichwd_write_tco_2(sc, TCO2_STS, TCO_BOOT_STS); } /* @@ -242,30 +242,23 @@ static __inline void ichwd_tmr_set(struct ichwd_softc *sc, unsigned int timeout) { - /* - * If the datasheets are to be believed, the minimum value - * actually varies from chipset to chipset - 4 for ICH5 and 2 for - * all other chipsets. I suspect this is a bug in the ICH5 - * datasheet and that the minimum is uniformly 2, but I'd rather - * err on the side of caution. - */ - if (timeout < 4) - timeout = 4; + if (timeout < TCO_RLD_TMR_MIN) + timeout = TCO_RLD_TMR_MIN; if (sc->ich_version <= 5) { uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1); - tmr_val8 &= 0xc0; - if (timeout > 0x3f) - timeout = 0x3f; + tmr_val8 &= (~TCO_RLD1_TMR_MAX & 0xff); + if (timeout > TCO_RLD1_TMR_MAX) + timeout = TCO_RLD1_TMR_MAX; tmr_val8 |= timeout; ichwd_write_tco_1(sc, TCO_TMR1, tmr_val8); } else { uint16_t tmr_val16 = ichwd_read_tco_2(sc, TCO_TMR2); - tmr_val16 &= 0xfc00; - if (timeout > 0x03ff) - timeout = 0x03ff; + tmr_val16 &= (~TCO_RLD2_TMR_MAX & 0xffff); + if (timeout > TCO_RLD2_TMR_MAX) + timeout = TCO_RLD2_TMR_MAX; tmr_val16 |= timeout; ichwd_write_tco_2(sc, TCO_TMR2, tmr_val16); } @@ -474,11 +467,13 @@ ichwd_attach(device_t dev) device_get_desc(dev), sc->ich_version); /* - * XXX we should check the status registers (specifically, the - * TCO_SECOND_TO_STS bit in the TCO2_STS register) to see if we - * just came back from a watchdog-induced reset, and let the user - * know. + * Determine if we are coming up after a watchdog-induced reset. Some + * BIOSes may clear this bit at bootup, preventing us from reporting + * this case on such systems. We clear this bit in ichwd_sts_reset(). */ + if ((ichwd_read_tco_2(sc, TCO2_STS) & TCO_SECOND_TO_STS) != 0) + device_printf(dev, + "resuming after hardware watchdog timeout\n"); /* reset the watchdog status registers */ ichwd_sts_reset(sc); Modified: stable/8/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/8/sys/dev/ichwd/ichwd.h Mon Dec 27 12:39:24 2010 (r216734) +++ stable/8/sys/dev/ichwd/ichwd.h Mon Dec 27 12:52:35 2010 (r216735) @@ -153,6 +153,17 @@ struct ichwd_softc { #define TCO_TMR_HALT 0x0800 /* clear to enable WDT */ #define TCO_CNT_PRESERVE 0x0200 /* preserve these bits */ +/* + * Masks for the TCO timer value field in TCO_RLD. + * If the datasheets are to be believed, the minimum value actually varies + * from chipset to chipset - 4 for ICH5 and 2 for all other chipsets. + * I suspect this is a bug in the ICH5 datasheet and that the minimum is + * uniformly 2, but I'd rather err on the side of caution. + */ +#define TCO_RLD_TMR_MIN 0x0004 +#define TCO_RLD1_TMR_MAX 0x003f +#define TCO_RLD2_TMR_MAX 0x03ff + /* approximate length in nanoseconds of one WDT tick (about 0.6 sec) */ #define ICHWD_TICK 600000000 From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 12:57:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FFA31065674; Mon, 27 Dec 2010 12:57:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2ECAC8FC1C; Mon, 27 Dec 2010 12:57:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRCvdg3025117; Mon, 27 Dec 2010 12:57:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRCvdet025115; Mon, 27 Dec 2010 12:57:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012271257.oBRCvdet025115@svn.freebsd.org> From: Attilio Rao Date: Mon, 27 Dec 2010 12:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216736 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 12:57:39 -0000 Author: attilio Date: Mon Dec 27 12:57:38 2010 New Revision: 216736 URL: http://svn.freebsd.org/changeset/base/216736 Log: MFC r216513: Add Exar octal PCI UART. Sponsored by: Sandvine Incorporated Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Mon Dec 27 12:52:35 2010 (r216735) +++ stable/8/sys/dev/puc/pucdata.c Mon Dec 27 12:57:38 2010 (r216736) @@ -554,6 +554,12 @@ const struct puc_cfg puc_pci_devices[] = .config_function = puc_config_cronyx }, + { 0x13a8, 0x0258, 0xffff, 0, + "Exar XR17V258IV", + DEFAULT_RCLK * 8, + PUC_PORT_8S, 0x10, 0, -1, + }, + { 0x1407, 0x0100, 0xffff, 0, "Lava Computers Dual Serial", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 15:05:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BB91065697; Mon, 27 Dec 2010 15:05:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 504D58FC1E; Mon, 27 Dec 2010 15:05:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRF5Fah028622; Mon, 27 Dec 2010 15:05:15 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRF5Ftm028620; Mon, 27 Dec 2010 15:05:15 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201012271505.oBRF5Ftm028620@svn.freebsd.org> From: Ed Schouten Date: Mon, 27 Dec 2010 15:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216737 - head/usr.bin/lock X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 15:05:15 -0000 Author: ed Date: Mon Dec 27 15:05:15 2010 New Revision: 216737 URL: http://svn.freebsd.org/changeset/base/216737 Log: Fix style bug introduced in r216696. Additional indentation caused the line to become longer than 80 columns. Modified: head/usr.bin/lock/lock.c Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Mon Dec 27 12:57:38 2010 (r216736) +++ head/usr.bin/lock/lock.c Mon Dec 27 15:05:15 2010 (r216737) @@ -198,7 +198,8 @@ main(int argc, char **argv) /* header info */ if (pw != NULL) - (void)printf("lock: %s using %s on %s.", pw->pw_name, ttynam, hostname); + (void)printf("lock: %s using %s on %s.", pw->pw_name, + ttynam, hostname); else (void)printf("lock: %s on %s.", ttynam, hostname); if (no_timeout) From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 15:57:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A7911065672; Mon, 27 Dec 2010 15:57:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED4CA8FC17; Mon, 27 Dec 2010 15:57:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRFvfbL029844; Mon, 27 Dec 2010 15:57:41 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRFvfP9029841; Mon, 27 Dec 2010 15:57:41 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201012271557.oBRFvfP9029841@svn.freebsd.org> From: Ed Maste Date: Mon, 27 Dec 2010 15:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216738 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 15:57:42 -0000 Author: emaste Date: Mon Dec 27 15:57:41 2010 New Revision: 216738 URL: http://svn.freebsd.org/changeset/base/216738 Log: Restore two commented-out tests from plus-minus1.0 to a new file. These two cases pass on -CURRENT but fail on stable/8. Reviewed by: jilles Added: head/tools/regression/bin/sh/expansion/plus-minus7.0 (contents, props changed) Modified: head/tools/regression/bin/sh/expansion/plus-minus1.0 Modified: head/tools/regression/bin/sh/expansion/plus-minus1.0 ============================================================================== --- head/tools/regression/bin/sh/expansion/plus-minus1.0 Mon Dec 27 15:05:15 2010 (r216737) +++ head/tools/regression/bin/sh/expansion/plus-minus1.0 Mon Dec 27 15:57:41 2010 (r216738) @@ -43,9 +43,6 @@ testcase 'set -- ${e:+$w"$e"}' '0|' testcase 'set -- ${w:+"$w"}' '1|a b c' testcase 'set -- ${w:+$w"$w"}' '3|a|b|ca b c' -# These two are known broken in FreeBSD /bin/sh -#testcase 'set -- ${s+a b}' '2|a|b' -#testcase 'set -- ${e:-a b}' '2|a|b' testcase 'set -- "${s+a b}"' '1|a b' testcase 'set -- "${e:-a b}"' '1|a b' testcase 'set -- ${e:-\}}' '1|}' Added: head/tools/regression/bin/sh/expansion/plus-minus7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/plus-minus7.0 Mon Dec 27 15:57:41 2010 (r216738) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +e= s='foo' +failures='' +ok='' + +testcase() { + code="$1" + expected="$2" + oIFS="$IFS" + eval "$code" + IFS='|' + result="$#|$*" + IFS="$oIFS" + if [ "x$result" = "x$expected" ]; then + ok=x$ok + else + failures=x$failures + echo "For $code, expected $expected actual $result" + fi +} + +testcase 'set -- ${s+a b}' '2|a|b' +testcase 'set -- ${e:-a b}' '2|a|b' + +test "x$failures" = x From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 16:01:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F59F1065693; Mon, 27 Dec 2010 16:01:40 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 336808FC0A; Mon, 27 Dec 2010 16:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRG1enK029994; Mon, 27 Dec 2010 16:01:40 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRG1e7D029991; Mon, 27 Dec 2010 16:01:40 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201012271601.oBRG1e7D029991@svn.freebsd.org> From: Hiroki Sato Date: Mon, 27 Dec 2010 16:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216739 - in stable/8: etc sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 16:01:40 -0000 Author: hrs Date: Mon Dec 27 16:01:39 2010 New Revision: 216739 URL: http://svn.freebsd.org/changeset/base/216739 Log: - route(8) manual page update: no longer supports RTF_CLONING and RTF_LLINFO (MFC from r196833) - Remove -cloning flag from network.subr[*] PR: conf/144842 [*] Approved by: re (bz) Modified: stable/8/etc/network.subr stable/8/sbin/route/route.8 Directory Properties: stable/8/sbin/route/ (props changed) Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Mon Dec 27 15:57:41 2010 (r216738) +++ stable/8/etc/network.subr Mon Dec 27 16:01:39 2010 (r216739) @@ -1134,8 +1134,7 @@ network6_default_interface_setup() ;; *) laddr=`network6_getladdr ${ipv6_default_interface}` - route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \ - -cloning + route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface # Disable installing the default interface with the # case net.inet6.ip6.forwarding=0 and Modified: stable/8/sbin/route/route.8 ============================================================================== --- stable/8/sbin/route/route.8 Mon Dec 27 15:57:41 2010 (r216738) +++ stable/8/sbin/route/route.8 Mon Dec 27 16:01:39 2010 (r216739) @@ -28,7 +28,7 @@ .\" @(#)route.8 8.3 (Berkeley) 3/19/94 .\" $FreeBSD$ .\" -.Dd October 2, 2005 +.Dd December 17, 2010 .Dt ROUTE 8 .Os .Sh NAME @@ -279,7 +279,6 @@ when sending to destinations matched by These flags may be set (or sometimes cleared) by indicating the following corresponding modifiers: .Bd -literal --cloning RTF_CLONING - generates a new route on use -xresolve RTF_XRESOLVE - emit mesg on use (for external lookup) -iface ~RTF_GATEWAY - destination is directly reachable -static RTF_STATIC - manually added route @@ -288,7 +287,6 @@ by indicating the following correspondin -blackhole RTF_BLACKHOLE - silently discard pkts (during updates) -proto1 RTF_PROTO1 - set protocol specific routing flag #1 -proto2 RTF_PROTO2 - set protocol specific routing flag #2 --llinfo RTF_LLINFO - validly translates proto addr to link addr .Ed .Pp The optional modifiers @@ -326,25 +324,6 @@ or .Fl ifa modifiers may be used to determine the interface or interface address. .Pp -The optional -.Fl proxy -modifier specifies that the -.Dv RTF_LLINFO -routing table entry is the -.Dq published (proxy-only) -.Tn ARP -entry, as reported by -.Xr arp 8 . -.Pp -The optional -.Fl genmask -modifier specifies that a cloning mask is present. -This specifies the mask applied when determining if a child route -should be created. -It is only applicable to network routes with the -.Dv RTF_CLONING -flag set. -.Pp All symbolic names specified for a .Ar destination or From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 16:02:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 949B91065694; Mon, 27 Dec 2010 16:02:14 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69B598FC1B; Mon, 27 Dec 2010 16:02:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRG2E5D030044; Mon, 27 Dec 2010 16:02:14 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRG2Eag030041; Mon, 27 Dec 2010 16:02:14 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201012271602.oBRG2Eag030041@svn.freebsd.org> From: Hiroki Sato Date: Mon, 27 Dec 2010 16:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216740 - in releng/8.2: etc sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 16:02:14 -0000 Author: hrs Date: Mon Dec 27 16:02:14 2010 New Revision: 216740 URL: http://svn.freebsd.org/changeset/base/216740 Log: - route(8) manual page update: no longer supports RTF_CLONING and RTF_LLINFO (MFC from r196833) - Remove -cloning flag from network.subr[*] PR: conf/144842 [*] Approved by: re (bz) Modified: releng/8.2/etc/network.subr releng/8.2/sbin/route/route.8 Directory Properties: releng/8.2/sbin/route/ (props changed) Modified: releng/8.2/etc/network.subr ============================================================================== --- releng/8.2/etc/network.subr Mon Dec 27 16:01:39 2010 (r216739) +++ releng/8.2/etc/network.subr Mon Dec 27 16:02:14 2010 (r216740) @@ -1134,8 +1134,7 @@ network6_default_interface_setup() ;; *) laddr=`network6_getladdr ${ipv6_default_interface}` - route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \ - -cloning + route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface # Disable installing the default interface with the # case net.inet6.ip6.forwarding=0 and Modified: releng/8.2/sbin/route/route.8 ============================================================================== --- releng/8.2/sbin/route/route.8 Mon Dec 27 16:01:39 2010 (r216739) +++ releng/8.2/sbin/route/route.8 Mon Dec 27 16:02:14 2010 (r216740) @@ -279,7 +279,6 @@ when sending to destinations matched by These flags may be set (or sometimes cleared) by indicating the following corresponding modifiers: .Bd -literal --cloning RTF_CLONING - generates a new route on use -xresolve RTF_XRESOLVE - emit mesg on use (for external lookup) -iface ~RTF_GATEWAY - destination is directly reachable -static RTF_STATIC - manually added route @@ -288,7 +287,6 @@ by indicating the following correspondin -blackhole RTF_BLACKHOLE - silently discard pkts (during updates) -proto1 RTF_PROTO1 - set protocol specific routing flag #1 -proto2 RTF_PROTO2 - set protocol specific routing flag #2 --llinfo RTF_LLINFO - validly translates proto addr to link addr .Ed .Pp The optional modifiers @@ -326,25 +324,6 @@ or .Fl ifa modifiers may be used to determine the interface or interface address. .Pp -The optional -.Fl proxy -modifier specifies that the -.Dv RTF_LLINFO -routing table entry is the -.Dq published (proxy-only) -.Tn ARP -entry, as reported by -.Xr arp 8 . -.Pp -The optional -.Fl genmask -modifier specifies that a cloning mask is present. -This specifies the mask applied when determining if a child route -should be created. -It is only applicable to network routes with the -.Dv RTF_CLONING -flag set. -.Pp All symbolic names specified for a .Ar destination or From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 18:55:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DCD91065674; Mon, 27 Dec 2010 18:55:16 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8228FC16; Mon, 27 Dec 2010 18:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRItGAo033762; Mon, 27 Dec 2010 18:55:16 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRItGtB033759; Mon, 27 Dec 2010 18:55:16 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201012271855.oBRItGtB033759@svn.freebsd.org> From: Oleg Bulyzhin Date: Mon, 27 Dec 2010 18:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216741 - releng/8.2/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 18:55:16 -0000 Author: oleg Date: Mon Dec 27 18:55:16 2010 New Revision: 216741 URL: http://svn.freebsd.org/changeset/base/216741 Log: MFC r203548: Propagate the vlan events to the underlying interfaces/members so they can do initialization of hw related features. PR: kern/141646 Approved by: re (bz) Modified: releng/8.2/sys/net/if_lagg.c releng/8.2/sys/net/if_lagg.h Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/net/if_lagg.c ============================================================================== --- releng/8.2/sys/net/if_lagg.c Mon Dec 27 16:02:14 2010 (r216740) +++ releng/8.2/sys/net/if_lagg.c Mon Dec 27 18:55:16 2010 (r216741) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -204,6 +205,50 @@ static moduledata_t lagg_mod = { DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +#if __FreeBSD_version >= 800000 +/* + * This routine is run via an vlan + * config EVENT + */ +static void +lagg_register_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) +{ + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc); +} + +/* + * This routine is run via an vlan + * unconfig EVENT + */ +static void +lagg_unregister_vlan(void *arg, struct ifnet *ifp, u_int16_t vtag) +{ + struct lagg_softc *sc = ifp->if_softc; + struct lagg_port *lp; + + if (ifp->if_softc != arg) /* Not our event */ + return; + + LAGG_RLOCK(sc); + if (!SLIST_EMPTY(&sc->sc_ports)) { + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); + } + LAGG_RUNLOCK(sc); +} +#endif + static int lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) { @@ -259,6 +304,13 @@ lagg_clone_create(struct if_clone *ifc, */ ether_ifattach(ifp, eaddr); +#if __FreeBSD_version >= 800000 + sc->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, + lagg_register_vlan, sc, EVENTHANDLER_PRI_FIRST); + sc->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, + lagg_unregister_vlan, sc, EVENTHANDLER_PRI_FIRST); +#endif + /* Insert into the global list of laggs */ mtx_lock(&lagg_list_mtx); SLIST_INSERT_HEAD(&lagg_list, sc, sc_entries); @@ -278,6 +330,11 @@ lagg_clone_destroy(struct ifnet *ifp) lagg_stop(sc); ifp->if_flags &= ~IFF_UP; +#if __FreeBSD_version >= 800000 + EVENTHANDLER_DEREGISTER(vlan_config, sc->vlan_attach); + EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); +#endif + /* Shutdown and remove lagg ports */ while ((lp = SLIST_FIRST(&sc->sc_ports)) != NULL) lagg_port_destroy(lp, 1); Modified: releng/8.2/sys/net/if_lagg.h ============================================================================== --- releng/8.2/sys/net/if_lagg.h Mon Dec 27 16:02:14 2010 (r216740) +++ releng/8.2/sys/net/if_lagg.h Mon Dec 27 18:55:16 2010 (r216741) @@ -198,6 +198,10 @@ struct lagg_softc { void (*sc_lladdr)(struct lagg_softc *); void (*sc_req)(struct lagg_softc *, caddr_t); void (*sc_portreq)(struct lagg_port *, caddr_t); +#if __FreeBSD_version >= 800000 + eventhandler_tag vlan_attach; + eventhandler_tag vlan_detach; +#endif }; struct lagg_port { From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 19:38:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F3251065673; Mon, 27 Dec 2010 19:38:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E3C18FC17; Mon, 27 Dec 2010 19:38:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRJcQuI034700; Mon, 27 Dec 2010 19:38:26 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRJcQM6034698; Mon, 27 Dec 2010 19:38:26 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201012271938.oBRJcQM6034698@svn.freebsd.org> From: Robert Watson Date: Mon, 27 Dec 2010 19:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216742 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 19:38:26 -0000 Author: rwatson Date: Mon Dec 27 19:38:25 2010 New Revision: 216742 URL: http://svn.freebsd.org/changeset/base/216742 Log: Remove comment bemoaning the lack of an INP_INHASHLIST above in_pcbdrop(); I fixed this in r189657 in early 2009, so the comment is OBE. Reviewed by: bz MFC after: 3 days Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Mon Dec 27 18:55:16 2010 (r216741) +++ head/sys/netinet/in_pcb.c Mon Dec 27 19:38:25 2010 (r216742) @@ -1077,12 +1077,6 @@ in_pcbfree(struct inpcb *inp) * maintaining the invariant that so_pcb always points to a valid inpcb until * in_pcbdetach(). * - * XXXRW: An inp_lport of 0 is used to indicate that the inpcb is not on hash - * lists, but can lead to confusing netstat output, as open sockets with - * closed TCP connections will no longer appear to have their bound port - * number. An explicit flag would be better, as it would allow us to leave - * the port number intact after the connection is dropped. - * * XXXRW: Possibly in_pcbdrop() should also prevent future notifications by * in_pcbnotifyall() and in_pcbpurgeif0()? */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 22:18:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680F1106564A; Mon, 27 Dec 2010 22:18:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56F2F8FC08; Mon, 27 Dec 2010 22:18:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRMIRsN038091; Mon, 27 Dec 2010 22:18:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRMIRct038088; Mon, 27 Dec 2010 22:18:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012272218.oBRMIRct038088@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 27 Dec 2010 22:18:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216743 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 22:18:27 -0000 Author: jilles Date: Mon Dec 27 22:18:27 2010 New Revision: 216743 URL: http://svn.freebsd.org/changeset/base/216743 Log: sh: Simplify "stack string" code slightly. Maintain a pointer to the end of the stack string area instead of how much space is left. This simplifies the macros in memalloc.h. The places where the new variable must be updated are only where the memory area is created, destroyed or resized. Modified: head/bin/sh/memalloc.c head/bin/sh/memalloc.h Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Mon Dec 27 19:38:25 2010 (r216742) +++ head/bin/sh/memalloc.c Mon Dec 27 22:18:27 2010 (r216743) @@ -127,7 +127,7 @@ static struct stack_block *stackp; static struct stackmark *markp; char *stacknxt; int stacknleft; -int sstrnleft; +char *sstrend; static void @@ -146,6 +146,7 @@ stnewblock(int nbytes) sp->prev = stackp; stacknxt = SPACE(sp); stacknleft = allocsize - (stacknxt - (char*)sp); + sstrend = stacknxt + stacknleft; stackp = sp; INTON; } @@ -204,6 +205,7 @@ popstackmark(struct stackmark *mark) } stacknxt = mark->stacknxt; stacknleft = mark->stacknleft; + sstrend = stacknxt + stacknleft; INTON; } @@ -250,6 +252,7 @@ growstackblock(int min) stackp = sp; stacknxt = SPACE(sp); stacknleft = newlen - (stacknxt - (char*)sp); + sstrend = stacknxt + stacknleft; /* * Stack marks pointing to the start of the old block @@ -306,7 +309,6 @@ static char * growstrstackblock(int n, int min) { growstackblock(min); - sstrnleft = stackblocksize() - n; return stackblock() + n; } @@ -325,31 +327,20 @@ growstackstr(void) */ char * -makestrspace(int min) +makestrspace(int min, char *p) { int len; - len = stackblocksize() - sstrnleft; + len = p - stackblock(); return (growstrstackblock(len, min)); } - -void -ungrabstackstr(char *s, char *p) -{ - stacknleft += stacknxt - s; - stacknxt = s; - sstrnleft = stacknleft - (p - s); -} - - char * stputbin(const char *data, int len, char *p) { CHECKSTRSPACE(len, p); memcpy(p, data, len); - sstrnleft -= len; return (p + len); } Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Mon Dec 27 19:38:25 2010 (r216742) +++ head/bin/sh/memalloc.h Mon Dec 27 22:18:27 2010 (r216743) @@ -45,7 +45,7 @@ struct stackmark { extern char *stacknxt; extern int stacknleft; -extern int sstrnleft; +extern char *sstrend; pointer ckmalloc(size_t); pointer ckrealloc(pointer, int); @@ -57,8 +57,7 @@ void setstackmark(struct stackmark *); void popstackmark(struct stackmark *); void grabstackblock(int); char *growstackstr(void); -char *makestrspace(int); -void ungrabstackstr(char *, char *); +char *makestrspace(int, char *); char *stputbin(const char *data, int len, char *p); char *stputs(const char *data, char *p); @@ -66,10 +65,10 @@ char *stputs(const char *data, char *p); #define stackblock() stacknxt #define stackblocksize() stacknleft -#define STARTSTACKSTR(p) p = stackblock(), sstrnleft = stackblocksize() -#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), --sstrnleft, *p++ = (c))) -#define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(n); } -#define USTPUTC(c, p) (--sstrnleft, *p++ = (c)) +#define STARTSTACKSTR(p) p = stackblock() +#define STPUTC(c, p) do { if (p == sstrend) p = growstackstr(); *p++ = (c); } while(0) +#define CHECKSTRSPACE(n, p) { if (sstrend - p < n) p = makestrspace(n, p); } +#define USTPUTC(c, p) (*p++ = (c)) /* * STACKSTRNUL's use is where we want to be able to turn a stack * (non-sentinel, character counting string) into a C string, @@ -77,10 +76,11 @@ char *stputs(const char *data, char *p); * Note: Because of STACKSTRNUL's semantics, STACKSTRNUL cannot be used * on a stack that will grabstackstr()ed. */ -#define STACKSTRNUL(p) (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0')) -#define STUNPUTC(p) (++sstrnleft, --p) +#define STACKSTRNUL(p) (p == sstrend ? (p = growstackstr(), *p = '\0') : (*p = '\0')) +#define STUNPUTC(p) (--p) #define STTOPC(p) p[-1] -#define STADJUST(amount, p) (p += (amount), sstrnleft -= (amount)) -#define grabstackstr(p) stalloc(stackblocksize() - sstrnleft) +#define STADJUST(amount, p) (p += (amount)) +#define grabstackstr(p) stalloc((char *)p - stackblock()) +#define ungrabstackstr(s, p) stunalloc((s)) #define STPUTBIN(s, len, p) p = stputbin((s), (len), p) #define STPUTS(s, p) p = stputs((s), p) From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 22:52:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 556AC1065670; Mon, 27 Dec 2010 22:52:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4389B8FC20; Mon, 27 Dec 2010 22:52:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRMqm9A038844; Mon, 27 Dec 2010 22:52:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRMqmaw038842; Mon, 27 Dec 2010 22:52:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201012272252.oBRMqmaw038842@svn.freebsd.org> From: Doug Barton Date: Mon, 27 Dec 2010 22:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216744 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 22:52:48 -0000 Author: dougb Date: Mon Dec 27 22:52:47 2010 New Revision: 216744 URL: http://svn.freebsd.org/changeset/base/216744 Log: Add pidfile [1] While I'm here, don't run the sysctl frob unconditionally, and s/sysctl/$SYSCTL/ PR: conf/153460 [1] Submitted by: Grigory Rechistov Modified: head/etc/rc.d/devd Modified: head/etc/rc.d/devd ============================================================================== --- head/etc/rc.d/devd Mon Dec 27 22:18:27 2010 (r216743) +++ head/etc/rc.d/devd Mon Dec 27 22:52:47 2010 (r216744) @@ -13,11 +13,17 @@ name="devd" rcvar=`set_rcvar` command="/sbin/${name}" +pidfile=/var/run/${name}.pid + +start_precmd=${name}_prestart + +devd_prestart () +{ + # If devd is disabled, turn it off in the kernel to avoid memory leaks. + if ! checkyesno ${rcvar}; then + $SYSCTL hw.bus.devctl_disable=1 + fi +} load_rc_config $name run_rc_command "$1" - -# If devd is disabled, turn it off in the kernel to avoid memory leaks. -if ! checkyesno ${rcvar}; then - sysctl hw.bus.devctl_disable=1 -fi From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 23:46:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DD101065672; Mon, 27 Dec 2010 23:46:48 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD728FC18; Mon, 27 Dec 2010 23:46:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRNklCd040083; Mon, 27 Dec 2010 23:46:47 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRNklbL040080; Mon, 27 Dec 2010 23:46:47 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201012272346.oBRNklbL040080@svn.freebsd.org> From: Garrett Wollman Date: Mon, 27 Dec 2010 23:46:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216745 - stable/8/usr.bin/locate/locate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 23:46:48 -0000 Author: wollman Date: Mon Dec 27 23:46:47 2010 New Revision: 216745 URL: http://svn.freebsd.org/changeset/base/216745 Log: Merge three revisions from head: r214583 | wollman | 2010-10-30 22:36:05 -0400 (Sat, 30 Oct 2010) | 6 lines Changed paths: M /head/usr.bin/locate/locate/locate.rc M /head/usr.bin/locate/locate/updatedb.sh Make it possible to exclude directories by name no matter where they are in the filesystem from the locate database. By default, exclude ".zfs" directories, as users who who have set snapdir=visible and are taking frequent snapshots most likely do not want the snapshots included in the locate database. ------------------------------------------------------------------------ r214613 | wollman | 2010-10-31 21:51:47 -0400 (Sun, 31 Oct 2010) | 7 lines Changed paths: M /head/usr.bin/locate/locate/updatedb.sh jilles@ pointed out that using ${PRUNEDIRS:=".zfs"} in updatedb.sh made it impossible to override PRUNEDIRS to make it empty. Use the non-colon form to only set PRUNEDIRS if it is completely unset. (For parallelism, the other configuration defaults here could be done the same way, but that could be more obviously accomplished by disabling updatedb in periodic.conf, so leave them alone for now.) ------------------------------------------------------------------------ r214615 | wollman | 2010-10-31 22:20:18 -0400 (Sun, 31 Oct 2010) | 6 lines Changed paths: M /head/usr.bin/locate/locate/updatedb.sh Style cleanup: make this look more like a 21st-century shell script and not something out of the early 1980s. Make sure all error messages go to stderr, not stdout. Since there's error-handling code to handle empty SEARCHPATHS and FILESYSTEMS, use the initialization form that allows this error to be diagnosed. (hat tip: jilles@) Modified: stable/8/usr.bin/locate/locate/locate.rc stable/8/usr.bin/locate/locate/updatedb.sh Directory Properties: stable/8/usr.bin/locate/ (props changed) Modified: stable/8/usr.bin/locate/locate/locate.rc ============================================================================== --- stable/8/usr.bin/locate/locate/locate.rc Mon Dec 27 22:52:47 2010 (r216744) +++ stable/8/usr.bin/locate/locate/locate.rc Mon Dec 27 23:46:47 2010 (r216745) @@ -15,9 +15,12 @@ # directories to be put in the database #SEARCHPATHS="/" -# directories unwanted in output +# paths unwanted in output #PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap" +# directories unwanted in output +#PRUNEDIRS=".zfs" + # filesystems allowed. Beware: a non-listed filesystem will be pruned # and if the SEARCHPATHS starts in such a filesystem locate will build # an empty database. Modified: stable/8/usr.bin/locate/locate/updatedb.sh ============================================================================== --- stable/8/usr.bin/locate/locate/updatedb.sh Mon Dec 27 22:52:47 2010 (r216744) +++ stable/8/usr.bin/locate/locate/updatedb.sh Mon Dec 27 23:46:47 2010 (r216745) @@ -50,17 +50,20 @@ PATH=$LIBEXECDIR:/bin:/usr/bin:$PATH; ex : ${mklocatedb:=locate.mklocatedb} # make locate database program : ${FCODES:=/var/db/locate.database} # the database -: ${SEARCHPATHS:="/"} # directories to be put in the database -: ${PRUNEPATHS:="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories -: ${FILESYSTEMS:="$(lsvfs | tail -n +3 | \ +: ${SEARCHPATHS="/"} # directories to be put in the database +: ${PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap"} # unwanted directories +: ${PRUNEDIRS=".zfs"} # unwanted directories, in any parent +: ${FILESYSTEMS="$(lsvfs | tail -n +3 | \ egrep -vw "loopback|network|synthetic|read-only|0" | \ cut -d " " -f1)"} # allowed filesystems : ${find:=find} -case X"$SEARCHPATHS" in - X) echo "$0: empty variable SEARCHPATHS"; exit 1;; esac -case X"$FILESYSTEMS" in - X) echo "$0: empty variable FILESYSTEMS"; exit 1;; esac +if [ -z "$SEARCHPATHS" ]; then + echo "$0: empty variable SEARCHPATHS" >&2; exit 1 +fi +if [ -z "$FILESYSTEMS" ]; then + echo "$0: empty variable FILESYSTEMS" >&2; exit 1 +fi # Make a list a paths to exclude in the locate run excludes="! (" or="" @@ -71,25 +74,29 @@ do done excludes="$excludes ) -prune" -case X"$PRUNEPATHS" in - X) ;; - *) for path in $PRUNEPATHS - do +if [ -n "$PRUNEPATHS" ]; then + for path in $PRUNEPATHS; do excludes="$excludes -or -path $path -prune" - done;; -esac + done +fi + +if [ -n "$PRUNEDIRS" ]; then + for dir in $PRUNEDIRS; do + excludes="$excludes -or -name $dir -type d -prune" + done +fi tmp=$TMPDIR/_updatedb$$ trap 'rm -f $tmp; rmdir $TMPDIR' 0 1 2 3 5 10 15 # search locally -# echo $find $SEARCHPATHS $excludes -or -print && exit if $find -s $SEARCHPATHS $excludes -or -print 2>/dev/null | $mklocatedb -presort > $tmp then - case X"`$find $tmp -size -257c -print`" in - X) cat $tmp > $FCODES;; - *) echo "updatedb: locate database $tmp is empty" - exit 1 - esac + if [ -n "$($find $tmp -size -257c -print)" ]; then + echo "updatedb: locate database $tmp is empty" >&2 + exit 1 + else + cat $tmp > $FCODES # should be cp? + fi fi From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 23:52:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE3F81065670; Mon, 27 Dec 2010 23:52:40 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD638FC15; Mon, 27 Dec 2010 23:52:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRNqeo2040249; Mon, 27 Dec 2010 23:52:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRNqeEb040247; Mon, 27 Dec 2010 23:52:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012272352.oBRNqeEb040247@svn.freebsd.org> From: Colin Percival Date: Mon, 27 Dec 2010 23:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 23:52:40 -0000 Author: cperciva Date: Mon Dec 27 23:52:40 2010 New Revision: 216746 URL: http://svn.freebsd.org/changeset/base/216746 Log: Make it possible to specify WITHOUT_MODULES in a kernel config file. MFC after: 1 week Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Mon Dec 27 23:46:47 2010 (r216745) +++ head/sys/conf/kern.pre.mk Mon Dec 27 23:52:40 2010 (r216746) @@ -170,6 +170,9 @@ MKMODULESENV+= ALL_MODULES=LINT .if defined(MODULES_OVERRIDE) MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" .endif +.if defined(WITHOUT_MODULES) +MKMODULESENV+= WITHOUT_MODULES="${WITHOUT_MODULES}" +.endif .if defined(DEBUG) MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" .endif From owner-svn-src-all@FreeBSD.ORG Mon Dec 27 23:56:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBDD1065670; Mon, 27 Dec 2010 23:56:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE318FC0A; Mon, 27 Dec 2010 23:56:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRNu3OT040360; Mon, 27 Dec 2010 23:56:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRNu3iE040359; Mon, 27 Dec 2010 23:56:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012272356.oBRNu3iE040359@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 27 Dec 2010 23:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216747 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 23:56:03 -0000 Author: jilles Date: Mon Dec 27 23:56:03 2010 New Revision: 216747 URL: http://svn.freebsd.org/changeset/base/216747 Log: sh: Add a testcase for cmdsubst errors that already works properly. If a command substitution consists of one special builtin and there is a redirection error, this should not abort the outer shell. It was fixed in r201366 by ignoring special builtin properties for command substitutions consisting of one builtin. Added: head/tools/regression/bin/sh/expansion/cmdsubst4.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/cmdsubst4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst4.0 Mon Dec 27 23:56:03 2010 (r216747) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +exec 2>/dev/null +! y=$(: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 818F61065695; Mon, 27 Dec 2010 23:59:27 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 712D28FC13; Mon, 27 Dec 2010 23:59:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBRNxRlE040453; Mon, 27 Dec 2010 23:59:27 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBRNxRFr040451; Mon, 27 Dec 2010 23:59:27 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012272359.oBRNxRFr040451@svn.freebsd.org> From: Colin Percival Date: Mon, 27 Dec 2010 23:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216748 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Dec 2010 23:59:27 -0000 Author: cperciva Date: Mon Dec 27 23:59:27 2010 New Revision: 216748 URL: http://svn.freebsd.org/changeset/base/216748 Log: Build the modules which can be built. The excluded modules fall into two categories: Those which can't build with PAE because they attempt to cast a pointer to a bus_addr_t (mostly scsi drivers); and those which can't be built with XEN because they conflict with something in xen-os.h (e.g., in cxgb there is a conflicting definition of test_and_clear_bit). MFC after: 1 week Modified: head/sys/i386/conf/XEN Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Mon Dec 27 23:56:03 2010 (r216747) +++ head/sys/i386/conf/XEN Mon Dec 27 23:59:27 2010 (r216748) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm hptmv ida malo mps mwl nve sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 00:04:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 377E0106566B; Tue, 28 Dec 2010 00:04:17 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from exhub015-2.exch015.msoutlookonline.net (exhub015-2.exch015.msoutlookonline.net [207.5.72.94]) by mx1.freebsd.org (Postfix) with ESMTP id 158E48FC0A; Tue, 28 Dec 2010 00:04:16 +0000 (UTC) Received: from [192.168.1.5] (71.185.67.210) by smtpx15.msoutlookonline.net (207.5.72.103) with Microsoft SMTP Server (TLS) id 8.2.254.0; Mon, 27 Dec 2010 15:54:12 -0800 Message-ID: <4D192722.4040002@p6m7g8.com> Date: Mon, 27 Dec 2010 18:54:10 -0500 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Colin Percival References: <201012272352.oBRNqeEb040247@svn.freebsd.org> In-Reply-To: <201012272352.oBRNqeEb040247@svn.freebsd.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 00:04:17 -0000 nice! On 12/27/2010 6:52 PM, Colin Percival wrote: > Author: cperciva > Date: Mon Dec 27 23:52:40 2010 > New Revision: 216746 > URL: http://svn.freebsd.org/changeset/base/216746 > > Log: > Make it possible to specify WITHOUT_MODULES in a kernel config file. > > MFC after: 1 week > > Modified: > head/sys/conf/kern.pre.mk > > Modified: head/sys/conf/kern.pre.mk > ============================================================================== > --- head/sys/conf/kern.pre.mk Mon Dec 27 23:46:47 2010 (r216745) > +++ head/sys/conf/kern.pre.mk Mon Dec 27 23:52:40 2010 (r216746) > @@ -170,6 +170,9 @@ MKMODULESENV+= ALL_MODULES=LINT > .if defined(MODULES_OVERRIDE) > MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" > .endif > +.if defined(WITHOUT_MODULES) > +MKMODULESENV+= WITHOUT_MODULES="${WITHOUT_MODULES}" > +.endif > .if defined(DEBUG) > MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" > .endif > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 01:38:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72431106564A; Tue, 28 Dec 2010 01:38:52 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 619178FC08; Tue, 28 Dec 2010 01:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS1cqKS042613; Tue, 28 Dec 2010 01:38:52 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS1cqjw042611; Tue, 28 Dec 2010 01:38:52 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012280138.oBS1cqjw042611@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 28 Dec 2010 01:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216749 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 01:38:52 -0000 Author: lstewart Date: Tue Dec 28 01:38:52 2010 New Revision: 216749 URL: http://svn.freebsd.org/changeset/base/216749 Log: Fix a whitespace nit introduced in r215166. Sponsored by: FreeBSD Foundation Spotted by: bz MFC after: 5 weeks X-MFC with: r215166 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Dec 27 23:59:27 2010 (r216748) +++ head/sys/netinet/tcp_subr.c Tue Dec 28 01:38:52 2010 (r216749) @@ -238,7 +238,7 @@ static char * tcp_log_addr(struct in_con struct tcpcb_mem { struct tcpcb tcb; struct tcp_timer tt; - struct cc_var ccv; + struct cc_var ccv; }; static VNET_DEFINE(uma_zone_t, tcpcb_zone); From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 01:59:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CD90106566C; Tue, 28 Dec 2010 01:59:06 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id C81518FC0C; Tue, 28 Dec 2010 01:59:05 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id oBS1x5Jr081522; Mon, 27 Dec 2010 17:59:05 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id oBS1x5Ul081521; Mon, 27 Dec 2010 17:59:05 -0800 (PST) (envelope-from sgk) Date: Mon, 27 Dec 2010 17:59:05 -0800 From: Steve Kargl To: Colin Percival Message-ID: <20101228015905.GA81514@troutmask.apl.washington.edu> References: <201012272352.oBRNqeEb040247@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012272352.oBRNqeEb040247@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 01:59:06 -0000 On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: > Author: cperciva > Date: Mon Dec 27 23:52:40 2010 > New Revision: 216746 > URL: http://svn.freebsd.org/changeset/base/216746 > > Log: > Make it possible to specify WITHOUT_MODULES in a kernel config file. > > MFC after: 1 week > Can you explain how this differs from makeoptions NO_MODULES which has been able to do for years? -- steve From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:02:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 32B83106566C for ; Tue, 28 Dec 2010 02:02:59 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 4C13317A341 for ; Tue, 28 Dec 2010 02:02:57 +0000 (UTC) Received: (qmail 90234 invoked from network); 28 Dec 2010 02:02:57 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 28 Dec 2010 02:02:57 -0000 Message-ID: <4D194551.7000004@freebsd.org> Date: Mon, 27 Dec 2010 18:02:57 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101220 Thunderbird/3.0.11 MIME-Version: 1.0 To: Steve Kargl References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> In-Reply-To: <20101228015905.GA81514@troutmask.apl.washington.edu> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 02:02:59 -0000 On 12/27/10 17:59, Steve Kargl wrote: > On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: >> Make it possible to specify WITHOUT_MODULES in a kernel config file. > > Can you explain how this differs from > makeoptions NO_MODULES > which has been able to do for years? NO_MODULES means what it says: No modules. WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except for foo, bar, and baz". -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:04:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 645DF1065674 for ; Tue, 28 Dec 2010 02:04:06 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id F01D28FC17 for ; Tue, 28 Dec 2010 02:04:05 +0000 (UTC) Received: (qmail 15784 invoked by uid 399); 28 Dec 2010 02:04:05 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 28 Dec 2010 02:04:05 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D194594.4080700@FreeBSD.org> Date: Mon, 27 Dec 2010 18:04:04 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101210 Thunderbird/3.1.7 MIME-Version: 1.0 To: Colin Percival References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> In-Reply-To: <4D194551.7000004@freebsd.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 02:04:06 -0000 On 12/27/2010 18:02, Colin Percival wrote: > On 12/27/10 17:59, Steve Kargl wrote: >> On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: >>> Make it possible to specify WITHOUT_MODULES in a kernel config file. >> >> Can you explain how this differs from >> makeoptions NO_MODULES >> which has been able to do for years? > > NO_MODULES means what it says: No modules. > > WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except for foo, > bar, and baz". so kind of the inverse of MODULES_OVERRIDE ? Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:09:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D47C106566C; Tue, 28 Dec 2010 02:09:00 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id 7976F8FC0C; Tue, 28 Dec 2010 02:09:00 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id oBS290Fp081621; Mon, 27 Dec 2010 18:09:00 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id oBS290g1081620; Mon, 27 Dec 2010 18:09:00 -0800 (PST) (envelope-from sgk) Date: Mon, 27 Dec 2010 18:09:00 -0800 From: Steve Kargl To: Colin Percival Message-ID: <20101228020900.GA81611@troutmask.apl.washington.edu> References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D194551.7000004@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 02:09:00 -0000 On Mon, Dec 27, 2010 at 06:02:57PM -0800, Colin Percival wrote: > On 12/27/10 17:59, Steve Kargl wrote: > > On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: > >> Make it possible to specify WITHOUT_MODULES in a kernel config file. > > > > Can you explain how this differs from > > makeoptions NO_MODULES > > which has been able to do for years? > > NO_MODULES means what it says: No modules. > > WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except for foo, > bar, and baz". > Thanks. The distincion wasn't clear from the commit log. I read it as "Build a kernel WITHOUT building MODULES", which is what NO_MODULES does. -- Steve From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:25:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B19F1065672; Tue, 28 Dec 2010 02:25:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 899158FC12; Tue, 28 Dec 2010 02:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2PWq7043585; Tue, 28 Dec 2010 02:25:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2PWJo043583; Tue, 28 Dec 2010 02:25:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280225.oBS2PWJo043583@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216750 - stable/8/usr.bin/find X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 02:25:32 -0000 Author: kevlo Date: Tue Dec 28 02:25:32 2010 New Revision: 216750 URL: http://svn.freebsd.org/changeset/base/216750 Log: MFC r216106: Don't error out while searching for empty directories. Submitted by: Bakul Shah Modified: stable/8/usr.bin/find/function.c Modified: stable/8/usr.bin/find/function.c ============================================================================== --- stable/8/usr.bin/find/function.c Tue Dec 28 01:38:52 2010 (r216749) +++ stable/8/usr.bin/find/function.c Tue Dec 28 02:25:32 2010 (r216750) @@ -560,7 +560,7 @@ f_empty(PLAN *plan __unused, FTSENT *ent empty = 1; dir = opendir(entry->fts_accpath); if (dir == NULL) - err(1, "%s", entry->fts_accpath); + return 0; for (dp = readdir(dir); dp; dp = readdir(dir)) if (dp->d_name[0] != '.' || (dp->d_name[1] != '\0' && From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:43:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E586106564A; Tue, 28 Dec 2010 02:43:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBBA8FC13; Tue, 28 Dec 2010 02:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2hTA6044021; Tue, 28 Dec 2010 02:43:29 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2hTIg044019; Tue, 28 Dec 2010 02:43:29 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280243.oBS2hTIg044019@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216751 - stable/8/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 02:43:29 -0000 Author: kevlo Date: Tue Dec 28 02:43:28 2010 New Revision: 216751 URL: http://svn.freebsd.org/changeset/base/216751 Log: MFC r216431: Check return value of malloc(). Reviewed by: hselasky Modified: stable/8/lib/libusb/libusb20_compat01.c Modified: stable/8/lib/libusb/libusb20_compat01.c ============================================================================== --- stable/8/lib/libusb/libusb20_compat01.c Tue Dec 28 02:25:32 2010 (r216750) +++ stable/8/lib/libusb/libusb20_compat01.c Tue Dec 28 02:43:28 2010 (r216751) @@ -457,6 +457,11 @@ usb_parse_configuration(struct usb_confi /* allocate memory for our configuration */ ptr = malloc(a + b + c + d); + if (ptr == NULL) { + /* free config structure */ + free(ps.a.currcfg); + return (-1); + } /* "currifcw" must be first, hence this pointer is freed */ ps.b.currifcw = (void *)(ptr); From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 02:45:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16EF0106566C; Tue, 28 Dec 2010 02:45:25 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B278FC1B; Tue, 28 Dec 2010 02:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS2jO4p044120; Tue, 28 Dec 2010 02:45:24 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS2jO1O044118; Tue, 28 Dec 2010 02:45:24 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201012280245.oBS2jO1O044118@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Dec 2010 02:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216752 - stable/8/lib/libproc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 02:45:25 -0000 Author: kevlo Date: Tue Dec 28 02:45:24 2010 New Revision: 216752 URL: http://svn.freebsd.org/changeset/base/216752 Log: MFC r216432: Fix a memory leak on the error condition Reviewed by: rpaulo Modified: stable/8/lib/libproc/proc_create.c Modified: stable/8/lib/libproc/proc_create.c ============================================================================== --- stable/8/lib/libproc/proc_create.c Tue Dec 28 02:43:28 2010 (r216751) +++ stable/8/lib/libproc/proc_create.c Tue Dec 28 02:45:24 2010 (r216752) @@ -84,7 +84,7 @@ proc_attach(pid_t pid, int flags, struct else *pphdl = phdl; out: - + proc_free(phdl); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 03:27:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFC6106566B; Tue, 28 Dec 2010 03:27:20 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9C6F8FC12; Tue, 28 Dec 2010 03:27:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS3RKjd045290; Tue, 28 Dec 2010 03:27:20 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS3RKCH045287; Tue, 28 Dec 2010 03:27:20 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012280327.oBS3RKCH045287@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 28 Dec 2010 03:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216753 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 03:27:20 -0000 Author: lstewart Date: Tue Dec 28 03:27:20 2010 New Revision: 216753 URL: http://svn.freebsd.org/changeset/base/216753 Log: Add a new sack hint to track the most recent and highest sacked sequence number. This will be used by the incoming Enhanced RTT Khelp module. Sponsored by: FreeBSD Foundation Submitted by: David Hayes Reviewed by: bz and others (as part of a larger patch) MFC after: 3 months Modified: head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Tue Dec 28 02:45:24 2010 (r216752) +++ head/sys/netinet/tcp_sack.c Tue Dec 28 03:27:20 2010 (r216753) @@ -425,6 +425,7 @@ tcp_sack_doack(struct tcpcb *tp, struct * are received. */ sblkp = &sack_blocks[num_sack_blks - 1]; /* Last SACK block */ + tp->sackhint.last_sack_ack = sblkp->end; if (SEQ_LT(tp->snd_fack, sblkp->start)) { /* * The highest SACK block is beyond fack. Append new SACK Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Dec 28 02:45:24 2010 (r216752) +++ head/sys/netinet/tcp_var.h Tue Dec 28 03:27:20 2010 (r216753) @@ -70,6 +70,7 @@ struct sackhole { struct sackhint { struct sackhole *nexthole; int sack_bytes_rexmit; + tcp_seq last_sack_ack; /* Most recent/largest sacked ack */ int ispare; /* explicit pad for 64bit alignment */ uint64_t _pad[2]; /* 1 sacked_bytes, 1 TBD */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 08:36:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D0B3106566B; Tue, 28 Dec 2010 08:36:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30DC58FC18; Tue, 28 Dec 2010 08:36:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS8ajqE051562; Tue, 28 Dec 2010 08:36:45 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS8ajBX051560; Tue, 28 Dec 2010 08:36:45 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201012280836.oBS8ajBX051560@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 28 Dec 2010 08:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216754 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 08:36:45 -0000 Author: ae Date: Tue Dec 28 08:36:44 2010 New Revision: 216754 URL: http://svn.freebsd.org/changeset/base/216754 Log: Make EBR probe method less strictly to be able detect EBRs with small non fatal inconsistency. EBR may contain boot loader and sometimes it just has some garbage data. Now this does not prevent FreeBSD to use extended partitions. But since we do not support bootcode for EBR we mark tables which have non empty boot area as corrupt. This does make them readonly and we can not damage this data. PR: kern/141235 MFC after: 1 month Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Tue Dec 28 03:27:20 2010 (r216753) +++ head/sys/geom/part/g_part_ebr.c Tue Dec 28 08:36:44 2010 (r216754) @@ -377,7 +377,7 @@ g_part_ebr_probe(struct g_part_table *ta char psn[8]; struct g_provider *pp; u_char *buf, *p; - int error, index, res, sum; + int error, index, res; uint16_t magic; pp = cp->provider; @@ -409,29 +409,11 @@ g_part_ebr_probe(struct g_part_table *ta if (magic != DOSMAGIC) goto out; - /* - * The sector is all zeroes, except for the partition entries, - * pseudo boot code and some signatures or disk serial number. - * The latter can be found in the 9 bytes immediately in front - * of the partition table. - */ - sum = 0; - for (index = 96; index < DOSPARTOFF - 9; index++) - sum += buf[index]; - if (sum != 0) - goto out; - - for (index = 0; index < NDOSPART; index++) { + for (index = 0; index < 2; index++) { p = buf + DOSPARTOFF + index * DOSPARTSIZE; if (p[0] != 0 && p[0] != 0x80) goto out; - if (index < 2) - continue; - /* The 3rd & 4th entries are always zero. */ - if ((le64dec(p+0) + le64dec(p+8)) != 0) - goto out; } - res = G_PART_PROBE_PRI_NORM; out: @@ -450,7 +432,7 @@ g_part_ebr_read(struct g_part_table *bas u_char *buf; off_t ofs, msize; u_int lba; - int error, index; + int error, index, sum; pp = cp->provider; table = (struct g_part_ebr_table *)basetable; @@ -465,6 +447,28 @@ g_part_ebr_read(struct g_part_table *bas ebr_entry_decode(buf + DOSPARTOFF + 0 * DOSPARTSIZE, ent + 0); ebr_entry_decode(buf + DOSPARTOFF + 1 * DOSPARTSIZE, ent + 1); + + /* The 3rd & 4th entries should be zeroes. */ + if (le64dec(buf + DOSPARTOFF + 2 * DOSPARTSIZE) + + le64dec(buf + DOSPARTOFF + 3 * DOSPARTSIZE) != 0) { + basetable->gpt_corrupt = 1; + printf("GEOM: %s: invalid entries in the EBR ignored.\n", + pp->name); + } + /* We do not support bootcode for EBR. If bootcode area is + * not zeroes, then mark this EBR as corrupt to do not break + * anything for another OS'es. + */ + if (lba == 0) { + sum = 0; + for (index = 0; index < DOSPARTOFF; index++) + sum += buf[index]; + if (sum != 0) { + basetable->gpt_corrupt = 1; + printf("GEOM: %s: EBR has non empty bootcode.\n", + pp->name); + } + } g_free(buf); if (ent[0].dp_typ == 0) From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 08:42:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2EE9106564A; Tue, 28 Dec 2010 08:42:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2AB48FC15; Tue, 28 Dec 2010 08:42:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBS8gCVD051733; Tue, 28 Dec 2010 08:42:12 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBS8gC4I051731; Tue, 28 Dec 2010 08:42:12 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201012280842.oBS8gC4I051731@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 28 Dec 2010 08:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216755 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 08:42:13 -0000 Author: ae Date: Tue Dec 28 08:42:12 2010 New Revision: 216755 URL: http://svn.freebsd.org/changeset/base/216755 Log: Allow destroying EBR in COMPAT (default) mode. MFC after: 2 week Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Tue Dec 28 08:36:44 2010 (r216754) +++ head/sys/geom/part/g_part_ebr.c Tue Dec 28 08:42:12 2010 (r216755) @@ -357,6 +357,8 @@ g_part_ebr_precheck(struct g_part_table struct g_part_parms *gpp) { #if defined(GEOM_PART_EBR_COMPAT) + if (req == G_PART_CTL_DESTROY) + return (0); return (ECANCELED); #else /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 10:08:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DC471065672; Tue, 28 Dec 2010 10:08:51 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BED98FC16; Tue, 28 Dec 2010 10:08:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSA8ood054277; Tue, 28 Dec 2010 10:08:50 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSA8okC054269; Tue, 28 Dec 2010 10:08:50 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201012281008.oBSA8okC054269@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 28 Dec 2010 10:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216756 - in head: lib/libc/locale lib/libc/rpc lib/libkvm usr.bin/c89 usr.bin/c99 usr.bin/tar usr.sbin/ancontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 10:08:51 -0000 Author: uqs Date: Tue Dec 28 10:08:50 2010 New Revision: 216756 URL: http://svn.freebsd.org/changeset/base/216756 Log: Revert most of r210764, now that mdocml does the right thing with empty quotation macros. Requested by: Alex Kozlov Modified: head/lib/libc/locale/mbrtowc.3 head/lib/libc/rpc/publickey.3 head/lib/libkvm/kvm_getloadavg.3 head/usr.bin/c89/c89.1 head/usr.bin/c99/c99.1 head/usr.bin/tar/bsdtar.1 head/usr.sbin/ancontrol/ancontrol.8 Modified: head/lib/libc/locale/mbrtowc.3 ============================================================================== --- head/lib/libc/locale/mbrtowc.3 Tue Dec 28 08:42:12 2010 (r216755) +++ head/lib/libc/locale/mbrtowc.3 Tue Dec 28 10:08:50 2010 (r216756) @@ -69,7 +69,7 @@ was .Dv NULL , .Fa s was an empty string -.Pq Qq \& +.Pq Qq and .Fa n was 1. Modified: head/lib/libc/rpc/publickey.3 ============================================================================== --- head/lib/libc/rpc/publickey.3 Tue Dec 28 08:42:12 2010 (r216755) +++ head/lib/libc/rpc/publickey.3 Tue Dec 28 10:08:50 2010 (r216756) @@ -44,7 +44,7 @@ fails to decrypt the secret key, the rou argument will be a .Dv NULL string -.Pq Dq \& . +.Pq Dq . .Sh SEE ALSO .Xr publickey 5 .Pp Modified: head/lib/libkvm/kvm_getloadavg.3 ============================================================================== --- head/lib/libkvm/kvm_getloadavg.3 Tue Dec 28 08:42:12 2010 (r216755) +++ head/lib/libkvm/kvm_getloadavg.3 Tue Dec 28 10:08:50 2010 (r216756) @@ -50,7 +50,7 @@ averaged over various periods of time. Up to .Fa nelem samples are retrieved and assigned to successive elements of -.Fa loadavg Ns Bq \& . +.Fa loadavg Ns Bq . The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively. .Sh DIAGNOSTICS Modified: head/usr.bin/c89/c89.1 ============================================================================== --- head/usr.bin/c89/c89.1 Tue Dec 28 08:42:12 2010 (r216755) +++ head/usr.bin/c89/c89.1 Tue Dec 28 10:08:50 2010 (r216756) @@ -94,7 +94,7 @@ absolute pathnames to look in the direct pathname before looking in the usual places. Thus, headers whose names are enclosed in double-quotes -.Pq Qq \& +.Pq Qq will be searched for first in the directory of the file with the .Ic #include @@ -103,7 +103,7 @@ directories named in .Fl I options, and last in the usual places. For headers whose names are enclosed in angle brackets -.Pq Aq \& , +.Pq Aq , the header will be searched for only in directories named in .Fl I Modified: head/usr.bin/c99/c99.1 ============================================================================== --- head/usr.bin/c99/c99.1 Tue Dec 28 08:42:12 2010 (r216755) +++ head/usr.bin/c99/c99.1 Tue Dec 28 10:08:50 2010 (r216756) @@ -96,7 +96,7 @@ absolute pathnames to look in the direct pathname before looking in the usual places. Thus, headers whose names are enclosed in double-quotes -.Pq Qq \& +.Pq Qq will be searched for first in the directory of the file with the .Ic #include @@ -105,7 +105,7 @@ directories named in .Fl I options, and last in the usual places. For headers whose names are enclosed in angle brackets -.Pq Aq \& , +.Pq Aq , the header will be searched for only in directories named in .Fl I Modified: head/usr.bin/tar/bsdtar.1 ============================================================================== --- head/usr.bin/tar/bsdtar.1 Tue Dec 28 08:42:12 2010 (r216755) +++ head/usr.bin/tar/bsdtar.1 Tue Dec 28 10:08:50 2010 (r216756) @@ -354,9 +354,9 @@ is run as non-root. .It Fl Fl numeric-owner This is equivalent to .Fl Fl uname -.Qq \& +.Qq .Fl Fl gname -.Qq \& . +.Qq . On extract, it causes user and group names in the archive to be ignored in favor of the numeric user and group ids. On create, it causes user and group names to not be stored Modified: head/usr.sbin/ancontrol/ancontrol.8 ============================================================================== --- head/usr.sbin/ancontrol/ancontrol.8 Tue Dec 28 08:42:12 2010 (r216755) +++ head/usr.sbin/ancontrol/ancontrol.8 Tue Dec 28 10:08:50 2010 (r216756) @@ -308,7 +308,7 @@ Set a WEP key. For 40 bit prefix 10 hex character with 0x. For 128 bit prefix 26 hex character with 0x. Use -.Qq \& +.Qq as the key to erase the key. Supports 4 keys; even numbers are for permanent keys and odd number are for temporary keys. From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 11:34:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8BB01065672; Tue, 28 Dec 2010 11:34:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7AC68FC0C; Tue, 28 Dec 2010 11:34:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSBYxln060560; Tue, 28 Dec 2010 11:34:59 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSBYxW0060558; Tue, 28 Dec 2010 11:34:59 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201012281134.oBSBYxW0060558@svn.freebsd.org> From: Oleg Bulyzhin Date: Tue, 28 Dec 2010 11:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216757 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 11:34:59 -0000 Author: oleg Date: Tue Dec 28 11:34:59 2010 New Revision: 216757 URL: http://svn.freebsd.org/changeset/base/216757 Log: MFC r213265: Fix handling of initial credit for an idle pipe. This fixes the bug where setting bw > 1 MTU/tick resulted in infinite bandwidth if io_fast=1 PR: kern/147245, kern/148429 Obtained from: Riccardo Panicucci Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_dn_io.c Tue Dec 28 10:08:50 2010 (r216756) +++ stable/8/sys/netinet/ipfw/ip_dn_io.c Tue Dec 28 11:34:59 2010 (r216757) @@ -742,8 +742,11 @@ dummynet_io(struct mbuf **m0, int dir, s } /* compute the initial allowance */ - { + if (si->idle_time < dn_cfg.curr_time) { + /* Do this only on the first packet on an idle pipe */ struct dn_link *p = &fs->sched->link; + + si->sched_time = dn_cfg.curr_time; si->credit = dn_cfg.io_fast ? p->bandwidth : 0; if (p->burst) { uint64_t burst = (dn_cfg.curr_time - si->idle_time) * p->bandwidth; From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 12:13:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D155106566B; Tue, 28 Dec 2010 12:13:30 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3248FC19; Tue, 28 Dec 2010 12:13:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSCDUY2061467; Tue, 28 Dec 2010 12:13:30 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSCDUZS061460; Tue, 28 Dec 2010 12:13:30 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012281213.oBSCDUZS061460@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 28 Dec 2010 12:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216758 - in head: . sys/netinet sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 12:13:30 -0000 Author: lstewart Date: Tue Dec 28 12:13:30 2010 New Revision: 216758 URL: http://svn.freebsd.org/changeset/base/216758 Log: - Add some helper hook points to the TCP stack. The hooks allow Khelp modules to access inbound/outbound events and associated data for established TCP connections. The hooks only run if at least one hook function is registered for the hook point, ensuring the impact on the stack is effectively nil when no TCP Khelp modules are loaded. struct tcp_hhook_data is passed as contextual data to any registered Khelp module hook functions. - Add an OSD (Object Specific Data) pointer to struct tcpcb to allow Khelp modules to associate per-connection data with the TCP control block. - Bump __FreeBSD_version and add a note to UPDATING regarding to ABI changes introduced by this commit and r216753. In collaboration with: David Hayes and Grenville Armitage Sponsored by: FreeBSD Foundation Reviewed by: bz, others along the way MFC after: 3 months Modified: head/UPDATING head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Dec 28 11:34:59 2010 (r216757) +++ head/UPDATING Tue Dec 28 12:13:30 2010 (r216758) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20101228: + The TCP stack has been modified to allow Khelp modules to interact with + it via helper hook points and store per-connection data in the TCP + control block. Bump __FreeBSD_version to 900029. User space tools that + rely on the size of struct tcpcb in tcp_var.h (e.g. sockstat) need to + be recompiled. + 20101114: Generic IEEE 802.3 annex 31B full duplex flow control support has been added to mii(4) and bge(4), bce(4), msk(4), nfe(4) and stge(4) along Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Dec 28 11:34:59 2010 (r216757) +++ head/sys/netinet/tcp_input.c Tue Dec 28 12:13:30 2010 (r216758) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include /* for proc0 declaration */ @@ -218,6 +219,8 @@ static void inline cc_ack_received(struc uint16_t type); static void inline cc_conn_init(struct tcpcb *tp); static void inline cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); +static void inline hhook_run_tcp_est_in(struct tcpcb *tp, + struct tcphdr *th, struct tcpopt *to); /* * Kernel module interface for updating tcpstat. The argument is an index @@ -234,6 +237,24 @@ kmod_tcpstat_inc(int statnum) } /* + * Wrapper for the TCP established input helper hook. + */ +static void inline +hhook_run_tcp_est_in(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to) +{ + struct tcp_hhook_data hhook_data; + + if (V_tcp_hhh[HHOOK_TCP_EST_IN]->hhh_nhooks > 0) { + hhook_data.tp = tp; + hhook_data.th = th; + hhook_data.to = to; + + hhook_run_hooks(V_tcp_hhh[HHOOK_TCP_EST_IN], &hhook_data, + tp->osd); + } +} + +/* * CC wrapper hook functions */ static void inline @@ -1486,6 +1507,10 @@ tcp_do_segment(struct mbuf *m, struct tc ticks - tp->t_rtttime); } acked = BYTES_THIS_ACK(tp, th); + + /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ + hhook_run_tcp_est_in(tp, th, &to); + TCPSTAT_INC(tcps_rcvackpack); TCPSTAT_ADD(tcps_rcvackbyte, acked); sbdrop(&so->so_snd, acked); @@ -2199,6 +2224,10 @@ tcp_do_segment(struct mbuf *m, struct tc ((to.to_flags & TOF_SACK) || !TAILQ_EMPTY(&tp->snd_holes))) tcp_sack_doack(tp, &to, th->th_ack); + + /* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */ + hhook_run_tcp_est_in(tp, th, &to); + if (SEQ_LEQ(th->th_ack, tp->snd_una)) { if (tlen == 0 && tiwin == tp->snd_wnd) { TCPSTAT_INC(tcps_rcvdupack); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Tue Dec 28 11:34:59 2010 (r216757) +++ head/sys/netinet/tcp_output.c Tue Dec 28 12:13:30 2010 (r216758) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,9 +127,33 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); +static void inline hhook_run_tcp_est_out(struct tcpcb *tp, + struct tcphdr *th, struct tcpopt *to, + long len, int tso); static void inline cc_after_idle(struct tcpcb *tp); /* + * Wrapper for the TCP established ouput helper hook. + */ +static void inline +hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th, + struct tcpopt *to, long len, int tso) +{ + struct tcp_hhook_data hhook_data; + + if (V_tcp_hhh[HHOOK_TCP_EST_OUT]->hhh_nhooks > 0) { + hhook_data.tp = tp; + hhook_data.th = th; + hhook_data.to = to; + hhook_data.len = len; + hhook_data.tso = tso; + + hhook_run_hooks(V_tcp_hhh[HHOOK_TCP_EST_OUT], &hhook_data, + tp->osd); + } +} + +/* * CC wrapper hook functions */ static void inline @@ -1134,6 +1159,9 @@ timer: tp->snd_max = tp->snd_nxt + len; } + /* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */ + hhook_run_tcp_est_out(tp, th, &to, len, tso); + #ifdef TCPDEBUG /* * Trace. Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Dec 28 11:34:59 2010 (r216757) +++ head/sys/netinet/tcp_subr.c Tue Dec 28 12:13:30 2010 (r216758) @@ -41,7 +41,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -214,6 +216,8 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sore VNET_DEFINE(uma_zone_t, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) +VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); + static struct inpcb *tcp_notify(struct inpcb *, int); static void tcp_isn_tick(void *); static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, @@ -239,6 +243,7 @@ struct tcpcb_mem { struct tcpcb tcb; struct tcp_timer tt; struct cc_var ccv; + struct osd osd; }; static VNET_DEFINE(uma_zone_t, tcpcb_zone); @@ -278,6 +283,13 @@ tcp_init(void) { int hashsize; + if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN, + &V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) + printf("%s: WARNING: unable to register helper hook\n", __func__); + if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, + &V_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0) + printf("%s: WARNING: unable to register helper hook\n", __func__); + hashsize = TCBHASHSIZE; TUNABLE_INT_FETCH("net.inet.tcp.tcbhashsize", &hashsize); if (!powerof2(hashsize)) { @@ -661,6 +673,12 @@ tcp_newtcpcb(struct inpcb *inp) return (NULL); } + tp->osd = &tm->osd; + if (khelp_init_osd(HELPER_CLASS_TCP, tp->osd)) { + uma_zfree(V_tcpcb_zone, tm); + return (NULL); + } + #ifdef VIMAGE tp->t_vnet = inp->inp_vnet; #endif @@ -894,6 +912,8 @@ tcp_discardcb(struct tcpcb *tp) if (CC_ALGO(tp)->cb_destroy != NULL) CC_ALGO(tp)->cb_destroy(tp->ccv); + khelp_destroy_osd(tp->osd); + CC_ALGO(tp) = NULL; inp->inp_ppcb = NULL; tp->t_inpcb = NULL; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Dec 28 11:34:59 2010 (r216757) +++ head/sys/netinet/tcp_var.h Tue Dec 28 12:13:30 2010 (r216758) @@ -201,6 +201,7 @@ struct tcpcb { int t_bytes_acked; /* # bytes acked during current RTT */ struct cc_algo *cc_algo; /* congestion control algorithm */ struct cc_var *ccv; + struct osd *osd; /* storage for Khelp module data */ int t_ispare; /* explicit pad for 64bit alignment */ void *t_pspare2[4]; /* 4 TBD */ @@ -501,6 +502,22 @@ struct tcpstat { void kmod_tcpstat_inc(int statnum); #define KMOD_TCPSTAT_INC(name) \ kmod_tcpstat_inc(offsetof(struct tcpstat, name) / sizeof(u_long)) + +/* + * TCP specific helper hook point identifiers. + */ +#define HHOOK_TCP_EST_IN 0 +#define HHOOK_TCP_EST_OUT 1 +#define HHOOK_TCP_LAST HHOOK_TCP_EST_OUT + +struct tcp_hhook_data { + struct tcpcb *tp; + struct tcphdr *th; + struct tcpopt *to; + long len; + int tso; + tcp_seq curack; +}; #endif /* @@ -608,6 +625,9 @@ VNET_DECLARE(int, tcp_ecn_maxretries); #define V_tcp_do_ecn VNET(tcp_do_ecn) #define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) +VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); +#define V_tcp_hhh VNET(tcp_hhh) + int tcp_addoptions(struct tcpopt *, u_char *); int tcp_ccalgounload(struct cc_algo *unload_algo); struct tcpcb * Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Dec 28 11:34:59 2010 (r216757) +++ head/sys/sys/param.h Tue Dec 28 12:13:30 2010 (r216758) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900028 /* Master, propagated to newvers */ +#define __FreeBSD_version 900029 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 12:18:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3685106566C; Tue, 28 Dec 2010 12:18:46 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2C658FC13; Tue, 28 Dec 2010 12:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSCIkSi061625; Tue, 28 Dec 2010 12:18:46 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSCIkPc061623; Tue, 28 Dec 2010 12:18:46 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201012281218.oBSCIkPc061623@svn.freebsd.org> From: Oleg Bulyzhin Date: Tue, 28 Dec 2010 12:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216759 - releng/8.2/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 12:18:47 -0000 Author: oleg Date: Tue Dec 28 12:18:46 2010 New Revision: 216759 URL: http://svn.freebsd.org/changeset/base/216759 Log: MFC r213265: Fix handling of initial credit for an idle pipe. This fixes the bug where setting bw > 1 MTU/tick resulted in infinite bandwidth if io_fast=1 PR: kern/147245, kern/148429 Obtained from: Riccardo Panicucci Approved by: re (bz) Modified: releng/8.2/sys/netinet/ipfw/ip_dn_io.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/netinet/ipfw/ip_dn_io.c ============================================================================== --- releng/8.2/sys/netinet/ipfw/ip_dn_io.c Tue Dec 28 12:13:30 2010 (r216758) +++ releng/8.2/sys/netinet/ipfw/ip_dn_io.c Tue Dec 28 12:18:46 2010 (r216759) @@ -742,8 +742,11 @@ dummynet_io(struct mbuf **m0, int dir, s } /* compute the initial allowance */ - { + if (si->idle_time < dn_cfg.curr_time) { + /* Do this only on the first packet on an idle pipe */ struct dn_link *p = &fs->sched->link; + + si->sched_time = dn_cfg.curr_time; si->credit = dn_cfg.io_fast ? p->bandwidth : 0; if (p->burst) { uint64_t burst = (dn_cfg.curr_time - si->idle_time) * p->bandwidth; From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 12:37:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 763D610656B5; Tue, 28 Dec 2010 12:37:57 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65D0F8FC1E; Tue, 28 Dec 2010 12:37:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSCbvon062124; Tue, 28 Dec 2010 12:37:57 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSCbvk5062122; Tue, 28 Dec 2010 12:37:57 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201012281237.oBSCbvk5062122@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 28 Dec 2010 12:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216760 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 12:37:57 -0000 Author: lstewart Date: Tue Dec 28 12:37:57 2010 New Revision: 216760 URL: http://svn.freebsd.org/changeset/base/216760 Log: Add a comment for the ccv member of struct tcpcb. Sponsored by: FreeBSD Foundation MFC after: 5 weeks X-MFC with: r215166 Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Dec 28 12:18:46 2010 (r216759) +++ head/sys/netinet/tcp_var.h Tue Dec 28 12:37:57 2010 (r216760) @@ -200,7 +200,7 @@ struct tcpcb { void *t_toe; /* TOE pcb pointer */ int t_bytes_acked; /* # bytes acked during current RTT */ struct cc_algo *cc_algo; /* congestion control algorithm */ - struct cc_var *ccv; + struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ int t_ispare; /* explicit pad for 64bit alignment */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 13:28:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D553106566B; Tue, 28 Dec 2010 13:28:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3458FC0C; Tue, 28 Dec 2010 13:28:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSDSOgI063232; Tue, 28 Dec 2010 13:28:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSDSOUo063229; Tue, 28 Dec 2010 13:28:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012281328.oBSDSOUo063229@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 28 Dec 2010 13:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216761 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 13:28:24 -0000 Author: jilles Date: Tue Dec 28 13:28:24 2010 New Revision: 216761 URL: http://svn.freebsd.org/changeset/base/216761 Log: sh: Make expansion errors in optimized command substitution non-fatal. Command substitutions consisting of a single simple command are executed in the main shell process but this should be invisible apart from performance and very few exceptions such as $(trap). Added: head/tools/regression/bin/sh/expansion/cmdsubst5.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Tue Dec 28 12:37:57 2010 (r216760) +++ head/bin/sh/eval.c Tue Dec 28 13:28:24 2010 (r216761) @@ -578,6 +578,8 @@ evalbackcmd(union node *n, struct backcm int pip[2]; struct job *jp; struct stackmark smark; /* unnecessary */ + struct jmploc jmploc; + struct jmploc *savehandler; setstackmark(&smark); result->fd = -1; @@ -590,7 +592,19 @@ evalbackcmd(union node *n, struct backcm } if (n->type == NCMD) { exitstatus = oexitstatus; - evalcommand(n, EV_BACKCMD, result); + savehandler = handler; + if (setjmp(jmploc.loc)) { + if (exception == EXERROR || exception == EXEXEC) + exitstatus = 2; + else if (exception != 0) { + handler = savehandler; + longjmp(handler->loc, 1); + } + } else { + handler = &jmploc; + evalcommand(n, EV_BACKCMD, result); + } + handler = savehandler; } else { exitstatus = 0; if (pipe(pip) < 0) Added: head/tools/regression/bin/sh/expansion/cmdsubst5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst5.0 Tue Dec 28 13:28:24 2010 (r216761) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +unset v +exec 2>/dev/null +! y=$(: ${v?}) From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 13:29:44 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD5E5106564A; Tue, 28 Dec 2010 13:29:44 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 68A888FC15; Tue, 28 Dec 2010 13:29:44 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id oBSDThPm010173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Dec 2010 14:29:43 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1293542983; bh=jLbaC1iyJW7aN95eaAumLV7pAIYzcw9a/nPEzuq/Ne8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=HAoe72ZILuVHtEres0QhRlfKTGRWeQ7KrqgnGcwZYBH750zHAkchduLwFoOUd9fUf iZfxHNJ45U+NpDiVdX0DTgGIG8MdeM/w1iiEHmOc2mE9+c9q7Nj52a88mW609oLShF dpTqMDV8DcNsIZf3RUbEoWHGTiWAhQwHcUoFnHIk= Date: Tue, 28 Dec 2010 14:29:43 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Konstantin Belousov Message-ID: <20101228132942.GY23098@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Konstantin Belousov , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201012250842.oBP8gchA016800@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012250842.oBP8gchA016800@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216694 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 13:29:45 -0000 On Sat, 25.12.2010 at 08:42:38 +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Dec 25 08:42:38 2010 > New Revision: 216694 > URL: http://svn.freebsd.org/changeset/base/216694 > > Log: > Add a hook to pass debug flags to the build of rtld when doing make in > the rtld directory. > > Reviewed by: kan Please revert this, $(VAR) is against style, and passing DEBUG_FLAGS is the canonical way to achieve what you wanted, eg. make DEBUG_FLAGS=-g is working just fine for me. > Modified: > head/libexec/rtld-elf/Makefile > > Modified: head/libexec/rtld-elf/Makefile > ============================================================================== > --- head/libexec/rtld-elf/Makefile Fri Dec 24 21:31:18 2010 (r216693) > +++ head/libexec/rtld-elf/Makefile Sat Dec 25 08:42:38 2010 (r216694) > @@ -34,7 +34,7 @@ CFLAGS+= -fPIC > .else > CFLAGS+= -fpic > .endif > -CFLAGS+= -DPIC > +CFLAGS+= -DPIC $(DEBUG) > LDFLAGS+= -shared -Wl,-Bsymbolic > DPADD= ${LIBC_PIC} > LDADD= -lc_pic -lssp_nonshared From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 13:32:52 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C786A1065672; Tue, 28 Dec 2010 13:32:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3755B8FC14; Tue, 28 Dec 2010 13:32:51 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oBSDWmaa000712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Dec 2010 15:32:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oBSDWmN1000469; Tue, 28 Dec 2010 15:32:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oBSDWlWF000468; Tue, 28 Dec 2010 15:32:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 Dec 2010 15:32:47 +0200 From: Kostik Belousov To: Ulrich Sp??rlein Message-ID: <20101228133247.GR90883@deviant.kiev.zoral.com.ua> References: <201012250842.oBP8gchA016800@svn.freebsd.org> <20101228132942.GY23098@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BZziOT8Kz25R/m/E" Content-Disposition: inline In-Reply-To: <20101228132942.GY23098@acme.spoerlein.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216694 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 13:32:52 -0000 --BZziOT8Kz25R/m/E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 28, 2010 at 02:29:43PM +0100, Ulrich Sp??rlein wrote: > On Sat, 25.12.2010 at 08:42:38 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Dec 25 08:42:38 2010 > > New Revision: 216694 > > URL: http://svn.freebsd.org/changeset/base/216694 > >=20 > > Log: > > Add a hook to pass debug flags to the build of rtld when doing make in > > the rtld directory. > > =20 > > Reviewed by: kan >=20 > Please revert this, $(VAR) is against style, and passing DEBUG_FLAGS is > the canonical way to achieve what you wanted, eg. make DEBUG_FLAGS=3D-g is > working just fine for me. DEBUG_FLAGS=3D-g might be fine for you, but it does not do what rtld debugg= ing needs. Look at the -DDEBUG. If you want ${} instead of $(), feel free to change. >=20 > > Modified: > > head/libexec/rtld-elf/Makefile > >=20 > > Modified: head/libexec/rtld-elf/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/libexec/rtld-elf/Makefile Fri Dec 24 21:31:18 2010 (r216693) > > +++ head/libexec/rtld-elf/Makefile Sat Dec 25 08:42:38 2010 (r216694) > > @@ -34,7 +34,7 @@ CFLAGS+=3D -fPIC > > .else > > CFLAGS+=3D -fpic > > .endif > > -CFLAGS+=3D -DPIC > > +CFLAGS+=3D -DPIC $(DEBUG) > > LDFLAGS+=3D -shared -Wl,-Bsymbolic > > DPADD=3D ${LIBC_PIC} > > LDADD=3D -lc_pic -lssp_nonshared --BZziOT8Kz25R/m/E Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0Z5v8ACgkQC3+MBN1Mb4gOpQCeI2xsxpg1y8F3WmoQFMqEl8bu hw4AoIveWcjohTdkYeJtV1rZTDm8X4Uk =npGo -----END PGP SIGNATURE----- --BZziOT8Kz25R/m/E-- From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 14:01:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4207E106566B for ; Tue, 28 Dec 2010 14:01:02 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from services.syscare.sk (services.syscare.sk [188.40.39.36]) by mx1.freebsd.org (Postfix) with ESMTP id F18A08FC1A for ; Tue, 28 Dec 2010 14:01:01 +0000 (UTC) Received: from services.syscare.sk (services [188.40.39.36]) by services.syscare.sk (Postfix) with ESMTP id 645FD6A00D for ; Tue, 28 Dec 2010 14:44:33 +0100 (CET) X-Virus-Scanned: amavisd-new at rulez.sk Received: from services.syscare.sk ([188.40.39.36]) by services.syscare.sk (services.rulez.sk [188.40.39.36]) (amavisd-new, port 10024) with ESMTP id Z68cVc2XDN+q for ; Tue, 28 Dec 2010 14:44:31 +0100 (CET) Received: from danger-mbp.local (bband-dyn177.178-41-52.t-com.sk [178.41.52.177]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: danger@rulez.sk) by services.syscare.sk (Postfix) with ESMTPSA id 7341368FFB for ; Tue, 28 Dec 2010 14:44:31 +0100 (CET) Message-ID: <4D19E9BE.1050006@FreeBSD.org> Date: Tue, 28 Dec 2010 14:44:30 +0100 From: Daniel Gerzo Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14pre) Gecko/20101225 Lanikai/3.1.8pre MIME-Version: 1.0 To: svn-src-all@freebsd.org References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> <4D194594.4080700@FreeBSD.org> In-Reply-To: <4D194594.4080700@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 14:01:02 -0000 On 28.12.2010 3:04, Doug Barton wrote: >> WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except >> for foo, bar, and baz". > > so kind of the inverse of MODULES_OVERRIDE ? Yep, I believe that's exactly it. -- S pozdravom / Best regards Daniel Gerzo, FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 14:36:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BEA0106566B; Tue, 28 Dec 2010 14:36:33 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2568FC18; Tue, 28 Dec 2010 14:36:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSEaWYU064702; Tue, 28 Dec 2010 14:36:32 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSEaWrY064700; Tue, 28 Dec 2010 14:36:32 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012281436.oBSEaWrY064700@svn.freebsd.org> From: Colin Percival Date: Tue, 28 Dec 2010 14:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216762 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 14:36:33 -0000 Author: cperciva Date: Tue Dec 28 14:36:32 2010 New Revision: 216762 URL: http://svn.freebsd.org/changeset/base/216762 Log: Remove a "not strictly correct" (and panic-inducing) workaround for a bug which doesn't seem to exist. PR: kern/141328 MFC after: 3 days Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Tue Dec 28 13:28:24 2010 (r216761) +++ head/sys/i386/xen/pmap.c Tue Dec 28 14:36:32 2010 (r216762) @@ -2225,27 +2225,14 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t if (oldpte & PG_G) pmap_invalidate_page(kernel_pmap, va); pmap->pm_stats.resident_count -= 1; - /* - * XXX This is not strictly correctly, but somewhere along the line - * we are losing the managed bit on some pages. It is unclear to me - * why, but I think the most likely explanation is that xen's writable - * page table implementation doesn't respect the unused bits. - */ - if ((oldpte & PG_MANAGED) || ((oldpte & PG_V) && (va < VM_MAXUSER_ADDRESS)) - ) { + if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(xpmap_mtop(oldpte) & PG_FRAME); - - if (!(oldpte & PG_MANAGED)) - printf("va=0x%x is unmanaged :-( pte=0x%llx\n", va, oldpte); - if ((oldpte & (PG_M | PG_RW)) == (PG_M | PG_RW)) vm_page_dirty(m); if (oldpte & PG_A) vm_page_flag_set(m, PG_REFERENCED); pmap_remove_entry(pmap, m, va); - } else if ((va < VM_MAXUSER_ADDRESS) && (oldpte & PG_V)) - printf("va=0x%x is unmanaged :-( pte=0x%llx\n", va, oldpte); - + } return (pmap_unuse_pt(pmap, va, free)); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 14:58:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BD80106564A; Tue, 28 Dec 2010 14:58:09 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEEB18FC16; Tue, 28 Dec 2010 14:58:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSEw8cl065178; Tue, 28 Dec 2010 14:58:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSEw8Tb065177; Tue, 28 Dec 2010 14:58:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012281458.oBSEw8Tb065177@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 28 Dec 2010 14:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216763 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 14:58:09 -0000 Author: jilles Date: Tue Dec 28 14:58:08 2010 New Revision: 216763 URL: http://svn.freebsd.org/changeset/base/216763 Log: sh: Add test for optimized command substitution. This test verifies that certain expansions without side effects do not cause the command substitution to be executed in a child process. This is not a correctness requirement, but it involves a nontrivial amount of code and it would be unfortunate if it stopped working. Added: head/tools/regression/bin/sh/expansion/cmdsubst6.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/cmdsubst6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst6.0 Tue Dec 28 14:58:08 2010 (r216763) @@ -0,0 +1,53 @@ +# $FreeBSD$ +# This tests if the cmdsubst optimization is still used if possible. + +failures='' +ok='' + +testcase() { + code="$1" + + unset v + eval "pid=\$(dummy=$code echo \$(\$SH -c echo\ \\\$PPID))" + + if [ "$pid" = "$$" ]; then + ok=x$ok + else + failures=x$failures + echo "Failure for $code" + fi +} + +unset v +w=1 +testcase '$w' +testcase '1${w+1}' +testcase '1${w-1}' +testcase '1${v+1}' +testcase '1${v-1}' +testcase '1${w:+1}' +testcase '1${w:-1}' +testcase '1${v:+1}' +testcase '1${v:-1}' +testcase '${w?}' +testcase '${w:?}' +testcase '${w#x}' +testcase '${w##x}' +testcase '${w%x}' +testcase '${w%%x}' + +testcase '$((w))' +testcase '$(((w+4)*2/3))' +testcase '$((w==1))' +testcase '$((w>=0 && w<=5 && w!=2))' +testcase '$((${#w}))' +testcase '$((${#IFS}))' +testcase '$((${#w}>=1))' +testcase '$(($$))' +testcase '$(($#))' +testcase '$(($?))' + +testcase '$(: $((w=4)))' +testcase '$(: ${v=2})' + +test "x$failures" = x From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 15:20:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 878AC1065670; Tue, 28 Dec 2010 15:20:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5931A8FC13; Tue, 28 Dec 2010 15:20:15 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1622D46B1A; Tue, 28 Dec 2010 10:20:15 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E12DE8A01D; Tue, 28 Dec 2010 10:20:13 -0500 (EST) From: John Baldwin To: Kostik Belousov Date: Tue, 28 Dec 2010 10:09:40 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <201012250842.oBP8gchA016800@svn.freebsd.org> <20101228132942.GY23098@acme.spoerlein.net> <20101228133247.GR90883@deviant.kiev.zoral.com.ua> In-Reply-To: <20101228133247.GR90883@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201012281009.41028.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 28 Dec 2010 10:20:14 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Ulrich Sp??rlein , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216694 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 15:20:15 -0000 On Tuesday, December 28, 2010 8:32:47 am Kostik Belousov wrote: > On Tue, Dec 28, 2010 at 02:29:43PM +0100, Ulrich Sp??rlein wrote: > > On Sat, 25.12.2010 at 08:42:38 +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sat Dec 25 08:42:38 2010 > > > New Revision: 216694 > > > URL: http://svn.freebsd.org/changeset/base/216694 > > > > > > Log: > > > Add a hook to pass debug flags to the build of rtld when doing make in > > > the rtld directory. > > > > > > Reviewed by: kan > > > > Please revert this, $(VAR) is against style, and passing DEBUG_FLAGS is > > the canonical way to achieve what you wanted, eg. make DEBUG_FLAGS=-g is > > working just fine for me. > DEBUG_FLAGS=-g might be fine for you, but it does not do what rtld debugging > needs. Look at the -DDEBUG. > > If you want ${} instead of $(), feel free to change. Err, why can't you use 'make DEBUG_FLAGS=-DDEBUG' or 'make DEBUG_FLAGS="-g -DDEBUG"'? If you are just doing 'make DEBUG=-DDEBUG' with this change, then I agree with Ulrich, DEBUG_FLAGS is already suitable for this purpose. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 15:43:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4174D106564A; Tue, 28 Dec 2010 15:43:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B1BFF8FC08; Tue, 28 Dec 2010 15:43:50 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id oBSFhkj8010080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Dec 2010 17:43:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id oBSFhkRG031443; Tue, 28 Dec 2010 17:43:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id oBSFhkFL031442; Tue, 28 Dec 2010 17:43:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 Dec 2010 17:43:46 +0200 From: Kostik Belousov To: John Baldwin Message-ID: <20101228154346.GT90883@deviant.kiev.zoral.com.ua> References: <201012250842.oBP8gchA016800@svn.freebsd.org> <20101228132942.GY23098@acme.spoerlein.net> <20101228133247.GR90883@deviant.kiev.zoral.com.ua> <201012281009.41028.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iskw6J4cuOvZ6IVF" Content-Disposition: inline In-Reply-To: <201012281009.41028.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Ulrich Sp??rlein , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r216694 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 15:43:51 -0000 --iskw6J4cuOvZ6IVF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 28, 2010 at 10:09:40AM -0500, John Baldwin wrote: > On Tuesday, December 28, 2010 8:32:47 am Kostik Belousov wrote: > > On Tue, Dec 28, 2010 at 02:29:43PM +0100, Ulrich Sp??rlein wrote: > > > On Sat, 25.12.2010 at 08:42:38 +0000, Konstantin Belousov wrote: > > > > Author: kib > > > > Date: Sat Dec 25 08:42:38 2010 > > > > New Revision: 216694 > > > > URL: http://svn.freebsd.org/changeset/base/216694 > > > >=20 > > > > Log: > > > > Add a hook to pass debug flags to the build of rtld when doing ma= ke in > > > > the rtld directory. > > > > =20 > > > > Reviewed by: kan > > >=20 > > > Please revert this, $(VAR) is against style, and passing DEBUG_FLAGS = is > > > the canonical way to achieve what you wanted, eg. make DEBUG_FLAGS=3D= -g is > > > working just fine for me. > > DEBUG_FLAGS=3D-g might be fine for you, but it does not do what rtld de= bugging > > needs. Look at the -DDEBUG. > >=20 > > If you want ${} instead of $(), feel free to change. >=20 > Err, why can't you use 'make DEBUG_FLAGS=3D-DDEBUG' or > 'make DEBUG_FLAGS=3D"-g -DDEBUG"'? >=20 > If you are just doing 'make DEBUG=3D-DDEBUG' with this change, then I agr= ee > with Ulrich, DEBUG_FLAGS is already suitable for this purpose. >=20 I previously had a version that used RTLD_DEBUG, that I set from make.conf. Now I do make DEBUG_FLAGS=3D"-g" DEBUG=3D"-DDEBUG". The patch allows to force the compilation of dbg() without affecting global DEBUG_FLAGS setting= s. All big patches to rtld have -DDEBUG addition, and I tired trying to not forget removing them before the commit. Anyway, if somebody wants to revert the whole commit, feel free, I will return to local patching. --iskw6J4cuOvZ6IVF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0aBbIACgkQC3+MBN1Mb4iJiwCgyxhO3ER2aOca2oPOIKEaIVPd WksAn1uGYQYnDgzcB/TWN8a289KbwAnP =8uXH -----END PGP SIGNATURE----- --iskw6J4cuOvZ6IVF-- From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 16:57:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42A8A1065693; Tue, 28 Dec 2010 16:57:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 320378FC08; Tue, 28 Dec 2010 16:57:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSGvUOM067725; Tue, 28 Dec 2010 16:57:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSGvUPO067723; Tue, 28 Dec 2010 16:57:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012281657.oBSGvUPO067723@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Dec 2010 16:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216764 - head/sys/dev/mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 16:57:30 -0000 Author: jhb Date: Tue Dec 28 16:57:29 2010 New Revision: 216764 URL: http://svn.freebsd.org/changeset/base/216764 Log: Use bus_alloc_resource_any(). MFC after: 2 weeks Modified: head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Tue Dec 28 14:58:08 2010 (r216763) +++ head/sys/dev/mpt/mpt_pci.c Tue Dec 28 16:57:29 2010 (r216764) @@ -523,8 +523,8 @@ mpt_pci_attach(device_t dev) * some cards otherwise). */ mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); - mpt->pci_pio_reg = bus_alloc_resource(dev, SYS_RES_IOPORT, - &mpt->pci_pio_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { device_printf(dev, "unable to map registers in PIO mode\n"); goto bad; @@ -534,8 +534,8 @@ mpt_pci_attach(device_t dev) /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); - mpt->pci_reg = bus_alloc_resource(dev, SYS_RES_MEMORY, - &mpt->pci_mem_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { device_printf(dev, "Unable to memory map registers.\n"); if (mpt->is_sas) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 17:02:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 603F5106566B; Tue, 28 Dec 2010 17:02:15 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3818FC0A; Tue, 28 Dec 2010 17:02:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSH2Fv5067874; Tue, 28 Dec 2010 17:02:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSH2F6l067872; Tue, 28 Dec 2010 17:02:15 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012281702.oBSH2F6l067872@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 28 Dec 2010 17:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216765 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 17:02:15 -0000 Author: nwhitehorn Date: Tue Dec 28 17:02:15 2010 New Revision: 216765 URL: http://svn.freebsd.org/changeset/base/216765 Log: Only keep track of PTE validity statistics for pages not locked in the table. The 'locked' attribute is used to circumvent the regular page table locking for some special pages, with the result that including locked pages here causes races when updating the stats. Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Tue Dec 28 16:57:29 2010 (r216764) +++ head/sys/powerpc/aim/moea64_native.c Tue Dec 28 17:02:15 2010 (r216765) @@ -281,7 +281,10 @@ moea64_pte_set_native(struct lpte *pt, s EIEIO(); pt->pte_hi = pvo_pt->pte_hi; PTESYNC(); - moea64_pte_valid++; + + /* Keep statistics for unlocked pages */ + if (!(pvo_pt->pte_hi & LPTE_LOCKED)) + moea64_pte_valid++; } static void @@ -310,7 +313,10 @@ moea64_pte_unset_native(mmu_t mmu, uintp * Save the reg & chg bits. */ moea64_pte_synch_native(mmu, pt_cookie, pvo_pt); - moea64_pte_valid--; + + /* Keep statistics for unlocked pages */ + if (!(pvo_pt->pte_hi & LPTE_LOCKED)) + moea64_pte_valid--; } static void From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 17:10:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35A64106566C; Tue, 28 Dec 2010 17:10:18 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id E4EF58FC08; Tue, 28 Dec 2010 17:10:17 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBSH5Gqk056862; Tue, 28 Dec 2010 10:05:16 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1A18CC.40604@bsdimp.com> Date: Tue, 28 Dec 2010 10:05:16 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201012240455.oBO4tvJ4079108@svn.freebsd.org> <20101226202125.C6126@maildrop.int.zabbadoz.net> In-Reply-To: <20101226202125.C6126@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r216685 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 17:10:18 -0000 On 12/26/2010 13:23, Bjoern A. Zeeb wrote: > On Fri, 24 Dec 2010, Warner Losh wrote: > >> Author: imp >> Date: Fri Dec 24 04:55:56 2010 >> New Revision: 216685 >> URL: http://svn.freebsd.org/changeset/base/216685 >> >> Log: >> Redirect stderr from config to /dev/null. config -m is printing lots >> of annoying warnings when dealing with arm. The arm config files need >> to be fixed, but this restricts the output to a more useful place. > > I'll assume these are the warning about duplicate devices and options. > Would we get the same warnings again when actually running config on > the kernel config files and will they then go to the logs? You'll get them again, and they will go to the appropriate _.$MACHINE.$KERNEL log file. They should be fixed, of course, but they shouldn't be in this output... Also, the warnings turned out to not be from the arm kernels at all... Warner > >> Modified: >> head/Makefile >> >> Modified: head/Makefile >> ============================================================================== >> >> --- head/Makefile Fri Dec 24 04:52:53 2010 (r216684) >> +++ head/Makefile Fri Dec 24 04:55:56 2010 (r216685) >> @@ -350,8 +350,8 @@ KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/ >> universe_kernconfs: >> .for kernel in ${KERNCONFS} >> TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ >> - config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} | \ >> - cut -f 2 >> + config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ >> + cut -f 2 >> universe_kernconfs: universe_kernconf_${TARGET}_${kernel} >> universe_kernconf_${TARGET}_${kernel}: >> @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ >> > From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 17:34:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C6E3106566C; Tue, 28 Dec 2010 17:34:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id F07268FC14; Tue, 28 Dec 2010 17:34:07 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBSHUUQ3057062; Tue, 28 Dec 2010 10:30:30 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1A1EB6.5040009@bsdimp.com> Date: Tue, 28 Dec 2010 10:30:30 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Colin Percival References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> In-Reply-To: <4D194551.7000004@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Steve Kargl Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 17:34:08 -0000 On 12/27/2010 19:02, Colin Percival wrote: > On 12/27/10 17:59, Steve Kargl wrote: >> On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: >>> Make it possible to specify WITHOUT_MODULES in a kernel config file. >> Can you explain how this differs from >> makeoptions NO_MODULES >> which has been able to do for years? > NO_MODULES means what it says: No modules. > > WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except for foo, > bar, and baz". Most of the other uses of the WITHOUT_xxx in the tree means omit feature xxx entirely... I usually hate to nit-pick names, but in this case I think "OMIT_MODULES" would be a better name and less confusing for the other uses of WITHOUT_FOO in the tree... Warner From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 17:34:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BCE51065673; Tue, 28 Dec 2010 17:34:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 199178FC08; Tue, 28 Dec 2010 17:34:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBSHV8LC057063; Tue, 28 Dec 2010 10:31:08 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1A1EDC.8010603@bsdimp.com> Date: Tue, 28 Dec 2010 10:31:08 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Steve Kargl References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> <20101228020900.GA81611@troutmask.apl.washington.edu> In-Reply-To: <20101228020900.GA81611@troutmask.apl.washington.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 17:34:10 -0000 On 12/27/2010 19:09, Steve Kargl wrote: > On Mon, Dec 27, 2010 at 06:02:57PM -0800, Colin Percival wrote: >> On 12/27/10 17:59, Steve Kargl wrote: >>> On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: >>>> Make it possible to specify WITHOUT_MODULES in a kernel config file. >>> Can you explain how this differs from >>> makeoptions NO_MODULES >>> which has been able to do for years? >> NO_MODULES means what it says: No modules. >> >> WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except for foo, >> bar, and baz". >> > Thanks. The distincion wasn't clear from the commit log. > I read it as "Build a kernel WITHOUT building MODULES", > which is what NO_MODULES does. which is why I'd like to have its name changed: it is confusing this way... Warner From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 17:45:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45014106564A; Tue, 28 Dec 2010 17:45:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33F258FC1B; Tue, 28 Dec 2010 17:45:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSHji21069020; Tue, 28 Dec 2010 17:45:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSHji6m069018; Tue, 28 Dec 2010 17:45:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012281745.oBSHji6m069018@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 28 Dec 2010 17:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216766 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 17:45:44 -0000 Author: yongari Date: Tue Dec 28 17:45:43 2010 New Revision: 216766 URL: http://svn.freebsd.org/changeset/base/216766 Log: Add device id for RDC M3010 which is found on Vortex86 SoC. Reviewed by: mav Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Dec 28 17:02:15 2010 (r216765) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Dec 28 17:45:43 2010 (r216766) @@ -197,6 +197,10 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_ATI_RV740 HDA_MODEL_CONSTRUCT(ATI, 0xaa48) #define HDA_ATI_ALL HDA_MODEL_CONSTRUCT(ATI, 0xffff) +/* RDC */ +#define RDC_VENDORID 0x17f3 +#define HDA_RDC_M3010 HDA_MODEL_CONSTRUCT(RDC, 0x3010) + /* VIA */ #define VIA_VENDORID 0x1106 #define HDA_VIA_VT82XX HDA_MODEL_CONSTRUCT(VIA, 0x3288) @@ -533,6 +537,7 @@ static const struct { { HDA_ATI_RV730, "ATI RV730", 0 }, { HDA_ATI_RV740, "ATI RV740", 0 }, { HDA_ATI_RV770, "ATI RV770", 0 }, + { HDA_RDC_M3010, "RDC M3010", 0 }, { HDA_VIA_VT82XX, "VIA VT8251/8237A",0 }, { HDA_SIS_966, "SiS 966", 0 }, { HDA_ULI_M5461, "ULI M5461", 0 }, From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 18:37:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B962E106564A; Tue, 28 Dec 2010 18:37:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7B388FC18; Tue, 28 Dec 2010 18:37:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSIbAxY073432; Tue, 28 Dec 2010 18:37:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSIbALd073429; Tue, 28 Dec 2010 18:37:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012281837.oBSIbALd073429@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Dec 2010 18:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216767 - in stable/7/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 18:37:10 -0000 Author: jhb Date: Tue Dec 28 18:37:10 2010 New Revision: 216767 URL: http://svn.freebsd.org/changeset/base/216767 Log: MFC 208587: Add support for reporting the NOCOREDUMP flag from sysctl_kern_proc_vmmap(). Modified: stable/7/sys/kern/kern_proc.c stable/7/sys/sys/user.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Tue Dec 28 17:45:43 2010 (r216766) +++ stable/7/sys/kern/kern_proc.c Tue Dec 28 18:37:10 2010 (r216767) @@ -1456,6 +1456,8 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); @@ -1630,6 +1632,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_flags |= KVME_FLAG_COW; if (entry->eflags & MAP_ENTRY_NEEDS_COPY) kve->kve_flags |= KVME_FLAG_NEEDS_COPY; + if (entry->eflags & MAP_ENTRY_NOCOREDUMP) + kve->kve_flags |= KVME_FLAG_NOCOREDUMP; last_timestamp = map->timestamp; vm_map_unlock_read(map); Modified: stable/7/sys/sys/user.h ============================================================================== --- stable/7/sys/sys/user.h Tue Dec 28 17:45:43 2010 (r216766) +++ stable/7/sys/sys/user.h Tue Dec 28 18:37:10 2010 (r216767) @@ -343,6 +343,7 @@ struct kinfo_file { #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002 +#define KVME_FLAG_NOCOREDUMP 0x00000004 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168 From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 18:56:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FEB1065674; Tue, 28 Dec 2010 18:56:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A12578FC0C; Tue, 28 Dec 2010 18:56:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSIut2I073913; Tue, 28 Dec 2010 18:56:55 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSIut5t073911; Tue, 28 Dec 2010 18:56:55 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012281856.oBSIut5t073911@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Dec 2010 18:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216768 - stable/8/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 18:56:56 -0000 Author: jhb Date: Tue Dec 28 18:56:55 2010 New Revision: 216768 URL: http://svn.freebsd.org/changeset/base/216768 Log: MFC 203532: Fix gcore so that it can have the '-s' flag without hanging. Modified: stable/8/usr.bin/gcore/gcore.c Directory Properties: stable/8/usr.bin/gcore/ (props changed) Modified: stable/8/usr.bin/gcore/gcore.c ============================================================================== --- stable/8/usr.bin/gcore/gcore.c Tue Dec 28 18:37:10 2010 (r216767) +++ stable/8/usr.bin/gcore/gcore.c Tue Dec 28 18:56:55 2010 (r216768) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -75,7 +74,6 @@ __FBSDID("$FreeBSD$"); int pflags; static void killed(int); -static void restart_target(void); static void usage(void) __dead2; static pid_t pid; @@ -152,36 +150,28 @@ main(int argc, char *argv[]) fd = open(corefile, O_RDWR|O_CREAT|O_TRUNC, DEFFILEMODE); if (fd < 0) err(1, "%s", corefile); - if ((pflags & PFLAGS_RESUME) != 0) { - signal(SIGHUP, killed); - signal(SIGINT, killed); - signal(SIGTERM, killed); - if (kill(pid, SIGSTOP) == -1) - err(1, "%d: stop signal", pid); - atexit(restart_target); - } + /* + * The semantics of the 's' flag is to stop the target process. + * Previous versions of gcore would manage this by trapping SIGHUP, + * SIGINT and SIGTERM (to be passed to the target pid), and then + * signal the child to stop. + * + * However, this messes up if the selected dumper uses ptrace calls + * that leave the child already stopped. The waitpid call in elfcore + * never returns. + * + * The best thing to do here is to externalize the 's' flag and let + * each dumper dispose of what that means, if anything. For the elfcore + * dumper, the 's' flag is a no-op since the ptrace attach stops the + * process in question already. + */ + dumper->dump(efd, fd, pid); (void)close(fd); (void)close(efd); exit(0); } -static void -killed(int sig) -{ - - restart_target(); - signal(sig, SIG_DFL); - kill(getpid(), sig); -} - -static void -restart_target(void) -{ - - kill(pid, SIGCONT); -} - void usage(void) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 18:58:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A7CE10656D4; Tue, 28 Dec 2010 18:58:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 395B58FC08; Tue, 28 Dec 2010 18:58:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSIwGCp074039; Tue, 28 Dec 2010 18:58:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSIwGOx074037; Tue, 28 Dec 2010 18:58:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012281858.oBSIwGOx074037@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Dec 2010 18:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216769 - head/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 18:58:16 -0000 Author: jhb Date: Tue Dec 28 18:58:15 2010 New Revision: 216769 URL: http://svn.freebsd.org/changeset/base/216769 Log: Start sentences on a new line to ease life for translators. Tweak the wording in a few places. MFC after: 1 week Modified: head/usr.bin/gcore/gcore.1 Modified: head/usr.bin/gcore/gcore.1 ============================================================================== --- head/usr.bin/gcore/gcore.1 Tue Dec 28 18:56:55 2010 (r216768) +++ head/usr.bin/gcore/gcore.1 Tue Dec 28 18:58:15 2010 (r216769) @@ -59,12 +59,13 @@ The following options are available: Write the core file to the specified file instead of .Dq Pa core. . .It Fl f -Dumps all the available segments, excluding only the malformed ones and -un-dumpable ones. Unlike the default invocation, it also dumps -device- and sglist-mapped areas that may invalidate the state of -some transactions. This flag must be used very carefully, when the -behavior of the application is fully understood and the fallouts can -be easily controlled. +Dumps all available segments, excluding only malformed and undumpable segments. +Unlike the default invocation, this flag dumps mappings of devices which +may invalidate the state of device transactions or trigger other unexpected +behavior. +As a result, this flag should only be used when the behavior of the +application and any devices it has mapped is fully understood and any side +effects can be controlled or tolerated. .It Fl s Stop the process while gathering the core image, and resume it when done. @@ -90,7 +91,7 @@ Because of the .Xr ptrace 2 usage .Nm -may not work with processes which are actively investigated with +may not work with processes which are actively being investigated with .Xr truss 1 or .Xr gdb 1 . From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 19:26:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F24B31065672; Tue, 28 Dec 2010 19:26:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEF218FC1C; Tue, 28 Dec 2010 19:26:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSJQvgY074780; Tue, 28 Dec 2010 19:26:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSJQvJJ074774; Tue, 28 Dec 2010 19:26:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201012281926.oBSJQvJJ074774@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Dec 2010 19:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216771 - stable/7/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 19:26:58 -0000 Author: jhb Date: Tue Dec 28 19:26:57 2010 New Revision: 216771 URL: http://svn.freebsd.org/changeset/base/216771 Log: MFC 199805,203532,204329,210063,210065: - Change gcore in order to get rid of the procfs accesses and use FreeBSD's specific sysctls and ptrace interfaces. This change switches a bit gcore POLA that is summarized here: - now gcore can recognize threads within the process and handle dumps on thread-scope - the process to be analyzed will be stopped during its gcore run - gcore may not work with processes which are actively being analyzed by gdb or truss - the ptrace interface may cause syscalls to return EINTR, thus interferring with signals handling within the process - Fix gcore so that it can have the '-s' flag without hanging. - Fix the way the segments are included in the gcore outputs (with the default invokation): - Right now if segments are not writable are not included. Remove this. - Right now if a segment is mapped with NOCORE the check is not honoured. Change this by checking the newly added flag, from libutil, KVME_FLAG_NOCOREDUMP. Besides that, add a new flag (-f) that forces a 'full' dump of all the segments excluding just the malformed ones. This might be used very carefully as, among the reported segments, there could be memory mapped areas that could be vital to program execution. Modified: stable/7/usr.bin/gcore/Makefile stable/7/usr.bin/gcore/elfcore.c stable/7/usr.bin/gcore/extern.h stable/7/usr.bin/gcore/gcore.1 stable/7/usr.bin/gcore/gcore.c Directory Properties: stable/7/usr.bin/gcore/ (props changed) Modified: stable/7/usr.bin/gcore/Makefile ============================================================================== --- stable/7/usr.bin/gcore/Makefile Tue Dec 28 19:22:53 2010 (r216770) +++ stable/7/usr.bin/gcore/Makefile Tue Dec 28 19:26:57 2010 (r216771) @@ -3,5 +3,7 @@ PROG= gcore SRCS= elfcore.c gcore.c +DPADD= ${LIBUTIL} +LDADD= -lutil .include Modified: stable/7/usr.bin/gcore/elfcore.c ============================================================================== --- stable/7/usr.bin/gcore/elfcore.c Tue Dec 28 19:22:53 2010 (r216770) +++ stable/7/usr.bin/gcore/elfcore.c Tue Dec 28 19:26:57 2010 (r216771) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2007 Sandvine Incorporated * Copyright (c) 1998 John D. Polstra * All rights reserved. * @@ -29,8 +30,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include +#include #include #include #include @@ -44,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -69,16 +75,15 @@ static void cb_put_phdr(vm_map_entry_t, static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(vm_map_entry_t, segment_callback, void *closure); -static void elf_corehdr(int fd, pid_t, vm_map_entry_t, int numsegs, - void *hdr, size_t hdrsize); -static void elf_puthdr(vm_map_entry_t, void *, size_t *, - const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int numsegs); +static void elf_detach(void); /* atexit() handler. */ +static void elf_puthdr(pid_t, vm_map_entry_t, void *, size_t *, int numsegs); static void elf_putnote(void *dst, size_t *off, const char *name, int type, const void *desc, size_t descsz); static void freemap(vm_map_entry_t); -static void readhdrinfo(pid_t, prstatus_t *, prfpregset_t *, prpsinfo_t *); static vm_map_entry_t readmap(pid_t); +static pid_t g_pid; /* Pid being dumped, global for elf_detach */ + static int elf_ident(int efd, pid_t pid __unused, char *binfile __unused) { @@ -93,6 +98,14 @@ elf_ident(int efd, pid_t pid __unused, c return (0); } +static void +elf_detach(void) +{ + + if (g_pid != 0) + ptrace(PT_DETACH, g_pid, (caddr_t)1, 0); +} + /* * Write an ELF coredump for the given pid to the given fd. */ @@ -103,11 +116,20 @@ elf_coredump(int efd __unused, int fd, p struct sseg_closure seginfo; void *hdr; size_t hdrsize; - char memname[64]; - int memfd; Elf_Phdr *php; int i; + /* Attach to process to dump. */ + g_pid = pid; + if (atexit(elf_detach) != 0) + err(1, "atexit"); + errno = 0; + ptrace(PT_ATTACH, pid, NULL, 0); + if (errno) + err(1, "PT_ATTACH"); + if (waitpid(pid, NULL, 0) == -1) + err(1, "waitpid"); + /* Get the program's memory map. */ map = readmap(pid); @@ -122,28 +144,31 @@ elf_coredump(int efd __unused, int fd, p * size is calculated. */ hdrsize = 0; - elf_puthdr(map, (void *)NULL, &hdrsize, - (const prstatus_t *)NULL, (const prfpregset_t *)NULL, - (const prpsinfo_t *)NULL, seginfo.count); + elf_puthdr(pid, map, NULL, &hdrsize, seginfo.count); /* * Allocate memory for building the header, fill it up, * and write it out. */ - if ((hdr = malloc(hdrsize)) == NULL) + if ((hdr = calloc(1, hdrsize)) == NULL) errx(1, "out of memory"); - elf_corehdr(fd, pid, map, seginfo.count, hdr, hdrsize); - /* Write the contents of all of the writable segments. */ - snprintf(memname, sizeof memname, "/proc/%d/mem", pid); - if ((memfd = open(memname, O_RDONLY)) == -1) - err(1, "cannot open %s", memname); + /* Fill in the header. */ + hdrsize = 0; + elf_puthdr(pid, map, hdr, &hdrsize, seginfo.count); + + /* Write it to the core file. */ + if (write(fd, hdr, hdrsize) == -1) + err(1, "write"); + /* Write the contents of all of the writable segments. */ php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; for (i = 0; i < seginfo.count; i++) { + struct ptrace_io_desc iorequest; uintmax_t nleft = php->p_filesz; - lseek(memfd, (off_t)php->p_vaddr, SEEK_SET); + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (caddr_t)php->p_vaddr; while (nleft > 0) { char buf[8*1024]; size_t nwant; @@ -153,12 +178,12 @@ elf_coredump(int efd __unused, int fd, p nwant = sizeof buf; else nwant = nleft; - ngot = read(memfd, buf, nwant); - if (ngot == -1) - err(1, "read from %s", memname); + iorequest.piod_addr = buf; + iorequest.piod_len = nwant; + ptrace(PT_IO, pid, (caddr_t)&iorequest, 0); + ngot = iorequest.piod_len; if ((size_t)ngot < nwant) - errx(1, "short read from %s:" - " wanted %zu, got %zd", memname, + errx(1, "short read wanted %d, got %d", nwant, ngot); ngot = write(fd, buf, nwant); if (ngot == -1) @@ -166,10 +191,10 @@ elf_coredump(int efd __unused, int fd, p if ((size_t)ngot != nwant) errx(1, "short write"); nleft -= nwant; + iorequest.piod_offs += ngot; } php++; } - close(memfd); free(hdr); freemap(map); } @@ -231,30 +256,25 @@ each_writable_segment(vm_map_entry_t map (*func)(entry, closure); } -/* - * Write the core file header to the file, including padding up to - * the page boundary. - */ static void -elf_corehdr(int fd, pid_t pid, vm_map_entry_t map, int numsegs, void *hdr, - size_t hdrsize) +elf_getstatus(pid_t pid, prpsinfo_t *psinfo) { - size_t off; - prstatus_t status; - prfpregset_t fpregset; - prpsinfo_t psinfo; - - /* Gather the information for the header. */ - readhdrinfo(pid, &status, &fpregset, &psinfo); - - /* Fill in the header. */ - memset(hdr, 0, hdrsize); - off = 0; - elf_puthdr(map, hdr, &off, &status, &fpregset, &psinfo, numsegs); - - /* Write it to the core file. */ - if (write(fd, hdr, hdrsize) == -1) - err(1, "write"); + struct kinfo_proc kobj; + int name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PID; + name[3] = pid; + + len = sizeof(kobj); + if (sysctl(name, 4, &kobj, &len, NULL, 0) == -1) + err(1, "error accessing kern.proc.pid.%u sysctl", pid); + if (kobj.ki_pid != pid) + err(1, "error accessing kern.proc.pid.%u sysctl datas", pid); + strncpy(psinfo->pr_fname, kobj.ki_comm, MAXCOMLEN); + strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); } /* @@ -262,13 +282,24 @@ elf_corehdr(int fd, pid_t pid, vm_map_en * be NULL, in which case the header is sized but not actually generated. */ static void -elf_puthdr(vm_map_entry_t map, void *dst, size_t *off, const prstatus_t *status, - const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs) +elf_puthdr(pid_t pid, vm_map_entry_t map, void *dst, size_t *off, int numsegs) { + struct { + prstatus_t status; + prfpregset_t fpregset; + prpsinfo_t psinfo; + } *tempdata; size_t ehoff; size_t phoff; size_t noteoff; size_t notesz; + size_t threads; + lwpid_t *tids; + int i; + + prstatus_t *status; + prfpregset_t *fpregset; + prpsinfo_t *psinfo; ehoff = *off; *off += sizeof(Elf_Ehdr); @@ -277,14 +308,68 @@ elf_puthdr(vm_map_entry_t map, void *dst *off += (numsegs + 1) * sizeof(Elf_Phdr); noteoff = *off; - elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); + + if (dst != NULL) { + if ((tempdata = calloc(1, sizeof(*tempdata))) == NULL) + errx(1, "out of memory"); + status = &tempdata->status; + fpregset = &tempdata->fpregset; + psinfo = &tempdata->psinfo; + } else { + tempdata = NULL; + status = NULL; + fpregset = NULL; + psinfo = NULL; + } + + errno = 0; + threads = ptrace(PT_GETNUMLWPS, pid, NULL, 0); + if (errno) + err(1, "PT_GETNUMLWPS"); + + if (dst != NULL) { + psinfo->pr_version = PRPSINFO_VERSION; + psinfo->pr_psinfosz = sizeof(prpsinfo_t); + elf_getstatus(pid, psinfo); + + } elf_putnote(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, sizeof *psinfo); + + if (dst != NULL) { + tids = malloc(threads * sizeof(*tids)); + if (tids == NULL) + errx(1, "out of memory"); + errno = 0; + ptrace(PT_GETLWPLIST, pid, (void *)tids, threads); + if (errno) + err(1, "PT_GETLWPLIST"); + } + for (i = 0; i < threads; ++i) { + if (dst != NULL) { + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(prstatus_t); + status->pr_gregsetsz = sizeof(gregset_t); + status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_osreldate = __FreeBSD_version; + status->pr_pid = tids[i]; + + ptrace(PT_GETREGS, tids[i], (void *)&status->pr_reg, 0); + ptrace(PT_GETFPREGS, tids[i], (void *)fpregset, 0); + } + elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status, + sizeof *status); + elf_putnote(dst, off, "FreeBSD", NT_FPREGSET, fpregset, + sizeof *fpregset); + } + notesz = *off - noteoff; + if (dst != NULL) { + free(tids); + free(tempdata); + } + /* Align up to a page boundary for the program segments. */ *off = round_page(*off); @@ -381,70 +466,7 @@ freemap(vm_map_entry_t map) } /* - * Read the process information necessary to fill in the core file's header. - */ -static void -readhdrinfo(pid_t pid, prstatus_t *status, prfpregset_t *fpregset, - prpsinfo_t *psinfo) -{ - char name[64]; - char line[256]; - int fd; - int i; - int n; - - memset(status, 0, sizeof *status); - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); - status->pr_osreldate = __FreeBSD_version; - status->pr_pid = pid; - - memset(fpregset, 0, sizeof *fpregset); - - memset(psinfo, 0, sizeof *psinfo); - psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); - - /* Read the general registers. */ - snprintf(name, sizeof name, "/proc/%d/regs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, &status->pr_reg, sizeof status->pr_reg)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(status->pr_reg)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof status->pr_reg, n); - close(fd); - - /* Read the floating point registers. */ - snprintf(name, sizeof name, "/proc/%d/fpregs", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, fpregset, sizeof *fpregset)) == -1) - err(1, "read error from %s", name); - if ((size_t)n < sizeof(*fpregset)) - errx(1, "short read from %s: wanted %zu, got %d", name, - sizeof *fpregset, n); - close(fd); - - /* Read and parse the process status. */ - snprintf(name, sizeof name, "/proc/%d/status", pid); - if ((fd = open(name, O_RDONLY)) == -1) - err(1, "cannot open %s", name); - if ((n = read(fd, line, sizeof line - 1)) == -1) - err(1, "read error from %s", name); - if (n > MAXCOMLEN) - n = MAXCOMLEN; - for (i = 0; i < n && line[i] != ' '; i++) - psinfo->pr_fname[i] = line[i]; - strncpy(psinfo->pr_psargs, psinfo->pr_fname, PRARGSZ); - close(fd); -} - -/* - * Read the process's memory map using procfs, and return a list of + * Read the process's memory map using kinfo_getvmmap(), and return a list of * VM map entries. Only the non-device read/writable segments are * returned. The map entries in the list aren't fully filled in; only * the items we need are present. @@ -452,83 +474,49 @@ readhdrinfo(pid_t pid, prstatus_t *statu static vm_map_entry_t readmap(pid_t pid) { - char mapname[64]; - int mapfd; - ssize_t mapsize; - size_t bufsize; - char *mapbuf; - int pos; - vm_map_entry_t map; - vm_map_entry_t *linkp; - - snprintf(mapname, sizeof mapname, "/proc/%d/map", pid); - if ((mapfd = open(mapname, O_RDONLY)) == -1) - err(1, "cannot open %s", mapname); + vm_map_entry_t ent, *linkp, map; + struct kinfo_vmentry *vmentl, *kve; + int i, nitems; + + vmentl = kinfo_getvmmap(pid, &nitems); + if (vmentl == NULL) + err(1, "cannot retrieve mappings for %u process", pid); - /* - * Procfs requires (for consistency) that the entire memory map - * be read with a single read() call. Start with a reasonably sized - * buffer, and double it until it is big enough. - */ - bufsize = 8 * 1024; - mapbuf = NULL; - for ( ; ; ) { - if ((mapbuf = realloc(mapbuf, bufsize + 1)) == NULL) - errx(1, "out of memory"); - mapsize = read(mapfd, mapbuf, bufsize); - if (mapsize != -1 || errno != EFBIG) - break; - bufsize *= 2; - /* This lseek shouldn't be necessary, but it is. */ - lseek(mapfd, (off_t)0, SEEK_SET); - } - if (mapsize == -1) - err(1, "read error from %s", mapname); - if (mapsize == 0) - errx(1, "empty map file %s", mapname); - mapbuf[mapsize] = 0; - close(mapfd); - - pos = 0; map = NULL; linkp = ↦ - while (pos < mapsize) { - vm_map_entry_t ent; - u_long start; - u_long end; - char prot[4]; - char type[16]; - int n; - int len; - - len = 0; - n = sscanf(mapbuf + pos, "%lx %lx %*d %*d %*x %3[-rwx]" - " %*d %*d %*x %*s %*s %16s %*s%*[\n]%n", - &start, &end, prot, type, &len); - if (n != 4 || len == 0) - errx(1, "ill-formed line in %s starting at character %d", mapname, pos + 1); - pos += len; - - /* Ignore segments of the wrong kind, and unwritable ones */ - if (strncmp(prot, "rw", 2) != 0 || - (strcmp(type, "default") != 0 && - strcmp(type, "vnode") != 0 && - strcmp(type, "swap") != 0)) + for (i = 0; i < nitems; i++) { + kve = &vmentl[i]; + + /* + * Ignore 'malformed' segments or ones representing memory + * mapping with MAP_NOCORE on. + * If the 'full' support is disabled, just dump the most + * meaningful data segments. + */ + if ((kve->kve_protection & KVME_PROT_READ) == 0 || + (kve->kve_flags & KVME_FLAG_NOCOREDUMP) != 0 || + kve->kve_type == KVME_TYPE_DEAD || + kve->kve_type == KVME_TYPE_UNKNOWN || + ((pflags & PFLAGS_FULL) == 0 && + kve->kve_type != KVME_TYPE_DEFAULT && + kve->kve_type != KVME_TYPE_VNODE && + kve->kve_type != KVME_TYPE_SWAP)) continue; - if ((ent = (vm_map_entry_t)calloc(1, sizeof *ent)) == NULL) + ent = calloc(1, sizeof(*ent)); + if (ent == NULL) errx(1, "out of memory"); - ent->start = start; - ent->end = end; + ent->start = (vm_offset_t)kve->kve_start; + ent->end = (vm_offset_t)kve->kve_end; ent->protection = VM_PROT_READ | VM_PROT_WRITE; - if (prot[2] == 'x') - ent->protection |= VM_PROT_EXECUTE; + if ((kve->kve_protection & KVME_PROT_EXEC) != 0) + ent->protection |= VM_PROT_EXECUTE; *linkp = ent; linkp = &ent->next; } - free(mapbuf); - return map; + free(vmentl); + return (map); } struct dumpers elfdump = { elf_ident, elf_coredump }; Modified: stable/7/usr.bin/gcore/extern.h ============================================================================== --- stable/7/usr.bin/gcore/extern.h Tue Dec 28 19:22:53 2010 (r216770) +++ stable/7/usr.bin/gcore/extern.h Tue Dec 28 19:26:57 2010 (r216771) @@ -34,7 +34,11 @@ * $FreeBSD$ */ +#define PFLAGS_FULL 0x01 +#define PFLAGS_RESUME 0x02 + struct dumpers { int (*ident)(int efd, pid_t pid, char *binfile); void (*dump)(int efd, int fd, pid_t pid); }; +extern int pflags; Modified: stable/7/usr.bin/gcore/gcore.1 ============================================================================== --- stable/7/usr.bin/gcore/gcore.1 Tue Dec 28 19:22:53 2010 (r216770) +++ stable/7/usr.bin/gcore/gcore.1 Tue Dec 28 19:26:57 2010 (r216771) @@ -32,7 +32,7 @@ .\" @(#)gcore.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 1994 +.Dd July 14, 2010 .Dt GCORE 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Nd get core images of running process .Sh SYNOPSIS .Nm +.Op Fl f .Op Fl s .Op Fl c Ar core .Op Ar executable @@ -55,17 +56,19 @@ By default, the core is written to the f The process identifier, .Ar pid , must be given on the command line. -If no executable image is -specified, -.Nm -will use -.Dq Pa /proc//file . .Pp The following options are available: .Bl -tag -width indent .It Fl c Write the core file to the specified file instead of .Dq Pa core. . +.It Fl f +Dumps all the available segments, excluding only the malformed ones and +un-dumpable ones. Unlike the default invocation, it also dumps +device- and sglist-mapped areas that may invalidate the state of +some transactions. This flag must be used very carefully, when the +behavior of the application is fully understood and the fallouts can +be easily controlled. .It Fl s Stop the process while gathering the core image, and resume it when done. @@ -80,8 +83,6 @@ The same effect can be achieved manually .Bl -tag -width /var/log/messages -compact .It Pa core. the core image -.It Pa /proc//file -the executable image .El .Sh HISTORY A @@ -89,12 +90,15 @@ A utility appeared in .Bx 4.2 . .Sh BUGS -Context switches or paging activity that occur while -.Nm -is running may cause the program to become confused. -For best results, use -.Fl s -to temporarily stop the target process. +Because of the +.Xr ptrace 2 +usage +.Nm +may not work with processes which are actively investigated with +.Xr truss 1 +or +.Xr gdb 1 . +Additionally, interruptable sleeps may exit with EINTR. .Pp The .Nm Modified: stable/7/usr.bin/gcore/gcore.c ============================================================================== --- stable/7/usr.bin/gcore/gcore.c Tue Dec 28 19:22:53 2010 (r216770) +++ stable/7/usr.bin/gcore/gcore.c Tue Dec 28 19:26:57 2010 (r216771) @@ -61,19 +61,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include #include #include #include "extern.h" +int pflags; static void killed(int); -static void restart_target(void); static void usage(void) __dead2; static pid_t pid; @@ -83,20 +83,24 @@ SET_DECLARE(dumpset, struct dumpers); int main(int argc, char *argv[]) { - int ch, efd, fd, sflag; + int ch, efd, fd, name[4]; char *binfile, *corefile; - char fname[MAXPATHLEN]; + char passpath[MAXPATHLEN], fname[MAXPATHLEN]; struct dumpers **d, *dumper; + size_t len; - sflag = 0; + pflags = 0; corefile = NULL; - while ((ch = getopt(argc, argv, "c:s")) != -1) { + while ((ch = getopt(argc, argv, "c:fs")) != -1) { switch (ch) { case 'c': corefile = optarg; break; + case 'f': + pflags |= PFLAGS_FULL; + break; case 's': - sflag = 1; + pflags |= PFLAGS_RESUME; break; default: usage(); @@ -109,9 +113,14 @@ main(int argc, char *argv[]) switch (argc) { case 1: pid = atoi(argv[0]); - asprintf(&binfile, "/proc/%d/file", pid); - if (binfile == NULL) - errx(1, "allocation failure"); + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + len = sizeof(passpath); + if (sysctl(name, 4, passpath, &len, NULL, 0) == -1) + errx(1, "kern.proc.pathname failure"); + binfile = passpath; break; case 2: pid = atoi(argv[1]); @@ -141,36 +150,28 @@ main(int argc, char *argv[]) fd = open(corefile, O_RDWR|O_CREAT|O_TRUNC, DEFFILEMODE); if (fd < 0) err(1, "%s", corefile); - if (sflag) { - signal(SIGHUP, killed); - signal(SIGINT, killed); - signal(SIGTERM, killed); - if (kill(pid, SIGSTOP) == -1) - err(1, "%d: stop signal", pid); - atexit(restart_target); - } + /* + * The semantics of the 's' flag is to stop the target process. + * Previous versions of gcore would manage this by trapping SIGHUP, + * SIGINT and SIGTERM (to be passed to the target pid), and then + * signal the child to stop. + * + * However, this messes up if the selected dumper uses ptrace calls + * that leave the child already stopped. The waitpid call in elfcore + * never returns. + * + * The best thing to do here is to externalize the 's' flag and let + * each dumper dispose of what that means, if anything. For the elfcore + * dumper, the 's' flag is a no-op since the ptrace attach stops the + * process in question already. + */ + dumper->dump(efd, fd, pid); (void)close(fd); (void)close(efd); exit(0); } -static void -killed(int sig) -{ - - restart_target(); - signal(sig, SIG_DFL); - kill(getpid(), sig); -} - -static void -restart_target(void) -{ - - kill(pid, SIGCONT); -} - void usage(void) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 20:02:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B869106566C; Tue, 28 Dec 2010 20:02:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF0478FC14; Tue, 28 Dec 2010 20:02:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSK2UM1075598; Tue, 28 Dec 2010 20:02:30 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSK2UtD075596; Tue, 28 Dec 2010 20:02:30 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012282002.oBSK2UtD075596@svn.freebsd.org> From: Alan Cox Date: Tue, 28 Dec 2010 20:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216772 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 20:02:31 -0000 Author: alc Date: Tue Dec 28 20:02:30 2010 New Revision: 216772 URL: http://svn.freebsd.org/changeset/base/216772 Log: Correct a typo in vm_fault_quick_hold_pages(). Reported by: Bartosz Stec Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Tue Dec 28 19:26:57 2010 (r216771) +++ head/sys/vm/vm_fault.c Tue Dec 28 20:02:30 2010 (r216772) @@ -1084,7 +1084,7 @@ vm_fault_quick_hold_pages(vm_map_t map, if (*mp == NULL) pmap_failed = TRUE; else if ((prot & VM_PROT_WRITE) != 0 && - (*ma)->dirty != VM_PAGE_BITS_ALL) { + (*mp)->dirty != VM_PAGE_BITS_ALL) { /* * Explicitly dirty the physical page. Otherwise, the * caller's changes may go unnoticed because they are From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 20:11:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAD351065674; Tue, 28 Dec 2010 20:11:54 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA478FC17; Tue, 28 Dec 2010 20:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSKBs8W075829; Tue, 28 Dec 2010 20:11:54 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSKBsZe075827; Tue, 28 Dec 2010 20:11:54 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201012282011.oBSKBsZe075827@svn.freebsd.org> From: Juli Mallett Date: Tue, 28 Dec 2010 20:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216773 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 20:11:55 -0000 Author: jmallett Date: Tue Dec 28 20:11:54 2010 New Revision: 216773 URL: http://svn.freebsd.org/changeset/base/216773 Log: When allocating memory from bootmem for the kernel to use, try to leave about 2MB of memory in the bootmem allocator for the SDK to use internally at a later point. It'd be nice if there were some functions we could call before allocating memory to let various facilities reserve some memory, but for now this seems sufficient. Previously some unfortunate systems could give up all (or at least most) of their memory to the kernel from bootmem, and then allocating command queues for packet output and the like would fail later in the boot process (which in turn would lead to crashes even later.) Reported by: kan Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Tue Dec 28 20:02:30 2010 (r216772) +++ head/sys/mips/cavium/octeon_machdep.c Tue Dec 28 20:11:54 2010 (r216773) @@ -287,6 +287,14 @@ octeon_memory_init(void) */ i = 0; while (i < PHYS_AVAIL_ENTRIES) { + /* + * If there is less than 2MB of memory available in 128-byte + * blocks, do not steal any more memory. We need to leave some + * memory for the command queues to be allocated out of. + */ + if (cvmx_bootmem_available_mem(128) < 2 << 20) + break; + addr = cvmx_bootmem_phy_alloc(1 << 20, phys_end, ~(vm_paddr_t)0, PAGE_SIZE, 0); if (addr == -1) From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 21:12:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA902106564A; Tue, 28 Dec 2010 21:12:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F27B8FC08; Tue, 28 Dec 2010 21:12:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSLCFWa077291; Tue, 28 Dec 2010 21:12:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSLCFPx077289; Tue, 28 Dec 2010 21:12:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012282112.oBSLCFPx077289@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 28 Dec 2010 21:12:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216774 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 21:12:15 -0000 Author: pjd Date: Tue Dec 28 21:12:15 2010 New Revision: 216774 URL: http://svn.freebsd.org/changeset/base/216774 Log: ZFS might not return monotonically increasing directory offset cookies, so turn off UFS-specific hack that assumes so in ZFS case. Before the change we can miss returning some directory entries to a NFS client. I believe that the hack should be moved to ufs_readdir(), but until we find somebody who will do it, turn it off for ZFS in NFS server code. Submitted by: rmacklem Discussed with: rmacklem, mckusick MFC after: 3 days Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Tue Dec 28 20:11:54 2010 (r216773) +++ head/sys/nfsserver/nfs_serv.c Tue Dec 28 21:12:15 2010 (r216774) @@ -2737,7 +2737,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs int v3 = (nfsd->nd_flag & ND_NFSV3); u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ - int vfslocked; + int vfslocked, not_zfs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; @@ -2801,6 +2801,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs error = 0; goto nfsmout; } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; VOP_UNLOCK(vp, 0); /* @@ -2887,10 +2888,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -3037,6 +3040,7 @@ nfsrv_readdirplus(struct nfsrv_descript int usevget = 1, vfslocked; struct componentname cn; struct mount *mntp = NULL; + int not_zfs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; @@ -3097,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = 0; goto nfsmout; } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; VOP_UNLOCK(vp, 0); vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); @@ -3176,10 +3181,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 21:18:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90BDD106566C; Tue, 28 Dec 2010 21:18:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 802128FC1D; Tue, 28 Dec 2010 21:18:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSLIwWN077448; Tue, 28 Dec 2010 21:18:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSLIwp1077446; Tue, 28 Dec 2010 21:18:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012282118.oBSLIwp1077446@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Dec 2010 21:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216775 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 21:18:58 -0000 Author: imp Date: Tue Dec 28 21:18:58 2010 New Revision: 216775 URL: http://svn.freebsd.org/changeset/base/216775 Log: Due to the automatic inclusion of DEFAULTS everywhere, and since it has device mem in it almost everywhere, we get warnings about duplicated device almost everywhere. Comment it out, with a note about why, so that we don't get those warnings. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Dec 28 21:12:15 2010 (r216774) +++ head/sys/conf/NOTES Tue Dec 28 21:18:58 2010 (r216775) @@ -1110,7 +1110,8 @@ options VFS_AIO device random # The system memory devices; /dev/mem, /dev/kmem -device mem +# In various system's DEFAULTS file, so we don't need it here. +#device mem # The kernel symbol table device; /dev/ksyms device ksyms From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 21:20:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE4F7106566C; Tue, 28 Dec 2010 21:20:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADB2E8FC12; Tue, 28 Dec 2010 21:20:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSLKwfc077526; Tue, 28 Dec 2010 21:20:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSLKwJQ077524; Tue, 28 Dec 2010 21:20:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012282120.oBSLKwJQ077524@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Dec 2010 21:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216776 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 21:20:58 -0000 Author: imp Date: Tue Dec 28 21:20:58 2010 New Revision: 216776 URL: http://svn.freebsd.org/changeset/base/216776 Log: Remove mem, io, isa and npx since they are duplicative of the entries in DEFAULTS. Saves 8 lines of warnings when we build XBOX. Modified: head/sys/i386/conf/XBOX Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Tue Dec 28 21:18:58 2010 (r216775) +++ head/sys/i386/conf/XBOX Tue Dec 28 21:20:58 2010 (r216776) @@ -47,8 +47,6 @@ options TIMER_FREQ=1125000 # Gives ~733 #device apic # I/O APIC -# Bus support. Do not remove isa, even if you have no isa slots -device isa device pci # ATA and ATAPI devices @@ -61,13 +59,8 @@ options ATA_STATIC_ID # Static device n device scbus # SCSI bus (required for SCSI) device da # Direct Access (disks) -# Floating point support - do not disable. -device npx - # Pseudo devices. device loop # Network loopback -device mem # Memory and kernel memory devices -device io # I/O device device random # Entropy device device ether # Ethernet support #device tun # Packet tunnel. From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 21:22:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FE0E106566B; Tue, 28 Dec 2010 21:22:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F44D8FC15; Tue, 28 Dec 2010 21:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSLM8cu077596; Tue, 28 Dec 2010 21:22:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSLM8oe077594; Tue, 28 Dec 2010 21:22:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012282122.oBSLM8oe077594@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Dec 2010 21:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216777 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 21:22:08 -0000 Author: imp Date: Tue Dec 28 21:22:08 2010 New Revision: 216777 URL: http://svn.freebsd.org/changeset/base/216777 Log: Comment out npx and isa from NOTES file. We don't need them here since DEFAULTS already pulls them in. Modified: head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Dec 28 21:20:58 2010 (r216776) +++ head/sys/i386/conf/NOTES Tue Dec 28 21:22:08 2010 (r216777) @@ -284,7 +284,8 @@ device apm_saver # Requires APM # # ISA bus # -device isa # Required by npx(4) +# Already in DEFAULTS, which means we don't need it here. +#device isa # Required by npx(4) # # Options for `isa': @@ -372,7 +373,8 @@ options X86BIOS # # The Numeric Processing eXtension driver. This is non-optional. -device npx +# Already in DEFAULTS, which means we don't need it here. +#device npx hint.npx.0.flags="0x0" hint.npx.0.irq="13" From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 21:27:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 787851065670; Tue, 28 Dec 2010 21:27:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6695D8FC0C; Tue, 28 Dec 2010 21:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSLR8AM077726; Tue, 28 Dec 2010 21:27:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSLR8R9077721; Tue, 28 Dec 2010 21:27:08 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012282127.oBSLR8R9077721@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 28 Dec 2010 21:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216778 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 21:27:08 -0000 Author: jilles Date: Tue Dec 28 21:27:08 2010 New Revision: 216778 URL: http://svn.freebsd.org/changeset/base/216778 Log: sh: Don't do optimized command substitution if expansions have side effects. Before considering to execute a command substitution in the same process, check if any of the expansions may have a side effect; if so, execute it in a new process just like happens if it is not a single simple command. Although the check happens at run time, it is a static check that does not depend on current state. It is triggered by: - expanding $! (which may cause the job to be remembered) - ${var=value} default value assignment - assignment operators in arithmetic - parameter substitutions in arithmetic except ${#param}, $$, $# and $? - command substitutions in arithmetic This means that $((v+1)) does not prevent optimized command substitution, whereas $(($v+1)) does, because $v might expand to something containing assignment operators. Scripts should not depend on these exact details for correctness. It is also imaginable to have the shell fork if and when a side effect is encountered or to create a new temporary namespace for variables. Due to the $! change, the construct $(jobs $!) no longer works. The value of $! should be stored in a variable outside command substitution first. Added: head/tools/regression/bin/sh/expansion/cmdsubst7.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/expand.c head/bin/sh/expand.h Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Tue Dec 28 21:22:08 2010 (r216777) +++ head/bin/sh/eval.c Tue Dec 28 21:27:08 2010 (r216778) @@ -94,6 +94,7 @@ static void evalsubshell(union node *, i static void evalredir(union node *, int); static void expredir(union node *); static void evalpipe(union node *); +static int is_valid_fast_cmdsubst(union node *n); static void evalcommand(union node *, int, struct backcmd *); static void prehash(union node *); @@ -565,6 +566,19 @@ evalpipe(union node *n) +static int +is_valid_fast_cmdsubst(union node *n) +{ + union node *argp; + + if (n->type != NCMD) + return 0; + for (argp = n->ncmd.args ; argp ; argp = argp->narg.next) + if (expandhassideeffects(argp->narg.text)) + return 0; + return 1; +} + /* * Execute a command inside back quotes. If it's a builtin command, we * want to save its output in a block obtained from malloc. Otherwise @@ -590,7 +604,7 @@ evalbackcmd(union node *n, struct backcm exitstatus = 0; goto out; } - if (n->type == NCMD) { + if (is_valid_fast_cmdsubst(n)) { exitstatus = oexitstatus; savehandler = handler; if (setjmp(jmploc.loc)) { Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Tue Dec 28 21:22:08 2010 (r216777) +++ head/bin/sh/expand.c Tue Dec 28 21:27:08 2010 (r216778) @@ -1570,6 +1570,78 @@ cvtnum(int num, char *buf) } /* + * Check statically if expanding a string may have side effects. + */ +int +expandhassideeffects(const char *p) +{ + int c; + int arinest; + + arinest = 0; + while ((c = *p++) != '\0') { + switch (c) { + case CTLESC: + p++; + break; + case CTLVAR: + c = *p++; + /* Expanding $! sets the job to remembered. */ + if (*p == '!') + return 1; + if ((c & VSTYPE) == VSASSIGN) + return 1; + /* + * If we are in arithmetic, the parameter may contain + * '=' which may cause side effects. Exceptions are + * the length of a parameter and $$, $# and $? which + * are always numeric. + */ + if ((c & VSTYPE) == VSLENGTH) { + while (*p != '=') + p++; + p++; + break; + } + if ((*p == '$' || *p == '#' || *p == '?') && + p[1] == '=') { + p += 2; + break; + } + if (arinest > 0) + return 1; + break; + case CTLBACKQ: + case CTLBACKQ | CTLQUOTE: + if (arinest > 0) + return 1; + break; + case CTLARI: + arinest++; + break; + case CTLENDARI: + arinest--; + break; + case '=': + if (*p == '=') { + /* Allow '==' operator. */ + p++; + continue; + } + if (arinest > 0) + return 1; + break; + case '!': case '<': case '>': + /* Allow '!=', '<=', '>=' operators. */ + if (*p == '=') + p++; + break; + } + } + return 0; +} + +/* * Do most of the work for wordexp(3). */ Modified: head/bin/sh/expand.h ============================================================================== --- head/bin/sh/expand.h Tue Dec 28 21:22:08 2010 (r216777) +++ head/bin/sh/expand.h Tue Dec 28 21:27:08 2010 (r216778) @@ -63,4 +63,5 @@ void expari(int); int patmatch(const char *, const char *, int); void rmescapes(char *); int casematch(union node *, const char *); +int expandhassideeffects(const char *); int wordexpcmd(int, char **); Added: head/tools/regression/bin/sh/expansion/cmdsubst7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst7.0 Tue Dec 28 21:27:08 2010 (r216778) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +failures='' +ok='' + +testcase() { + code="$1" + + unset v + eval ": \$($code)" + + if [ "${v:+bad}" = "" ]; then + ok=x$ok + else + failures=x$failures + echo "Failure for $code" + fi +} + +testcase ': ${v=0}' +testcase ': ${v:=0}' +testcase ': $((v=1))' +testcase ': $((v+=1))' +w='v=1' +testcase ': $(($w))' +testcase ': $((${$+v=1}))' +testcase ': $((v${$+=1}))' +testcase ': $((v $(echo =) 1))' +testcase ': $(($(echo $w)))' + +test "x$failures" = x From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 22:31:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2096106566B; Tue, 28 Dec 2010 22:31:59 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 955C38FC0C; Tue, 28 Dec 2010 22:31:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSMVxTd079169; Tue, 28 Dec 2010 22:31:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSMVxhW079167; Tue, 28 Dec 2010 22:31:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201012282231.oBSMVxhW079167@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 28 Dec 2010 22:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216780 - head/libexec/rtld-elf/powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 22:31:59 -0000 Author: nwhitehorn Date: Tue Dec 28 22:31:59 2010 New Revision: 216780 URL: http://svn.freebsd.org/changeset/base/216780 Log: Fix an error in the ABI in rtld_bind_start(). When passing arguments to a C function, the caller's stack frame must have room to store all of the arguments to that function. While here, fix stack frame alignment issues. Without this change, the compiler will save r3 and r4 into the caller's stack frame before calling setjmp() in _rtld_bind(). These would then overwrite arguments to the newly-bound function, causing eventual failures. Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S Modified: head/libexec/rtld-elf/powerpc64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_start.S Tue Dec 28 21:40:19 2010 (r216779) +++ head/libexec/rtld-elf/powerpc64/rtld_start.S Tue Dec 28 22:31:59 2010 (r216780) @@ -35,15 +35,15 @@ .extern _DYNAMIC _ENTRY(_rtld_start) - stdu %r1,-96(%r1) /* 16-byte aligned stack for reg saves + + stdu %r1,-144(%r1) /* 16-byte aligned stack for reg saves + exit_proc & obj _rtld args + backchain & lrsave stack frame */ - std %r3,48(%r1) /* argc */ - std %r4,56(%r1) /* argv */ - std %r5,64(%r1) /* envp */ -/* std %r6,72(%r1) *//* obj (always 0) */ -/* std %r7,80(%r1) *//* cleanup (always 0) */ - std %r8,88(%r1) /* ps_strings */ + std %r3,96(%r1) /* argc */ + std %r4,104(%r1) /* argv */ + std %r5,112(%r1) /* envp */ +/* std %r6,120(%r1) *//* obj (always 0) */ +/* std %r7,128(%r1) *//* cleanup (always 0) */ + std %r8,136(%r1) /* ps_strings */ /* * Perform initial relocation of ld-elf.so. Not as easy as it @@ -75,10 +75,10 @@ _ENTRY(_rtld_start) * original stack layout has to be found by moving back a word * from the argv pointer. */ - ld %r4,56(%r1) + ld %r4,104(%r1) addi %r3,%r4,-8 /* locate argc ptr, &argv[-1] */ - addi %r4,%r1,80 /* &exit_proc on stack */ - addi %r5,%r1,72 /* &obj_main on stack */ + addi %r4,%r1,128 /* &exit_proc on stack */ + addi %r5,%r1,120 /* &obj_main on stack */ bl ._rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ nop @@ -90,12 +90,12 @@ _ENTRY(_rtld_start) /* * Restore args, with new obj/exit proc */ - ld %r3,48(%r1) /* argc */ - ld %r4,56(%r1) /* argv */ - ld %r5,64(%r1) /* envp */ - ld %r6,72(%r1) /* obj */ - ld %r7,80(%r1) /* exit proc */ - ld %r8,88(%r1) /* ps_strings */ + ld %r3,96(%r1) /* argc */ + ld %r4,104(%r1) /* argv */ + ld %r5,112(%r1) /* envp */ + ld %r6,120(%r1) /* obj */ + ld %r7,128(%r1) /* exit proc */ + ld %r8,136(%r1) /* ps_strings */ blrl /* _start(argc, argv, envp, obj, cleanup, ps_strings) */ @@ -119,16 +119,17 @@ _ENTRY(_rtld_bind_start) mfcr %r0 std %r0,8(%r1) # save cr - stdu %r1,-48-9*8(%r1) # stack space for 8 regs + header - std %r3,48+0*8(%r1) # save r3-r31 - std %r4,48+1*8(%r1) - std %r5,48+2*8(%r1) - std %r6,48+3*8(%r1) - std %r7,48+4*8(%r1) - std %r8,48+5*8(%r1) - std %r9,48+6*8(%r1) - std %r10,48+7*8(%r1) - std %r12,48+8*8(%r1) + stdu %r1,-48-12*8(%r1) # stack space for 8 regs + header + # + 2 save regs + std %r3,64+0*8(%r1) # save r3-r31 + std %r4,64+1*8(%r1) + std %r5,64+2*8(%r1) + std %r6,64+3*8(%r1) + std %r7,64+4*8(%r1) + std %r8,64+5*8(%r1) + std %r9,64+6*8(%r1) + std %r10,64+7*8(%r1) + std %r12,64+8*8(%r1) ld %r3,0(%r11) ld %r4,8(%r11) @@ -140,22 +141,21 @@ _ENTRY(_rtld_bind_start) ld %r3,0(%r3) mtctr %r3 # move absolute target addr into ctr - ld %r3,48+0*8(%r1) # restore r3-r31 - ld %r4,48+1*8(%r1) - ld %r5,48+2*8(%r1) - ld %r6,48+3*8(%r1) - ld %r7,48+4*8(%r1) - ld %r8,48+5*8(%r1) - ld %r9,48+6*8(%r1) - ld %r10,48+7*8(%r1) - ld %r12,48+8*8(%r1) - - addi %r1,%r1,48+9*8 # restore stack - - ld %r0,8(%r1) # restore cr - mtcr %r0 - ld %r0,16(%r1) # restore lr - mtlr %r0 + ld %r3,64+0*8(%r1) # restore r3-r31 + ld %r4,64+1*8(%r1) + ld %r5,64+2*8(%r1) + ld %r6,64+3*8(%r1) + ld %r7,64+4*8(%r1) + ld %r8,64+5*8(%r1) + ld %r9,64+6*8(%r1) + ld %r10,64+7*8(%r1) + ld %r12,64+8*8(%r1) + + ld %r1,0(%r1) # restore stack + ld %r0,8(%r1) # restore cr + mtcr %r0 + ld %r0,16(%r1) # restore lr + mtlr %r0 - bctr # jump to target + bctr # jump to target From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 22:44:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0FAD1065672; Tue, 28 Dec 2010 22:44:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F1E08FC22; Tue, 28 Dec 2010 22:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSMiW18079464; Tue, 28 Dec 2010 22:44:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSMiWQB079462; Tue, 28 Dec 2010 22:44:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012282244.oBSMiWQB079462@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Dec 2010 22:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216781 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 22:44:32 -0000 Author: imp Date: Tue Dec 28 22:44:32 2010 New Revision: 216781 URL: http://svn.freebsd.org/changeset/base/216781 Log: Revert r216775, per jhb@ Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Dec 28 22:31:59 2010 (r216780) +++ head/sys/conf/NOTES Tue Dec 28 22:44:32 2010 (r216781) @@ -1110,8 +1110,7 @@ options VFS_AIO device random # The system memory devices; /dev/mem, /dev/kmem -# In various system's DEFAULTS file, so we don't need it here. -#device mem +device mem # The kernel symbol table device; /dev/ksyms device ksyms From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 22:45:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D07B1065697; Tue, 28 Dec 2010 22:45:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8A88FC1A; Tue, 28 Dec 2010 22:45:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSMjU2h079525; Tue, 28 Dec 2010 22:45:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSMjUDL079523; Tue, 28 Dec 2010 22:45:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012282245.oBSMjUDL079523@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Dec 2010 22:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216782 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 22:45:30 -0000 Author: imp Date: Tue Dec 28 22:45:29 2010 New Revision: 216782 URL: http://svn.freebsd.org/changeset/base/216782 Log: Revert r216777, per jhb@ Modified: head/sys/i386/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Tue Dec 28 22:44:32 2010 (r216781) +++ head/sys/i386/conf/NOTES Tue Dec 28 22:45:29 2010 (r216782) @@ -284,8 +284,7 @@ device apm_saver # Requires APM # # ISA bus # -# Already in DEFAULTS, which means we don't need it here. -#device isa # Required by npx(4) +device isa # Required by npx(4) # # Options for `isa': @@ -373,8 +372,7 @@ options X86BIOS # # The Numeric Processing eXtension driver. This is non-optional. -# Already in DEFAULTS, which means we don't need it here. -#device npx +device npx hint.npx.0.flags="0x0" hint.npx.0.irq="13" From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 22:49:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4DF61065670; Tue, 28 Dec 2010 22:49:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 945528FC16; Tue, 28 Dec 2010 22:49:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSMnS1A079633; Tue, 28 Dec 2010 22:49:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSMnS5b079631; Tue, 28 Dec 2010 22:49:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201012282249.oBSMnS5b079631@svn.freebsd.org> From: Warner Losh Date: Tue, 28 Dec 2010 22:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216783 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 22:49:28 -0000 Author: imp Date: Tue Dec 28 22:49:28 2010 New Revision: 216783 URL: http://svn.freebsd.org/changeset/base/216783 Log: MIPS has lots of flavors as well Modified: head/sys/conf/makeLINT.mk Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Tue Dec 28 22:45:29 2010 (r216782) +++ head/sys/conf/makeLINT.mk Tue Dec 28 22:49:28 2010 (r216783) @@ -17,6 +17,6 @@ LINT: ${NOTES} ../../conf/makeLINT.sed echo "ident ${.TARGET}-VIMAGE" >> ${.TARGET}-VIMAGE echo "options VIMAGE" >> ${.TARGET}-VIMAGE .endif -.if ${TARGET} == "powerpc" +.if ${TARGET} == "powerpc" || ${TARGET} == "mips" echo "machine ${TARGET} ${TARGET_ARCH}" >> ${.TARGET} .endif From owner-svn-src-all@FreeBSD.ORG Tue Dec 28 23:50:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1891106566B; Tue, 28 Dec 2010 23:50:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C65EF8FC17; Tue, 28 Dec 2010 23:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBSNoDdE080917; Tue, 28 Dec 2010 23:50:13 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBSNoDeX080914; Tue, 28 Dec 2010 23:50:13 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012282350.oBSNoDeX080914@svn.freebsd.org> From: Rick Macklem Date: Tue, 28 Dec 2010 23:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216784 - in head/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Dec 2010 23:50:14 -0000 Author: rmacklem Date: Tue Dec 28 23:50:13 2010 New Revision: 216784 URL: http://svn.freebsd.org/changeset/base/216784 Log: Delete the nfsvno_localconflict() function in the experimental NFS server since it is no longer used and is broken. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Tue Dec 28 22:49:28 2010 (r216783) +++ head/sys/fs/nfs/nfs_var.h Tue Dec 28 23:50:13 2010 (r216784) @@ -569,8 +569,6 @@ int nfsvno_fhtovp(mount_t, fhandle_t *, int nfsvno_pathconf(vnode_t, int, register_t *, struct ucred *, NFSPROC_T *); vnode_t nfsvno_getvp(fhandle_t *); -int nfsvno_localconflict(vnode_t, int, u_int64_t, u_int64_t, - struct nfslockconflict *, NFSPROC_T *); int nfsvno_advlock(vnode_t, int, u_int64_t, u_int64_t, NFSPROC_T *); void nfsvno_unlockvfs(mount_t); int nfsvno_lockvfs(mount_t); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 28 22:49:28 2010 (r216783) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 28 23:50:13 2010 (r216784) @@ -2781,66 +2781,6 @@ nfsvno_getvp(fhandle_t *fhp) } /* - * Check to see it a byte range lock held by a process running - * locally on the server conflicts with the new lock. - */ -int -nfsvno_localconflict(struct vnode *vp, int ftype, u_int64_t first, - u_int64_t end, struct nfslockconflict *cfp, struct thread *td) -{ - int error; - struct flock fl; - - if (!nfsrv_dolocallocks) - return (0); - fl.l_whence = SEEK_SET; - fl.l_type = ftype; - fl.l_start = (off_t)first; - if (end == NFS64BITSSET) - fl.l_len = 0; - else - fl.l_len = (off_t)(end - first); - /* - * For FreeBSD8, the l_pid and l_sysid must be set to the same - * values for all calls, so that all locks will be held by the - * nfsd server. (The nfsd server handles conflicts between the - * various clients.) - * Since an NFSv4 lockowner is a ClientID plus an array of up to 1024 - * bytes, so it can't be put in l_sysid. - */ - if (nfsv4_sysid == 0) - nfsv4_sysid = nlm_acquire_next_sysid(); - fl.l_pid = (pid_t)0; - fl.l_sysid = (int)nfsv4_sysid; - - NFSVOPUNLOCK(vp, 0, td); - error = VOP_ADVLOCK(vp, (caddr_t)td->td_proc, F_GETLK, &fl, - (F_POSIX | F_REMOTE)); - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, td); - if (error) - return (error); - if (fl.l_type == F_UNLCK) - return (0); - if (cfp != NULL) { - cfp->cl_clientid.lval[0] = cfp->cl_clientid.lval[1] = 0; - cfp->cl_first = (u_int64_t)fl.l_start; - if (fl.l_len == 0) - cfp->cl_end = NFS64BITSSET; - else - cfp->cl_end = (u_int64_t) - (fl.l_start + fl.l_len); - if (fl.l_type == F_WRLCK) - cfp->cl_flags = NFSLCK_WRITE; - else - cfp->cl_flags = NFSLCK_READ; - sprintf(cfp->cl_owner, "LOCALID%d", fl.l_pid); - cfp->cl_ownerlen = strlen(cfp->cl_owner); - return (NFSERR_DENIED); - } - return (NFSERR_INVAL); -} - -/* * Do a local VOP_ADVLOCK(). */ int From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 00:32:24 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08AC7106566C; Wed, 29 Dec 2010 00:32:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE248FC0A; Wed, 29 Dec 2010 00:32:23 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBT0WJ6U025879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Dec 2010 11:32:20 +1100 Date: Wed, 29 Dec 2010 11:32:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201012281858.oBSIwGOx074037@svn.freebsd.org> Message-ID: <20101229111431.X1083@besplex.bde.org> References: <201012281858.oBSIwGOx074037@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216769 - head/usr.bin/gcore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 00:32:24 -0000 On Tue, 28 Dec 2010, John Baldwin wrote: > Log: > Start sentences on a new line to ease life for translators. Tweak the > wording in a few places. Simplifying life for translators is only a side effect. > Modified: head/usr.bin/gcore/gcore.1 > ============================================================================== > --- head/usr.bin/gcore/gcore.1 Tue Dec 28 18:56:55 2010 (r216768) > +++ head/usr.bin/gcore/gcore.1 Tue Dec 28 18:58:15 2010 (r216769) > @@ -59,12 +59,13 @@ The following options are available: > Write the core file to the specified file instead of > .Dq Pa core. . > .It Fl f > -Dumps all the available segments, excluding only the malformed ones and > -un-dumpable ones. Unlike the default invocation, it also dumps > -device- and sglist-mapped areas that may invalidate the state of > -some transactions. This flag must be used very carefully, when the > -behavior of the application is fully understood and the fallouts can > -be easily controlled. Hard coded sentence breaks gave formatting that might be, and in fact was wrong for at least -Tascii format, since 1 space was hard coded but the default is the normal 2 spaces. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 02:54:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7DE91065670; Wed, 29 Dec 2010 02:54:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95F0E8FC17; Wed, 29 Dec 2010 02:54:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBT2sfbf084844; Wed, 29 Dec 2010 02:54:41 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBT2sflv084842; Wed, 29 Dec 2010 02:54:41 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012290254.oBT2sflv084842@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 Dec 2010 02:54:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216786 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 02:54:41 -0000 Author: rmacklem Date: Wed Dec 29 02:54:41 2010 New Revision: 216786 URL: http://svn.freebsd.org/changeset/base/216786 Log: MFC: r216691 Since VOP_READDIR() for ZFS does not return monotonically increasing directory offset cookies, disable the UFS related loop that skips over directory entries at the beginning of the block for the experimental NFS server. This loop is required for UFS since it always returns directory entries starting at the beginning of the block that the requested directory offset is in. In discussion with pjd@ and mckusick@ it seems that this behaviour of UFS should maybe change, with this fix being an interim patch until then. This patch only fixes the experimental server, since pjd@ is working on a patch for the regular server. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 29 02:24:43 2010 (r216785) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 29 02:54:41 2010 (r216786) @@ -1432,6 +1432,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd u_long *cookies = NULL, *cookiep; struct uio io; struct iovec iv; + int not_zfs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1484,6 +1485,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd nfsrv_postopattr(nd, getret, &at); return (0); } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); NFSVOPUNLOCK(vp, 0, p); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1566,10 +1568,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -1678,6 +1682,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct uio io; struct iovec iv; struct componentname cn; + int not_zfs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1755,6 +1760,7 @@ nfsrvd_readdirplus(struct nfsrv_descript nfsrv_postopattr(nd, getret, &at); return (0); } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1827,10 +1833,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff || + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff) || ((nd->nd_flag & ND_NFSV4) && ((dp->d_namlen == 1 && dp->d_name[0] == '.') || (dp->d_namlen==2 && dp->d_name[0]=='.' && dp->d_name[1]=='.'))))) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 03:34:28 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582AB106566B; Wed, 29 Dec 2010 03:34:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id E85758FC16; Wed, 29 Dec 2010 03:34:27 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oBT3YOqf015298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Dec 2010 14:34:26 +1100 Date: Wed, 29 Dec 2010 14:34:24 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh In-Reply-To: <201012282245.oBSMjUDL079523@svn.freebsd.org> Message-ID: <20101229143323.D1646@besplex.bde.org> References: <201012282245.oBSMjUDL079523@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216782 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 03:34:28 -0000 On Tue, 28 Dec 2010, Warner Losh wrote: > Log: > Revert r216777, per jhb@ I didn't see "per jhb@". I think the bug DEFAULTS being included unconditionally (and maybe the name of DEFAULTS -- defaults hould be optional). > Modified: head/sys/i386/conf/NOTES > ============================================================================== > --- head/sys/i386/conf/NOTES Tue Dec 28 22:44:32 2010 (r216781) > +++ head/sys/i386/conf/NOTES Tue Dec 28 22:45:29 2010 (r216782) > @@ -284,8 +284,7 @@ device apm_saver # Requires APM > # > # ISA bus > # > -# Already in DEFAULTS, which means we don't need it here. > -#device isa # Required by npx(4) > +device isa # Required by npx(4) This comment seems wrong. isa used to be required for the isa resources related to irq13, but npx no longer supports irq13. It now seems to use isa only for PNPBIOS, but that is ifdefed so it doesn't require isa (except for test coverage). > > # > # Options for `isa': > @@ -373,8 +372,7 @@ options X86BIOS > > # > # The Numeric Processing eXtension driver. This is non-optional. > -# Already in DEFAULTS, which means we don't need it here. > -#device npx > +device npx > hint.npx.0.flags="0x0" > hint.npx.0.irq="13" > These hints are more clearly garbage: - the flags hint hasn't worked since FreeBSD-4 or earlier, where it controlled use of npx for bcopy and bzero (but this use stopped being useful with Pentium 1's many years before FreeBSD-4 was released). The flags hint remained referenced until rev.1.182 (2010/06/23), but only in ifdefed-out code. Then the dead code was removed too. - the support for irq13 was removed in rev.1.183 (also on 2010/06/23). npx.c still has some references to removed code in comments (several IRQ13's and one "BUSY# latch". The BUSY# latch was only ISA address used IIRC. npx used to use nexus for configuring the flags and irq at least. I think it no longer does, but nexus.c still gives npx as an example of special handling in a comment. npx.4 still has hints for the unused(?) nexus, the unused port for the BUSY# latch, the unused flags for bcopying (including a very detailed description of when these flags are applied, which rotted started with ifdefing out the code that applied them), and the unused irq. After removing these anachronisms including the BUGS section (which is entirely FUD about the unused irq13), npx.4 has about 5 useful lines. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 04:07:11 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12AA01065675; Wed, 29 Dec 2010 04:07:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B79C68FC0A; Wed, 29 Dec 2010 04:07:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBT3xtjN083793; Tue, 28 Dec 2010 20:59:56 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1AB23A.8080307@bsdimp.com> Date: Tue, 28 Dec 2010 20:59:54 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Bruce Evans References: <201012282245.oBSMjUDL079523@svn.freebsd.org> <20101229143323.D1646@besplex.bde.org> In-Reply-To: <20101229143323.D1646@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Warner Losh Subject: Re: svn commit: r216782 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 04:07:11 -0000 On 12/28/2010 20:34, Bruce Evans wrote: > On Tue, 28 Dec 2010, Warner Losh wrote: > >> Log: >> Revert r216777, per jhb@ > > I didn't see "per jhb@". I think the bug DEFAULTS being included > unconditionally (and maybe the name of DEFAULTS -- defaults hould be > optional). I'm working up a patch to address these concerns. I'll include you on the reviewer list. >> Modified: head/sys/i386/conf/NOTES >> ============================================================================== >> >> --- head/sys/i386/conf/NOTES Tue Dec 28 22:44:32 2010 (r216781) >> +++ head/sys/i386/conf/NOTES Tue Dec 28 22:45:29 2010 (r216782) >> @@ -284,8 +284,7 @@ device apm_saver # Requires APM >> # >> # ISA bus >> # >> -# Already in DEFAULTS, which means we don't need it here. >> -#device isa # Required by npx(4) >> +device isa # Required by npx(4) > > This comment seems wrong. isa used to be required for the isa resources > related to irq13, but npx no longer supports irq13. It now seems to use > isa only for PNPBIOS, but that is ifdefed so it doesn't require isa > (except for test coverage). I think you may be right. ISA is still required, but not for the reason listed here. >> # >> # Options for `isa': >> @@ -373,8 +372,7 @@ options X86BIOS >> >> # >> # The Numeric Processing eXtension driver. This is non-optional. >> -# Already in DEFAULTS, which means we don't need it here. >> -#device npx >> +device npx >> hint.npx.0.flags="0x0" >> hint.npx.0.irq="13" >> > > These hints are more clearly garbage: > - the flags hint hasn't worked since FreeBSD-4 or earlier, where it > controlled use of npx for bcopy and bzero (but this use stopped being > useful with Pentium 1's many years before FreeBSD-4 was released). > The flags hint remained referenced until rev.1.182 (2010/06/23), but > only in ifdefed-out code. Then the dead code was removed too. > - the support for irq13 was removed in rev.1.183 (also on 2010/06/23). > > npx.c still has some references to removed code in comments (several > IRQ13's > and one "BUSY# latch". The BUSY# latch was only ISA address used IIRC. > > npx used to use nexus for configuring the flags and irq at least. I > think > it no longer does, but nexus.c still gives npx as an example of special > handling in a comment. > > npx.4 still has hints for the unused(?) nexus, the unused port for the > BUSY# > latch, the unused flags for bcopying (including a very detailed > description > of when these flags are applied, which rotted started with ifdefing > out the > code that applied them), and the unused irq. After removing these > anachronisms including the BUGS section (which is entirely FUD about the > unused irq13), npx.4 has about 5 useful lines. I'm sure that nobody would object in the slightest if you did a pass over the code and manual page and fixed it up. I doubt anybody else could double the useful line count, let alone make it correct :) Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 05:13:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81CA3106564A; Wed, 29 Dec 2010 05:13:21 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 708A28FC08; Wed, 29 Dec 2010 05:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBT5DLs2088229; Wed, 29 Dec 2010 05:13:21 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBT5DLJN088227; Wed, 29 Dec 2010 05:13:21 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012290513.oBT5DLJN088227@svn.freebsd.org> From: Colin Percival Date: Wed, 29 Dec 2010 05:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216790 - head/sys/dev/xen/console X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 05:13:21 -0000 Author: cperciva Date: Wed Dec 29 05:13:21 2010 New Revision: 216790 URL: http://svn.freebsd.org/changeset/base/216790 Log: A lack of console input is not the same thing as a byte of \0 input. Correctly return -1 from cngetc when no input is available to be read. This fixes the '(CTRL-C to abort)' spam while dumping. MFC after: 3 days Modified: head/sys/dev/xen/console/console.c Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Wed Dec 29 04:17:50 2010 (r216789) +++ head/sys/dev/xen/console/console.c Wed Dec 29 05:13:21 2010 (r216790) @@ -125,17 +125,18 @@ xc_cnterm(struct consdev *cp) static int xc_cngetc(struct consdev *dev) { - int ret = (xc_mute ? 0 : -1); + int ret; if (xencons_has_input()) xencons_handle_input(NULL); CN_LOCK(cn_mtx); - if ((rp - rc)) { + if ((rp - rc) && !xc_mute) { /* we need to return only one char */ ret = (int)rbuf[RBUF_MASK(rc)]; rc++; - } + } else + ret = -1; CN_UNLOCK(cn_mtx); return(ret); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 09:26:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 475041065673; Wed, 29 Dec 2010 09:26:47 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 352078FC15; Wed, 29 Dec 2010 09:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBT9Ql6k094182; Wed, 29 Dec 2010 09:26:47 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBT9Ql7g094176; Wed, 29 Dec 2010 09:26:47 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201012290926.oBT9Ql7g094176@svn.freebsd.org> From: David Xu Date: Wed, 29 Dec 2010 09:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216791 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 09:26:47 -0000 Author: davidxu Date: Wed Dec 29 09:26:46 2010 New Revision: 216791 URL: http://svn.freebsd.org/changeset/base/216791 Log: - Follow r216313, the sched_unlend_user_prio is no longer needed, always use sched_lend_user_prio to set lent priority. - Improve pthread priority-inherit mutex, when a contender's priority is lowered, repropagete priorities, this may cause mutex owner's priority to be lowerd, in old code, mutex owner's priority is rise-only. Modified: head/sys/kern/kern_resource.c head/sys/kern/kern_umtx.c head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/sys/sched.h Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Wed Dec 29 05:13:21 2010 (r216790) +++ head/sys/kern/kern_resource.c Wed Dec 29 09:26:46 2010 (r216791) @@ -489,8 +489,10 @@ rtp_to_pri(struct rtprio *rtp, struct th if (curthread == td) sched_prio(curthread, td->td_user_pri); /* XXX dubious */ if (TD_ON_UPILOCK(td) && oldpri != newpri) { + critical_enter(); thread_unlock(td); umtx_pi_adjust(td, oldpri); + critical_exit(); } else thread_unlock(td); return (0); Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Dec 29 05:13:21 2010 (r216790) +++ head/sys/kern/kern_umtx.c Wed Dec 29 09:26:46 2010 (r216791) @@ -243,7 +243,6 @@ static int umtx_key_get(void *addr, int static void umtx_key_release(struct umtx_key *key); static struct umtx_pi *umtx_pi_alloc(int); static void umtx_pi_free(struct umtx_pi *pi); -static void umtx_pi_adjust_locked(struct thread *td, u_char oldpri); static int do_unlock_pp(struct thread *td, struct umutex *m, uint32_t flags); static void umtx_thread_cleanup(struct thread *td); static void umtx_exec_hook(void *arg __unused, struct proc *p __unused, @@ -1428,9 +1427,10 @@ umtx_propagate_priority(struct thread *t */ uq = td->td_umtxq; pi = uq->uq_pi_blocked; - /* Resort td on the list if needed. */ - if (!umtx_pi_adjust_thread(pi, td)) + if (pi == NULL) break; + /* Resort td on the list if needed. */ + umtx_pi_adjust_thread(pi, td); } } @@ -1439,11 +1439,11 @@ umtx_propagate_priority(struct thread *t * it is interrupted by signal or resumed by others. */ static void -umtx_unpropagate_priority(struct umtx_pi *pi) +umtx_repropagate_priority(struct umtx_pi *pi) { struct umtx_q *uq, *uq_owner; struct umtx_pi *pi2; - int pri, oldpri; + int pri; mtx_assert(&umtx_lock, MA_OWNED); @@ -1462,12 +1462,10 @@ umtx_unpropagate_priority(struct umtx_pi if (pri > uq_owner->uq_inherited_pri) pri = uq_owner->uq_inherited_pri; thread_lock(pi->pi_owner); - oldpri = pi->pi_owner->td_user_pri; - sched_unlend_user_prio(pi->pi_owner, pri); + sched_lend_user_prio(pi->pi_owner, pri); thread_unlock(pi->pi_owner); - if (uq_owner->uq_pi_blocked != NULL) - umtx_pi_adjust_locked(pi->pi_owner, oldpri); - pi = uq_owner->uq_pi_blocked; + if ((pi = uq_owner->uq_pi_blocked) != NULL) + umtx_pi_adjust_thread(pi, uq_owner->uq_thread); } } @@ -1524,31 +1522,6 @@ umtx_pi_claim(struct umtx_pi *pi, struct return (0); } -static void -umtx_pi_adjust_locked(struct thread *td, u_char oldpri) -{ - struct umtx_q *uq; - struct umtx_pi *pi; - - uq = td->td_umtxq; - /* - * Pick up the lock that td is blocked on. - */ - pi = uq->uq_pi_blocked; - MPASS(pi != NULL); - - /* Resort the turnstile on the list. */ - if (!umtx_pi_adjust_thread(pi, td)) - return; - - /* - * If our priority was lowered and we are at the head of the - * turnstile, then propagate our new priority up the chain. - */ - if (uq == TAILQ_FIRST(&pi->pi_blocked) && UPRI(td) < oldpri) - umtx_propagate_priority(td); -} - /* * Adjust a thread's order position in its blocked PI mutex, * this may result new priority propagating process. @@ -1565,8 +1538,10 @@ umtx_pi_adjust(struct thread *td, u_char * Pick up the lock that td is blocked on. */ pi = uq->uq_pi_blocked; - if (pi != NULL) - umtx_pi_adjust_locked(td, oldpri); + if (pi != NULL) { + umtx_pi_adjust_thread(pi, td); + umtx_repropagate_priority(pi); + } mtx_unlock_spin(&umtx_lock); } @@ -1635,7 +1610,7 @@ umtxq_sleep_pi(struct umtx_q *uq, struct td->td_flags &= ~TDF_UPIBLOCKED; thread_unlock(td); TAILQ_REMOVE(&pi->pi_blocked, uq, uq_lockq); - umtx_unpropagate_priority(pi); + umtx_repropagate_priority(pi); mtx_unlock_spin(&umtx_lock); umtxq_unlock(&uq->uq_key); @@ -1937,7 +1912,7 @@ do_unlock_pi(struct thread *td, struct u } } thread_lock(curthread); - sched_unlend_user_prio(curthread, pri); + sched_lend_user_prio(curthread, pri); thread_unlock(curthread); mtx_unlock_spin(&umtx_lock); if (uq_first) @@ -2062,7 +2037,7 @@ _do_lock_pp(struct thread *td, struct um if (pri > uq->uq_inherited_pri) pri = uq->uq_inherited_pri; thread_lock(td); - sched_unlend_user_prio(td, pri); + sched_lend_user_prio(td, pri); thread_unlock(td); mtx_unlock_spin(&umtx_lock); } @@ -2081,7 +2056,7 @@ _do_lock_pp(struct thread *td, struct um if (pri > uq->uq_inherited_pri) pri = uq->uq_inherited_pri; thread_lock(td); - sched_unlend_user_prio(td, pri); + sched_lend_user_prio(td, pri); thread_unlock(td); mtx_unlock_spin(&umtx_lock); } @@ -2172,7 +2147,7 @@ do_unlock_pp(struct thread *td, struct u if (pri > uq->uq_inherited_pri) pri = uq->uq_inherited_pri; thread_lock(td); - sched_unlend_user_prio(td, pri); + sched_lend_user_prio(td, pri); thread_unlock(td); mtx_unlock_spin(&umtx_lock); } @@ -3680,6 +3655,6 @@ umtx_thread_cleanup(struct thread *td) } mtx_unlock_spin(&umtx_lock); thread_lock(td); - sched_unlend_user_prio(td, PRI_MAX); + sched_lend_user_prio(td, PRI_MAX); thread_unlock(td); } Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Wed Dec 29 05:13:21 2010 (r216790) +++ head/sys/kern/sched_4bsd.c Wed Dec 29 09:26:46 2010 (r216791) @@ -892,24 +892,12 @@ sched_lend_user_prio(struct thread *td, { THREAD_LOCK_ASSERT(td, MA_OWNED); - if (prio < td->td_lend_user_pri) - td->td_lend_user_pri = prio; - if (prio < td->td_user_pri) - td->td_user_pri = prio; -} - -void -sched_unlend_user_prio(struct thread *td, u_char prio) -{ - u_char base_pri; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - base_pri = td->td_base_user_pri; td->td_lend_user_pri = prio; - if (prio > base_pri) - td->td_user_pri = base_pri; - else - td->td_user_pri = prio; + td->td_user_pri = min(prio, td->td_base_user_pri); + if (td->td_priority > td->td_user_pri) + sched_prio(td, td->td_user_pri); + else if (td->td_priority != td->td_user_pri) + td->td_flags |= TDF_NEEDRESCHED; } void Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Dec 29 05:13:21 2010 (r216790) +++ head/sys/kern/sched_ule.c Wed Dec 29 09:26:46 2010 (r216791) @@ -1687,24 +1687,12 @@ sched_lend_user_prio(struct thread *td, { THREAD_LOCK_ASSERT(td, MA_OWNED); - if (prio < td->td_lend_user_pri) - td->td_lend_user_pri = prio; - if (prio < td->td_user_pri) - td->td_user_pri = prio; -} - -void -sched_unlend_user_prio(struct thread *td, u_char prio) -{ - u_char base_pri; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - base_pri = td->td_base_user_pri; td->td_lend_user_pri = prio; - if (prio > base_pri) - td->td_user_pri = base_pri; - else - td->td_user_pri = prio; + td->td_user_pri = min(prio, td->td_base_user_pri); + if (td->td_priority > td->td_user_pri) + sched_prio(td, td->td_user_pri); + else if (td->td_priority != td->td_user_pri) + td->td_flags |= TDF_NEEDRESCHED; } /* Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Wed Dec 29 05:13:21 2010 (r216790) +++ head/sys/sys/sched.h Wed Dec 29 09:26:46 2010 (r216791) @@ -99,7 +99,6 @@ void sched_sleep(struct thread *td, int void sched_switch(struct thread *td, struct thread *newtd, int flags); void sched_throw(struct thread *td); void sched_unlend_prio(struct thread *td, u_char prio); -void sched_unlend_user_prio(struct thread *td, u_char pri); void sched_user_prio(struct thread *td, u_char prio); void sched_userret(struct thread *td); void sched_wakeup(struct thread *td); From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 11:19:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A18106566C; Wed, 29 Dec 2010 11:19:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC5198FC19; Wed, 29 Dec 2010 11:19:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTBJd4G098771; Wed, 29 Dec 2010 11:19:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTBJd8d098769; Wed, 29 Dec 2010 11:19:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291119.oBTBJd8d098769@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 11:19:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216792 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 11:19:40 -0000 Author: kib Date: Wed Dec 29 11:19:39 2010 New Revision: 216792 URL: http://svn.freebsd.org/changeset/base/216792 Log: Use a proper type for the variable holding the summary size of the inode data. Otherwise, on 32bit systems, unlinked inode which size is the multiple of 4GB was not truncated, causing corruption. Reported by: brucec Reviewed by: mckusick Tested by: pho Modified: head/sys/ufs/ufs/ufs_inode.c Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Wed Dec 29 09:26:46 2010 (r216791) +++ head/sys/ufs/ufs/ufs_inode.c Wed Dec 29 11:19:39 2010 (r216792) @@ -76,7 +76,7 @@ ufs_inactive(ap) struct thread *td = ap->a_td; mode_t mode; int error = 0; - int isize; + off_t isize; struct mount *mp; mp = NULL; From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 11:39:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65B83106566C; Wed, 29 Dec 2010 11:39:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39A3B8FC1C; Wed, 29 Dec 2010 11:39:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTBdG3q099219; Wed, 29 Dec 2010 11:39:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTBdG8Y099217; Wed, 29 Dec 2010 11:39:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291139.oBTBdG8Y099217@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 11:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216793 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 11:39:16 -0000 Author: kib Date: Wed Dec 29 11:39:15 2010 New Revision: 216793 URL: http://svn.freebsd.org/changeset/base/216793 Log: Add sysctl vm.md_malloc_wait, non-zero value of which switches malloc-backed md(4) to using M_WAITOK malloc calls. M_NOWAITOK allocations may fail when enough memory could be freed, but not immediately. E.g. SU UFS becomes quite unhappy when metadata write return error, that would happen for failed malloc() call. Reported and tested by: pho MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Dec 29 11:19:39 2010 (r216792) +++ head/sys/dev/md/md.c Wed Dec 29 11:39:15 2010 (r216793) @@ -103,6 +103,8 @@ static MALLOC_DEFINE(M_MDSECT, "md_secto static int md_debug; SYSCTL_INT(_debug, OID_AUTO, mddebug, CTLFLAG_RW, &md_debug, 0, ""); +static int md_malloc_wait; +SYSCTL_INT(_vm, OID_AUTO, md_malloc_wait, CTLFLAG_RW, &md_malloc_wait, 0, ""); #if defined(MD_ROOT) && defined(MD_ROOT_SIZE) /* @@ -208,11 +210,12 @@ new_indir(u_int shift) { struct indir *ip; - ip = malloc(sizeof *ip, M_MD, M_NOWAIT | M_ZERO); + ip = malloc(sizeof *ip, M_MD, (md_malloc_wait ? M_WAITOK : M_NOWAIT) + | M_ZERO); if (ip == NULL) return (NULL); ip->array = malloc(sizeof(uintptr_t) * NINDIR, - M_MDSECT, M_NOWAIT | M_ZERO); + M_MDSECT, (md_malloc_wait ? M_WAITOK : M_NOWAIT) | M_ZERO); if (ip->array == NULL) { free(ip, M_MD); return (NULL); @@ -456,6 +459,7 @@ mdstart_malloc(struct md_s *sc, struct b } else { if (osp <= 255) { sp = (uintptr_t)uma_zalloc(sc->uma, + md_malloc_wait ? M_WAITOK : M_NOWAIT); if (sp == 0) { error = ENOSPC; @@ -850,7 +854,8 @@ mdcreate_malloc(struct md_s *sc, struct nsectors = sc->mediasize / sc->sectorsize; for (u = 0; u < nsectors; u++) { - sp = (uintptr_t)uma_zalloc(sc->uma, M_NOWAIT | M_ZERO); + sp = (uintptr_t)uma_zalloc(sc->uma, md_malloc_wait ? + M_WAITOK : M_NOWAIT | M_ZERO); if (sp != 0) error = s_write(sc->indir, u, sp); else From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:00:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 847971065670; Wed, 29 Dec 2010 12:00:29 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 7C1E38FC13; Wed, 29 Dec 2010 12:00:28 +0000 (UTC) Received: by wwf26 with SMTP id 26so9787893wwf.31 for ; Wed, 29 Dec 2010 04:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=jm3QescwB+7eD3BE80ukdOvmFIWdcZ0+BUiU3Fw9J7U=; b=eDV8vbRHFr3A6NuAxqBYVYumiBklchACUBOiTCb/pqLlmhLj9ZUBQWQY3NMHnMZI5n 6s05kGdAWD3naGJKw9s0ToWSPY54Bvvg50Z0u+Hhb5HMMsIUwwwD9eGc9r5CfJmMEknZ XjIXZoLwPWwHPoA7g4KFwPBnSJNh+9stVbybY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=OytnKppWXox1GyUWDJM9q/mUKTIzC7ZbDcrcRhO+qwn3kVHC9Fxo5bZOlWNXFLdY8M C19IYqJNFOvFy9oQ5qIYztY64WGTnpsETC8S7k5y/SP3+jh90t9UtZ7N9meSBMm+W9JJ RC08guJ9p0nIxSfSlBgM1Vzqm379YTuTP15lw= MIME-Version: 1.0 Received: by 10.216.141.75 with SMTP id f53mr2568584wej.16.1293624027100; Wed, 29 Dec 2010 04:00:27 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Wed, 29 Dec 2010 04:00:26 -0800 (PST) In-Reply-To: <4D1A1EDC.8010603@bsdimp.com> References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> <20101228020900.GA81611@troutmask.apl.washington.edu> <4D1A1EDC.8010603@bsdimp.com> Date: Wed, 29 Dec 2010 04:00:26 -0800 X-Google-Sender-Auth: LzpelG9t9IdnuZJmxODoL4-Dfss Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Colin Percival , Steve Kargl Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:00:29 -0000 On Tue, Dec 28, 2010 at 9:31 AM, Warner Losh wrote: > On 12/27/2010 19:09, Steve Kargl wrote: >> >> On Mon, Dec 27, 2010 at 06:02:57PM -0800, Colin Percival wrote: >>> >>> On 12/27/10 17:59, Steve Kargl wrote: >>>> >>>> On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: >>>>> >>>>> =A0 Make it possible to specify WITHOUT_MODULES in a kernel config fi= le. >>>> >>>> Can you explain how this differs from >>>> makeoptions =A0 =A0 NO_MODULES >>>> which has been able to do for years? >>> >>> NO_MODULES means what it says: No modules. >>> >>> WITHOUT_MODULES=3D"foo bar baz" means "go ahead and build modules excep= t >>> for foo, >>> bar, and baz". >>> >> Thanks. =A0The distincion wasn't clear from the commit log. >> I read it as "Build a kernel WITHOUT building MODULES", >> which is what NO_MODULES does. > > which is why I'd like to have its name changed: it is confusing this way.= .. Wouldn't it be better to have MODULES_EXCLUDE and MODULES_INCLUDE or something along those lines? MODULES_OVERRIDE doesn't really have a nice clean antonym to go with it according to my friendly neighborhood thesaurus. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:07:01 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id F31151065695 for ; Wed, 29 Dec 2010 12:07:00 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 975E614E73A for ; Wed, 29 Dec 2010 12:07:00 +0000 (UTC) Received: (qmail 15043 invoked from network); 29 Dec 2010 12:07:00 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 29 Dec 2010 12:07:00 -0000 Message-ID: <4D1B2464.1010604@freebsd.org> Date: Wed, 29 Dec 2010 04:07:00 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101220 Thunderbird/3.0.11 MIME-Version: 1.0 To: Garrett Cooper References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> <20101228020900.GA81611@troutmask.apl.washington.edu> <4D1A1EDC.8010603@bsdimp.com> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:07:01 -0000 On 12/29/10 04:00, Garrett Cooper wrote: > Wouldn't it be better to have MODULES_EXCLUDE and MODULES_INCLUDE > or something along those lines? MODULES_OVERRIDE doesn't really have a > nice clean antonym to go with it according to my friendly neighborhood > thesaurus. Sounds like a great idea. Feel free to hop in a time machine and go back 6 years to encourage Wes to use a different name when he added the option. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:11:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAEA0106564A; Wed, 29 Dec 2010 12:11:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 996D08FC0A; Wed, 29 Dec 2010 12:11:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCB7Ax000104; Wed, 29 Dec 2010 12:11:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCB7C5000101; Wed, 29 Dec 2010 12:11:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291211.oBTCB7C5000101@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 12:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216794 - in head/sys: dev/md geom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:11:07 -0000 Author: kib Date: Wed Dec 29 12:11:07 2010 New Revision: 216794 URL: http://svn.freebsd.org/changeset/base/216794 Log: Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4). Non-zero value of attribute means that device supports BIO_DELETE. Suggested and reviewed by: pjd Tested by: pho MFC after: 1 week Modified: head/sys/dev/md/md.c head/sys/geom/geom_disk.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Dec 29 11:39:15 2010 (r216793) +++ head/sys/dev/md/md.c Wed Dec 29 12:11:07 2010 (r216794) @@ -717,11 +717,12 @@ md_kthread(void *arg) } mtx_unlock(&sc->queue_mtx); if (bp->bio_cmd == BIO_GETATTR) { - if (sc->fwsectors && sc->fwheads && + if ((sc->fwsectors && sc->fwheads && (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors) || g_handleattr_int(bp, "GEOM::fwheads", - sc->fwheads))) + sc->fwheads))) || + g_handleattr_int(bp, "GEOM::candelete", 1)) error = -1; else error = EOPNOTSUPP; Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Dec 29 11:39:15 2010 (r216793) +++ head/sys/geom/geom_disk.c Wed Dec 29 12:11:07 2010 (r216794) @@ -297,7 +297,11 @@ g_disk_start(struct bio *bp) } while (bp2 != NULL); break; case BIO_GETATTR: - if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors)) + if (g_handleattr_int(bp, "GEOM::candelete", + (dp->d_flags & DISKFLAG_CANDELETE) != 0)) + break; + else if (g_handleattr_int(bp, "GEOM::fwsectors", + dp->d_fwsectors)) break; else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads)) break; From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:16:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01564106566B; Wed, 29 Dec 2010 12:16:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44858FC15; Wed, 29 Dec 2010 12:16:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCG63o000243; Wed, 29 Dec 2010 12:16:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCG67M000240; Wed, 29 Dec 2010 12:16:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291216.oBTCG67M000240@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 12:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216795 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:16:07 -0000 Author: kib Date: Wed Dec 29 12:16:06 2010 New Revision: 216795 URL: http://svn.freebsd.org/changeset/base/216795 Log: Move the definition of mkdirlisthd from header to C file. Reviewed by: mckusick Tested by: pho Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Wed Dec 29 12:11:07 2010 (r216794) +++ head/sys/ufs/ffs/ffs_softdep.c Wed Dec 29 12:16:06 2010 (r216795) @@ -691,6 +691,8 @@ static struct malloc_type *memtype[] = { M_JTRUNC }; +static LIST_HEAD(mkdirlist, mkdir) mkdirlisthd; + #define DtoM(type) (memtype[type]) /* Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Wed Dec 29 12:11:07 2010 (r216794) +++ head/sys/ufs/ffs/softdep.h Wed Dec 29 12:16:06 2010 (r216795) @@ -657,7 +657,6 @@ struct mkdir { struct buf *md_buf; /* MKDIR_BODY: buffer holding dir */ LIST_ENTRY(mkdir) md_mkdirs; /* list of all mkdirs */ }; -LIST_HEAD(mkdirlist, mkdir) mkdirlisthd; /* * A "dirrem" structure describes an operation to decrement the link From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:25:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61C01065672; Wed, 29 Dec 2010 12:25:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3FCE8FC16; Wed, 29 Dec 2010 12:25:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCPS6A000565; Wed, 29 Dec 2010 12:25:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCPSYC000560; Wed, 29 Dec 2010 12:25:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291225.oBTCPSYC000560@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 12:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216796 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:25:28 -0000 Author: kib Date: Wed Dec 29 12:25:28 2010 New Revision: 216796 URL: http://svn.freebsd.org/changeset/base/216796 Log: Add kernel side support for BIO_DELETE/TRIM on UFS. The FS_TRIM fs flag indicates that administrator requested issuing of TRIM commands for the volume. UFS will only send the command to disk if the disk reports GEOM::candelete attribute. Since disk queue is reordered, data block is marked as free in the bitmap only after TRIM command completed. Due to need to sleep waiting for i/o to finish, TRIM bio_done routine schedules taskqueue to set the bitmap bit. Based on the patch by: mckusick Reviewed by: mckusick, pjd Tested by: pho MFC after: 1 month Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/ufsmount.h Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Dec 29 12:16:06 2010 (r216795) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Dec 29 12:25:28 2010 (r216796) @@ -80,9 +80,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include + #include #include #include @@ -92,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include typedef ufs2_daddr_t allocfcn_t(struct inode *ip, u_int cg, ufs2_daddr_t bpref, int size, int rsize); @@ -99,6 +103,11 @@ typedef ufs2_daddr_t allocfcn_t(struct i static ufs2_daddr_t ffs_alloccg(struct inode *, u_int, ufs2_daddr_t, int, int); static ufs2_daddr_t ffs_alloccgblk(struct inode *, struct buf *, ufs2_daddr_t, int); +static void ffs_blkfree_cg(struct ufsmount *, struct fs *, + struct vnode *, ufs2_daddr_t, long, ino_t, + struct workhead *); +static void ffs_blkfree_trim_completed(struct bio *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif @@ -1831,8 +1840,8 @@ gotit: * free map. If a fragment is deallocated, a possible * block reassembly is checked. */ -void -ffs_blkfree(ump, fs, devvp, bno, size, inum, dephd) +static void +ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) struct ufsmount *ump; struct fs *fs; struct vnode *devvp; @@ -1964,6 +1973,95 @@ ffs_blkfree(ump, fs, devvp, bno, size, i bdwrite(bp); } +TASKQUEUE_DEFINE_THREAD(ffs_trim); + +struct ffs_blkfree_trim_params { + struct task task; + struct ufsmount *ump; + struct vnode *devvp; + ufs2_daddr_t bno; + long size; + ino_t inum; + struct workhead *pdephd; + struct workhead dephd; +}; + +static void +ffs_blkfree_trim_task(ctx, pending) + void *ctx; + int pending; +{ + struct ffs_blkfree_trim_params *tp; + + tp = ctx; + ffs_blkfree_cg(tp->ump, tp->ump->um_fs, tp->devvp, tp->bno, tp->size, + tp->inum, tp->pdephd); + vn_finished_secondary_write(UFSTOVFS(tp->ump)); + free(tp, M_TEMP); +} + +static void +ffs_blkfree_trim_completed(bip) + struct bio *bip; +{ + struct ffs_blkfree_trim_params *tp; + + tp = bip->bio_caller2; + g_destroy_bio(bip); + TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); + taskqueue_enqueue(taskqueue_ffs_trim, &tp->task); +} + +void +ffs_blkfree(ump, fs, devvp, bno, size, inum, dephd) + struct ufsmount *ump; + struct fs *fs; + struct vnode *devvp; + ufs2_daddr_t bno; + long size; + ino_t inum; + struct workhead *dephd; +{ + struct mount *mp; + struct bio *bip; + struct ffs_blkfree_trim_params *tp; + + if (!ump->um_candelete) { + ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd); + return; + } + + /* + * Postpone the set of the free bit in the cg bitmap until the + * BIO_DELETE is completed. Otherwise, due to disk queue + * reordering, TRIM might be issued after we reuse the block + * and write some new data into it. + */ + tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); + tp->ump = ump; + tp->devvp = devvp; + tp->bno = bno; + tp->size = size; + tp->inum = inum; + if (dephd != NULL) { + LIST_INIT(&tp->dephd); + LIST_SWAP(dephd, &tp->dephd, worklist, wk_list); + tp->pdephd = &tp->dephd; + } else + tp->pdephd = NULL; + + bip = g_alloc_bio(); + bip->bio_cmd = BIO_DELETE; + bip->bio_offset = dbtob(fsbtodb(fs, bno)); + bip->bio_done = ffs_blkfree_trim_completed; + bip->bio_length = size; + bip->bio_caller2 = tp; + + mp = UFSTOVFS(ump); + vn_start_secondary_write(NULL, &mp, 0); + g_io_request(bip, (struct g_consumer *)devvp->v_bufobj.bo_private); +} + #ifdef INVARIANTS /* * Verify allocation of a block or fragment. Returns true if block or Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Wed Dec 29 12:16:06 2010 (r216795) +++ head/sys/ufs/ffs/ffs_vfsops.c Wed Dec 29 12:25:28 2010 (r216796) @@ -895,6 +895,21 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_mntonname); #endif } + if ((fs->fs_flags & FS_TRIM) != 0) { + size = sizeof(int); + if (g_io_getattr("GEOM::candelete", cp, &size, + &ump->um_candelete) == 0) { + if (!ump->um_candelete) + printf( +"WARNING: %s: TRIM flag on fs but disk does not support TRIM\n", + mp->mnt_stat.f_mntonname); + } else { + printf( +"WARNING: %s: TRIM flag on fs but cannot get whether disk supports TRIM\n", + mp->mnt_stat.f_mntonname); + ump->um_candelete = 0; + } + } ump->um_mountp = mp; ump->um_dev = dev; Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Wed Dec 29 12:16:06 2010 (r216795) +++ head/sys/ufs/ffs/fs.h Wed Dec 29 12:25:28 2010 (r216796) @@ -417,6 +417,7 @@ CTASSERT(sizeof(struct fs) == 1376); #define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ #define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ #define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ +#define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ /* * Macros to access bits in the fs_active array. Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Wed Dec 29 12:16:06 2010 (r216795) +++ head/sys/ufs/ufs/ufsmount.h Wed Dec 29 12:25:28 2010 (r216796) @@ -95,6 +95,7 @@ struct ufsmount { time_t um_itime[MAXQUOTAS]; /* inode quota time limit */ char um_qflags[MAXQUOTAS]; /* quota specific flags */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ + int um_candelete; /* devvp supports TRIM */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *, struct thread *); From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:25:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C288310656A4; Wed, 29 Dec 2010 12:25:45 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B04758FC13; Wed, 29 Dec 2010 12:25:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCPj9g000612; Wed, 29 Dec 2010 12:25:45 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCPjEF000610; Wed, 29 Dec 2010 12:25:45 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012291225.oBTCPjEF000610@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 29 Dec 2010 12:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216797 - stable/8/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:25:45 -0000 Author: simon Date: Wed Dec 29 12:25:45 2010 New Revision: 216797 URL: http://svn.freebsd.org/changeset/base/216797 Log: MFC r216725: Fix deprecated warning about -L which said -i was deprecated. Modified: stable/8/sbin/mount_nfs/mount_nfs.c Directory Properties: stable/8/sbin/mount_nfs/ (props changed) Modified: stable/8/sbin/mount_nfs/mount_nfs.c ============================================================================== --- stable/8/sbin/mount_nfs/mount_nfs.c Wed Dec 29 12:25:28 2010 (r216796) +++ stable/8/sbin/mount_nfs/mount_nfs.c Wed Dec 29 12:25:45 2010 (r216797) @@ -213,7 +213,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "intr", NULL, 0); break; case 'L': - printf("-i deprecated, use -o nolockd\n"); + printf("-L deprecated, use -o nolockd\n"); build_iovec(&iov, &iovlen, "nolockd", NULL, 0); break; case 'l': From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:31:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C298C106566B; Wed, 29 Dec 2010 12:31:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFE728FC14; Wed, 29 Dec 2010 12:31:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCVIxh000804; Wed, 29 Dec 2010 12:31:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCVInI000796; Wed, 29 Dec 2010 12:31:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291231.oBTCVInI000796@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 12:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216798 - in head/sbin: dumpfs newfs tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:31:18 -0000 Author: kib Date: Wed Dec 29 12:31:18 2010 New Revision: 216798 URL: http://svn.freebsd.org/changeset/base/216798 Log: Add support for FS_TRIM to user-mode UFS utilities. Reviewed by: mckusick, pjd, pho Tested by: pho MFC after: 1 month Modified: head/sbin/dumpfs/dumpfs.c head/sbin/newfs/mkfs.c head/sbin/newfs/newfs.8 head/sbin/newfs/newfs.c head/sbin/newfs/newfs.h head/sbin/tunefs/tunefs.8 head/sbin/tunefs/tunefs.c Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/dumpfs/dumpfs.c Wed Dec 29 12:31:18 2010 (r216798) @@ -253,9 +253,11 @@ dumpfs(const char *name) printf("fs_flags expanded "); if (fsflags & FS_NFS4ACLS) printf("nfsv4acls "); + if (fsflags & FS_TRIM) + printf("trim "); fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS | FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED | - FS_NFS4ACLS | FS_SUJ); + FS_NFS4ACLS | FS_SUJ | FS_TRIM); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); putchar('\n'); Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/newfs/mkfs.c Wed Dec 29 12:31:18 2010 (r216798) @@ -151,6 +151,8 @@ mkfs(struct partition *pp, char *fsys) sblock.fs_flags |= FS_GJOURNAL; if (lflag) sblock.fs_flags |= FS_MULTILABEL; + if (tflag) + sblock.fs_flags |= FS_TRIM; /* * Validate the given file system size. * Verify that its last block can actually be accessed. Modified: head/sbin/newfs/newfs.8 ============================================================================== --- head/sbin/newfs/newfs.8 Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/newfs/newfs.8 Wed Dec 29 12:31:18 2010 (r216798) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd September 14, 2010 +.Dd December 9, 2010 .Dt NEWFS 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd construct a new UFS1/UFS2 file system .Sh SYNOPSIS .Nm -.Op Fl EJNUln +.Op Fl EJNUlnt .Op Fl L Ar volname .Op Fl O Ar filesystem-type .Op Fl S Ar sector-size @@ -241,6 +241,14 @@ A valid .Ar size value cannot be larger than the default one, which means that the file system cannot extend into the reserved space. +.It Fl t +Turn on the TRIM enable flag. +If enabled, and if the underlying device supports the BIO_DELETE +command, the file system will send a delete request to the underlying +device for each freed block. +The trim enable flag is typically set when the underlying device +uses flash-memory as the device can use the delete command to +pre-zero or at least avoid copying blocks that have been deleted. .El .Pp The following options override the standard sizes for the disk geometry. Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/newfs/newfs.c Wed Dec 29 12:31:18 2010 (r216798) @@ -91,6 +91,7 @@ int Xflag = 0; /* exit in middle of new int Jflag; /* enable gjournal for file system */ int lflag; /* enable multilabel for file system */ int nflag; /* do not create .snap directory */ +int tflag; /* enable TRIM */ intmax_t fssize; /* file system size */ int sectorsize; /* bytes/sector */ int realsectorsize; /* bytes/sector in hardware */ @@ -139,7 +140,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:t")) != -1) switch (ch) { case 'E': Eflag = 1; @@ -279,6 +280,9 @@ main(int argc, char *argv[]) *cp != '\0' || fssize < 0) errx(1, "%s: bad file system size", optarg); break; + case 't': + tflag = 1; + break; case '?': default: usage(); @@ -495,6 +499,7 @@ usage() fprintf(stderr, "\t-p partition name (a..h)\n"); fprintf(stderr, "\t-r reserved sectors at the end of device\n"); fprintf(stderr, "\t-s file system size (sectors)\n"); + fprintf(stderr, "\t-t enable TRIM\n"); exit(1); } Modified: head/sbin/newfs/newfs.h ============================================================================== --- head/sbin/newfs/newfs.h Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/newfs/newfs.h Wed Dec 29 12:31:18 2010 (r216798) @@ -85,6 +85,7 @@ extern int Xflag; /* exit in middle of extern int Jflag; /* enable gjournal for file system */ extern int lflag; /* enable multilabel MAC for file system */ extern int nflag; /* do not create .snap directory */ +extern int tflag; /* enable TRIM */ extern intmax_t fssize; /* file system size */ extern int sectorsize; /* bytes/sector */ extern int realsectorsize; /* bytes/sector in hardware*/ Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/tunefs/tunefs.8 Wed Dec 29 12:31:18 2010 (r216798) @@ -28,7 +28,7 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd March 6, 2010 +.Dd December 9, 2010 .Dt TUNEFS 8 .Os .Sh NAME @@ -51,6 +51,7 @@ .Op Fl p .Op Fl s Ar avgfpdir .Op Fl S Ar size +.Op Fl t Cm enable | disable .Ar special | filesystem .Sh DESCRIPTION The @@ -143,6 +144,14 @@ Specify the expected number of files per .It Fl S Ar size Specify the softdep journal size in bytes. The minimum is 4M. +.It Fl t Cm enable | disable +Turn on/off the TRIM enable flag. +If enabled, and if the underlying device supports the BIO_DELETE +command, the file system will send a delete request to the underlying +device for each freed block. +The trim enable flag is typically set when the underlying device +uses flash-memory as the device can use the delete command to +pre-zero or at least avoid copying blocks that have been deleted. .El .Pp At least one of the above flags is required. Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Wed Dec 29 12:25:45 2010 (r216797) +++ head/sbin/tunefs/tunefs.c Wed Dec 29 12:31:18 2010 (r216798) @@ -82,11 +82,13 @@ int main(int argc, char *argv[]) { char *avalue, *jvalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; + char *tvalue; const char *special, *on; const char *name; int active; int Aflag, aflag, eflag, evalue, fflag, fvalue, jflag, Jflag, Lflag; int lflag, mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag; + int tflag; int svalue, Sflag, Svalue; int ch, found_arg, i; const char *chg[2]; @@ -96,12 +98,13 @@ main(int argc, char *argv[]) if (argc < 3) usage(); Aflag = aflag = eflag = fflag = jflag = Jflag = Lflag = lflag = 0; - mflag = Nflag = nflag = oflag = pflag = sflag = 0; + mflag = Nflag = nflag = oflag = pflag = sflag = tflag = 0; avalue = jvalue = Jvalue = Lvalue = lvalue = Nvalue = nvalue = NULL; evalue = fvalue = mvalue = ovalue = svalue = Svalue = 0; active = 0; found_arg = 0; /* At least one arg is required. */ - while ((ch = getopt(argc, argv, "Aa:e:f:j:J:L:l:m:N:n:o:ps:S:")) != -1) + while ((ch = getopt(argc, argv, "Aa:e:f:j:J:L:l:m:N:n:o:ps:S:t:")) + != -1) switch (ch) { case 'A': @@ -268,6 +271,18 @@ main(int argc, char *argv[]) Sflag = 1; break; + case 't': + found_arg = 1; + name = "trim"; + tvalue = optarg; + if (strcmp(tvalue, "enable") != 0 && + strcmp(tvalue, "disable") != 0) { + errx(10, "bad %s (options are %s)", + name, "`enable' or `disable'"); + } + tflag = 1; + break; + default: usage(); } @@ -493,6 +508,24 @@ main(int argc, char *argv[]) sblock.fs_avgfpdir = svalue; } } + if (tflag) { + name = "issue TRIM to the disk"; + if (strcmp(tvalue, "enable") == 0) { + if (sblock.fs_flags & FS_TRIM) + warnx("%s remains unchanged as enabled", name); + else { + sblock.fs_flags |= FS_TRIM; + warnx("%s set", name); + } + } else if (strcmp(tvalue, "disable") == 0) { + if ((~sblock.fs_flags & FS_TRIM) == FS_TRIM) + warnx("%s remains unchanged as disabled", name); + else { + sblock.fs_flags &= ~FS_TRIM; + warnx("%s cleared", name); + } + } + } if (sbwrite(&disk, Aflag) == -1) goto err; @@ -1011,12 +1044,13 @@ out: void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]", " [-J enable | disable] [-j enable | disable]", " [-L volname] [-l enable | disable] [-m minfree]", " [-N enable | disable] [-n enable | disable]", -" [-o space | time] [-p] [-s avgfpdir] special | filesystem"); +" [-o space | time] [-p] [-s avgfpdir] [-t enable | disable]", +" special | filesystem"); exit(2); } @@ -1035,6 +1069,8 @@ printfs(void) (sblock.fs_flags & FS_SUJ)? "enabled" : "disabled"); warnx("gjournal: (-J) %s", (sblock.fs_flags & FS_GJOURNAL)? "enabled" : "disabled"); + warnx("trim: (-t) %s", + (sblock.fs_flags & FS_TRIM)? "enabled" : "disabled"); warnx("maximum blocks per file in a cylinder group: (-e) %d", sblock.fs_maxbpg); warnx("average file size: (-f) %d", From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 12:53:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E755106566C; Wed, 29 Dec 2010 12:53:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CDDE8FC14; Wed, 29 Dec 2010 12:53:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTCrrmi001328; Wed, 29 Dec 2010 12:53:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTCrr7G001325; Wed, 29 Dec 2010 12:53:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012291253.oBTCrr7G001325@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 12:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216799 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 12:53:54 -0000 Author: kib Date: Wed Dec 29 12:53:53 2010 New Revision: 216799 URL: http://svn.freebsd.org/changeset/base/216799 Log: Move the increment of vm object generation count into vm_object_set_writeable_dirty(). Fix an issue where restart of the scan in vm_object_page_clean() did not removed write permissions for newly added pages or, if the mapping for some already scanned page changed to writeable due to fault. Merge the two loops in vm_object_page_clean(), doing the remove of write permission and cleaning in the same loop. The restart of the loop then correctly downgrade writeable mappings. Fix an issue where a second caller to msync() might actually return before the first caller had actually completed flushing the pages. Clear the OBJ_MIGHTBEDIRTY flag after the cleaning loop, not before. Calls to pmap_is_modified() are not needed after pmap_remove_write() there. Proposed, reviewed and tested by: alc MFC after: 1 week Modified: head/sys/vm/vm_object.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Dec 29 12:31:18 2010 (r216798) +++ head/sys/vm/vm_object.c Wed Dec 29 12:53:53 2010 (r216799) @@ -101,7 +101,9 @@ SYSCTL_INT(_vm, OID_AUTO, old_msync, CTL "Use old (insecure) msync behavior"); static int vm_object_page_collect_flush(vm_object_t object, vm_page_t p, - int pagerflags); + int pagerflags, int flags, int *clearobjflags); +static boolean_t vm_object_page_remove_write(vm_page_t p, int flags, + int *clearobjflags); static void vm_object_qcollapse(vm_object_t object); static void vm_object_vndeallocate(vm_object_t object); @@ -753,6 +755,24 @@ vm_object_terminate(vm_object_t object) vm_object_destroy(object); } +static boolean_t +vm_object_page_remove_write(vm_page_t p, int flags, int *clearobjflags) +{ + + /* + * If we have been asked to skip nosync pages and this is a + * nosync page, skip it. Note that the object flags were not + * cleared in this case so we do not have to set them. + */ + if ((flags & OBJPC_NOSYNC) != 0 && (p->oflags & VPO_NOSYNC) != 0) { + *clearobjflags = 0; + return (FALSE); + } else { + pmap_remove_write(p); + return (p->dirty != 0); + } +} + /* * vm_object_page_clean * @@ -799,17 +819,6 @@ vm_object_page_clean(vm_object_t object, * object flags. */ clearobjflags = 1; - for (p = vm_page_find_least(object, start); - p != NULL && p->pindex < tend; p = TAILQ_NEXT(p, listq)) { - if ((flags & OBJPC_NOSYNC) != 0 && - (p->oflags & VPO_NOSYNC) != 0) - clearobjflags = 0; - else - pmap_remove_write(p); - } - - if (clearobjflags && (start == 0) && (tend == object->size)) - vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); rescan: curgeneration = object->generation; @@ -827,20 +836,11 @@ rescan: np = vm_page_find_least(object, pi); continue; } - vm_page_test_dirty(p); - if (p->dirty == 0) + if (!vm_object_page_remove_write(p, flags, &clearobjflags)) continue; - /* - * If we have been asked to skip nosync pages and this is a - * nosync page, skip it. Note that the object flags were - * not cleared in this case so we do not have to set them. - */ - if ((flags & OBJPC_NOSYNC) != 0 && - (p->oflags & VPO_NOSYNC) != 0) - continue; - - n = vm_object_page_collect_flush(object, p, pagerflags); + n = vm_object_page_collect_flush(object, p, pagerflags, + flags, &clearobjflags); if (object->generation != curgeneration) goto rescan; np = vm_page_find_least(object, pi + n); @@ -850,10 +850,13 @@ rescan: #endif vm_object_clear_flag(object, OBJ_CLEANING); + if (clearobjflags && start == 0 && tend == object->size) + vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); } static int -vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags) +vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags, + int flags, int *clearobjflags) { vm_page_t ma[vm_pageout_page_count], p_first, tp; int count, i, mreq, runlen; @@ -869,8 +872,7 @@ vm_object_page_collect_flush(vm_object_t tp = vm_page_next(tp); if (tp == NULL || tp->busy != 0 || (tp->oflags & VPO_BUSY) != 0) break; - vm_page_test_dirty(tp); - if (tp->dirty == 0) + if (!vm_object_page_remove_write(tp, flags, clearobjflags)) break; } @@ -878,8 +880,7 @@ vm_object_page_collect_flush(vm_object_t tp = vm_page_prev(p_first); if (tp == NULL || tp->busy != 0 || (tp->oflags & VPO_BUSY) != 0) break; - vm_page_test_dirty(tp); - if (tp->dirty == 0) + if (!vm_object_page_remove_write(tp, flags, clearobjflags)) break; p_first = tp; mreq++; @@ -1985,8 +1986,10 @@ vm_object_set_writeable_dirty(vm_object_ { VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - if (object->type != OBJT_VNODE || - (object->flags & OBJ_MIGHTBEDIRTY) != 0) + if (object->type != OBJT_VNODE) + return; + object->generation++; + if ((object->flags & OBJ_MIGHTBEDIRTY) != 0) return; vm_object_set_flag(object, OBJ_MIGHTBEDIRTY); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Dec 29 12:31:18 2010 (r216798) +++ head/sys/vm/vm_page.c Wed Dec 29 12:53:53 2010 (r216799) @@ -811,7 +811,6 @@ vm_page_insert(vm_page_t m, vm_object_t } } object->root = m; - object->generation++; /* * show that the object has one more resident page. From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 14:06:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F23810656CA; Wed, 29 Dec 2010 14:06:20 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE518FC17; Wed, 29 Dec 2010 14:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTE6KHZ003069; Wed, 29 Dec 2010 14:06:20 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTE6Kg7003067; Wed, 29 Dec 2010 14:06:20 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201012291406.oBTE6Kg7003067@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 29 Dec 2010 14:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216800 - releng/8.2/sbin/mount_nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 14:06:20 -0000 Author: simon Date: Wed Dec 29 14:06:20 2010 New Revision: 216800 URL: http://svn.freebsd.org/changeset/base/216800 Log: MFS r216725: Fix deprecated warning about -L which said -i was deprecated. Approved by: re (kib) Modified: releng/8.2/sbin/mount_nfs/mount_nfs.c Directory Properties: releng/8.2/sbin/mount_nfs/ (props changed) Modified: releng/8.2/sbin/mount_nfs/mount_nfs.c ============================================================================== --- releng/8.2/sbin/mount_nfs/mount_nfs.c Wed Dec 29 12:53:53 2010 (r216799) +++ releng/8.2/sbin/mount_nfs/mount_nfs.c Wed Dec 29 14:06:20 2010 (r216800) @@ -213,7 +213,7 @@ main(int argc, char *argv[]) build_iovec(&iov, &iovlen, "intr", NULL, 0); break; case 'L': - printf("-i deprecated, use -o nolockd\n"); + printf("-L deprecated, use -o nolockd\n"); build_iovec(&iov, &iovlen, "nolockd", NULL, 0); break; case 'l': From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 14:11:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5183310656A6; Wed, 29 Dec 2010 14:11:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 251518FC17; Wed, 29 Dec 2010 14:11:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTEBls7003220; Wed, 29 Dec 2010 14:11:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTEBlKc003218; Wed, 29 Dec 2010 14:11:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201012291411.oBTEBlKc003218@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 Dec 2010 14:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216801 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 14:11:47 -0000 Author: marius Date: Wed Dec 29 14:11:46 2010 New Revision: 216801 URL: http://svn.freebsd.org/changeset/base/216801 Log: Rename the "xor" parameter to "xorval" as the former is a reserved keyword in C++. Submitted by: gahr Modified: head/sys/sparc64/include/cpufunc.h Modified: head/sys/sparc64/include/cpufunc.h ============================================================================== --- head/sys/sparc64/include/cpufunc.h Wed Dec 29 14:06:20 2010 (r216800) +++ head/sys/sparc64/include/cpufunc.h Wed Dec 29 14:11:46 2010 (r216801) @@ -157,9 +157,9 @@ int fasword32(u_long asi, void *addr, ui __sr; \ }) -#define wr(name, val, xor) do { \ +#define wr(name, val, xorval) do { \ __asm __volatile("wr %0, %1, %%" #name \ - : : "r" (val), "rI" (xor)); \ + : : "r" (val), "rI" (xorval)); \ } while (0) #define rdpr(name) ({ \ @@ -168,24 +168,24 @@ int fasword32(u_long asi, void *addr, ui __pr; \ }) -#define wrpr(name, val, xor) do { \ +#define wrpr(name, val, xorval) do { \ __asm __volatile("wrpr %0, %1, %%" #name \ - : : "r" (val), "rI" (xor)); \ + : : "r" (val), "rI" (xorval)); \ } while (0) /* * Trick GAS/GCC into compiling access to TICK/(S)TICK_COMPARE independently * of the selected instruction set. */ -#define rdtickcmpr() rd(asr23) -#define rdstick() rd(asr24) -#define rdstickcmpr() rd(asr25) -#define wrtickcmpr(val, xor) wr(asr23, (val), (xor)) -#define wrstick(val, xor) wr(asr24, (val), (xor)) -#define wrstickcmpr(val, xor) wr(asr25, (val), (xor)) +#define rdtickcmpr() rd(asr23) +#define rdstick() rd(asr24) +#define rdstickcmpr() rd(asr25) +#define wrtickcmpr(val, xorval) wr(asr23, (val), (xorval)) +#define wrstick(val, xorval) wr(asr24, (val), (xorval)) +#define wrstickcmpr(val, xorval) wr(asr25, (val), (xorval)) /* - * Macro intended to be used instead of wr(asr23, val, xor) for writing to + * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that * can cause these writes to fail under certain condidtions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE @@ -193,14 +193,14 @@ int fasword32(u_long asi, void *addr, ui * aligned to a quadword boundary in order to ensure that I$ misses won't * split them up. */ -#define wrtickcmpr_bbwar(val, xor) ({ \ +#define wrtickcmpr_bbwar(val, xorval) ({ \ __asm __volatile( \ " ba,pt %%xcc, 1f ; " \ " nop ; " \ " .align 128 ; " \ "1: wr %0, %1, %%asr23 ; " \ " rd %%asr23, %%g0 ; " \ - : : "r" (val), "rI" (xor)); \ + : : "r" (val), "rI" (xorval)); \ }) static __inline void From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 14:14:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91AFD106564A; Wed, 29 Dec 2010 14:14:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FE868FC13; Wed, 29 Dec 2010 14:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTEEo7C003315; Wed, 29 Dec 2010 14:14:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTEEo5m003312; Wed, 29 Dec 2010 14:14:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201012291414.oBTEEo5m003312@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 Dec 2010 14:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216802 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 14:14:50 -0000 Author: marius Date: Wed Dec 29 14:14:50 2010 New Revision: 216802 URL: http://svn.freebsd.org/changeset/base/216802 Log: - Move the macros for generating load and store instructions to asmacros.h so they can be shared by different source files and extend them by a variant for atomic compare and swap. - Consistently use EMPTY. Modified: head/sys/sparc64/include/asmacros.h head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/include/asmacros.h ============================================================================== --- head/sys/sparc64/include/asmacros.h Wed Dec 29 14:11:46 2010 (r216801) +++ head/sys/sparc64/include/asmacros.h Wed Dec 29 14:14:50 2010 (r216802) @@ -33,7 +33,7 @@ /* * Normal and alternate %g6 point to the pcb of the current process. Normal, - & alternate and interrupt %g7 point to per-cpu data. + * alternate and interrupt %g7 point to per-cpu data. */ #define PCB_REG %g6 #define PCPU_REG %g7 @@ -134,6 +134,19 @@ name: #define EMPTY +/* + * Generate atomic compare and swap, load and store instructions for the + * corresponding width and ASI (or not). Note that we want to evaluate the + * macro args before concatenating, so that EMPTY really turns into nothing. + */ +#define _LD(w, a) ld ## w ## a +#define _ST(w, a) st ## w ## a +#define _CAS(w, a) cas ## w ## a + +#define LD(w, a) _LD(w, a) +#define ST(w, a) _ST(w, a) +#define CAS(w, a) _CAS(w, a) + #endif /* LOCORE */ #endif /* _KERNEL */ Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Wed Dec 29 14:11:46 2010 (r216801) +++ head/sys/sparc64/sparc64/support.S Wed Dec 29 14:14:50 2010 (r216802) @@ -44,19 +44,6 @@ __FBSDID("$FreeBSD$"); .register %g3, #ignore .register %g6, #ignore -#define E /* empty */ - -/* - * Generate load and store instructions for the corresponding width and asi - * (or not). Note that we want to evaluate the macro args before - * concatenating, so that E really turns into nothing. - */ -#define _LD(w, a) ld ## w ## a -#define _ST(w, a) st ## w ## a - -#define LD(w, a) _LD(w, a) -#define ST(w, a) _ST(w, a) - /* * Common code for copy routines. * @@ -233,7 +220,7 @@ END(ascopy) */ ENTRY(ascopyfrom) wr %o0, 0, %asi - _MEMCPY(%o2, %o1, %o3, E, E, a, %asi) + _MEMCPY(%o2, %o1, %o3, EMPTY, EMPTY, a, %asi) retl nop END(ascopyfrom) @@ -243,7 +230,7 @@ END(ascopyfrom) */ ENTRY(ascopyto) wr %o1, 0, %asi - _MEMCPY(%o2, %o0, %o3, a, %asi, E, E) + _MEMCPY(%o2, %o0, %o3, a, %asi, EMPTY, EMPTY) retl nop END(ascopyto) @@ -307,7 +294,7 @@ ENTRY(bcopy) /* * Do the fast version. */ -3: _MEMCPY(%o1, %o0, %o2, E, E, E, E) +3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl nop END(bcopy) @@ -316,7 +303,7 @@ END(bcopy) * void bzero(void *b, size_t len) */ ENTRY(bzero) - _MEMSET(%o0, %g0, %o1, E, E) + _MEMSET(%o0, %g0, %o1, EMPTY, EMPTY) retl nop END(bzero) @@ -325,7 +312,7 @@ END(bzero) * int copystr(const void *src, void *dst, size_t len, size_t *done) */ ENTRY(copystr) - _COPYSTR(%o0, %o1, %o2, %o3, E, E, E, E) + _COPYSTR(%o0, %o1, %o2, %o3, EMPTY, EMPTY, EMPTY, EMPTY) retl mov %g1, %o0 END(copystr) @@ -335,7 +322,7 @@ END(copystr) */ ENTRY(memcpy) mov %o0, %o3 - _MEMCPY(%o3, %o1, %o2, E, E, E, E) + _MEMCPY(%o3, %o1, %o2, EMPTY, EMPTY, EMPTY, EMPTY) retl nop END(memcpy) @@ -345,7 +332,7 @@ END(memcpy) */ ENTRY(memset) mov %o0, %o3 - _MEMSET(%o3, %o1, %o2, E, E) + _MEMSET(%o3, %o1, %o2, EMPTY, EMPTY) retl nop END(memset) @@ -359,7 +346,7 @@ copy_nofault_begin: */ ENTRY(copyin) wr %g0, ASI_AIUP, %asi - _MEMCPY(%o1, %o0, %o2, E, E, a, %asi) + _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, a, %asi) retl clr %o0 END(copyin) @@ -369,7 +356,7 @@ END(copyin) */ ENTRY(copyinstr) wr %g0, ASI_AIUP, %asi - _COPYSTR(%o0, %o1, %o2, %o3, a, %asi, E, E) + _COPYSTR(%o0, %o1, %o2, %o3, a, %asi, EMPTY, EMPTY) retl mov %g1, %o0 END(copyinstr) @@ -379,7 +366,7 @@ END(copyinstr) */ ENTRY(copyout) wr %g0, ASI_AIUP, %asi - _MEMCPY(%o1, %o0, %o2, a, %asi, E, E) + _MEMCPY(%o1, %o0, %o2, a, %asi, EMPTY, EMPTY) retl clr %o0 END(copyout) From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 16:59:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4593106564A; Wed, 29 Dec 2010 16:59:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1E4D8FC08; Wed, 29 Dec 2010 16:59:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTGxXnw007295; Wed, 29 Dec 2010 16:59:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTGxXQ0007287; Wed, 29 Dec 2010 16:59:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201012291659.oBTGxXQ0007287@svn.freebsd.org> From: Marius Strobl Date: Wed, 29 Dec 2010 16:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216803 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 16:59:33 -0000 Author: marius Date: Wed Dec 29 16:59:33 2010 New Revision: 216803 URL: http://svn.freebsd.org/changeset/base/216803 Log: On UltraSPARC-III+ and greater take advantage of ASI_ATOMIC_QUAD_LDD_PHYS, which takes an physical address instead of an virtual one, for loading TTEs of the kernel TSB so we no longer need to lock the kernel TSB into the dTLB, which only has a very limited number of lockable dTLB slots. The net result is that we now basically can handle a kernel TSB of any size and no longer need to limit the kernel address space based on the number of dTLB slots available for locked entries. Consequently, other parts of the trap handlers now also only access the the kernel TSB via its physical address in order to avoid nested traps, as does the PMAP bootstrap code as we haven't taken over the trap table at that point, yet. Apart from that the kernel TSB now is accessed via a direct mapping when we are otherwise taking advantage of ASI_ATOMIC_QUAD_LDD_PHYS so no further code changes are needed. Most of this is implemented by extending the patching of the TSB addresses and mask as well as the ASIs used to load it into the trap table so the runtime overhead of this change is rather low. Currently the use of ASI_ATOMIC_QUAD_LDD_PHYS is not yet enabled on SPARC64 CPUs due to lack of testing and due to the fact it might require minor adjustments there. Theoretically it should be possible to use the same approach also for the user TSB, which already is not locked into the dTLB, avoiding nested traps. However, for reasons I don't understand yet OpenSolaris only does that with SPARC64 CPUs. On the other hand I think that also addressing the user TSB physically and thus avoiding nested traps would get us closer to sharing this code with sun4v, which only supports trap level 0 and 1, so eventually we could have a single kernel which runs on both sun4u and sun4v (as does Linux and OpenBSD). Developed at and committed from: 27C3 Modified: head/sys/sparc64/include/pmap.h head/sys/sparc64/include/tsb.h head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/genassym.c head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/tsb.c Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/include/pmap.h Wed Dec 29 16:59:33 2010 (r216803) @@ -61,18 +61,18 @@ struct pmap { struct mtx pm_mtx; struct tte *pm_tsb; vm_object_t pm_tsb_obj; - cpumask_t pm_active; - uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ - u_int pm_retries; + cpumask_t pm_active; + uint32_t pm_gen_count; /* generation count (pmap lock dropped) */ + u_int pm_retries; u_int pm_context[MAXCPU]; struct pmap_statistics pm_stats; }; #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) -#define PMAP_LOCK_ASSERT(pmap, type) \ +#define PMAP_LOCK_ASSERT(pmap, type) \ mtx_assert(&(pmap)->pm_mtx, (type)) #define PMAP_LOCK_DESTROY(pmap) mtx_destroy(&(pmap)->pm_mtx) -#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \ +#define PMAP_LOCK_INIT(pmap) mtx_init(&(pmap)->pm_mtx, "pmap", \ NULL, MTX_DEF | MTX_DUPOK) #define PMAP_LOCKED(pmap) mtx_owned(&(pmap)->pm_mtx) #define PMAP_MTX(pmap) (&(pmap)->pm_mtx) @@ -99,6 +99,7 @@ int pmap_protect_tte(struct pmap *pm1, s vm_offset_t va); void pmap_map_tsb(void); +void pmap_set_kctx(void); #define vtophys(va) pmap_kextract((vm_offset_t)(va)) @@ -114,7 +115,7 @@ SYSCTL_DECL(_debug_pmap_stats); #define PMAP_STATS_VAR(name) \ static long name; \ - SYSCTL_LONG(_debug_pmap_stats, OID_AUTO, name, CTLFLAG_RW, \ + SYSCTL_LONG(_debug_pmap_stats, OID_AUTO, name, CTLFLAG_RW, \ &name, 0, "") #define PMAP_STATS_INC(var) \ Modified: head/sys/sparc64/include/tsb.h ============================================================================== --- head/sys/sparc64/include/tsb.h Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/include/tsb.h Wed Dec 29 16:59:33 2010 (r216803) @@ -50,6 +50,7 @@ extern struct tte *tsb_kernel; extern vm_size_t tsb_kernel_mask; extern vm_size_t tsb_kernel_size; extern vm_paddr_t tsb_kernel_phys; +extern u_int tsb_kernel_ldd_phys; static __inline struct tte * tsb_vpntobucket(pmap_t pm, vm_offset_t vpn) Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/sparc64/exception.S Wed Dec 29 16:59:33 2010 (r216803) @@ -75,8 +75,12 @@ __FBSDID("$FreeBSD$"); #include "assym.s" -#define TSB_KERNEL_MASK 0x0 -#define TSB_KERNEL 0x0 +#define TSB_ASI 0x0 +#define TSB_KERNEL 0x0 +#define TSB_KERNEL_MASK 0x0 +#define TSB_KERNEL_PHYS 0x0 +#define TSB_KERNEL_PHYS_END 0x0 +#define TSB_QUAD_LDD 0x0 .register %g2,#ignore .register %g3,#ignore @@ -84,19 +88,19 @@ __FBSDID("$FreeBSD$"); .register %g7,#ignore /* - * Atomically set the reference bit in a TTE. + * Atomically set a bit in a TTE. */ -#define TTE_SET_BIT(r1, r2, r3, bit) \ +#define TTE_SET_BIT(r1, r2, r3, bit, a, asi) \ add r1, TTE_DATA, r1 ; \ - ldx [r1], r2 ; \ + LD(x, a) [r1] asi, r2 ; \ 9: or r2, bit, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ + CAS(x, a) [r1] asi, r2, r3 ; \ cmp r2, r3 ; \ bne,pn %xcc, 9b ; \ mov r3, r2 -#define TTE_SET_REF(r1, r2, r3) TTE_SET_BIT(r1, r2, r3, TD_REF) -#define TTE_SET_W(r1, r2, r3) TTE_SET_BIT(r1, r2, r3, TD_W) +#define TTE_SET_REF(r1, r2, r3, a, asi) TTE_SET_BIT(r1, r2, r3, TD_REF, a, asi) +#define TTE_SET_W(r1, r2, r3, a, asi) TTE_SET_BIT(r1, r2, r3, TD_W, a, asi) /* * Macros for spilling and filling live windows. @@ -691,7 +695,7 @@ ENTRY(tl0_immu_miss_set_ref) /* * Set the reference bit. */ - TTE_SET_REF(%g4, %g2, %g3) + TTE_SET_REF(%g4, %g2, %g3, a, ASI_N) /* * May have become invalid during casxa, in which case start over. @@ -849,7 +853,7 @@ ENTRY(tl0_dmmu_miss_set_ref) /* * Set the reference bit. */ - TTE_SET_REF(%g4, %g2, %g3) + TTE_SET_REF(%g4, %g2, %g3, a, ASI_N) /* * May have become invalid during casxa, in which case start over. @@ -997,7 +1001,7 @@ tl1_dmmu_prot_user: /* * Set the hardware write bit. */ - TTE_SET_W(%g4, %g2, %g3) + TTE_SET_W(%g4, %g2, %g3, a, ASI_N) /* * Delete the old TLB entry and clear the SFSR. @@ -1327,11 +1331,14 @@ END(tl1_sfsr_trap) * Compute the address of the TTE. The TSB mask and address of the * TSB are patched at startup. */ - .globl tl1_immu_miss_patch_1 -tl1_immu_miss_patch_1: + .globl tl1_immu_miss_patch_tsb_mask_1 +tl1_immu_miss_patch_tsb_mask_1: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 + .globl tl1_immu_miss_patch_tsb_1 +tl1_immu_miss_patch_tsb_1: sethi %hi(TSB_KERNEL), %g7 + or %g7, %lo(TSB_KERNEL), %g7 srlx %g5, TAR_VPN_SHIFT, %g5 and %g5, %g6, %g6 @@ -1341,7 +1348,9 @@ tl1_immu_miss_patch_1: /* * Load the TTE. */ - ldda [%g6] ASI_NUCLEUS_QUAD_LDD, %g6 /*, %g7 */ + .globl tl1_immu_miss_patch_quad_ldd_1 +tl1_immu_miss_patch_quad_ldd_1: + ldda [%g6] TSB_QUAD_LDD, %g6 /*, %g7 */ /* * Check that it's valid and executable and that the virtual page @@ -1375,11 +1384,14 @@ ENTRY(tl1_immu_miss_set_ref) * Recompute the TTE address, which we clobbered loading the TTE. * The TSB mask and address of the TSB are patched at startup. */ - .globl tl1_immu_miss_patch_2 -tl1_immu_miss_patch_2: + .globl tl1_immu_miss_patch_tsb_mask_2 +tl1_immu_miss_patch_tsb_mask_2: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 + .globl tl1_immu_miss_patch_tsb_2 +tl1_immu_miss_patch_tsb_2: sethi %hi(TSB_KERNEL), %g7 + or %g7, %lo(TSB_KERNEL), %g7 and %g5, %g6, %g5 sllx %g5, TTE_SHIFT, %g5 @@ -1388,7 +1400,10 @@ tl1_immu_miss_patch_2: /* * Set the reference bit. */ - TTE_SET_REF(%g5, %g6, %g7) + .globl tl1_immu_miss_patch_asi_1 +tl1_immu_miss_patch_asi_1: + wr %g0, TSB_ASI, %asi + TTE_SET_REF(%g5, %g6, %g7, a, %asi) /* * May have become invalid during casxa, in which case start over. @@ -1447,11 +1462,14 @@ END(tl1_immu_miss_trap) * Compute the address of the TTE. The TSB mask and address of the * TSB are patched at startup. */ - .globl tl1_dmmu_miss_patch_1 -tl1_dmmu_miss_patch_1: + .globl tl1_dmmu_miss_patch_tsb_mask_1 +tl1_dmmu_miss_patch_tsb_mask_1: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 + .globl tl1_dmmu_miss_patch_tsb_1 +tl1_dmmu_miss_patch_tsb_1: sethi %hi(TSB_KERNEL), %g7 + or %g7, %lo(TSB_KERNEL), %g7 srlx %g5, TAR_VPN_SHIFT, %g5 and %g5, %g6, %g6 @@ -1461,7 +1479,9 @@ tl1_dmmu_miss_patch_1: /* * Load the TTE. */ - ldda [%g6] ASI_NUCLEUS_QUAD_LDD, %g6 /*, %g7 */ + .globl tl1_dmmu_miss_patch_quad_ldd_1 +tl1_dmmu_miss_patch_quad_ldd_1: + ldda [%g6] TSB_QUAD_LDD, %g6 /*, %g7 */ /* * Check that it's valid and that the virtual page numbers match. @@ -1492,11 +1512,14 @@ ENTRY(tl1_dmmu_miss_set_ref) * Recompute the TTE address, which we clobbered loading the TTE. * The TSB mask and address of the TSB are patched at startup. */ - .globl tl1_dmmu_miss_patch_2 -tl1_dmmu_miss_patch_2: + .globl tl1_dmmu_miss_patch_tsb_mask_2 +tl1_dmmu_miss_patch_tsb_mask_2: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 + .globl tl1_dmmu_miss_patch_tsb_2 +tl1_dmmu_miss_patch_tsb_2: sethi %hi(TSB_KERNEL), %g7 + or %g7, %lo(TSB_KERNEL), %g7 and %g5, %g6, %g5 sllx %g5, TTE_SHIFT, %g5 @@ -1505,7 +1528,10 @@ tl1_dmmu_miss_patch_2: /* * Set the reference bit. */ - TTE_SET_REF(%g5, %g6, %g7) + .globl tl1_dmmu_miss_patch_asi_1 +tl1_dmmu_miss_patch_asi_1: + wr %g0, TSB_ASI, %asi + TTE_SET_REF(%g5, %g6, %g7, a, %asi) /* * May have become invalid during casxa, in which case start over. @@ -1545,15 +1571,36 @@ ENTRY(tl1_dmmu_miss_direct) * correspond to the TTE valid and page size bits are left set, so * they don't have to be included in the TTE bits below. We know they * are set because the virtual address is in the upper va hole. + * NB: if we are taking advantage of the ASI_ATOMIC_QUAD_LDD_PHYS + * and we get a miss on the directly accessed kernel TSB we must not + * set TD_CV in order to access it uniformly bypassing the D$. */ + setx TLB_DIRECT_ADDRESS_MASK, %g7, %g4 + and %g5, %g4, %g4 setx TLB_DIRECT_TO_TTE_MASK, %g7, %g6 and %g5, %g6, %g5 - or %g5, TD_CP | TD_CV | TD_W, %g5 + .globl tl1_dmmu_miss_direct_patch_tsb_phys_1 +tl1_dmmu_miss_direct_patch_tsb_phys_1: + sethi %hi(TSB_KERNEL_PHYS), %g7 + or %g7, %lo(TSB_KERNEL_PHYS), %g7 + cmp %g4, %g7 + bl,pt %xcc, 1f + or %g5, TD_CP | TD_W, %g5 + .globl tl1_dmmu_miss_direct_patch_tsb_phys_end_1 +tl1_dmmu_miss_direct_patch_tsb_phys_end_1: + sethi %hi(TSB_KERNEL_PHYS_END), %g7 + or %g7, %lo(TSB_KERNEL_PHYS_END), %g7 + cmp %g4, %g7 + bg,a,pt %xcc, 1f + nop + ba,pt %xcc, 2f + nop +1: or %g5, TD_CV, %g5 /* * Load the TTE data into the TLB and retry the instruction. */ - stxa %g5, [%g0] ASI_DTLB_DATA_IN_REG +2: stxa %g5, [%g0] ASI_DTLB_DATA_IN_REG retry END(tl1_dmmu_miss_direct) @@ -1584,11 +1631,14 @@ ENTRY(tl1_dmmu_prot_1) * Compute the address of the TTE. The TSB mask and address of the * TSB are patched at startup. */ - .globl tl1_dmmu_prot_patch_1 -tl1_dmmu_prot_patch_1: + .globl tl1_dmmu_prot_patch_tsb_mask_1 +tl1_dmmu_prot_patch_tsb_mask_1: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 + .globl tl1_dmmu_prot_patch_tsb_1 +tl1_dmmu_prot_patch_tsb_1: sethi %hi(TSB_KERNEL), %g7 + or %g7, %lo(TSB_KERNEL), %g7 srlx %g5, TAR_VPN_SHIFT, %g5 and %g5, %g6, %g6 @@ -1598,7 +1648,9 @@ tl1_dmmu_prot_patch_1: /* * Load the TTE. */ - ldda [%g6] ASI_NUCLEUS_QUAD_LDD, %g6 /*, %g7 */ + .globl tl1_dmmu_prot_patch_quad_ldd_1 +tl1_dmmu_prot_patch_quad_ldd_1: + ldda [%g6] TSB_QUAD_LDD, %g6 /*, %g7 */ /* * Check that it's valid and writeable and that the virtual page @@ -1625,11 +1677,14 @@ tl1_dmmu_prot_patch_1: * Recompute the TTE address, which we clobbered loading the TTE. * The TSB mask and address of the TSB are patched at startup. */ - .globl tl1_dmmu_prot_patch_2 -tl1_dmmu_prot_patch_2: + .globl tl1_dmmu_prot_patch_tsb_mask_2 +tl1_dmmu_prot_patch_tsb_mask_2: sethi %hi(TSB_KERNEL_MASK), %g6 or %g6, %lo(TSB_KERNEL_MASK), %g6 + .globl tl1_dmmu_prot_patch_tsb_2 +tl1_dmmu_prot_patch_tsb_2: sethi %hi(TSB_KERNEL), %g7 + or %g7, %lo(TSB_KERNEL), %g7 and %g5, %g6, %g5 sllx %g5, TTE_SHIFT, %g5 @@ -1638,7 +1693,10 @@ tl1_dmmu_prot_patch_2: /* * Set the hardware write bit. */ - TTE_SET_W(%g5, %g6, %g7) + .globl tl1_dmmu_prot_patch_asi_1 +tl1_dmmu_prot_patch_asi_1: + wr %g0, TSB_ASI, %asi + TTE_SET_W(%g5, %g6, %g7, a, %asi) /* * May have become invalid during casxa, in which case start over. Modified: head/sys/sparc64/sparc64/genassym.c ============================================================================== --- head/sys/sparc64/sparc64/genassym.c Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/sparc64/genassym.c Wed Dec 29 16:59:33 2010 (r216803) @@ -136,6 +136,7 @@ ASSYM(TS_MIN, TS_MIN); ASSYM(TS_MAX, TS_MAX); ASSYM(TLB_DAR_SLOT_SHIFT, TLB_DAR_SLOT_SHIFT); ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MASK); +ASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); #endif Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/sparc64/mp_machdep.c Wed Dec 29 16:59:33 2010 (r216803) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -439,8 +440,12 @@ cpu_mp_bootstrap(struct pcpu *pc) tick_clear(pc->pc_impl); tick_stop(pc->pc_impl); - /* Lock the kernel TSB in the TLB. */ - pmap_map_tsb(); + /* Set the kernel context. */ + pmap_set_kctx(); + + /* Lock the kernel TSB in the TLB if necessary. */ + if (tsb_kernel_ldd_phys == 0) + pmap_map_tsb(); /* * Flush all non-locked TLB entries possibly left over by the Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/sparc64/pmap.c Wed Dec 29 16:59:33 2010 (r216803) @@ -156,6 +156,8 @@ struct pmap kernel_pmap_store; */ static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); +static void pmap_bootstrap_set_tte(struct tte *tp, u_long vpn, u_long data); + /* * Map the given physical page at the specified virtual address in the * target pmap with the protection requested. If specified the page @@ -166,12 +168,26 @@ static vm_paddr_t pmap_bootstrap_alloc(v static void pmap_enter_locked(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot, boolean_t wired); -extern int tl1_immu_miss_patch_1[]; -extern int tl1_immu_miss_patch_2[]; -extern int tl1_dmmu_miss_patch_1[]; -extern int tl1_dmmu_miss_patch_2[]; -extern int tl1_dmmu_prot_patch_1[]; -extern int tl1_dmmu_prot_patch_2[]; +extern int tl1_dmmu_miss_direct_patch_tsb_phys_1[]; +extern int tl1_dmmu_miss_direct_patch_tsb_phys_end_1[]; +extern int tl1_dmmu_miss_patch_asi_1[]; +extern int tl1_dmmu_miss_patch_quad_ldd_1[]; +extern int tl1_dmmu_miss_patch_tsb_1[]; +extern int tl1_dmmu_miss_patch_tsb_2[]; +extern int tl1_dmmu_miss_patch_tsb_mask_1[]; +extern int tl1_dmmu_miss_patch_tsb_mask_2[]; +extern int tl1_dmmu_prot_patch_asi_1[]; +extern int tl1_dmmu_prot_patch_quad_ldd_1[]; +extern int tl1_dmmu_prot_patch_tsb_1[]; +extern int tl1_dmmu_prot_patch_tsb_2[]; +extern int tl1_dmmu_prot_patch_tsb_mask_1[]; +extern int tl1_dmmu_prot_patch_tsb_mask_2[]; +extern int tl1_immu_miss_patch_asi_1[]; +extern int tl1_immu_miss_patch_quad_ldd_1[]; +extern int tl1_immu_miss_patch_tsb_1[]; +extern int tl1_immu_miss_patch_tsb_2[]; +extern int tl1_immu_miss_patch_tsb_mask_1[]; +extern int tl1_immu_miss_patch_tsb_mask_2[]; /* * If user pmap is processed with pmap_remove and with pmap_remove and the @@ -302,13 +318,21 @@ pmap_bootstrap(u_int cpu_impl) vm_size_t physsz; vm_size_t virtsz; u_long data; + u_long vpn; phandle_t pmem; phandle_t vmem; u_int dtlb_slots_avail; int i; int j; int sz; + uint32_t asi; uint32_t colors; + uint32_t ldd; + + /* + * Set the kernel context. + */ + pmap_set_kctx(); colors = dcache_color_ignore != 0 ? 1 : DCACHE_COLORS; @@ -355,40 +379,56 @@ pmap_bootstrap(u_int cpu_impl) /* * Calculate the size of kernel virtual memory, and the size and mask * for the kernel TSB based on the phsyical memory size but limited - * by the amount of dTLB slots available for locked entries (given - * that for spitfire-class CPUs all of the dt64 slots can hold locked - * entries but there is no large dTLB for unlocked ones, we don't use - * more than half of it for locked entries). - */ - dtlb_slots_avail = 0; - for (i = 0; i < dtlb_slots; i++) { - data = dtlb_get_data(i); - if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) - dtlb_slots_avail++; - } + * by the amount of dTLB slots available for locked entries if we have + * to lock the TSB in the TLB (given that for spitfire-class CPUs all + * of the dt64 slots can hold locked entries but there is no large + * dTLB for unlocked ones, we don't use more than half of it for the + * TSB). + * Note that for reasons unknown OpenSolaris doesn't take advantage of + * ASI_ATOMIC_QUAD_LDD_PHYS on UltraSPARC-III. However, given that no + * public documentation is available for these, the latter just might + * not support it, yet. + */ + virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); + if (cpu_impl >= CPU_IMPL_ULTRASPARCIIIp) + tsb_kernel_ldd_phys = 1; + else { + dtlb_slots_avail = 0; + for (i = 0; i < dtlb_slots; i++) { + data = dtlb_get_data(i); + if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) + dtlb_slots_avail++; + } #ifdef SMP - dtlb_slots_avail -= PCPU_PAGES; + dtlb_slots_avail -= PCPU_PAGES; #endif - if (cpu_impl >= CPU_IMPL_ULTRASPARCI && - cpu_impl < CPU_IMPL_ULTRASPARCIII) - dtlb_slots_avail /= 2; - virtsz = roundup(physsz, PAGE_SIZE_4M << (PAGE_SHIFT - TTE_SHIFT)); - virtsz = MIN(virtsz, - (dtlb_slots_avail * PAGE_SIZE_4M) << (PAGE_SHIFT - TTE_SHIFT)); + if (cpu_impl >= CPU_IMPL_ULTRASPARCI && + cpu_impl < CPU_IMPL_ULTRASPARCIII) + dtlb_slots_avail /= 2; + virtsz = MIN(virtsz, (dtlb_slots_avail * PAGE_SIZE_4M) << + (PAGE_SHIFT - TTE_SHIFT)); + } vm_max_kernel_address = VM_MIN_KERNEL_ADDRESS + virtsz; tsb_kernel_size = virtsz >> (PAGE_SHIFT - TTE_SHIFT); tsb_kernel_mask = (tsb_kernel_size >> TTE_SHIFT) - 1; /* - * Allocate the kernel TSB and lock it in the TLB. + * Allocate the kernel TSB and lock it in the TLB if necessary. */ pa = pmap_bootstrap_alloc(tsb_kernel_size, colors); if (pa & PAGE_MASK_4M) - panic("pmap_bootstrap: tsb unaligned\n"); + panic("pmap_bootstrap: TSB unaligned\n"); tsb_kernel_phys = pa; - tsb_kernel = (struct tte *)(VM_MIN_KERNEL_ADDRESS - tsb_kernel_size); - pmap_map_tsb(); - bzero(tsb_kernel, tsb_kernel_size); + if (tsb_kernel_ldd_phys == 0) { + tsb_kernel = + (struct tte *)(VM_MIN_KERNEL_ADDRESS - tsb_kernel_size); + pmap_map_tsb(); + bzero(tsb_kernel, tsb_kernel_size); + } else { + tsb_kernel = + (struct tte *)TLB_PHYS_TO_DIRECT(tsb_kernel_phys); + aszero(ASI_PHYS_USE_EC, tsb_kernel_phys, tsb_kernel_size); + } /* * Allocate and map the dynamic per-CPU area for the BSP. @@ -403,35 +443,84 @@ pmap_bootstrap(u_int cpu_impl) msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa); /* - * Patch the virtual address and the tsb mask into the trap table. + * Patch the TSB addresses and mask as well as the ASIs used to load + * it into the trap table. */ -#define SETHI(rd, imm22) \ - (EIF_OP(IOP_FORM2) | EIF_F2_RD(rd) | EIF_F2_OP2(INS0_SETHI) | \ +#define LDDA_R_I_R(rd, imm_asi, rs1, rs2) \ + (EIF_OP(IOP_LDST) | EIF_F3_RD(rd) | EIF_F3_OP3(INS3_LDDA) | \ + EIF_F3_RS1(rs1) | EIF_F3_I(0) | EIF_F3_IMM_ASI(imm_asi) | \ + EIF_F3_RS2(rs2)) +#define OR_R_I_R(rd, imm13, rs1) \ + (EIF_OP(IOP_MISC) | EIF_F3_RD(rd) | EIF_F3_OP3(INS2_OR) | \ + EIF_F3_RS1(rs1) | EIF_F3_I(1) | EIF_IMM(imm13, 13)) +#define SETHI(rd, imm22) \ + (EIF_OP(IOP_FORM2) | EIF_F2_RD(rd) | EIF_F2_OP2(INS0_SETHI) | \ EIF_IMM((imm22) >> 10, 22)) -#define OR_R_I_R(rd, imm13, rs1) \ - (EIF_OP(IOP_MISC) | EIF_F3_RD(rd) | EIF_F3_OP3(INS2_OR) | \ +#define WR_R_I(rd, imm13, rs1) \ + (EIF_OP(IOP_MISC) | EIF_F3_RD(rd) | EIF_F3_OP3(INS2_WR) | \ EIF_F3_RS1(rs1) | EIF_F3_I(1) | EIF_IMM(imm13, 13)) -#define PATCH(addr) do { \ - if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ - addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, IF_F3_RS1(addr[1])) || \ - addr[2] != SETHI(IF_F2_RD(addr[2]), 0x0)) \ - panic("pmap_boostrap: patched instructions have changed"); \ - addr[0] |= EIF_IMM((tsb_kernel_mask) >> 10, 22); \ - addr[1] |= EIF_IMM(tsb_kernel_mask, 10); \ - addr[2] |= EIF_IMM(((vm_offset_t)tsb_kernel) >> 10, 22); \ - flush(addr); \ - flush(addr + 1); \ - flush(addr + 2); \ +#define PATCH_ASI(addr, asi) do { \ + if (addr[0] != WR_R_I(IF_F3_RD(addr[0]), 0x0, \ + IF_F3_RS1(addr[0]))) \ + panic("%s: patched instructions have changed", \ + __func__); \ + addr[0] |= EIF_IMM((asi), 13); \ + flush(addr); \ +} while (0) + +#define PATCH_LDD(addr, asi) do { \ + if (addr[0] != LDDA_R_I_R(IF_F3_RD(addr[0]), 0x0, \ + IF_F3_RS1(addr[0]), IF_F3_RS2(addr[0]))) \ + panic("%s: patched instructions have changed", \ + __func__); \ + addr[0] |= EIF_F3_IMM_ASI(asi); \ + flush(addr); \ } while (0) - PATCH(tl1_immu_miss_patch_1); - PATCH(tl1_immu_miss_patch_2); - PATCH(tl1_dmmu_miss_patch_1); - PATCH(tl1_dmmu_miss_patch_2); - PATCH(tl1_dmmu_prot_patch_1); - PATCH(tl1_dmmu_prot_patch_2); +#define PATCH_TSB(addr, val) do { \ + if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ + addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ + IF_F3_RS1(addr[1]))) \ + panic("%s: patched instructions have changed", \ + __func__); \ + addr[0] |= EIF_IMM((val) >> 10, 22); \ + addr[1] |= EIF_IMM((val), 10); \ + flush(addr); \ + flush(addr + 1); \ +} while (0) + + if (tsb_kernel_ldd_phys == 0) { + asi = ASI_N; + ldd = ASI_NUCLEUS_QUAD_LDD; + off = (vm_offset_t)tsb_kernel; + } else { + asi = ASI_PHYS_USE_EC; + ldd = ASI_ATOMIC_QUAD_LDD_PHYS; + off = (vm_offset_t)tsb_kernel_phys; + } + PATCH_TSB(tl1_dmmu_miss_direct_patch_tsb_phys_1, tsb_kernel_phys); + PATCH_TSB(tl1_dmmu_miss_direct_patch_tsb_phys_end_1, + tsb_kernel_phys + tsb_kernel_size - 1); + PATCH_ASI(tl1_dmmu_miss_patch_asi_1, asi); + PATCH_LDD(tl1_dmmu_miss_patch_quad_ldd_1, ldd); + PATCH_TSB(tl1_dmmu_miss_patch_tsb_1, off); + PATCH_TSB(tl1_dmmu_miss_patch_tsb_2, off); + PATCH_TSB(tl1_dmmu_miss_patch_tsb_mask_1, tsb_kernel_mask); + PATCH_TSB(tl1_dmmu_miss_patch_tsb_mask_2, tsb_kernel_mask); + PATCH_ASI(tl1_dmmu_prot_patch_asi_1, asi); + PATCH_LDD(tl1_dmmu_prot_patch_quad_ldd_1, ldd); + PATCH_TSB(tl1_dmmu_prot_patch_tsb_1, off); + PATCH_TSB(tl1_dmmu_prot_patch_tsb_2, off); + PATCH_TSB(tl1_dmmu_prot_patch_tsb_mask_1, tsb_kernel_mask); + PATCH_TSB(tl1_dmmu_prot_patch_tsb_mask_2, tsb_kernel_mask); + PATCH_ASI(tl1_immu_miss_patch_asi_1, asi); + PATCH_LDD(tl1_immu_miss_patch_quad_ldd_1, ldd); + PATCH_TSB(tl1_immu_miss_patch_tsb_1, off); + PATCH_TSB(tl1_immu_miss_patch_tsb_2, off); + PATCH_TSB(tl1_immu_miss_patch_tsb_mask_1, tsb_kernel_mask); + PATCH_TSB(tl1_immu_miss_patch_tsb_mask_2, tsb_kernel_mask); /* * Enter fake 8k pages for the 4MB kernel pages, so that @@ -442,9 +531,10 @@ pmap_bootstrap(u_int cpu_impl) va = kernel_tlbs[i].te_va; for (off = 0; off < PAGE_SIZE_4M; off += PAGE_SIZE) { tp = tsb_kvtotte(va + off); - tp->tte_vpn = TV_VPN(va + off, TS_8K); - tp->tte_data = TD_V | TD_8K | TD_PA(pa + off) | - TD_REF | TD_SW | TD_CP | TD_CV | TD_P | TD_W; + vpn = TV_VPN(va + off, TS_8K); + data = TD_V | TD_8K | TD_PA(pa + off) | TD_REF | + TD_SW | TD_CP | TD_CV | TD_P | TD_W; + pmap_bootstrap_set_tte(tp, vpn, data); } } @@ -485,9 +575,10 @@ pmap_bootstrap(u_int cpu_impl) pa = kstack0_phys + i * PAGE_SIZE; va = kstack0 + i * PAGE_SIZE; tp = tsb_kvtotte(va); - tp->tte_vpn = TV_VPN(va, TS_8K); - tp->tte_data = TD_V | TD_8K | TD_PA(pa) | TD_REF | TD_SW | - TD_CP | TD_CV | TD_P | TD_W; + vpn = TV_VPN(va, TS_8K); + data = TD_V | TD_8K | TD_PA(pa) | TD_REF | TD_SW | TD_CP | + TD_CV | TD_P | TD_W; + pmap_bootstrap_set_tte(tp, vpn, data); } /* @@ -527,9 +618,8 @@ pmap_bootstrap(u_int cpu_impl) off += PAGE_SIZE) { va = translations[i].om_start + off; tp = tsb_kvtotte(va); - tp->tte_vpn = TV_VPN(va, TS_8K); - tp->tte_data = - ((translations[i].om_tte & + vpn = TV_VPN(va, TS_8K); + data = ((translations[i].om_tte & ~((TD_SOFT2_MASK << TD_SOFT2_SHIFT) | (cpu_impl >= CPU_IMPL_ULTRASPARCI && cpu_impl < CPU_IMPL_ULTRASPARCIII ? @@ -537,6 +627,7 @@ pmap_bootstrap(u_int cpu_impl) (TD_RSVD_CH_MASK << TD_RSVD_CH_SHIFT)) | (TD_SOFT_MASK << TD_SOFT_SHIFT))) | TD_EXEC) + off; + pmap_bootstrap_set_tte(tp, vpn, data); } } @@ -571,20 +662,17 @@ pmap_bootstrap(u_int cpu_impl) tlb_flush_nonlocked(); } +/* + * Map the 4MB kernel TSB pages. + */ void pmap_map_tsb(void) { vm_offset_t va; vm_paddr_t pa; u_long data; - register_t s; int i; - s = intr_disable(); - - /* - * Map the 4MB TSB pages. - */ for (i = 0; i < tsb_kernel_size; i += PAGE_SIZE_4M) { va = (vm_offset_t)tsb_kernel + i; pa = tsb_kernel_phys + i; @@ -594,16 +682,19 @@ pmap_map_tsb(void) TLB_TAR_CTX(TLB_CTX_KERNEL)); stxa_sync(0, ASI_DTLB_DATA_IN_REG, data); } +} + +/* + * Set the secondary context to be the kernel context (needed for FP block + * operations in the kernel). + */ +void +pmap_set_kctx(void) +{ - /* - * Set the secondary context to be the kernel context (needed for - * FP block operations in the kernel). - */ stxa(AA_DMMU_SCXR, ASI_DMMU, (ldxa(AA_DMMU_SCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | TLB_CTX_KERNEL); flush(KERNBASE); - - intr_restore(s); } /* @@ -629,6 +720,27 @@ pmap_bootstrap_alloc(vm_size_t size, uin } /* + * Set a TTE. This function is intended as a helper when tsb_kernel is + * direct-mapped but we haven't taken over the trap table, yet, as it's the + * case when we are taking advantage of ASI_ATOMIC_QUAD_LDD_PHYS to access + * the kernel TSB. + */ +void +pmap_bootstrap_set_tte(struct tte *tp, u_long vpn, u_long data) +{ + + if (tsb_kernel_ldd_phys == 0) { + tp->tte_vpn = vpn; + tp->tte_data = data; + } else { + stxa((vm_paddr_t)tp + offsetof(struct tte, tte_vpn), + ASI_PHYS_USE_EC, vpn); + stxa((vm_paddr_t)tp + offsetof(struct tte, tte_data), + ASI_PHYS_USE_EC, data); + } +} + +/* * Initialize a vm_page's machine-dependent fields. */ void Modified: head/sys/sparc64/sparc64/tsb.c ============================================================================== --- head/sys/sparc64/sparc64/tsb.c Wed Dec 29 14:14:50 2010 (r216802) +++ head/sys/sparc64/sparc64/tsb.c Wed Dec 29 16:59:33 2010 (r216803) @@ -26,9 +26,11 @@ * SUCH DAMAGE. * * from BSDI: pmap.c,v 1.28.2.15 2000/04/27 03:10:31 cp Exp - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include "opt_ddb.h" #include "opt_pmap.h" @@ -43,7 +45,7 @@ #include #include -#include +#include #include #include #include @@ -78,6 +80,8 @@ struct tte *tsb_kernel; vm_size_t tsb_kernel_mask; vm_size_t tsb_kernel_size; vm_paddr_t tsb_kernel_phys; +vm_paddr_t tsb_kernel_phys_end; +u_int tsb_kernel_ldd_phys; struct tte * tsb_tte_lookup(pmap_t pm, vm_offset_t va) From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 17:12:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09B96106564A; Wed, 29 Dec 2010 17:12:06 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED56E8FC14; Wed, 29 Dec 2010 17:12:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTHC5Lc007636; Wed, 29 Dec 2010 17:12:05 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTHC5Id007633; Wed, 29 Dec 2010 17:12:05 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201012291712.oBTHC5Id007633@svn.freebsd.org> From: Alexander Kabaev Date: Wed, 29 Dec 2010 17:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216804 - in head: gnu/lib/libgcc lib/libcompiler_rt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 17:12:06 -0000 Author: kan Date: Wed Dec 29 17:12:05 2010 New Revision: 216804 URL: http://svn.freebsd.org/changeset/base/216804 Log: Switch mips architectures back to libgcc. MIPS64 n64 binaries are broken with libcompiler_rt at this time. Switch mips back to libgcc until the cause of breakage is analyzed and fixed. Modified: head/gnu/lib/libgcc/Makefile head/lib/libcompiler_rt/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Wed Dec 29 16:59:33 2010 (r216803) +++ head/gnu/lib/libgcc/Makefile Wed Dec 29 17:12:05 2010 (r216804) @@ -15,7 +15,7 @@ MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" -.if ${TARGET_CPUARCH} == "sparc64" +.if ${TARGET_CPUARCH} == "sparc64" || ${TARGET_CPUARCH} == "mips" LIB= gcc .endif Modified: head/lib/libcompiler_rt/Makefile ============================================================================== --- head/lib/libcompiler_rt/Makefile Wed Dec 29 16:59:33 2010 (r216803) +++ head/lib/libcompiler_rt/Makefile Wed Dec 29 17:12:05 2010 (r216804) @@ -147,7 +147,7 @@ SRCS+= ${file}.c . endif .endfor -.if ${MACHINE_CPUARCH} != "sparc64" +.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a . endif From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 18:17:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3E82106564A; Wed, 29 Dec 2010 18:17:36 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E29198FC16; Wed, 29 Dec 2010 18:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTIHaW1009087; Wed, 29 Dec 2010 18:17:36 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTIHa0H009085; Wed, 29 Dec 2010 18:17:36 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201012291817.oBTIHa0H009085@svn.freebsd.org> From: Attilio Rao Date: Wed, 29 Dec 2010 18:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216805 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 18:17:37 -0000 Author: attilio Date: Wed Dec 29 18:17:36 2010 New Revision: 216805 URL: http://svn.freebsd.org/changeset/base/216805 Log: Fix several callout migration races: - Problem1: Hypothesis: thread1 is doing a callout_reset_on(), within his callout handler, willing to implicitly or explicitly migrate the callout. thread2 is draining the callout. Thesys: * thread1 calls callout_lock() and locks the old callout cpu * thread1 performs the checks in the first path of the callout_reset_on() * thread1 hits this codepiece: /* * If the lock must migrate we have to check the state again as * we can't hold both the new and old locks simultaneously. */ if (c->c_cpu != cpu) { c->c_cpu = cpu; CC_UNLOCK(cc); goto retry; } which means it will drop the lock and 'retry' * thread2 will callout_lock() and locks the new callout cpu. thread1 spins on the new lock and will not keep going for the moment. * thread2 checks that the callout is not pending (as callout is currently running) and that it is not on cc->cc_curr (because cc now refers to the new callout and the callout is running on the old callout cpu) thus it thinks it is done and returns. * thread1 will now acquire the lock and then adds the callout to the new callout cpu queue That seems an obvious race as callout_stop() falsely reports the callout stopped or worse, callout_drain() falsely returns while the callout is still in use. - Solution1: Fixing this problem would require, in general, to lock both callout cpus at once while switching the c_cpu field and avoid cyclic deadlocks between callout cpus locks. The concept of CPUBLOCK is then introduced (working more or less like the blocked_lock for thread_lock() function) meaning: "in callout_lock(), spin until the c->c_cpu is not different from CPUBLOCK". That way the "original" callout cpu, referred to the above mentioned code snippet, will remain blocked until the lock handover is over critical path will remain covered. - Problem2: Having the callout currently executed on a specific callout cpu and contemporary pending on another callout cpu (as it can happen with current code) breaks, at least, the assumption callout_drain() returns just once the callout cannot be referenced anymore. - Solution2: Callout migration is deferred if the current callout is already under execution. The best place to do that is in softclock() and new members are added to the callout cpu structure in order to specify a pending migration is requested. That is necessary because the callout cannot be trusted (not freed) the 100% of times after the execution of the callout handler. CPUBLOCK will prevent, in the "deferred migration" case, that the callout gets freed in this case, stopping any callout_stop() and callout_drain() possible activity until the migration is actually performed. - Problem3: There is a further race in callout_drain(). In order to avoid a race between sleepqueue lock and callout cpu spinlock, in _callout_stop_safe(), the callout cpu lock is dropped, the sleepqueue lock is acquired and a new callout cpu lookup is performed. Note that the channel used for locking the sleepqueue is obtained from the "current" callout cpu (&cc->cc_waiting). If the callout migrated in the meanwhile, callout_drain() will end up using the wrong wchan for the sleepqueue (the locked one will be the older, while the new one will not really be locked) leading to a lock leak and a race access to sleepqueue. - Solution3: It is enough to check if a migration happened between the operation of acquiring the sleepqueue lock and the new callout cpu lock and eventually unwind all those and try again. This problems can lead to deathly races on moderate (4-ways) SMP environment, leading to easy panic or deadlocks. The 24-ways of the reporter, could easilly panic, with completely normal workload, almost daily. gianni@ kindly wrote the following prof-of-concept which can panic a FreeBSD machine in less than one hour, in smaller SMP: http://www.freebsd.org/~attilio/callout/test.c Reported by: Nicholas Esborn , DesertNet In collabouration with: gianni, pho, Nicholas Esborn Reviewed by: jhb MFC after: 1 week (*) * Usually, I would aim for a larger MFC timeout, but I really want this in before 8.2-RELEASE, thus re@ accepted a shorter timeout as a special case for this patch Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Wed Dec 29 17:12:05 2010 (r216804) +++ head/sys/kern/kern_timeout.c Wed Dec 29 18:17:36 2010 (r216805) @@ -56,6 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef SMP +#include +#endif + SDT_PROVIDER_DEFINE(callout_execute); SDT_PROBE_DEFINE(callout_execute, kernel, , callout_start, callout-start); SDT_PROBE_ARGTYPE(callout_execute, kernel, , callout_start, 0, @@ -107,11 +111,15 @@ struct callout_cpu { struct callout *cc_next; struct callout *cc_curr; void *cc_cookie; + void (*cc_migration_func)(void *); + void *cc_migration_arg; int cc_ticks; int cc_softticks; int cc_cancel; int cc_waiting; int cc_firsttick; + int cc_migration_cpu; + int cc_migration_ticks; }; #ifdef SMP @@ -123,8 +131,10 @@ struct callout_cpu cc_cpu; #define CC_CPU(cpu) &cc_cpu #define CC_SELF() &cc_cpu #endif +#define CPUBLOCK MAXCPU #define CC_LOCK(cc) mtx_lock_spin(&(cc)->cc_lock) #define CC_UNLOCK(cc) mtx_unlock_spin(&(cc)->cc_lock) +#define CC_LOCK_ASSERT(cc) mtx_assert(&(cc)->cc_lock, MA_OWNED) static int timeout_cpu; void (*callout_new_inserted)(int cpu, int ticks) = NULL; @@ -188,6 +198,7 @@ callout_cpu_init(struct callout_cpu *cc) for (i = 0; i < callwheelsize; i++) { TAILQ_INIT(&cc->cc_callwheel[i]); } + cc->cc_migration_cpu = CPUBLOCK; if (cc->cc_callout == NULL) return; for (i = 0; i < ncallout; i++) { @@ -311,6 +322,13 @@ callout_lock(struct callout *c) for (;;) { cpu = c->c_cpu; +#ifdef SMP + if (cpu == CPUBLOCK) { + while (c->c_cpu == CPUBLOCK) + cpu_spinwait(); + continue; + } +#endif cc = CC_CPU(cpu); CC_LOCK(cc); if (cpu == c->c_cpu) @@ -320,6 +338,29 @@ callout_lock(struct callout *c) return (cc); } +static void +callout_cc_add(struct callout *c, struct callout_cpu *cc, int to_ticks, + void (*func)(void *), void *arg, int cpu) +{ + + CC_LOCK_ASSERT(cc); + + if (to_ticks <= 0) + to_ticks = 1; + c->c_arg = arg; + c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); + c->c_func = func; + c->c_time = ticks + to_ticks; + TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], + c, c_links.tqe); + if ((c->c_time - cc->cc_firsttick) < 0 && + callout_new_inserted != NULL) { + cc->cc_firsttick = c->c_time; + (*callout_new_inserted)(cpu, + to_ticks + (ticks - cc->cc_ticks)); + } +} + /* * The callout mechanism is based on the work of Adam M. Costello and * George Varghese, published in a technical report entitled "Redesigning @@ -390,11 +431,14 @@ softclock(void *arg) steps = 0; } } else { + struct callout_cpu *new_cc; void (*c_func)(void *); - void *c_arg; + void (*new_func)(void *); + void *c_arg, *new_arg; struct lock_class *class; struct lock_object *c_lock; int c_flags, sharedlock; + int new_cpu, new_ticks; cc->cc_next = TAILQ_NEXT(c, c_links.tqe); TAILQ_REMOVE(bucket, c, c_links.tqe); @@ -496,7 +540,40 @@ softclock(void *arg) c_links.sle); } cc->cc_curr = NULL; - if (cc->cc_waiting) { + + /* + * If the callout was scheduled for + * migration just perform it now. + */ + if (cc->cc_migration_cpu != CPUBLOCK) { + + /* + * There must not be any waiting + * thread now because the callout + * has a blocked CPU. + * Also, the callout must not be + * freed, but that is not easy to + * assert. + */ + MPASS(cc->cc_waiting == 0); + new_cpu = cc->cc_migration_cpu; + new_ticks = cc->cc_migration_ticks; + new_func = cc->cc_migration_func; + new_arg = cc->cc_migration_arg; + cc->cc_migration_cpu = CPUBLOCK; + cc->cc_migration_ticks = 0; + cc->cc_migration_func = NULL; + cc->cc_migration_arg = NULL; + CC_UNLOCK(cc); + new_cc = CC_CPU(new_cpu); + CC_LOCK(new_cc); + MPASS(c->c_cpu == CPUBLOCK); + c->c_cpu = new_cpu; + callout_cc_add(c, new_cc, new_ticks, + new_func, new_arg, new_cpu); + CC_UNLOCK(new_cc); + CC_LOCK(cc); + } else if (cc->cc_waiting) { /* * There is someone waiting * for the callout to complete. @@ -617,7 +694,6 @@ callout_reset_on(struct callout *c, int */ if (c->c_flags & CALLOUT_LOCAL_ALLOC) cpu = c->c_cpu; -retry: cc = callout_lock(c); if (cc->cc_curr == c) { /* @@ -649,31 +725,34 @@ retry: cancelled = 1; c->c_flags &= ~(CALLOUT_ACTIVE | CALLOUT_PENDING); } +#ifdef SMP /* - * If the lock must migrate we have to check the state again as - * we can't hold both the new and old locks simultaneously. + * If the lock must migrate we have to block the callout locking + * until migration is completed. + * If the callout is currently running, just defer the migration + * to a more appropriate moment. */ if (c->c_cpu != cpu) { - c->c_cpu = cpu; + c->c_cpu = CPUBLOCK; + if (cc->cc_curr == c) { + cc->cc_migration_cpu = cpu; + cc->cc_migration_ticks = to_ticks; + cc->cc_migration_func = ftn; + cc->cc_migration_arg = arg; + CTR5(KTR_CALLOUT, + "migration of %p func %p arg %p in %d to %u deferred", + c, c->c_func, c->c_arg, to_ticks, cpu); + CC_UNLOCK(cc); + return (cancelled); + } CC_UNLOCK(cc); - goto retry; + cc = CC_CPU(cpu); + CC_LOCK(cc); + c->c_cpu = cpu; } +#endif - if (to_ticks <= 0) - to_ticks = 1; - - c->c_arg = arg; - c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); - c->c_func = ftn; - c->c_time = ticks + to_ticks; - TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], - c, c_links.tqe); - if ((c->c_time - cc->cc_firsttick) < 0 && - callout_new_inserted != NULL) { - cc->cc_firsttick = c->c_time; - (*callout_new_inserted)(cpu, - to_ticks + (ticks - cc->cc_ticks)); - } + callout_cc_add(c, cc, to_ticks, ftn, arg, cpu); CTR5(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d", cancelled ? "re" : "", c, c->c_func, c->c_arg, to_ticks); CC_UNLOCK(cc); @@ -701,7 +780,7 @@ _callout_stop_safe(c, safe) struct callout *c; int safe; { - struct callout_cpu *cc; + struct callout_cpu *cc, *old_cc; struct lock_class *class; int use_lock, sq_locked; @@ -721,8 +800,23 @@ _callout_stop_safe(c, safe) use_lock = 0; sq_locked = 0; + old_cc = NULL; again: cc = callout_lock(c); + + /* + * If the callout was migrating while the callout cpu lock was + * dropped, just drop the sleepqueue lock and check the states + * again. + */ + if (sq_locked != 0 && cc != old_cc) { + CC_UNLOCK(cc); + sleepq_release(&old_cc->cc_waiting); + sq_locked = 0; + old_cc = NULL; + goto again; + } + /* * If the callout isn't pending, it's not on the queue, so * don't attempt to remove it from the queue. We can try to @@ -774,6 +868,7 @@ again: CC_UNLOCK(cc); sleepq_lock(&cc->cc_waiting); sq_locked = 1; + old_cc = cc; goto again; } cc->cc_waiting = 1; @@ -784,6 +879,7 @@ again: SLEEPQ_SLEEP, 0); sleepq_wait(&cc->cc_waiting, 0); sq_locked = 0; + old_cc = NULL; /* Reacquire locks previously released. */ PICKUP_GIANT(); From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 18:34:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B78106564A; Wed, 29 Dec 2010 18:34:44 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 59AE18FC1B; Wed, 29 Dec 2010 18:34:44 +0000 (UTC) Received: by ywp6 with SMTP id 6so4684700ywp.13 for ; Wed, 29 Dec 2010 10:34:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; bh=HOsRr6Khfp33ZOyXL0hkdhV+NhFk/nkB5zgqqrx3xzk=; b=hOgEpnc2aY8YFO0Ek8y7n9y3l1OtTM9dvDOI35dHU3fzQGXmgaWWbdmqNxs4k68Msj bFKY6q5Ge3VIAaKnzYPtdezyrSeWroefUmJ4wCLHBG0ZeyDH3Rh8KwivaSuIQoGk/WS6 PKfAFdraqYQ4EEJNI0JQgJKiGCRF/emGpJJj4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=Szyqq7bgZPQt/sXS4bVVsKPTs26CvTvcwdvP6zWiWY+2yxqlBed5QqqLdFVyrhL5wl h4L5AexC3fIpbmfXHHg7C+9UIyzw/faxf1+HY5dT26XHhLW1V1z8WSYoPHvAZjxOpDNT 15elyvEdwpt6IQi23MJiuTAlcbUg3ZwSLdx08= MIME-Version: 1.0 Received: by 10.236.102.179 with SMTP id d39mr2571691yhg.13.1293647683087; Wed, 29 Dec 2010 10:34:43 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.236.109.45 with HTTP; Wed, 29 Dec 2010 10:34:43 -0800 (PST) In-Reply-To: <201012291817.oBTIHa0H009085@svn.freebsd.org> References: <201012291817.oBTIHa0H009085@svn.freebsd.org> Date: Wed, 29 Dec 2010 19:34:43 +0100 X-Google-Sender-Auth: FV-QIGWGac3G4ig0WRXDniY6lmc Message-ID: From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r216805 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 18:34:44 -0000 2010/12/29 Attilio Rao : > Author: attilio > Date: Wed Dec 29 18:17:36 2010 > New Revision: 216805 > URL: http://svn.freebsd.org/changeset/base/216805 > > Log: > =C2=A0Fix several callout migration races: ... > =C2=A0Reported by: =C2=A0Nicholas Esborn , Desert= Net > =C2=A0In collabouration with: =C2=A0 =C2=A0 =C2=A0 gianni, pho, Nicholas = Esborn This is a perfect example on how much help from FreeBSD shops and testers can make a huge difference for our Project. Nicholas and DesertNet were so eager to fix the bug that they gave me access to their 24-ways for several nights (and built a very nice debugging environment) as the bug was not really obvious. gianni@ spent some time writing down a prof-of-concept and testing several revisions of the patch (with several different compiling options). pho@ stress-tested several revisions of the patch finding not-really trivial bugs. I really want to acknowledge these guys for the 'underway' hard work they perform and really want to hope to see other people following the same footprints. Testing is often as important as developing patches. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 19:39:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51CF01065670; Wed, 29 Dec 2010 19:39:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 411568FC08; Wed, 29 Dec 2010 19:39:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTJdq0K010794; Wed, 29 Dec 2010 19:39:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTJdqDG010792; Wed, 29 Dec 2010 19:39:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012291939.oBTJdqDG010792@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 29 Dec 2010 19:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216806 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 19:39:52 -0000 Author: jilles Date: Wed Dec 29 19:39:51 2010 New Revision: 216806 URL: http://svn.freebsd.org/changeset/base/216806 Log: sh: Properly restore exception handler in fc. If SIGINT arrived at exactly the right moment (unlikely), an exception handler in a no longer active stack frame would be called. Because the old handler was not used in the normal path, clang thought it was a dead value and if an exception happened it would longjmp() to garbage. This caused builtins/fc1.0 to fail if histedit.c was compiled with clang. MFC after: 1 week Modified: head/bin/sh/histedit.c Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Wed Dec 29 18:17:36 2010 (r216805) +++ head/bin/sh/histedit.c Wed Dec 29 19:39:51 2010 (r216806) @@ -232,6 +232,7 @@ histcmd(int argc, char **argv) } argc -= optind, argv += optind; + savehandler = handler; /* * If executing... */ @@ -242,7 +243,6 @@ histcmd(int argc, char **argv) * Catch interrupts to reset active counter and * cleanup temp files. */ - savehandler = handler; if (setjmp(jmploc.loc)) { active = 0; if (editfile) @@ -399,6 +399,7 @@ histcmd(int argc, char **argv) --active; if (displayhist) displayhist = 0; + handler = savehandler; return 0; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 19:50:28 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E138106566C; Wed, 29 Dec 2010 19:50:28 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 27C0C8FC0A; Wed, 29 Dec 2010 19:50:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBTJjtdx075900; Wed, 29 Dec 2010 12:45:56 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1B8FF3.2040005@bsdimp.com> Date: Wed, 29 Dec 2010 12:45:55 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Garrett Cooper References: <201012272352.oBRNqeEb040247@svn.freebsd.org> <20101228015905.GA81514@troutmask.apl.washington.edu> <4D194551.7000004@freebsd.org> <20101228020900.GA81611@troutmask.apl.washington.edu> <4D1A1EDC.8010603@bsdimp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival , Steve Kargl Subject: Re: svn commit: r216746 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 19:50:28 -0000 On 12/29/2010 05:00, Garrett Cooper wrote: > On Tue, Dec 28, 2010 at 9:31 AM, Warner Losh wrote: >> On 12/27/2010 19:09, Steve Kargl wrote: >>> On Mon, Dec 27, 2010 at 06:02:57PM -0800, Colin Percival wrote: >>>> On 12/27/10 17:59, Steve Kargl wrote: >>>>> On Mon, Dec 27, 2010 at 11:52:40PM +0000, Colin Percival wrote: >>>>>> Make it possible to specify WITHOUT_MODULES in a kernel config file. >>>>> Can you explain how this differs from >>>>> makeoptions NO_MODULES >>>>> which has been able to do for years? >>>> NO_MODULES means what it says: No modules. >>>> >>>> WITHOUT_MODULES="foo bar baz" means "go ahead and build modules except >>>> for foo, >>>> bar, and baz". >>>> >>> Thanks. The distincion wasn't clear from the commit log. >>> I read it as "Build a kernel WITHOUT building MODULES", >>> which is what NO_MODULES does. >> which is why I'd like to have its name changed: it is confusing this way... > Wouldn't it be better to have MODULES_EXCLUDE and MODULES_INCLUDE > or something along those lines? MODULES_OVERRIDE doesn't really have a > nice clean antonym to go with it according to my friendly neighborhood > thesaurus. Yes. jhb and I have been talking about this, and will have some changes soon. Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 20:35:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7098F1065748; Wed, 29 Dec 2010 20:35:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50B408FC08; Wed, 29 Dec 2010 20:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTKZaxF012109; Wed, 29 Dec 2010 20:35:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTKZagg012107; Wed, 29 Dec 2010 20:35:36 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201012292035.oBTKZagg012107@svn.freebsd.org> From: Alan Cox Date: Wed, 29 Dec 2010 20:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216807 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 20:35:36 -0000 Author: alc Date: Wed Dec 29 20:35:36 2010 New Revision: 216807 URL: http://svn.freebsd.org/changeset/base/216807 Log: There is no point in vm_contig_launder{,_page}() flushing held pages, instead skip over them. As long as a page is held, it can't be reclaimed by contigmalloc(M_WAITOK). Moreover, a held page may be undergoing modification, e.g., vmapbuf(), so even if the hold were released before the completion of contigmalloc(), the page might have to be flushed again. MFC after: 3 weeks Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Wed Dec 29 19:39:51 2010 (r216806) +++ head/sys/vm/vm_contig.c Wed Dec 29 20:35:36 2010 (r216807) @@ -100,7 +100,7 @@ vm_contig_launder_page(vm_page_t m, vm_p vm_page_lock_assert(m, MA_OWNED); object = m->object; if (!VM_OBJECT_TRYLOCK(object) && - !vm_pageout_fallback_object_lock(m, next)) { + (!vm_pageout_fallback_object_lock(m, next) || m->hold_count != 0)) { vm_page_unlock(m); VM_OBJECT_UNLOCK(object); return (EAGAIN); @@ -111,7 +111,7 @@ vm_contig_launder_page(vm_page_t m, vm_p return (EBUSY); } vm_page_test_dirty(m); - if (m->dirty == 0 && m->hold_count == 0) + if (m->dirty == 0) pmap_remove_all(m); if (m->dirty != 0) { vm_page_unlock(m); @@ -146,8 +146,7 @@ vm_contig_launder_page(vm_page_t m, vm_p return (0); } } else { - if (m->hold_count == 0) - vm_page_cache(m); + vm_page_cache(m); vm_page_unlock(m); } VM_OBJECT_UNLOCK(object); @@ -171,7 +170,7 @@ vm_contig_launder(int queue, vm_paddr_t if (pa < low || pa + PAGE_SIZE > high) continue; - if (!vm_pageout_page_lock(m, &next)) { + if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) { vm_page_unlock(m); continue; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 21:04:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 852901065670; Wed, 29 Dec 2010 21:04:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73C648FC12; Wed, 29 Dec 2010 21:04:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTL4AlW013195; Wed, 29 Dec 2010 21:04:10 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTL4Adi013193; Wed, 29 Dec 2010 21:04:10 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012292104.oBTL4Adi013193@svn.freebsd.org> From: Rick Macklem Date: Wed, 29 Dec 2010 21:04:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216808 - releng/8.2/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 21:04:10 -0000 Author: rmacklem Date: Wed Dec 29 21:04:10 2010 New Revision: 216808 URL: http://svn.freebsd.org/changeset/base/216808 Log: MFC: r216691 Since VOP_READDIR() for ZFS does not return monotonically increasing directory offset cookies, disable the UFS related loop that skips over directory entries at the beginning of the block for the experimental NFS server. This loop is required for UFS since it always returns directory entries starting at the beginning of the block that the requested directory offset is in. In discussion with pjd@ and mckusick@ it seems that this behaviour of UFS should maybe change, with this fix being an interim patch until then. This patch only fixes the experimental server, since pjd@ is working on a patch for the regular server. Approved by: re (kib) Modified: releng/8.2/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- releng/8.2/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 29 20:35:36 2010 (r216807) +++ releng/8.2/sys/fs/nfsserver/nfs_nfsdport.c Wed Dec 29 21:04:10 2010 (r216808) @@ -1432,6 +1432,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd u_long *cookies = NULL, *cookiep; struct uio io; struct iovec iv; + int not_zfs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1484,6 +1485,7 @@ nfsrvd_readdir(struct nfsrv_descript *nd nfsrv_postopattr(nd, getret, &at); return (0); } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); NFSVOPUNLOCK(vp, 0, p); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1566,10 +1568,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -1678,6 +1682,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct uio io; struct iovec iv; struct componentname cn; + int not_zfs; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1755,6 +1760,7 @@ nfsrvd_readdirplus(struct nfsrv_descript nfsrv_postopattr(nd, getret, &at); return (0); } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs"); MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: @@ -1827,10 +1833,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff || + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff) || ((nd->nd_flag & ND_NFSV4) && ((dp->d_namlen == 1 && dp->d_name[0] == '.') || (dp->d_namlen==2 && dp->d_name[0]=='.' && dp->d_name[1]=='.'))))) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 21:38:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C54BF1065674; Wed, 29 Dec 2010 21:38:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B449D8FC18; Wed, 29 Dec 2010 21:38:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTLc0lK013950; Wed, 29 Dec 2010 21:38:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTLc05T013948; Wed, 29 Dec 2010 21:38:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012292138.oBTLc05T013948@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 29 Dec 2010 21:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216809 - head/usr.bin/printf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 21:38:00 -0000 Author: jilles Date: Wed Dec 29 21:38:00 2010 New Revision: 216809 URL: http://svn.freebsd.org/changeset/base/216809 Log: printf: Do not use sh memory functions in sh builtin. These functions throw exceptions if they fail, possibly causing memory leaks. The normal out-of-memory handling suffices. The INTOFF around almost all of printf prevents memory leaks due to SIGINT. Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Wed Dec 29 21:04:10 2010 (r216808) +++ head/usr.bin/printf/printf.c Wed Dec 29 21:38:00 2010 (r216809) @@ -58,7 +58,6 @@ static const char rcsid[] = #ifdef SHELL #define main printfcmd #include "bltin/bltin.h" -#include "memalloc.h" #include "error.h" #endif @@ -256,11 +255,7 @@ printf_doformat(char *start, int *rval) char *p; int getout; -#ifdef SHELL - p = savestr(getstr()); -#else p = strdup(getstr()); -#endif if (p == NULL) { warnx("%s", strerror(ENOMEM)); return (NULL); @@ -269,11 +264,7 @@ printf_doformat(char *start, int *rval) *(fmt - 1) = 's'; PF(start, p); *(fmt - 1) = 'b'; -#ifdef SHELL - ckfree(p); -#else free(p); -#endif if (getout) return (fmt); break; @@ -342,11 +333,7 @@ mknum(char *str, char ch) len = strlen(str) + 2; if (len > copy_size) { newlen = ((len + 1023) >> 10) << 10; -#ifdef SHELL - if ((newcopy = ckrealloc(copy, newlen)) == NULL) -#else if ((newcopy = realloc(copy, newlen)) == NULL) -#endif { warnx("%s", strerror(ENOMEM)); return (NULL); From owner-svn-src-all@FreeBSD.ORG Wed Dec 29 22:26:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78D54106566C; Wed, 29 Dec 2010 22:26:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6C78FC08; Wed, 29 Dec 2010 22:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBTMQo1w015166; Wed, 29 Dec 2010 22:26:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBTMQovf015162; Wed, 29 Dec 2010 22:26:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012292226.oBTMQovf015162@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Dec 2010 22:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216810 - in head/sys: kern vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 29 Dec 2010 22:26:50 -0000 Author: kib Date: Wed Dec 29 22:26:49 2010 New Revision: 216810 URL: http://svn.freebsd.org/changeset/base/216810 Log: Remove OBJ_CLEANING flag. The vfs_setdirty_locked_object() is the only consumer of the flag, and it used the flag because OBJ_MIGHTBEDIRTY was cleared early in vm_object_page_clean, before the cleaning pass was done. This is no longer true after r216799. Moreover, since OBJ_CLEANING is a flag, and not the counter, it could be reset too prematurely when parallel vm_object_page_clean() are performed. Reviewed by: alc (as a part of the bigger patch) MFC after: 1 month (after r216799 is merged) Modified: head/sys/kern/vfs_bio.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Dec 29 21:38:00 2010 (r216809) +++ head/sys/kern/vfs_bio.c Wed Dec 29 22:26:49 2010 (r216810) @@ -2523,7 +2523,7 @@ vfs_setdirty_locked_object(struct buf *b * We qualify the scan for modified pages on whether the * object has been flushed yet. */ - if (object->flags & (OBJ_MIGHTBEDIRTY|OBJ_CLEANING)) { + if ((object->flags & OBJ_MIGHTBEDIRTY) != 0) { vm_offset_t boffset; vm_offset_t eoffset; Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Dec 29 21:38:00 2010 (r216809) +++ head/sys/vm/vm_object.c Wed Dec 29 22:26:49 2010 (r216810) @@ -809,8 +809,6 @@ vm_object_page_clean(vm_object_t object, tend = (end == 0) ? object->size : end; - vm_object_set_flag(object, OBJ_CLEANING); - /* * Make the page read-only so we can then clear the object flags. * @@ -849,7 +847,6 @@ rescan: VOP_FSYNC(vp, (pagerflags & VM_PAGER_PUT_SYNC) ? MNT_WAIT : 0); #endif - vm_object_clear_flag(object, OBJ_CLEANING); if (clearobjflags && start == 0 && tend == object->size) vm_object_clear_flag(object, OBJ_MIGHTBEDIRTY); } Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Wed Dec 29 21:38:00 2010 (r216809) +++ head/sys/vm/vm_object.h Wed Dec 29 22:26:49 2010 (r216810) @@ -155,7 +155,6 @@ struct vm_object { #define OBJ_NOSPLIT 0x0010 /* dont split this object */ #define OBJ_PIPWNT 0x0040 /* paging in progress wanted */ #define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty, only for vnode */ -#define OBJ_CLEANING 0x0200 #define OBJ_COLORED 0x1000 /* pg_color is defined */ #define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ #define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 01:13:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC44C1065674; Thu, 30 Dec 2010 01:13:42 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABFE38FC1B; Thu, 30 Dec 2010 01:13:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU1Dgmh018669; Thu, 30 Dec 2010 01:13:42 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU1DgJJ018667; Thu, 30 Dec 2010 01:13:42 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012300113.oBU1DgJJ018667@svn.freebsd.org> From: Colin Percival Date: Thu, 30 Dec 2010 01:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216811 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 01:13:43 -0000 Author: cperciva Date: Thu Dec 30 01:13:42 2010 New Revision: 216811 URL: http://svn.freebsd.org/changeset/base/216811 Log: Remove INDEX-6 from the default portsnap configuration file; the 6.x index bits haven't been built since December 1st, although the mirrors are still distributing the bits as they were at the EoL. Reminded by: Alex Kozlov Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Wed Dec 29 22:26:49 2010 (r216810) +++ head/etc/portsnap.conf Thu Dec 30 01:13:42 2010 (r216811) @@ -30,6 +30,5 @@ KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddb # REFUSE korean polish portuguese russian ukrainian vietnamese # List of INDEX files to build and the DESCRIBE file to use for each -INDEX INDEX-6 DESCRIBE.6 INDEX INDEX-7 DESCRIBE.7 INDEX INDEX-8 DESCRIBE.8 From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 01:28:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AFD2106564A; Thu, 30 Dec 2010 01:28:56 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 500368FC15; Thu, 30 Dec 2010 01:28:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU1SuCQ018985; Thu, 30 Dec 2010 01:28:56 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU1Su5p018983; Thu, 30 Dec 2010 01:28:56 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012300128.oBU1Su5p018983@svn.freebsd.org> From: Colin Percival Date: Thu, 30 Dec 2010 01:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216812 - head/sys/xen/evtchn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 01:28:56 -0000 Author: cperciva Date: Thu Dec 30 01:28:56 2010 New Revision: 216812 URL: http://svn.freebsd.org/changeset/base/216812 Log: Add xenpic_dynirq_disable_intr and set it as the .pic_disable_intr method for xenpic_dynirq_template. This fixes a panic when a virtual disk is removed, since that results in an interrupt channel being disabled and NULL isn't very good function for disabling interrupts. We should probably have a xenpic_pirq_disable_intr as well; I'm not adding that here because (a) I'm not sure what uses pirqs so I don't have a test case, and (b) the xenpic_pirq_enable_intr code is significantly more complex than the xenpic_dynirq_enable_intr code, so I'm not sure what should go into a xenpic_pirq_disable_intr routine. PR: kern/153511 MFC after: 3 days Modified: head/sys/xen/evtchn/evtchn.c Modified: head/sys/xen/evtchn/evtchn.c ============================================================================== --- head/sys/xen/evtchn/evtchn.c Thu Dec 30 01:13:42 2010 (r216811) +++ head/sys/xen/evtchn/evtchn.c Thu Dec 30 01:28:56 2010 (r216812) @@ -628,6 +628,7 @@ static void xenpic_dynirq_enable_sou static void xenpic_dynirq_disable_source(struct intsrc *isrc, int); static void xenpic_dynirq_eoi_source(struct intsrc *isrc); static void xenpic_dynirq_enable_intr(struct intsrc *isrc); +static void xenpic_dynirq_disable_intr(struct intsrc *isrc); static void xenpic_pirq_enable_source(struct intsrc *isrc); static void xenpic_pirq_disable_source(struct intsrc *isrc, int); @@ -647,6 +648,7 @@ struct pic xenpic_dynirq_template = { .pic_disable_source = xenpic_dynirq_disable_source, .pic_eoi_source = xenpic_dynirq_eoi_source, .pic_enable_intr = xenpic_dynirq_enable_intr, + .pic_disable_intr = xenpic_dynirq_disable_intr, .pic_vector = xenpic_vector, .pic_source_pending = xenpic_source_pending, .pic_suspend = xenpic_suspend, @@ -716,6 +718,20 @@ xenpic_dynirq_enable_intr(struct intsrc } static void +xenpic_dynirq_disable_intr(struct intsrc *isrc) +{ + unsigned int irq; + struct xenpic_intsrc *xp; + + xp = (struct xenpic_intsrc *)isrc; + mtx_lock_spin(&irq_mapping_update_lock); + irq = xenpic_vector(isrc); + mask_evtchn(evtchn_from_irq(irq)); + xp->xp_masked = 1; + mtx_unlock_spin(&irq_mapping_update_lock); +} + +static void xenpic_dynirq_eoi_source(struct intsrc *isrc) { unsigned int irq; From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 02:18:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A4EB106564A; Thu, 30 Dec 2010 02:18:05 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E40058FC08; Thu, 30 Dec 2010 02:18:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU2I4Ll020071; Thu, 30 Dec 2010 02:18:04 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU2I4BF020068; Thu, 30 Dec 2010 02:18:04 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201012300218.oBU2I4BF020068@svn.freebsd.org> From: Sean Farley Date: Thu, 30 Dec 2010 02:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216813 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 02:18:05 -0000 Author: scf Date: Thu Dec 30 02:18:04 2010 New Revision: 216813 URL: http://svn.freebsd.org/changeset/base/216813 Log: Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after the information is set to FreeBSD. It had been falling through to the end of linux_ioctl_sound() and returning ENOIOCTL. Noticed when running the Linux ALSA amixer tool. Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype v2.1.0.81 binary. Reviewed by: gavin MFC after: 2 weeks Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Thu Dec 30 01:28:56 2010 (r216812) +++ head/sys/compat/linux/linux_ioctl.c Thu Dec 30 02:18:04 2010 (r216813) @@ -1749,7 +1749,7 @@ linux_ioctl_sound(struct thread *td, str strncpy(info.id, "OSS", sizeof(info.id) - 1); strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); copyout(&info, (void *)args->arg, sizeof(info)); - break; + return (0); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; @@ -1757,7 +1757,7 @@ linux_ioctl_sound(struct thread *td, str strncpy(info.id, "OSS", sizeof(info.id) - 1); strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); copyout(&info, (void *)args->arg, sizeof(info)); - break; + return (0); } default: return (ENOIOCTL); @@ -1774,6 +1774,10 @@ linux_ioctl_sound(struct thread *td, str args->cmd = SOUND_MIXER_READ_STEREODEVS; return (ioctl(td, (struct ioctl_args *)args)); + case LINUX_SOUND_MIXER_READ_CAPS: + args->cmd = SOUND_MIXER_READ_CAPS; + return (ioctl(td, (struct ioctl_args *)args)); + case LINUX_SOUND_MIXER_READ_RECMASK: args->cmd = SOUND_MIXER_READ_RECMASK; return (ioctl(td, (struct ioctl_args *)args)); Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Thu Dec 30 01:28:56 2010 (r216812) +++ head/sys/compat/linux/linux_ioctl.h Thu Dec 30 02:18:04 2010 (r216813) @@ -267,6 +267,7 @@ #define LINUX_SOUND_MIXER_INFO 0x4d65 #define LINUX_OSS_GETVERSION 0x4d76 #define LINUX_SOUND_MIXER_READ_STEREODEVS 0x4dfb +#define LINUX_SOUND_MIXER_READ_CAPS 0x4dfc #define LINUX_SOUND_MIXER_READ_RECMASK 0x4dfd #define LINUX_SOUND_MIXER_READ_DEVMASK 0x4dfe #define LINUX_SOUND_MIXER_WRITE_RECSRC 0x4dff From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 09:32:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A327106564A; Thu, 30 Dec 2010 09:32:40 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A8B8FC19; Thu, 30 Dec 2010 09:32:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU9WdFG029007; Thu, 30 Dec 2010 09:32:39 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU9WdM1029003; Thu, 30 Dec 2010 09:32:39 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012300932.oBU9WdM1029003@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 09:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216814 - in stable/8: bin/pkill tools/regression/usr.bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 09:32:40 -0000 Author: pjd Date: Thu Dec 30 09:32:39 2010 New Revision: 216814 URL: http://svn.freebsd.org/changeset/base/216814 Log: MFC r203802: - Implement -q option for pgrep(1). - Add regression test to test -q option. Added: stable/8/tools/regression/usr.bin/pkill/pgrep-q.t - copied unchanged from r203802, head/tools/regression/usr.bin/pkill/pgrep-q.t Modified: stable/8/bin/pkill/pkill.1 stable/8/bin/pkill/pkill.c Directory Properties: stable/8/bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) Modified: stable/8/bin/pkill/pkill.1 ============================================================================== --- stable/8/bin/pkill/pkill.1 Thu Dec 30 02:18:04 2010 (r216813) +++ stable/8/bin/pkill/pkill.1 Thu Dec 30 09:32:39 2010 (r216814) @@ -36,7 +36,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 16, 2009 +.Dd February 11, 2010 .Dt PKILL 1 .Os .Sh NAME @@ -44,7 +44,7 @@ .Nd find or signal processes by name .Sh SYNOPSIS .Nm pgrep -.Op Fl LSafilnovx +.Op Fl LSafilnoqvx .Op Fl F Ar pidfile .Op Fl G Ar gid .Op Fl M Ar core @@ -177,6 +177,8 @@ display the kill command used for each p Select only the newest (most recently started) of the matching processes. .It Fl o Select only the oldest (least recently started) of the matching processes. +.It Fl q +Do not write anything to standard output. .It Fl s Ar sid Restrict matches to processes with a session ID in the comma-separated list Modified: stable/8/bin/pkill/pkill.c ============================================================================== --- stable/8/bin/pkill/pkill.c Thu Dec 30 02:18:04 2010 (r216813) +++ stable/8/bin/pkill/pkill.c Thu Dec 30 09:32:39 2010 (r216814) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -110,6 +111,7 @@ static int matchargs; static int fullmatch; static int kthreads; static int cflags = REG_EXTENDED; +static int quiet; static kvm_t *kd; static pid_t mypid; @@ -180,10 +182,11 @@ main(int argc, char **argv) debug_opt = 0; pidfile = NULL; pidfilelock = 0; + quiet = 0; execf = NULL; coref = _PATH_DEVNULL; - while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) + while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnoqs:t:u:vx")) != -1) switch (ch) { case 'D': debug_opt++; @@ -256,6 +259,11 @@ main(int argc, char **argv) oldest = 1; criteria = 1; break; + case 'q': + if (!pgrep) + usage(); + quiet = 1; + break; case 's': makelist(&sidlist, LT_SID, optarg); criteria = 1; @@ -555,7 +563,7 @@ usage(void) const char *ustr; if (pgrep) - ustr = "[-LSfilnovx] [-d delim]"; + ustr = "[-LSfilnoqvx] [-d delim]"; else ustr = "[-signal] [-ILfilnovx]"; @@ -573,6 +581,10 @@ show_process(const struct kinfo_proc *kp { char **argv; + if (quiet) { + assert(pgrep); + return; + } if ((longfmt || !pgrep) && matchargs && (argv = kvm_getargv(kd, kp, 0)) != NULL) { printf("%d ", (int)kp->ki_pid); @@ -629,7 +641,8 @@ grepact(const struct kinfo_proc *kp) { show_process(kp); - printf("%s", delim); + if (!quiet) + printf("%s", delim); return (1); } Copied: stable/8/tools/regression/usr.bin/pkill/pgrep-q.t (from r203802, head/tools/regression/usr.bin/pkill/pgrep-q.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/pkill/pgrep-q.t Thu Dec 30 09:32:39 2010 (r216814, copy of r203802, head/tools/regression/usr.bin/pkill/pgrep-q.t) @@ -0,0 +1,38 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..4" + +name="pgrep -q" +sleep0=`mktemp /tmp/$base.XXXXXX` || exit 1 +sleep1=`mktemp /tmp/$base.XXXXXX` || exit 1 +ln -sf /bin/sleep $sleep0 +$sleep0 5 & +sleep 0.3 +pid=$! +out="`pgrep -q -f $sleep0 2>&1`" +if [ $? -eq 0 ]; then + echo "ok 1 - $name" +else + echo "not ok 1 - $name" +fi +if [ -z "${out}" ]; then + echo "ok 2 - $name" +else + echo "not ok 2 - $name" +fi +out="`pgrep -q -f $sleep1 2>&1`" +if [ $? -ne 0 ]; then + echo "ok 3 - $name" +else + echo "not ok 3 - $name" +fi +if [ -z "${out}" ]; then + echo "ok 4 - $name" +else + echo "not ok 4 - $name" +fi +kill $pid +rm -f $sleep0 $sleep1 From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 09:45:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03B66106564A; Thu, 30 Dec 2010 09:45:27 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E50648FC17; Thu, 30 Dec 2010 09:45:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU9jQO0029338; Thu, 30 Dec 2010 09:45:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU9jQXG029334; Thu, 30 Dec 2010 09:45:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012300945.oBU9jQXG029334@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 09:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216815 - stable/8/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 09:45:27 -0000 Author: pjd Date: Thu Dec 30 09:45:26 2010 New Revision: 216815 URL: http://svn.freebsd.org/changeset/base/216815 Log: MFC r216565,r216631,r216632,r216633,r216774: r216565: Reduce lock scope a little. r216631: On error, unbusy file system and jump to the end, so we won't try to unlock NULL *vpp. Reviewed by: kib r216632: - Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() - this is the only place that is different from all the other nfsrv_fhtovp() consumers. This simplifies nfsrv_fhtovp() a bit and also eliminates one vn_lock/VOP_UNLOCK() cycle in case of NFSv3. - Implement NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() that tells it to leave mount point busy. Reviewed by: kib r216633: Use newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point busy. This fixes a race where we can pass invalid mount point to VFS_VGET() via vp->v_mount when exported file system was forcibly unmounted between nfsrv_fhtovp() and VFS_VGET(). Reviewed by: kib r216774: ZFS might not return monotonically increasing directory offset cookies, so turn off UFS-specific hack that assumes so in ZFS case. Before the change we can miss returning some directory entries to a NFS client. I believe that the hack should be moved to ufs_readdir(), but until we find somebody who will do it, turn it off for ZFS in NFS server code. Submitted by: rmacklem Discussed with: rmacklem, mckusick Modified: stable/8/sys/nfsserver/nfs.h stable/8/sys/nfsserver/nfs_serv.c stable/8/sys/nfsserver/nfs_srvsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/nfsserver/nfs.h ============================================================================== --- stable/8/sys/nfsserver/nfs.h Thu Dec 30 09:32:39 2010 (r216814) +++ stable/8/sys/nfsserver/nfs.h Thu Dec 30 09:45:26 2010 (r216815) @@ -239,6 +239,12 @@ extern int nfs_debug; #endif +/* + * The following flags can be passed to nfsrv_fhtovp() function. + */ +/* Leave file system busy on success. */ +#define NFSRV_FLAG_BUSY 0x01 + struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **, caddr_t *); void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, @@ -264,7 +270,7 @@ int nfsrv_create(struct nfsrv_descript * struct mbuf **mrq); int nfsrv_fhtovp(fhandle_t *, int, struct vnode **, int *, struct nfsrv_descript *, struct nfssvc_sock *, struct sockaddr *, - int *, int); + int *); int nfsrv_setpublicfs(struct mount *, struct netexport *, struct export_args *); int nfs_ispublicfh(fhandle_t *); Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Thu Dec 30 09:32:39 2010 (r216814) +++ stable/8/sys/nfsserver/nfs_serv.c Thu Dec 30 09:45:26 2010 (r216815) @@ -213,8 +213,7 @@ nfsrv3_access(struct nfsrv_descript *nfs fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); tl = nfsm_dissect_nonblock(u_int32_t *, NFSX_UNSIGNED); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(1, NULL); @@ -280,8 +279,7 @@ nfsrv_getattr(struct nfsrv_descript *nfs vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, nam, - &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(0); error = 0; @@ -389,8 +387,7 @@ nfsrv_setattr(struct nfsrv_descript *nfs /* * Now that we have all the fields, lets do it. */ - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); @@ -712,8 +709,7 @@ nfsrv_readlink(struct nfsrv_descript *nf uiop->uio_rw = UIO_READ; uiop->uio_segflg = UIO_SYSSPACE; uiop->uio_td = NULL; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); if (v3) @@ -808,8 +804,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, * as well. */ - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { vp = NULL; nfsm_reply(2 * NFSX_UNSIGNED); @@ -1109,8 +1104,7 @@ nfsrv_write(struct nfsrv_descript *nfsd, error = 0; goto nfsmout; } - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { vp = NULL; @@ -2102,8 +2096,7 @@ nfsrv_link(struct nfsrv_descript *nfsd, nfsm_srvmtofh(dfhp); nfsm_srvnamesiz(len); - error = nfsrv_fhtovp(fhp, TRUE, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); @@ -2744,7 +2737,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs int v3 = (nfsd->nd_flag & ND_NFSV3); u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ - int vfslocked; + int vfslocked, not_zfs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; @@ -2770,8 +2763,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs if (siz > xfer) siz = xfer; fullsiz = siz; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (!error && vp->v_type != VDIR) { error = ENOTDIR; vput(vp); @@ -2809,6 +2801,7 @@ nfsrv_readdir(struct nfsrv_descript *nfs error = 0; goto nfsmout; } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; VOP_UNLOCK(vp, 0); /* @@ -2826,11 +2819,11 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_SHARED | LK_RETRY); if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; } + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (off_t)io.uio_offset; if (!cookies && !error) @@ -2895,10 +2888,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -3044,9 +3039,12 @@ nfsrv_readdirplus(struct nfsrv_descript int v3 = (nfsd->nd_flag & ND_NFSV3); int usevget = 1, vfslocked; struct componentname cn; + struct mount *mntp = NULL; + int not_zfs; nfsdbprintf(("%s %d\n", __FILE__, __LINE__)); vfslocked = 0; + vp_locked = 0; if (!v3) panic("nfsrv_readdirplus: v3 proc called on a v2 connection"); fhp = &nfh.fh_generic; @@ -3066,14 +3064,17 @@ nfsrv_readdirplus(struct nfsrv_descript if (siz > xfer) siz = xfer; fullsiz = siz; - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); - vp_locked = 1; - if (!error && vp->v_type != VDIR) { - error = ENOTDIR; - vput(vp); - vp = NULL; - vp_locked = 0; + error = nfsrv_fhtovp(fhp, NFSRV_FLAG_BUSY, &vp, &vfslocked, nfsd, slp, + nam, &rdonly); + if (!error) { + vp_locked = 1; + mntp = vp->v_mount; + if (vp->v_type != VDIR) { + error = ENOTDIR; + vput(vp); + vp = NULL; + vp_locked = 0; + } } if (error) { nfsm_reply(NFSX_UNSIGNED); @@ -3100,6 +3101,7 @@ nfsrv_readdirplus(struct nfsrv_descript error = 0; goto nfsmout; } + not_zfs = strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0; VOP_UNLOCK(vp, 0); vp_locked = 0; rbuf = malloc(siz, M_TEMP, M_WAITOK); @@ -3114,12 +3116,12 @@ again: io.uio_rw = UIO_READ; io.uio_td = NULL; eofflag = 0; - vn_lock(vp, LK_SHARED | LK_RETRY); vp_locked = 1; if (cookies) { free((caddr_t)cookies, M_TEMP); cookies = NULL; } + vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_READDIR(vp, &io, cred, &eofflag, &ncookies, &cookies); off = (u_quad_t)io.uio_offset; getret = VOP_GETATTR(vp, &at, cred); @@ -3179,10 +3181,12 @@ again: * skip over the records that precede the requested offset. This * requires the assumption that file offset cookies monotonically * increase. + * Since the offset cookies don't monotonically increase for ZFS, + * this is not done when ZFS is the file system. */ while (cpos < cend && ncookies > 0 && (dp->d_fileno == 0 || dp->d_type == DT_WHT || - ((u_quad_t)(*cookiep)) <= toff)) { + (not_zfs != 0 && ((u_quad_t)(*cookiep)) <= toff))) { cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; @@ -3215,8 +3219,8 @@ again: * For readdir_and_lookup get the vnode using * the file number. */ - error = VFS_VGET(vp->v_mount, dp->d_fileno, - LK_SHARED, &nvp); + error = VFS_VGET(mntp, dp->d_fileno, LK_SHARED, + &nvp); if (error != 0 && error != EOPNOTSUPP) { error = 0; goto invalid; @@ -3375,6 +3379,8 @@ invalid: nfsmout: if (vp) vrele(vp); + if (mntp) + vfs_unbusy(mntp); VFS_UNLOCK_GIANT(vfslocked); return(error); } @@ -3426,8 +3432,7 @@ nfsrv_commit(struct nfsrv_descript *nfsd off = fxdr_hyper(tl); tl += 2; cnt = fxdr_unsigned(int, *tl); - error = nfsrv_fhtovp(fhp, 1, &vp, &tvfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &tvfslocked, nfsd, slp, nam, &rdonly); vfslocked = nfsrv_lockedpair(vfslocked, tvfslocked); if (error) { nfsm_reply(2 * NFSX_UNSIGNED); @@ -3571,8 +3576,7 @@ nfsrv_statfs(struct nfsrv_descript *nfsd vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); if (v3) @@ -3666,8 +3670,7 @@ nfsrv_fsinfo(struct nfsrv_descript *nfsd fhp = &nfh.fh_generic; vfslocked = 0; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(getret, &at); @@ -3741,8 +3744,7 @@ nfsrv_pathconf(struct nfsrv_descript *nf vfslocked = 0; fhp = &nfh.fh_generic; nfsm_srvmtofh(fhp); - error = nfsrv_fhtovp(fhp, 1, &vp, &vfslocked, nfsd, slp, - nam, &rdonly, TRUE); + error = nfsrv_fhtovp(fhp, 0, &vp, &vfslocked, nfsd, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_UNSIGNED); nfsm_srvpostop_attr(getret, &at); Modified: stable/8/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- stable/8/sys/nfsserver/nfs_srvsubs.c Thu Dec 30 09:32:39 2010 (r216814) +++ stable/8/sys/nfsserver/nfs_srvsubs.c Thu Dec 30 09:45:26 2010 (r216815) @@ -639,16 +639,18 @@ nfs_namei(struct nameidata *ndp, struct goto out; } + if (!pubflag && nfs_ispublicfh(fhp)) + return (ESTALE); + /* * Extract and set starting directory. */ - error = nfsrv_fhtovp(fhp, FALSE, &dp, &dvfslocked, - nfsd, slp, nam, &rdonly, pubflag); + error = nfsrv_fhtovp(fhp, 0, &dp, &dvfslocked, nfsd, slp, nam, &rdonly); if (error) goto out; vfslocked = VFS_LOCK_GIANT(dp->v_mount); if (dp->v_type != VDIR) { - vrele(dp); + vput(dp); error = ENOTDIR; goto out; } @@ -662,12 +664,12 @@ nfs_namei(struct nameidata *ndp, struct */ *retdirp = dp; if (v3) { - vn_lock(dp, LK_EXCLUSIVE | LK_RETRY); *retdirattr_retp = VOP_GETATTR(dp, retdirattrp, ndp->ni_cnd.cn_cred); - VOP_UNLOCK(dp, 0); } + VOP_UNLOCK(dp, 0); + if (pubflag) { /* * Oh joy. For WebNFS, handle those pesky '%' escapes, @@ -1051,12 +1053,11 @@ nfsm_srvfattr(struct nfsrv_descript *nfs * - look up fsid in mount list (if not found ret error) * - get vp and export rights by calling VFS_FHTOVP() * - if cred->cr_uid == 0 or MNT_EXPORTANON set it to credanon - * - if not lockflag unlock it with VOP_UNLOCK() */ int -nfsrv_fhtovp(fhandle_t *fhp, int lockflag, struct vnode **vpp, int *vfslockedp, +nfsrv_fhtovp(fhandle_t *fhp, int flags, struct vnode **vpp, int *vfslockedp, struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, - struct sockaddr *nam, int *rdonlyp, int pubflag) + struct sockaddr *nam, int *rdonlyp) { struct mount *mp; int i; @@ -1076,7 +1077,7 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla *vpp = NULL; if (nfs_ispublicfh(fhp)) { - if (!pubflag || !nfs_pub.np_valid) + if (!nfs_pub.np_valid) return (ESTALE); fhp = &nfs_pub.np_handle; } @@ -1128,12 +1129,12 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla } } error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp); - if (error != 0) + if (error) { /* Make sure the server replies ESTALE to the client. */ error = ESTALE; - vfs_unbusy(mp); - if (error) + vfs_unbusy(mp); goto out; + } #ifdef MNT_EXNORESPORT if (!(exflags & (MNT_EXNORESPORT|MNT_EXPUBLIC))) { saddr = (struct sockaddr_in *)nam; @@ -1144,6 +1145,8 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla vput(*vpp); *vpp = NULL; error = NFSERR_AUTHERR | AUTH_TOOWEAK; + vfs_unbusy(mp); + goto out; } } #endif @@ -1160,8 +1163,8 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla else *rdonlyp = 0; - if (!lockflag) - VOP_UNLOCK(*vpp, 0); + if (!(flags & NFSRV_FLAG_BUSY)) + vfs_unbusy(mp); out: if (credanon != NULL) crfree(credanon); From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 09:46:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D26106564A; Thu, 30 Dec 2010 09:46:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31B8D8FC0C; Thu, 30 Dec 2010 09:46:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBU9kk2N029414; Thu, 30 Dec 2010 09:46:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBU9kk2e029410; Thu, 30 Dec 2010 09:46:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012300946.oBU9kk2e029410@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 09:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216816 - stable/8/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 09:46:46 -0000 Author: pjd Date: Thu Dec 30 09:46:45 2010 New Revision: 216816 URL: http://svn.freebsd.org/changeset/base/216816 Log: MFC r216477,r216478,r216479,r216494,r216721,r216722: r216477: Log the fact of launching and include protocol version number. r216478: Don't ignore errors from remote requests. r216479: Improve problems logging. r216494: The 'ret' variable is of type ssize_t and we use proper format for it (%zd), so no (bogus) cast is needed. r216721: When node-specific configuration is missing in resource section, provide more useful information. Instead of: hastd: remote address not configured for resource foo Print the following: No resource foo configuration for this node (acceptable node names: freefall, freefall.freebsd.org, 44333332-4c44-4e31-4a30-313920202020). r216722: Detect when resource is configured more than once. Modified: stable/8/sbin/hastd/hastd.c stable/8/sbin/hastd/parse.y stable/8/sbin/hastd/primary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hastd.c ============================================================================== --- stable/8/sbin/hastd/hastd.c Thu Dec 30 09:45:26 2010 (r216815) +++ stable/8/sbin/hastd/hastd.c Thu Dec 30 09:46:45 2010 (r216816) @@ -619,6 +619,9 @@ main_loop(void) PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGCHLD) == 0); + pjdlog_info("Started successfully, running protocol version %d.", + HAST_PROTO_VERSION); + for (;;) { while ((signo = sigtimedwait(&mask, NULL, &sigtimeout)) != -1) { switch (signo) { Modified: stable/8/sbin/hastd/parse.y ============================================================================== --- stable/8/sbin/hastd/parse.y Thu Dec 30 09:45:26 2010 (r216815) +++ stable/8/sbin/hastd/parse.y Thu Dec 30 09:46:45 2010 (r216816) @@ -55,7 +55,7 @@ extern char *yytext; static struct hastd_config *lconfig; static struct hast_resource *curres; -static bool mynode; +static bool mynode, hadmynode; static char depth0_control[HAST_ADDRSIZE]; static char depth0_listen[HAST_ADDRSIZE]; @@ -109,6 +109,44 @@ isitme(const char *name) return (0); } +static int +node_names(char **namesp) +{ + static char names[MAXHOSTNAMELEN * 3]; + char buf[MAXHOSTNAMELEN]; + char *pos; + size_t bufsize; + + if (gethostname(buf, sizeof(buf)) < 0) { + pjdlog_errno(LOG_ERR, "gethostname() failed"); + return (-1); + } + + /* First component of the host name. */ + pos = strchr(buf, '.'); + if (pos != NULL && pos != buf) { + (void)strlcpy(names, buf, MIN((size_t)(pos - buf + 1), + sizeof(names))); + (void)strlcat(names, ", ", sizeof(names)); + } + + /* Full host name. */ + (void)strlcat(names, buf, sizeof(names)); + (void)strlcat(names, ", ", sizeof(names)); + + /* Host UUID. */ + bufsize = sizeof(buf); + if (sysctlbyname("kern.hostuuid", buf, &bufsize, NULL, 0) < 0) { + pjdlog_errno(LOG_ERR, "sysctlbyname(kern.hostuuid) failed"); + return (-1); + } + (void)strlcat(names, buf, sizeof(names)); + + *namesp = names; + + return (0); +} + void yyerror(const char *str) { @@ -424,6 +462,20 @@ resource_statement: RESOURCE resource_st { if (curres != NULL) { /* + * There must be section for this node, at least with + * remote address configuration. + */ + if (!hadmynode) { + char *names; + + if (node_names(&names) != 0) + return (1); + pjdlog_error("No resource %s configuration for this node (acceptable node names: %s).", + curres->hr_name, names); + return (1); + } + + /* * Let's see there are some resource-level settings * that we can use for node-level settings. */ @@ -483,12 +535,23 @@ resource_statement: RESOURCE resource_st resource_start: STR { + /* Check if there is no duplicate entry. */ + TAILQ_FOREACH(curres, &lconfig->hc_resources, hr_next) { + if (strcmp(curres->hr_name, $1) == 0) { + pjdlog_error("Resource %s configured more than once.", + curres->hr_name); + free($1); + return (1); + } + } + /* * Clear those, so we can tell if they were set at * resource-level or not. */ depth1_provname[0] = '\0'; depth1_localpath[0] = '\0'; + hadmynode = false; curres = calloc(1, sizeof(*curres)); if (curres == NULL) { @@ -614,7 +677,7 @@ resource_node_start: STR case 0: break; case 1: - mynode = true; + mynode = hadmynode = true; break; default: assert(!"invalid isitme() return value"); Modified: stable/8/sbin/hastd/primary.c ============================================================================== --- stable/8/sbin/hastd/primary.c Thu Dec 30 09:45:26 2010 (r216815) +++ stable/8/sbin/hastd/primary.c Thu Dec 30 09:46:45 2010 (r216816) @@ -1133,6 +1133,15 @@ local_send_thread(void *arg) /* * If READ failed, try to read from remote node. */ + if (ret < 0) { + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s), trying remote node. ", + strerror(errno)); + } else if (ret != ggio->gctl_length) { + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%zd != %jd), trying remote node. ", + ret, (intmax_t)ggio->gctl_length); + } QUEUE_INSERT1(hio, send, rncomp); continue; } @@ -1141,28 +1150,43 @@ local_send_thread(void *arg) ret = pwrite(res->hr_localfd, ggio->gctl_data, ggio->gctl_length, ggio->gctl_offset + res->hr_localoff); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else if (ret != ggio->gctl_length) + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else if (ret != ggio->gctl_length) { hio->hio_errors[ncomp] = EIO; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%zd != %jd): ", + ret, (intmax_t)ggio->gctl_length); + } else { hio->hio_errors[ncomp] = 0; + } break; case BIO_DELETE: ret = g_delete(res->hr_localfd, ggio->gctl_offset + res->hr_localoff, ggio->gctl_length); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else { hio->hio_errors[ncomp] = 0; + } break; case BIO_FLUSH: ret = g_flush(res->hr_localfd); - if (ret < 0) + if (ret < 0) { hio->hio_errors[ncomp] = errno; - else + reqlog(LOG_WARNING, 0, ggio, + "Local request failed (%s): ", + strerror(errno)); + } else { hio->hio_errors[ncomp] = 0; + } break; } if (refcount_release(&hio->hio_countdown)) { @@ -1443,7 +1467,9 @@ remote_recv_thread(void *arg) error = nv_get_int16(nv, "error"); if (error != 0) { /* Request failed on remote side. */ - hio->hio_errors[ncomp] = 0; + hio->hio_errors[ncomp] = error; + reqlog(LOG_WARNING, 0, &hio->hio_ggio, + "Remote request failed (%s): ", strerror(error)); nv_free(nv); goto done_queue; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 10:41:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC9A1106566B; Thu, 30 Dec 2010 10:41:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A183F8FC0A; Thu, 30 Dec 2010 10:41:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUAfHI2037199; Thu, 30 Dec 2010 10:41:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUAfHVF037197; Thu, 30 Dec 2010 10:41:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012301041.oBUAfHVF037197@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Dec 2010 10:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216817 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 10:41:17 -0000 Author: kib Date: Thu Dec 30 10:41:17 2010 New Revision: 216817 URL: http://svn.freebsd.org/changeset/base/216817 Log: In indir_trunc(), when processing jnewblk entries that are not written to the disk, recurse to handle indirect blocks of next level that are hidden by the corresponding entry. In collaboration with: pho Reviewed by: jeff, mckusick Tested by: mckusick, pho Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 09:46:45 2010 (r216816) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 10:41:17 2010 (r216817) @@ -6140,17 +6140,20 @@ indir_trunc(freework, dbn, lbn) ufs1fmt = 0; bap2 = (ufs2_daddr_t *)bp->b_data; } + + if (needj) + freework->fw_ref += NINDIR(fs) + 1; + /* * Reclaim indirect blocks which never made it to disk. */ cnt = 0; LIST_FOREACH_SAFE(wk, &wkhd, wk_list, wkn) { - struct workhead freewk; if (wk->wk_type != D_JNEWBLK) continue; - WORKLIST_REMOVE_UNLOCKED(wk); - LIST_INIT(&freewk); - WORKLIST_INSERT_UNLOCKED(&freewk, wk); + ACQUIRE_LOCK(&lk); + WORKLIST_REMOVE(wk); + FREE_LOCK(&lk); jnewblk = WK_JNEWBLK(wk); if (jnewblk->jn_lbn > 0) i = (jnewblk->jn_lbn - -lbn) / lbnadd; @@ -6158,8 +6161,8 @@ indir_trunc(freework, dbn, lbn) i = (-(jnewblk->jn_lbn + level - 1) - -(lbn + level)) / lbnadd; KASSERT(i >= 0 && i < NINDIR(fs), - ("indir_trunc: Index out of range %d parent %jd lbn %jd", - i, lbn, jnewblk->jn_lbn)); + ("indir_trunc: Index out of range %d parent %jd lbn %jd level %d", + i, lbn, jnewblk->jn_lbn, level)); /* Clear the pointer so it isn't found below. */ if (ufs1fmt) { nb = bap1[i]; @@ -6171,13 +6174,29 @@ indir_trunc(freework, dbn, lbn) KASSERT(nb == jnewblk->jn_blkno, ("indir_trunc: Block mismatch %jd != %jd", nb, jnewblk->jn_blkno)); - ffs_blkfree(ump, fs, freeblks->fb_devvp, jnewblk->jn_blkno, - fs->fs_bsize, freeblks->fb_previousinum, &freewk); + if (level != 0) { + ufs_lbn_t nlbn; + + nlbn = (lbn + 1) - (i * lbnadd); + nfreework = newfreework(freeblks, freework, + nlbn, nb, fs->fs_frag, 0); + WORKLIST_INSERT_UNLOCKED(&nfreework->fw_jwork, wk); + freedeps++; + indir_trunc(nfreework, fsbtodb(fs, nb), nlbn); + } else { + struct workhead freewk; + + LIST_INIT(&freewk); + ACQUIRE_LOCK(&lk); + WORKLIST_INSERT(&freewk, wk); + FREE_LOCK(&lk); + ffs_blkfree(ump, fs, freeblks->fb_devvp, + jnewblk->jn_blkno, fs->fs_bsize, + freeblks->fb_previousinum, &freewk); + } cnt++; } ACQUIRE_LOCK(&lk); - if (needj) - freework->fw_ref += NINDIR(fs) + 1; /* Any remaining journal work can be completed with freeblks. */ jwork_move(&freeblks->fb_jwork, &wkhd); FREE_LOCK(&lk); From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 10:52:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00953106564A; Thu, 30 Dec 2010 10:52:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D99618FC0C; Thu, 30 Dec 2010 10:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUAq79A037461; Thu, 30 Dec 2010 10:52:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUAq7SH037458; Thu, 30 Dec 2010 10:52:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201012301052.oBUAq7SH037458@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 30 Dec 2010 10:52:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216818 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 10:52:08 -0000 Author: kib Date: Thu Dec 30 10:52:07 2010 New Revision: 216818 URL: http://svn.freebsd.org/changeset/base/216818 Log: Handle missing jremrefs when a directory is renamed overtop of another, deleting it. If the directory is removed, UFS always need to remove the .. ref, even if the ultimate ref on the parent would not change. The new directory must have a new journal entry for that ref. Otherwise journal processing would not properly account for the parent's reference since it will belong to a removed directory entry. Change ufs_rename()'s dotdot rename section to always setup_dotdot_link(). In the tip != NULL case SUJ needs the newref dependency allocated via setup_dotdot_link(). Stop setting isrmdir to 2 for newdirrem() in softdep_setup_remove(). Remove the isdirrem > 1 checks from newdirrem(). Reported by: many Submitted by: jeff Tested by: pho Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 10:41:17 2010 (r216817) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Dec 30 10:52:07 2010 (r216818) @@ -6918,7 +6918,7 @@ softdep_setup_remove(bp, dp, ip, isrmdir * newdirrem() to setup the full directory remove which requires * isrmdir > 1. */ - dirrem = newdirrem(bp, dp, ip, isrmdir?2:0, &prevdirrem); + dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem); /* * Add the dirrem to the inodedep's pending remove list for quick * discovery later. @@ -7152,14 +7152,12 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre ip->i_effnlink + 2); dotremref = newjremref(dirrem, ip, ip, DOT_OFFSET, ip->i_effnlink + 1); - } else - jremref = newjremref(dirrem, dp, ip, dp->i_offset, - ip->i_effnlink + 1); - if (isrmdir > 1) { dotdotremref = newjremref(dirrem, ip, dp, DOTDOT_OFFSET, dp->i_effnlink + 1); dotdotremref->jr_state |= MKDIR_PARENT; - } + } else + jremref = newjremref(dirrem, dp, ip, dp->i_offset, + ip->i_effnlink + 1); } ACQUIRE_LOCK(&lk); lbn = lblkno(dp->i_fs, dp->i_offset); @@ -7184,7 +7182,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre * cancel it. Any pending journal work will be added to the dirrem * to be completed when the workitem remove completes. */ - if (isrmdir > 1) + if (isrmdir) dotdotremref = cancel_diradd_dotdot(ip, dirrem, dotdotremref); /* * Check for a diradd dependency for the same directory entry. Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Thu Dec 30 10:41:17 2010 (r216817) +++ head/sys/ufs/ufs/ufs_vnops.c Thu Dec 30 10:52:07 2010 (r216818) @@ -1497,7 +1497,9 @@ relock: /* Don't go to bad here as the new link exists. */ if (error) goto unlockout; - } + } else if (DOINGSUJ(tdvp)) + /* Journal must account for each new link. */ + softdep_setup_dotdot_link(tdp, fip); fip->i_offset = mastertemplate.dot_reclen; ufs_dirrewrite(fip, fdp, newparent, DT_DIR, 0); cache_purge(fdvp); From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 15:04:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7266B1065693; Thu, 30 Dec 2010 15:04:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61CA68FC0A; Thu, 30 Dec 2010 15:04:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUF4xeH042715; Thu, 30 Dec 2010 15:04:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUF4xhx042713; Thu, 30 Dec 2010 15:04:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012301504.oBUF4xhx042713@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 30 Dec 2010 15:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216819 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 15:04:59 -0000 Author: jilles Date: Thu Dec 30 15:04:59 2010 New Revision: 216819 URL: http://svn.freebsd.org/changeset/base/216819 Log: sh: Add two tests for special cases in command substitution that already work in stable/8. Added: head/tools/regression/bin/sh/expansion/cmdsubst8.0 (contents, props changed) head/tools/regression/bin/sh/expansion/cmdsubst9.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/cmdsubst8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst8.0 Thu Dec 30 15:04:59 2010 (r216819) @@ -0,0 +1,17 @@ +# $FreeBSD$ +# Not required by POSIX (although referenced in a non-normative section), +# but possibly useful. + +: hi there & +p=$! +q=$(jobs -l $p) + +# Change tabs to spaces. +set -f +set -- $q +r="$*" + +case $r in +*" $p "*) ;; +*) echo Pid missing; exit 3 ;; +esac Added: head/tools/regression/bin/sh/expansion/cmdsubst9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst9.0 Thu Dec 30 15:04:59 2010 (r216819) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +set -e + +cd / +dummy=$(cd /bin) +[ "$(pwd)" = / ] + +v=1 +dummy=$(eval v=2) +[ "$v" = 1 ] From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 15:58:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B3461065673; Thu, 30 Dec 2010 15:58:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2922F8FC0C; Thu, 30 Dec 2010 15:58:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUFwO8A043902; Thu, 30 Dec 2010 15:58:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUFwOxG043899; Thu, 30 Dec 2010 15:58:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201012301558.oBUFwOxG043899@svn.freebsd.org> From: Marius Strobl Date: Thu, 30 Dec 2010 15:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216820 - in head/share: examples/etc mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 15:58:24 -0000 Author: marius Date: Thu Dec 30 15:58:23 2010 New Revision: 216820 URL: http://svn.freebsd.org/changeset/base/216820 Log: - Add CPUTYPE support for sparc64. The net result is that it's now possible to let the compiler optimize for the famility of UltraSPARC-III CPUs as the default already was to optimize for UltraSPARC-I/II and generating generic 64-bit V9 is mainly for reference purposes. At least for SPARC64-V CPUs code optimized for UltraSPARC-I/II still is the most performant one. Thanks go to Michael Moll for testing SPARC64-V. - Move a booke MACHINE_CPU bit into the right section. Modified: head/share/examples/etc/make.conf head/share/mk/bsd.cpu.mk Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Thu Dec 30 15:04:59 2010 (r216819) +++ head/share/examples/etc/make.conf Thu Dec 30 15:58:23 2010 (r216820) @@ -38,6 +38,8 @@ # (Via CPUs) c3 c3-2 # AMD64 architecture: opteron, athlon64, nocona, prescott, core2 # Intel ia64 architecture: itanium2, itanium +# SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default +# if omitted), ultrasparc3 # # (?= allows to buildworld for a different CPUTYPE.) # Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Dec 30 15:04:59 2010 (r216819) +++ head/share/mk/bsd.cpu.mk Thu Dec 30 15:58:23 2010 (r216820) @@ -15,6 +15,7 @@ MACHINE_CPU = itanium . elif ${MACHINE_CPUARCH} == "powerpc" MACHINE_CPU = aim . elif ${MACHINE_CPUARCH} == "sparc64" +MACHINE_CPU = ultrasparc . elif ${MACHINE_CPUARCH} == "arm" MACHINE_CPU = arm . elif ${MACHINE_CPUARCH} == "mips" @@ -58,6 +59,12 @@ CPUTYPE = athlon . if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" CPUTYPE = nocona . endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "us" +CPUTYPE = ultrasparc +. elif ${CPUTYPE} == "us3" +CPUTYPE = ultrasparc3 +. endif . endif ############################################################################### @@ -116,7 +123,6 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" -MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float . else _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 @@ -137,6 +143,14 @@ _CPUCFLAGS = -march=4kc . elif ${CPUTYPE} == "mips24kc" _CPUCFLAGS = -march=24kc . endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "v9" +_CPUCFLAGS = -mcpu=v9 +. elif ${CPUTYPE} == "ultrasparc" +_CPUCFLAGS = -mcpu=ultrasparc +. elif ${CPUTYPE} == "ultrasparc3" +_CPUCFLAGS = -mcpu=ultrasparc3 +. endif . endif # Set up the list of CPU features based on the CPU type. This is an @@ -193,10 +207,22 @@ MACHINE_CPU += amd64 sse2 sse mmx . if ${CPUTYPE} == "itanium" MACHINE_CPU = itanium . endif +. elif ${MACHINE_ARCH} == "powerpc" +. if ${CPUTYPE} == "e500" +MACHINE_CPU = booke +. endif +. elif ${MACHINE_ARCH} == "sparc64" +. if ${CPUTYPE} == "v9" +MACHINE_CPU = v9 +. elif ${CPUTYPE} == "ultrasparc" +MACHINE_CPU = v9 ultrasparc +. elif ${CPUTYPE} == "ultrasparc3" +MACHINE_CPU = v9 ultrasparc ultrasparc3 +. endif . endif .endif -.if ${MACHINE_CPUARCH} == "mips" +.if ${MACHINE_CPUARCH} == "mips" CFLAGS += -G0 .endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 16:23:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67EBC106566B; Thu, 30 Dec 2010 16:23:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCC08FC12; Thu, 30 Dec 2010 16:23:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUGNED2044454; Thu, 30 Dec 2010 16:23:14 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUGNE66044450; Thu, 30 Dec 2010 16:23:14 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012301623.oBUGNE66044450@svn.freebsd.org> From: Michael Tuexen Date: Thu, 30 Dec 2010 16:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216821 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 16:23:14 -0000 Author: tuexen Date: Thu Dec 30 16:23:13 2010 New Revision: 216821 URL: http://svn.freebsd.org/changeset/base/216821 Log: Fix three bugs related to the sequence number wrap-around affecting the processing of ECNE and ASCONF chunks. Reviewed by: rrs MFC after: 3 days. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Dec 30 15:58:23 2010 (r216820) +++ head/sys/netinet/sctp_asconf.c Thu Dec 30 16:23:13 2010 (r216821) @@ -632,7 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_SEQ) || + if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || serial_num == asoc->asconf_seq_in) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 30 15:58:23 2010 (r216820) +++ head/sys/netinet/sctp_input.c Thu Dec 30 16:23:13 2010 (r216821) @@ -2944,7 +2944,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_SEQ)) + if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) break; lchk = TAILQ_NEXT(lchk, sctp_next); } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Dec 30 15:58:23 2010 (r216820) +++ head/sys/netinet/sctp_output.c Thu Dec 30 16:23:13 2010 (r216821) @@ -6477,7 +6477,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_SEQ)) { + if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_TSN)) { /* Not Acked yet */ break; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 16:56:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 782BF1065670; Thu, 30 Dec 2010 16:56:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48B788FC18; Thu, 30 Dec 2010 16:56:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUGuKb8045224; Thu, 30 Dec 2010 16:56:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUGuK3C045218; Thu, 30 Dec 2010 16:56:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012301656.oBUGuK3C045218@svn.freebsd.org> From: Michael Tuexen Date: Thu, 30 Dec 2010 16:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216822 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 16:56:20 -0000 Author: tuexen Date: Thu Dec 30 16:56:20 2010 New Revision: 216822 URL: http://svn.freebsd.org/changeset/base/216822 Log: Code cleanup: Use LIST_FOREACH, LIST_FOREACH_SAFE, TAILQ_FOREACH, TAILQ_FOREACH_SAFE where appropriate. No functional change. MFC after: 3 months. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Dec 30 16:23:13 2010 (r216821) +++ head/sys/netinet/sctp_asconf.c Thu Dec 30 16:56:20 2010 (r216822) @@ -656,19 +656,16 @@ sctp_handle_asconf(struct mbuf *m, unsig /* delete old cache */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n"); - ack = TAILQ_FIRST(&stcb->asoc.asconf_ack_sent); - while (ack != NULL) { - ack_next = TAILQ_NEXT(ack, next); + TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) { if (ack->serial_number == serial_num) break; SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: delete old(%u) < first(%u)\n", ack->serial_number, serial_num); - TAILQ_REMOVE(&stcb->asoc.asconf_ack_sent, ack, next); + TAILQ_REMOVE(&asoc->asconf_ack_sent, ack, next); if (ack->data != NULL) { sctp_m_freem(ack->data); } SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), ack); - ack = ack_next; } } m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, @@ -1264,9 +1261,7 @@ sctp_asconf_queue_mgmt(struct sctp_tcb * struct sockaddr *sa; /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, &ifa->address.sa) == 0) continue; @@ -1480,9 +1475,7 @@ sctp_asconf_queue_sa_delete(struct sctp_ return (-1); } /* make sure the request isn't already in the queue */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { /* address match? */ if (sctp_asconf_addr_match(aa, sa) == 0) continue; @@ -1836,9 +1829,7 @@ sctp_handle_asconf_ack(struct mbuf *m, i */ if (last_error_id == 0) last_error_id--;/* set to "max" value */ - for (aa = TAILQ_FIRST(&stcb->asoc.asconf_queue); aa != NULL; - aa = aa_next) { - aa_next = TAILQ_NEXT(aa, next); + TAILQ_FOREACH_SAFE(aa, &stcb->asoc.asconf_queue, next, aa_next) { if (aa->sent == 1) { /* * implicitly successful or failed if correlation_id @@ -2098,14 +2089,11 @@ sctp_asconf_iterator_ep_end(struct sctp_ } } } else if (l->action == SCTP_DEL_IP_ADDRESS) { - laddr = LIST_FIRST(&inp->sctp_addr_list); - while (laddr) { - nladdr = LIST_NEXT(laddr, sctp_nxt_addr); + LIST_FOREACH_SAFE(laddr, &inp->sctp_addr_list, sctp_nxt_addr, nladdr) { /* remove only after all guys are done */ if (laddr->ifa == ifa) { sctp_del_local_addr_ep(inp, ifa); } - laddr = nladdr; } } } @@ -2285,12 +2273,10 @@ sctp_asconf_iterator_end(void *ptr, uint { struct sctp_asconf_iterator *asc; struct sctp_ifa *ifa; - struct sctp_laddr *l, *l_next; + struct sctp_laddr *l, *nl; asc = (struct sctp_asconf_iterator *)ptr; - l = LIST_FIRST(&asc->list_of_work); - while (l != NULL) { - l_next = LIST_NEXT(l, sctp_nxt_addr); + LIST_FOREACH_SAFE(l, &asc->list_of_work, sctp_nxt_addr, nl) { ifa = l->ifa; if (l->action == SCTP_ADD_IP_ADDRESS) { /* Clear the defer use flag */ @@ -2299,7 +2285,6 @@ sctp_asconf_iterator_end(void *ptr, uint sctp_free_ifa(ifa); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), l); SCTP_DECR_LADDR_COUNT(); - l = l_next; } SCTP_FREE(asc, SCTP_M_ASC_IT); } @@ -2394,11 +2379,7 @@ sctp_is_addr_pending(struct sctp_tcb *st add_cnt = del_cnt = 0; last_param_type = 0; - for (chk = TAILQ_FIRST(&stcb->asoc.asconf_send_queue); chk != NULL; - chk = nchk) { - /* get next chk */ - nchk = TAILQ_NEXT(chk, sctp_next); - + TAILQ_FOREACH_SAFE(chk, &stcb->asoc.asconf_send_queue, sctp_next, nchk) { if (chk->data == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: No mbuf data?\n"); continue; Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Thu Dec 30 16:23:13 2010 (r216821) +++ head/sys/netinet/sctp_bsd_addr.c Thu Dec 30 16:56:20 2010 (r216822) @@ -77,9 +77,9 @@ static int __sctp_thread_based_iterator_ static void sctp_cleanup_itqueue(void) { - struct sctp_iterator *it; + struct sctp_iterator *it, *nit; - while ((it = TAILQ_FIRST(&sctp_it_ctl.iteratorhead)) != NULL) { + TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Dec 30 16:23:13 2010 (r216821) +++ head/sys/netinet/sctp_indata.c Thu Dec 30 16:56:20 2010 (r216822) @@ -344,13 +344,12 @@ sctp_mark_non_revokable(struct sctp_asso static void sctp_service_reassembly(struct sctp_tcb *stcb, struct sctp_association *asoc) { - struct sctp_tmit_chunk *chk; + struct sctp_tmit_chunk *chk, *nchk; uint16_t nxt_todel; uint16_t stream_no; int end = 0; int cntDel; - - struct sctp_queued_to_read *control, *ctl, *ctlat; + struct sctp_queued_to_read *control, *ctl, *nctl; if (stcb == NULL) return; @@ -362,8 +361,7 @@ sctp_service_reassembly(struct sctp_tcb /* socket above is long gone or going.. */ abandon: asoc->fragmented_delivery_inprogress = 0; - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); asoc->size_on_reasm_queue -= chk->send_size; sctp_ucount_decr(asoc->cnt_on_reasm_queue); @@ -378,16 +376,11 @@ abandon: /* Now free the address and data */ sctp_free_a_chunk(stcb, chk); /* sa_ignore FREED_MEMORY */ - chk = TAILQ_FIRST(&asoc->reasmqueue); } return; } SCTP_TCB_LOCK_ASSERT(stcb); - do { - chk = TAILQ_FIRST(&asoc->reasmqueue); - if (chk == NULL) { - return; - } + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { if (chk->rec.data.TSN_seq != (asoc->tsn_last_delivered + 1)) { /* Can't deliver more :< */ return; @@ -496,33 +489,26 @@ abandon: strm = &asoc->strmin[stream_no]; nxt_todel = strm->last_sequence_delivered + 1; - ctl = TAILQ_FIRST(&strm->inqueue); - if (ctl && (nxt_todel == ctl->sinfo_ssn)) { - while (ctl != NULL) { - /* Deliver more if we can. */ - if (nxt_todel == ctl->sinfo_ssn) { - ctlat = TAILQ_NEXT(ctl, next); - TAILQ_REMOVE(&strm->inqueue, ctl, next); - asoc->size_on_all_streams -= ctl->length; - sctp_ucount_decr(asoc->cnt_on_all_streams); - strm->last_sequence_delivered++; - sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - ctl, - &stcb->sctp_socket->so_rcv, 1, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - ctl = ctlat; - } else { - break; - } - nxt_todel = strm->last_sequence_delivered + 1; + TAILQ_FOREACH_SAFE(ctl, &strm->inqueue, next, nctl) { + /* Deliver more if we can. */ + if (nxt_todel == ctl->sinfo_ssn) { + TAILQ_REMOVE(&strm->inqueue, ctl, next); + asoc->size_on_all_streams -= ctl->length; + sctp_ucount_decr(asoc->cnt_on_all_streams); + strm->last_sequence_delivered++; + sctp_mark_non_revokable(asoc, ctl->sinfo_tsn); + sctp_add_to_readq(stcb->sctp_ep, stcb, + ctl, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + } else { + break; } + nxt_todel = strm->last_sequence_delivered + 1; } break; } - /* sa_ignore FREED_MEMORY */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - } while (chk); + } } /* @@ -626,12 +612,10 @@ protocol_error: control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - control = TAILQ_FIRST(&strm->inqueue); - while (control != NULL) { + TAILQ_FOREACH_SAFE(control, &strm->inqueue, next, at) { /* all delivered */ nxt_todel = strm->last_sequence_delivered + 1; if (nxt_todel == control->sinfo_ssn) { - at = TAILQ_NEXT(control, next); TAILQ_REMOVE(&strm->inqueue, control, next); asoc->size_on_all_streams -= control->length; sctp_ucount_decr(asoc->cnt_on_all_streams); @@ -652,7 +636,6 @@ protocol_error: &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - control = at; continue; } break; @@ -756,7 +739,7 @@ sctp_is_all_msg_on_reasm(struct sctp_ass return (0); } tsn = chk->rec.data.TSN_seq; - while (chk) { + TAILQ_FOREACH(chk, &asoc->reasmqueue, sctp_next) { if (tsn != chk->rec.data.TSN_seq) { return (0); } @@ -765,7 +748,6 @@ sctp_is_all_msg_on_reasm(struct sctp_ass return (1); } tsn++; - chk = TAILQ_NEXT(chk, sctp_next); } return (0); } @@ -2090,14 +2072,14 @@ failed_pdapi_express_del: /* first one on */ TAILQ_INSERT_TAIL(&asoc->pending_reply_queue, control, next); } else { - struct sctp_queued_to_read *ctlOn; + struct sctp_queued_to_read *ctlOn, + *nctlOn; unsigned char inserted = 0; - ctlOn = TAILQ_FIRST(&asoc->pending_reply_queue); - while (ctlOn) { + TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { if (compare_with_wrap(control->sinfo_tsn, ctlOn->sinfo_tsn, MAX_TSN)) { - ctlOn = TAILQ_NEXT(ctlOn, next); + continue; } else { /* found it */ TAILQ_INSERT_BEFORE(ctlOn, control, next); @@ -2166,27 +2148,27 @@ finish_express_del: * pending_reply space 3: distribute any chunks in * pending_reply_queue. */ - struct sctp_queued_to_read *ctl; + struct sctp_queued_to_read *ctl, *nctl; sctp_reset_in_stream(stcb, liste->number_entries, liste->req.list_of_streams); TAILQ_REMOVE(&asoc->resetHead, liste, next_resp); SCTP_FREE(liste, SCTP_M_STRESET); /* sa_ignore FREED_MEMORY */ liste = TAILQ_FIRST(&asoc->resetHead); - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); - if (ctl && (liste == NULL)) { + if (TAILQ_EMPTY(&asoc->resetHead)) { /* All can be removed */ - while (ctl) { + TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { TAILQ_REMOVE(&asoc->pending_reply_queue, ctl, next); sctp_queue_data_to_stream(stcb, asoc, ctl, abort_flag); if (*abort_flag) { return (0); } - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); } - } else if (ctl) { - /* more than one in queue */ - while (!compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + } else { + TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { + if (compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + break; + } /* * if ctl->sinfo_tsn is <= liste->tsn we can * process it which is the NOT of @@ -2197,7 +2179,6 @@ finish_express_del: if (*abort_flag) { return (0); } - ctl = TAILQ_FIRST(&asoc->pending_reply_queue); } } /* @@ -3143,8 +3124,7 @@ sctp_check_for_revoked(struct sctp_tcb * struct sctp_tmit_chunk *tp1; int tot_revoked = 0; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (compare_with_wrap(tp1->rec.data.TSN_seq, cumack, MAX_TSN)) { /* @@ -3196,7 +3176,6 @@ sctp_check_for_revoked(struct sctp_tcb * } if (tp1->sent == SCTP_DATAGRAM_UNSENT) break; - tp1 = TAILQ_NEXT(tp1, sctp_next); } if (tot_revoked > 0) { /* @@ -3252,12 +3231,10 @@ sctp_strike_gap_ack_chunks(struct sctp_t if (stcb->asoc.peer_supports_prsctp) { (void)SCTP_GETTIME_TIMEVAL(&now); } - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { strike_flag = 0; if (tp1->no_fr_allowed) { /* this one had a timeout or something */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { @@ -3283,7 +3260,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t (SCTP_RESPONSE_TO_USER_REQ | SCTP_NOTIFY_DATAGRAM_SENT), SCTP_SO_NOT_LOCKED); } - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } } @@ -3300,7 +3276,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t /* Continue strikin FWD-TSN chunks */ tp1->rec.data.fwd_tsn_cnt++; } - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } /* @@ -3313,7 +3288,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t * CMT, no data sent to this dest can be marked for * FR using this SACK. */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } else if (tp1->whoTo && compare_with_wrap(tp1->rec.data.TSN_seq, tp1->whoTo->this_sack_highest_newack, MAX_TSN)) { @@ -3325,7 +3299,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t * this SACK. This step covers part of the DAC algo * and the HTNA algo as well. */ - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } /* @@ -3546,7 +3519,6 @@ sctp_strike_gap_ack_chunks(struct sctp_t } /* Make sure to flag we had a FR */ tp1->whoTo->net_ack++; - tp1 = TAILQ_NEXT(tp1, sctp_next); continue; } } @@ -3660,8 +3632,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t atomic_add_int(&alt->ref_count, 1); } } - tp1 = TAILQ_NEXT(tp1, sctp_next); - } /* while (tp1) */ + } if (tot_retrans > 0) { /* @@ -3686,8 +3657,7 @@ sctp_try_advance_peer_ack_point(struct s if (asoc->peer_supports_prsctp == 0) { return (NULL); } - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (tp1->sent != SCTP_FORWARD_TSN_SKIP && tp1->sent != SCTP_DATAGRAM_RESEND) { /* no chance to advance, out of here */ @@ -3711,7 +3681,6 @@ sctp_try_advance_peer_ack_point(struct s (void)SCTP_GETTIME_TIMEVAL(&now); now_filled = 1; } - tp2 = TAILQ_NEXT(tp1, sctp_next); /* * now we got a chunk which is marked for another * retransmission to a PR-stream but has run out its chances @@ -3763,11 +3732,6 @@ sctp_try_advance_peer_ack_point(struct s */ break; } - /* - * If we hit here we just dumped tp1, move to next tsn on - * sent queue. - */ - tp1 = tp2; } return (a_adv); } @@ -3961,9 +3925,7 @@ sctp_express_handle_sack(struct sctp_tcb stcb->asoc.overall_error_count = 0; if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) { /* process the new consecutive TSN first */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { - tp2 = TAILQ_NEXT(tp1, sctp_next); + TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq, MAX_TSN) || cumack == tp1->rec.data.TSN_seq) { @@ -4051,6 +4013,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_free_bufspace(stcb, asoc, tp1, 1); sctp_m_freem(tp1->data); + tp1->data = NULL; } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SACK_LOGGING_ENABLE) { sctp_log_sack(asoc->last_acked_seq, @@ -4060,10 +4023,8 @@ sctp_express_handle_sack(struct sctp_tcb 0, SCTP_LOG_FREE_SENT); } - tp1->data = NULL; asoc->sent_queue_cnt--; sctp_free_a_chunk(stcb, tp1); - tp1 = tp2; } else { break; } @@ -4612,8 +4573,7 @@ sctp_handle_sack(struct mbuf *m, int off net->will_exit_fast_recovery = 0; } /* process the new consecutive TSN first */ - tp1 = TAILQ_FIRST(&asoc->sent_queue); - while (tp1) { + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { if (compare_with_wrap(last_tsn, tp1->rec.data.TSN_seq, MAX_TSN) || last_tsn == tp1->rec.data.TSN_seq) { @@ -4725,7 +4685,6 @@ sctp_handle_sack(struct mbuf *m, int off } else { break; } - tp1 = TAILQ_NEXT(tp1, sctp_next); } biggest_tsn_newly_acked = biggest_tsn_acked = last_tsn; /* always set this up to cum-ack */ @@ -4899,36 +4858,32 @@ sctp_handle_sack(struct mbuf *m, int off } else if (asoc->saw_sack_with_frags) { int cnt_revoked = 0; - tp1 = TAILQ_FIRST(&asoc->sent_queue); - if (tp1 != NULL) { - /* Peer revoked all dg's marked or acked */ - TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (tp1->sent == SCTP_DATAGRAM_ACKED) { - tp1->sent = SCTP_DATAGRAM_SENT; - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { - sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, - tp1->whoTo->flight_size, - tp1->book_size, - (uintptr_t) tp1->whoTo, - tp1->rec.data.TSN_seq); - } - sctp_flight_size_increase(tp1); - sctp_total_flight_increase(stcb, tp1); - tp1->rec.data.chunk_was_revoked = 1; - /* - * To ensure that this increase in - * flightsize, which is artificial, - * does not throttle the sender, we - * also increase the cwnd - * artificially. - */ - tp1->whoTo->cwnd += tp1->book_size; - cnt_revoked++; + /* Peer revoked all dg's marked or acked */ + TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { + if (tp1->sent == SCTP_DATAGRAM_ACKED) { + tp1->sent = SCTP_DATAGRAM_SENT; + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { + sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE, + tp1->whoTo->flight_size, + tp1->book_size, + (uintptr_t) tp1->whoTo, + tp1->rec.data.TSN_seq); } + sctp_flight_size_increase(tp1); + sctp_total_flight_increase(stcb, tp1); + tp1->rec.data.chunk_was_revoked = 1; + /* + * To ensure that this increase in + * flightsize, which is artificial, does not + * throttle the sender, we also increase the + * cwnd artificially. + */ + tp1->whoTo->cwnd += tp1->book_size; + cnt_revoked++; } - if (cnt_revoked) { - reneged_all = 1; - } + } + if (cnt_revoked) { + reneged_all = 1; } asoc->saw_sack_with_frags = 0; } @@ -5346,9 +5301,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * First deliver anything prior to and including the stream no that * came in */ - ctl = TAILQ_FIRST(&strmin->inqueue); - while (ctl) { - nctl = TAILQ_NEXT(ctl, next); + TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { if (compare_with_wrap(tt, ctl->sinfo_ssn, MAX_SEQ) || (tt == ctl->sinfo_ssn)) { /* this is deliverable now */ @@ -5367,16 +5320,13 @@ sctp_kick_prsctp_reorder_queue(struct sc /* no more delivery now. */ break; } - ctl = nctl; } /* * now we must deliver things in queue the normal way if any are * now ready. */ tt = strmin->last_sequence_delivered + 1; - ctl = TAILQ_FIRST(&strmin->inqueue); - while (ctl) { - nctl = TAILQ_NEXT(ctl, next); + TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { if (tt == ctl->sinfo_ssn) { /* this is deliverable now */ TAILQ_REMOVE(&strmin->inqueue, ctl, next); @@ -5396,7 +5346,6 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { break; } - ctl = nctl; } } @@ -5405,87 +5354,73 @@ sctp_flush_reassm_for_str_seq(struct sct struct sctp_association *asoc, uint16_t stream, uint16_t seq) { - struct sctp_tmit_chunk *chk, *at; + struct sctp_tmit_chunk *chk, *nchk; - if (!TAILQ_EMPTY(&asoc->reasmqueue)) { - /* For each one on here see if we need to toss it */ + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are complete + * will be tossed too. We could in theory do more work to spin + * through and stop after dumping one msg aka seeing the start of a + * new msg at the head, and call the delivery function... to see if + * it can be delivered... But for now we just dump everything on the + * queue. + */ + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { /* - * For now large messages held on the reasmqueue that are - * complete will be tossed too. We could in theory do more - * work to spin through and stop after dumping one msg aka - * seeing the start of a new msg at the head, and call the - * delivery function... to see if it can be delivered... But - * for now we just dump everything on the queue. + * Do not toss it if on a different stream or marked for + * unordered delivery in which case the stream sequence + * number has no meaning. */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { - at = TAILQ_NEXT(chk, sctp_next); - /* - * Do not toss it if on a different stream or marked - * for unordered delivery in which case the stream - * sequence number has no meaning. - */ - if ((chk->rec.data.stream_number != stream) || - ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { - chk = at; - continue; + if ((chk->rec.data.stream_number != stream) || + ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) == SCTP_DATA_UNORDERED)) { + continue; + } + if (chk->rec.data.stream_seq == seq) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = chk->rec.data.TSN_seq; + asoc->str_of_pdapi = chk->rec.data.stream_number; + asoc->ssn_of_pdapi = chk->rec.data.stream_seq; + asoc->fragment_flags = chk->rec.data.rcv_flags; } - if (chk->rec.data.stream_seq == seq) { - /* It needs to be tossed */ - TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { - asoc->tsn_last_delivered = - chk->rec.data.TSN_seq; - asoc->str_of_pdapi = - chk->rec.data.stream_number; - asoc->ssn_of_pdapi = - chk->rec.data.stream_seq; - asoc->fragment_flags = - chk->rec.data.rcv_flags; - } - asoc->size_on_reasm_queue -= chk->send_size; - sctp_ucount_decr(asoc->cnt_on_reasm_queue); - - /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { - /* - * We must dump forward this streams - * sequence number if the chunk is - * not unordered that is being - * skipped. There is a chance that - * if the peer does not include the - * last fragment in its FWD-TSN we - * WILL have a problem here since - * you would have a partial chunk in - * queue that may not be - * deliverable. Also if a Partial - * delivery API as started the user - * may get a partial chunk. The next - * read returning a new chunk... - * really ugly but I see no way - * around it! Maybe a notify?? - */ - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = - chk->rec.data.stream_seq; - } - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk); - } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { - /* - * If the stream_seq is > than the purging - * one, we are done + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is not + * unordered that is being skipped. There is + * a chance that if the peer does not + * include the last fragment in its FWD-TSN + * we WILL have a problem here since you + * would have a partial chunk in queue that + * may not be deliverable. Also if a Partial + * delivery API as started the user may get + * a partial chunk. The next read returning + * a new chunk... really ugly but I see no + * way around it! Maybe a notify?? */ - break; + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq; + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; } - chk = at; + sctp_free_a_chunk(stcb, chk); + } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + /* + * If the stream_seq is > than the purging one, we + * are done + */ + break; } } } @@ -5524,7 +5459,7 @@ sctp_handle_forward_tsn(struct sctp_tcb unsigned int i, fwd_sz, cumack_set_flag, m_size; uint32_t str_seq; struct sctp_stream_in *strm; - struct sctp_tmit_chunk *chk, *at; + struct sctp_tmit_chunk *chk, *nchk; struct sctp_queued_to_read *ctl, *sv; cumack_set_flag = 0; @@ -5618,77 +5553,64 @@ sctp_handle_forward_tsn(struct sctp_tcb if (asoc->fragmented_delivery_inprogress) { sctp_service_reassembly(stcb, asoc); } - if (!TAILQ_EMPTY(&asoc->reasmqueue)) { - /* For each one on here see if we need to toss it */ - /* - * For now large messages held on the reasmqueue that are - * complete will be tossed too. We could in theory do more - * work to spin through and stop after dumping one msg aka - * seeing the start of a new msg at the head, and call the - * delivery function... to see if it can be delivered... But - * for now we just dump everything on the queue. - */ - chk = TAILQ_FIRST(&asoc->reasmqueue); - while (chk) { - at = TAILQ_NEXT(chk, sctp_next); - if ((compare_with_wrap(new_cum_tsn, - chk->rec.data.TSN_seq, MAX_TSN)) || - (new_cum_tsn == chk->rec.data.TSN_seq)) { - /* It needs to be tossed */ - TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { - asoc->tsn_last_delivered = - chk->rec.data.TSN_seq; - asoc->str_of_pdapi = - chk->rec.data.stream_number; - asoc->ssn_of_pdapi = - chk->rec.data.stream_seq; - asoc->fragment_flags = - chk->rec.data.rcv_flags; - } - asoc->size_on_reasm_queue -= chk->send_size; - sctp_ucount_decr(asoc->cnt_on_reasm_queue); - - /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { - /* - * We must dump forward this streams - * sequence number if the chunk is - * not unordered that is being - * skipped. There is a chance that - * if the peer does not include the - * last fragment in its FWD-TSN we - * WILL have a problem here since - * you would have a partial chunk in - * queue that may not be - * deliverable. Also if a Partial - * delivery API as started the user - * may get a partial chunk. The next - * read returning a new chunk... - * really ugly but I see no way - * around it! Maybe a notify?? - */ - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = - chk->rec.data.stream_seq; - } - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } - sctp_free_a_chunk(stcb, chk); - } else { - /* - * Ok we have gone beyond the end of the - * fwd-tsn's mark. + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are complete + * will be tossed too. We could in theory do more work to spin + * through and stop after dumping one msg aka seeing the start of a + * new msg at the head, and call the delivery function... to see if + * it can be delivered... But for now we just dump everything on the + * queue. + */ + TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { + if ((compare_with_wrap(new_cum_tsn, + chk->rec.data.TSN_seq, MAX_TSN)) || + (new_cum_tsn == chk->rec.data.TSN_seq)) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = chk->rec.data.TSN_seq; + asoc->str_of_pdapi = chk->rec.data.stream_number; + asoc->ssn_of_pdapi = chk->rec.data.stream_seq; + asoc->fragment_flags = chk->rec.data.rcv_flags; + } + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is not + * unordered that is being skipped. There is + * a chance that if the peer does not + * include the last fragment in its FWD-TSN + * we WILL have a problem here since you + * would have a partial chunk in queue that + * may not be deliverable. Also if a Partial + * delivery API as started the user may get + * a partial chunk. The next read returning + * a new chunk... really ugly but I see no + * way around it! Maybe a notify?? */ - break; + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = chk->rec.data.stream_seq; } - chk = at; + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } + sctp_free_a_chunk(stcb, chk); + } else { + /* + * Ok we have gone beyond the end of the fwd-tsn's + * mark. + */ + break; } } /*******************************************************/ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 30 16:23:13 2010 (r216821) +++ head/sys/netinet/sctp_input.c Thu Dec 30 16:56:20 2010 (r216822) @@ -193,7 +193,7 @@ int sctp_is_there_unsent_data(struct sctp_tcb *stcb) { int unsent_data = 0; - struct sctp_stream_queue_pending *sp; + struct sctp_stream_queue_pending *sp, *nsp; struct sctp_stream_out *strq; struct sctp_association *asoc; @@ -205,15 +205,9 @@ sctp_is_there_unsent_data(struct sctp_tc */ asoc = &stcb->asoc; SCTP_TCB_SEND_LOCK(stcb); - if (!TAILQ_EMPTY(&asoc->out_wheel)) { - /* Check to see if some data queued */ - TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { - is_there_another: - /* sa_ignore FREED_MEMORY */ - sp = TAILQ_FIRST(&strq->outqueue); - if (sp == NULL) { - continue; - } + TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { + /* sa_ignore FREED_MEMORY */ + TAILQ_FOREACH_SAFE(sp, &strq->outqueue, next, nsp) { if ((sp->msg_is_complete) && (sp->length == 0) && (sp->sender_all_done)) { @@ -230,7 +224,7 @@ sctp_is_there_unsent_data(struct sctp_tc sp->msg_is_complete, sp->put_last_out); } - atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); + atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); if (sp->net) { sctp_free_remote_addr(sp->net); @@ -241,10 +235,9 @@ sctp_is_there_unsent_data(struct sctp_tc sp->data = NULL; } sctp_free_a_strmoq(stcb, sp); - goto is_there_another; } else { unsent_data++; - continue; + break; } } } @@ -280,38 +273,32 @@ sctp_process_init(struct sctp_init_chunk if (asoc->pre_open_streams > ntohs(init->num_inbound_streams)) { unsigned int newcnt; struct sctp_stream_out *outs; - struct sctp_stream_queue_pending *sp; - struct sctp_tmit_chunk *chk, *chk_next; + struct sctp_stream_queue_pending *sp, *nsp; + struct sctp_tmit_chunk *chk, *nchk; /* abandon the upper streams */ newcnt = ntohs(init->num_inbound_streams); - if (!TAILQ_EMPTY(&asoc->send_queue)) { - chk = TAILQ_FIRST(&asoc->send_queue); - while (chk) { - chk_next = TAILQ_NEXT(chk, sctp_next); - if (chk->rec.data.stream_number >= newcnt) { - TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); - asoc->send_queue_cnt--; - if (chk->data != NULL) { - sctp_free_bufspace(stcb, asoc, chk, 1); - sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, - SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); - if (chk->data) { - sctp_m_freem(chk->data); - chk->data = NULL; - } + TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { + if (chk->rec.data.stream_number >= newcnt) { + TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next); + asoc->send_queue_cnt--; + if (chk->data != NULL) { + sctp_free_bufspace(stcb, asoc, chk, 1); + sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb, + SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED); + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); - /* sa_ignore FREED_MEMORY */ } - chk = chk_next; + sctp_free_a_chunk(stcb, chk); + /* sa_ignore FREED_MEMORY */ } } if (asoc->strmout) { for (i = newcnt; i < asoc->pre_open_streams; i++) { outs = &asoc->strmout[i]; - sp = TAILQ_FIRST(&outs->outqueue); - while (sp) { + TAILQ_FOREACH_SAFE(sp, &outs->outqueue, next, nsp) { TAILQ_REMOVE(&outs->outqueue, sp, next); asoc->stream_queue_cnt--; sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL, @@ -328,7 +315,6 @@ sctp_process_init(struct sctp_init_chunk /* Free the chunk */ sctp_free_a_strmoq(stcb, sp); /* sa_ignore FREED_MEMORY */ - sp = TAILQ_FIRST(&outs->outqueue); } } } @@ -355,18 +341,16 @@ sctp_process_init(struct sctp_init_chunk if (asoc->strmin != NULL) { /* Free the old ones */ - struct sctp_queued_to_read *ctl; + struct sctp_queued_to_read *ctl, *nctl; for (i = 0; i < asoc->streamincnt; i++) { - ctl = TAILQ_FIRST(&asoc->strmin[i].inqueue); - while (ctl) { + TAILQ_FOREACH_SAFE(ctl, &asoc->strmin[i].inqueue, next, nctl) { TAILQ_REMOVE(&asoc->strmin[i].inqueue, ctl, next); sctp_free_remote_addr(ctl->whoFrom); ctl->whoFrom = NULL; sctp_m_freem(ctl->data); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 18:06:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A78E1065675; Thu, 30 Dec 2010 18:06:32 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E7518FC19; Thu, 30 Dec 2010 18:06:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUI6VC0046735; Thu, 30 Dec 2010 18:06:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUI6VcW046731; Thu, 30 Dec 2010 18:06:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201012301806.oBUI6VcW046731@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 30 Dec 2010 18:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 18:06:32 -0000 Author: pjd Date: Thu Dec 30 18:06:31 2010 New Revision: 216823 URL: http://svn.freebsd.org/changeset/base/216823 Log: For compatibility with Linux and Solaris add poweroff(8). It is implemented as a hard link to shutdown(8) and it is equivalent of: # shutdown -p now While I'm here put one line of usage into one line of C code so it is easier to grep(1) and separate unrelated code with empty line. MFC after: 2 weeks Modified: head/sbin/shutdown/Makefile head/sbin/shutdown/shutdown.8 head/sbin/shutdown/shutdown.c Modified: head/sbin/shutdown/Makefile ============================================================================== --- head/sbin/shutdown/Makefile Thu Dec 30 16:56:20 2010 (r216822) +++ head/sbin/shutdown/Makefile Thu Dec 30 18:06:31 2010 (r216823) @@ -3,6 +3,8 @@ PROG= shutdown MAN= shutdown.8 +LINKS= ${BINDIR}/shutdown ${BINDIR}/poweroff +MLINKS= shutdown.8 poweroff.8 BINOWN= root BINGRP= operator Modified: head/sbin/shutdown/shutdown.8 ============================================================================== --- head/sbin/shutdown/shutdown.8 Thu Dec 30 16:56:20 2010 (r216822) +++ head/sbin/shutdown/shutdown.8 Thu Dec 30 18:06:31 2010 (r216823) @@ -28,11 +28,12 @@ .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 .\" $FreeBSD$ .\" -.Dd December 23, 2008 +.Dd December 30, 2010 .Dt SHUTDOWN 8 .Os .Sh NAME -.Nm shutdown +.Nm shutdown , +.Nm poweroff .Nd "close down the system at a given time" .Sh SYNOPSIS .Nm @@ -47,6 +48,7 @@ .Oc .Ar time .Op Ar warning-message ... +.Nm poweroff .Sh DESCRIPTION The .Nm @@ -173,6 +175,13 @@ When run without options, the utility will place the system into single user mode at the .Ar time specified. +.Pp +Calling utility as +.Nm poweroff +is equivalent of calling: +.Bd -literal -offset indent +shutdown -p now +.Ed .Sh FILES .Bl -tag -width /var/run/nologin -compact .It Pa /var/run/nologin Modified: head/sbin/shutdown/shutdown.c ============================================================================== --- head/sbin/shutdown/shutdown.c Thu Dec 30 16:56:20 2010 (r216822) +++ head/sbin/shutdown/shutdown.c Thu Dec 30 18:06:31 2010 (r216823) @@ -115,8 +115,31 @@ main(int argc, char **argv) if (geteuid()) errx(1, "NOT super-user"); #endif + nosync = NULL; readstdin = 0; + + /* + * Test for the special case where the utility is called as + * "poweroff", for which it runs 'shutdown -p now'. + */ + if ((p = rindex(argv[0], '/')) == NULL) + p = argv[0]; + else + ++p; + if (strcmp(p, "poweroff") == 0) { + if (getopt(argc, argv, "") != -1) + usage((char *)NULL); + argc -= optind; + argv += optind; + if (argc != 0) + usage((char *)NULL); + dopower = 1; + offset = 0; + (void)time(&shuttime); + goto poweroff; + } + while ((ch = getopt(argc, argv, "-hknopr")) != -1) switch (ch) { case '-': @@ -161,6 +184,7 @@ main(int argc, char **argv) getoffset(*argv++); +poweroff: if (*argv) { for (p = mbuf, len = sizeof(mbuf); *argv; ++argv) { arglen = strlen(*argv); @@ -510,7 +534,7 @@ usage(const char *cp) if (cp != NULL) warnx("%s", cp); (void)fprintf(stderr, - "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]]" - " time [warning-message ...]\n"); + "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]] time [warning-message ...]\n" + " poweroff\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 18:29:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF2C1065698; Thu, 30 Dec 2010 18:29:22 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF2B08FC15; Thu, 30 Dec 2010 18:29:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUITM54047458; Thu, 30 Dec 2010 18:29:22 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUITMK6047456; Thu, 30 Dec 2010 18:29:22 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012301829.oBUITMK6047456@svn.freebsd.org> From: Bernhard Schmidt Date: Thu, 30 Dec 2010 18:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216824 - head/sys/dev/wpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 18:29:23 -0000 Author: bschmidt Date: Thu Dec 30 18:29:22 2010 New Revision: 216824 URL: http://svn.freebsd.org/changeset/base/216824 Log: The RX path is missing a few bus_dmamap_*() calls, this results in modification of memory which was already free'd and eventually in: wpi0: could not map mbuf (error 12) wpi0: wpi_rx_intr: bus_dmamap_load failed, error 12 and an usuable device. PR: kern/144898 MFC after: 3 days Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Thu Dec 30 18:06:31 2010 (r216823) +++ head/sys/dev/wpi/if_wpi.c Thu Dec 30 18:29:22 2010 (r216824) @@ -1052,9 +1052,18 @@ wpi_free_rx_ring(struct wpi_softc *sc, s wpi_dma_contig_free(&ring->desc_dma); - for (i = 0; i < WPI_RX_RING_COUNT; i++) - if (ring->data[i].m != NULL) - m_freem(ring->data[i].m); + for (i = 0; i < WPI_RX_RING_COUNT; i++) { + struct wpi_rx_data *data = &ring->data[i]; + + if (data->m != NULL) { + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->data_dmat, data->map); + m_freem(data->m); + } + if (data->map != NULL) + bus_dmamap_destroy(ring->data_dmat, data->map); + } } static int @@ -1461,6 +1470,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct return; } + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); head = (struct wpi_rx_head *)((caddr_t)(stat + 1) + stat->len); tail = (struct wpi_rx_tail *)((caddr_t)(head + 1) + le16toh(head->len)); @@ -1491,6 +1501,8 @@ wpi_rx_intr(struct wpi_softc *sc, struct ifp->if_ierrors++; return; } + bus_dmamap_unload(ring->data_dmat, data->map); + error = bus_dmamap_load(ring->data_dmat, data->map, mtod(mnew, caddr_t), MJUMPAGESIZE, wpi_dma_map_addr, &paddr, BUS_DMA_NOWAIT); From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 21:32:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A93106564A; Thu, 30 Dec 2010 21:32:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 029008FC12; Thu, 30 Dec 2010 21:32:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBULWZko051515; Thu, 30 Dec 2010 21:32:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBULWZfc051507; Thu, 30 Dec 2010 21:32:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201012302132.oBULWZfc051507@svn.freebsd.org> From: Michael Tuexen Date: Thu, 30 Dec 2010 21:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216825 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 21:32:36 -0000 Author: tuexen Date: Thu Dec 30 21:32:35 2010 New Revision: 216825 URL: http://svn.freebsd.org/changeset/base/216825 Log: Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macros and use them instead of the generic compare_with_wrap. Retire compare_with_wrap. MFC after: 3 months. Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_asconf.c Thu Dec 30 21:32:35 2010 (r216825) @@ -632,8 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsig asoc = &stcb->asoc; serial_num = ntohl(cp->serial_number); - if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) || - serial_num == asoc->asconf_seq_in) { + if (SCTP_TSN_GE(asoc->asconf_seq_in, serial_num)) { /* got a duplicate ASCONF */ SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: got duplicate serial number = %xh\n", Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_constants.h Thu Dec 30 21:32:35 2010 (r216825) @@ -322,7 +322,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_VERSION_NUMBER 0x3 #define MAX_TSN 0xffffffff -#define MAX_SEQ 0xffff /* how many executions every N tick's */ #define SCTP_ITERATOR_MAX_AT_ONCE 20 @@ -906,10 +905,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_MAX_DATA_BUNDLING 256 /* modular comparison */ -/* True if a > b (mod = M) */ -#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \ - ((b > a) && ((b - a) > ((M >> 1) + 1)))) - +/* See RFC 1982 for details. */ +#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ + ((a > b) && ((a - b) < (1<<15)))) +#define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) +#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ + ((a > b) && ((a - b) < (1<<31)))) +#define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ #define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01) Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_indata.c Thu Dec 30 21:32:35 2010 (r216825) @@ -298,7 +298,7 @@ sctp_mark_non_revokable(struct sctp_asso return; } cumackp1 = asoc->cumulative_tsn + 1; - if (compare_with_wrap(cumackp1, tsn, MAX_TSN)) { + if (SCTP_TSN_GT(cumackp1, tsn)) { /* * this tsn is behind the cum ack and thus we don't need to * worry about it being moved from one to the other. @@ -315,13 +315,12 @@ sctp_mark_non_revokable(struct sctp_asso } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == asoc->highest_tsn_inside_map) { /* We must back down to see what the new highest is */ - for (i = tsn - 1; (compare_with_wrap(i, asoc->mapping_array_base_tsn, MAX_TSN) || - (i == asoc->mapping_array_base_tsn)); i--) { + for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { asoc->highest_tsn_inside_map = i; @@ -558,9 +557,7 @@ sctp_queue_data_to_stream(struct sctp_tc (uint32_t) control->sinfo_stream, (uint32_t) strm->last_sequence_delivered, (uint32_t) nxt_todel); - if (compare_with_wrap(strm->last_sequence_delivered, - control->sinfo_ssn, MAX_SEQ) || - (strm->last_sequence_delivered == control->sinfo_ssn)) { + if (SCTP_SSN_GE(strm->last_sequence_delivered, control->sinfo_ssn)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "Duplicate S-SEQ:%d delivered:%d from peer, Abort association\n", control->sinfo_ssn, strm->last_sequence_delivered); @@ -646,9 +643,7 @@ protocol_error: * Ok, we did not deliver this guy, find the correct place * to put it on the queue. */ - if ((compare_with_wrap(asoc->cumulative_tsn, - control->sinfo_tsn, MAX_TSN)) || - (control->sinfo_tsn == asoc->cumulative_tsn)) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, control->sinfo_tsn)) { goto protocol_error; } if (TAILQ_EMPTY(&strm->inqueue)) { @@ -659,8 +654,7 @@ protocol_error: TAILQ_INSERT_HEAD(&strm->inqueue, control, next); } else { TAILQ_FOREACH(at, &strm->inqueue, next) { - if (compare_with_wrap(at->sinfo_ssn, - control->sinfo_ssn, MAX_SEQ)) { + if (SCTP_SSN_GT(at->sinfo_ssn, control->sinfo_ssn)) { /* * one in queue is bigger than the * new one, insert before this one @@ -991,8 +985,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } /* Find its place */ TAILQ_FOREACH(at, &asoc->reasmqueue, sctp_next) { - if (compare_with_wrap(at->rec.data.TSN_seq, - chk->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(at->rec.data.TSN_seq, chk->rec.data.TSN_seq)) { /* * one in queue is bigger than the new one, insert * before this one @@ -1383,8 +1376,7 @@ sctp_does_tsn_belong_to_reasm(struct sct uint32_t tsn_est; TAILQ_FOREACH(at, &asoc->reasmqueue, sctp_next) { - if (compare_with_wrap(TSN_seq, - at->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(TSN_seq, at->rec.data.TSN_seq)) { /* is it one bigger? */ tsn_est = at->rec.data.TSN_seq + 1; if (tsn_est == TSN_seq) { @@ -1467,8 +1459,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } SCTP_LTRACE_CHK(stcb->sctp_ep, stcb, ch->ch.chunk_type, tsn); - if (compare_with_wrap(asoc->cumulative_tsn, tsn, MAX_TSN) || - asoc->cumulative_tsn == tsn) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* It is a duplicate */ SCTP_STAT_INCR(sctps_recvdupdata); if (asoc->numduptsns < SCTP_MAX_DUP_TSNS) { @@ -1492,7 +1483,7 @@ sctp_process_a_data_chunk(struct sctp_tc return (0); } } - if (compare_with_wrap(tsn, *high_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, *high_tsn)) { *high_tsn = tsn; } /* See if we have received this one already */ @@ -1564,8 +1555,8 @@ sctp_process_a_data_chunk(struct sctp_tc #endif } /* now is it in the mapping array of what we have accepted? */ - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN) && - compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map) && + SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { /* Nope not in the valid range dump it */ sctp_set_rwnd(stcb, asoc); if ((asoc->cnt_on_all_streams + @@ -1610,7 +1601,7 @@ sctp_process_a_data_chunk(struct sctp_tc SCTP_STAT_INCR(sctps_badsid); SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } if (tsn == (asoc->cumulative_tsn + 1)) { @@ -1646,9 +1637,7 @@ sctp_process_a_data_chunk(struct sctp_tc if ((chunk_flags & SCTP_DATA_FIRST_FRAG) && (TAILQ_EMPTY(&asoc->resetHead)) && (chunk_flags & SCTP_DATA_UNORDERED) == 0 && - (compare_with_wrap(asoc->strmin[strmno].last_sequence_delivered, - strmseq, MAX_SEQ) || - asoc->strmin[strmno].last_sequence_delivered == strmseq)) { + SCTP_SSN_GE(asoc->strmin[strmno].last_sequence_delivered, strmseq)) { /* The incoming sseq is behind where we last delivered? */ SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); @@ -1759,7 +1748,7 @@ sctp_process_a_data_chunk(struct sctp_tc goto failed_express_del; } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } sctp_add_to_readq(stcb->sctp_ep, stcb, @@ -1813,7 +1802,7 @@ failed_express_del: goto failed_pdapi_express_del; } SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } SCTP_STAT_INCR(sctps_recvexpressm); @@ -1847,12 +1836,12 @@ failed_pdapi_express_del: control = NULL; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = tsn; } } else { SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap); - if (compare_with_wrap(tsn, asoc->highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_map)) { asoc->highest_tsn_inside_map = tsn; } } @@ -2062,8 +2051,7 @@ failed_pdapi_express_del: * singletons I must worry about. */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && - ((compare_with_wrap(tsn, liste->tsn, MAX_TSN))) - ) { + SCTP_TSN_GT(tsn, liste->tsn)) { /* * yep its past where we need to reset... go * ahead and queue it. @@ -2077,8 +2065,7 @@ failed_pdapi_express_del: unsigned char inserted = 0; TAILQ_FOREACH_SAFE(ctlOn, &asoc->pending_reply_queue, next, nctlOn) { - if (compare_with_wrap(control->sinfo_tsn, - ctlOn->sinfo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(control->sinfo_tsn, ctlOn->sinfo_tsn)) { continue; } else { /* found it */ @@ -2139,9 +2126,7 @@ finish_express_del: } /* check the special flag for stream resets */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && - ((compare_with_wrap(asoc->cumulative_tsn, liste->tsn, MAX_TSN)) || - (asoc->cumulative_tsn == liste->tsn)) - ) { + SCTP_TSN_GE(asoc->cumulative_tsn, liste->tsn)) { /* * we have finished working through the backlogged TSN's now * time to reset streams. 1: call reset function. 2: free @@ -2166,7 +2151,7 @@ finish_express_del: } } else { TAILQ_FOREACH_SAFE(ctl, &asoc->pending_reply_queue, next, nctl) { - if (compare_with_wrap(ctl->sinfo_tsn, liste->tsn, MAX_TSN)) { + if (SCTP_TSN_GT(ctl->sinfo_tsn, liste->tsn)) { break; } /* @@ -2275,8 +2260,8 @@ sctp_slide_mapping_arrays(struct sctp_tc } asoc->cumulative_tsn = asoc->mapping_array_base_tsn + (at - 1); - if (compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_map, MAX_TSN) && - compare_with_wrap(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_map) && + SCTP_TSN_GT(asoc->cumulative_tsn, asoc->highest_tsn_inside_nr_map)) { #ifdef INVARIANTS panic("huh, cumack 0x%x greater than high-tsn 0x%x in map", asoc->cumulative_tsn, asoc->highest_tsn_inside_map); @@ -2291,9 +2276,7 @@ sctp_slide_mapping_arrays(struct sctp_tc asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn; #endif } - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, - asoc->highest_tsn_inside_map, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; @@ -2411,9 +2394,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i uint32_t highest_tsn; asoc = &stcb->asoc; - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, - asoc->highest_tsn_inside_map, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; @@ -2439,7 +2420,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i int is_a_gap; /* is there a gap now ? */ - is_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + is_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * CMT DAC algorithm: increase number of packets received @@ -2576,12 +2557,12 @@ sctp_process_data(struct mbuf **mm, int m = *mm; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->highest_tsn_inside_map)) { highest_tsn = asoc->highest_tsn_inside_nr_map; } else { highest_tsn = asoc->highest_tsn_inside_map; } - was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); /* * setup where we got the last DATA packet from for any SACK that * may need to go out. Don't bump the net. This is done ONLY when a @@ -2889,8 +2870,8 @@ sctp_process_segment_range(struct sctp_t * via previous Gap Ack Blocks... * i.e. ACKED or RESEND. */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, - *biggest_newly_acked_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + *biggest_newly_acked_tsn)) { *biggest_newly_acked_tsn = tp1->rec.data.TSN_seq; } /*- @@ -2903,9 +2884,8 @@ sctp_process_segment_range(struct sctp_t if (tp1->rec.data.chunk_was_revoked == 0) tp1->whoTo->saw_newack = 1; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - tp1->whoTo->this_sack_highest_newack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + tp1->whoTo->this_sack_highest_newack)) { tp1->whoTo->this_sack_highest_newack = tp1->rec.data.TSN_seq; } @@ -2989,9 +2969,8 @@ sctp_process_segment_range(struct sctp_t if (tp1->sent <= SCTP_DATAGRAM_RESEND) { (*ecn_seg_sums) += tp1->rec.data.ect_nonce; (*ecn_seg_sums) &= SCTP_SACK_NONCE_SUM; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - stcb->asoc.this_sack_highest_gap, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + stcb->asoc.this_sack_highest_gap)) { stcb->asoc.this_sack_highest_gap = tp1->rec.data.TSN_seq; } @@ -3031,10 +3010,9 @@ sctp_process_segment_range(struct sctp_t } break; } /* if (tp1->TSN_seq == theTSN) */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, theTSN, - MAX_TSN)) + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, theTSN)) { break; - + } tp1 = TAILQ_NEXT(tp1, sctp_next); if ((tp1 == NULL) && (circled == 0)) { circled++; @@ -3092,7 +3070,7 @@ sctp_handle_segments(struct mbuf *m, int /* This gap report is not in order, so restart. */ tp1 = TAILQ_FIRST(&asoc->sent_queue); } - if (compare_with_wrap((last_tsn + frag_end), *biggest_tsn_acked, MAX_TSN)) { + if (SCTP_TSN_GT((last_tsn + frag_end), *biggest_tsn_acked)) { *biggest_tsn_acked = last_tsn + frag_end; } if (i < num_seg) { @@ -3125,19 +3103,16 @@ sctp_check_for_revoked(struct sctp_tcb * int tot_revoked = 0; TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (compare_with_wrap(tp1->rec.data.TSN_seq, cumack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cumack)) { /* * ok this guy is either ACK or MARKED. If it is * ACKED it has been previously acked but not this * time i.e. revoked. If it is MARKED it was ACK'ed * again. */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, biggest_tsn_acked, - MAX_TSN)) + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, biggest_tsn_acked)) { break; - - + } if (tp1->sent == SCTP_DATAGRAM_ACKED) { /* it has been revoked */ tp1->sent = SCTP_DATAGRAM_SENT; @@ -3244,8 +3219,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t tp1->sent, SCTP_FR_LOG_CHECK_STRIKE); } - if (compare_with_wrap(tp1->rec.data.TSN_seq, biggest_tsn_acked, - MAX_TSN) || + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, biggest_tsn_acked) || tp1->sent == SCTP_DATAGRAM_UNSENT) { /* done */ break; @@ -3264,8 +3238,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t } } } - if (compare_with_wrap(tp1->rec.data.TSN_seq, - asoc->this_sack_highest_gap, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->this_sack_highest_gap)) { /* we are beyond the tsn in the sack */ break; } @@ -3289,8 +3262,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * FR using this SACK. */ continue; - } else if (tp1->whoTo && compare_with_wrap(tp1->rec.data.TSN_seq, - tp1->whoTo->this_sack_highest_newack, MAX_TSN)) { + } else if (tp1->whoTo && SCTP_TSN_GT(tp1->rec.data.TSN_seq, + tp1->whoTo->this_sack_highest_newack)) { /* * CMT: New acks were receieved for data sent to * this dest. But no new acks were seen for data @@ -3341,7 +3314,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t * received after this missing TSN. */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(16 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3373,9 +3346,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t #endif ) { - if ((compare_with_wrap(biggest_tsn_newly_acked, - tp1->rec.data.fast_retran_tsn, MAX_TSN)) || - (biggest_tsn_newly_acked == + if (SCTP_TSN_GE(biggest_tsn_newly_acked, tp1->rec.data.fast_retran_tsn)) { /* * Strike the TSN, since this ack is @@ -3415,8 +3386,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, - tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, + tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(32 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3434,8 +3405,8 @@ sctp_strike_gap_ack_chunks(struct sctp_t * JRI: TODO: remove code for HTNA algo. CMT's SFR * algo covers HTNA. */ - } else if (compare_with_wrap(tp1->rec.data.TSN_seq, - biggest_tsn_newly_acked, MAX_TSN)) { + } else if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, + biggest_tsn_newly_acked)) { /* * We don't strike these: This is the HTNA * algorithm i.e. we don't strike If our TSN is @@ -3468,7 +3439,7 @@ sctp_strike_gap_ack_chunks(struct sctp_t * received after this missing TSN. */ if ((tp1->sent < SCTP_DATAGRAM_RESEND) && (num_dests_sacked == 1) && - compare_with_wrap(this_sack_lowest_newack, tp1->rec.data.TSN_seq, MAX_TSN)) { + SCTP_TSN_GT(this_sack_lowest_newack, tp1->rec.data.TSN_seq)) { if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FR_LOGGING_ENABLE) { sctp_log_fr(48 + num_dests_sacked, tp1->rec.data.TSN_seq, @@ -3715,10 +3686,7 @@ sctp_try_advance_peer_ack_point(struct s */ if (tp1->sent == SCTP_FORWARD_TSN_SKIP) { /* advance PeerAckPoint goes forward */ - if (compare_with_wrap(tp1->rec.data.TSN_seq, - asoc->advanced_peer_ack_point, - MAX_TSN)) { - + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = tp1->rec.data.TSN_seq; a_adv = tp1; } else if (tp1->rec.data.TSN_seq == asoc->advanced_peer_ack_point) { @@ -3843,7 +3811,7 @@ sctp_express_handle_sack(struct sctp_tcb #endif asoc = &stcb->asoc; old_rwnd = asoc->peers_rwnd; - if (compare_with_wrap(asoc->last_acked_seq, cumack, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, cumack)) { /* old ack */ return; } else if (asoc->last_acked_seq == cumack) { @@ -3882,8 +3850,7 @@ sctp_express_handle_sack(struct sctp_tcb } else { send_s = asoc->sending_seq; } - if ((cumack == send_s) || - compare_with_wrap(cumack, send_s, MAX_TSN)) { + if (SCTP_TSN_GE(cumack, send_s)) { #ifndef INVARIANTS struct mbuf *oper; @@ -3923,12 +3890,10 @@ sctp_express_handle_sack(struct sctp_tcb __LINE__); } stcb->asoc.overall_error_count = 0; - if (compare_with_wrap(cumack, asoc->last_acked_seq, MAX_TSN)) { + if (SCTP_TSN_GT(cumack, asoc->last_acked_seq)) { /* process the new consecutive TSN first */ TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { - if (compare_with_wrap(cumack, tp1->rec.data.TSN_seq, - MAX_TSN) || - cumack == tp1->rec.data.TSN_seq) { + if (SCTP_TSN_GE(cumack, tp1->rec.data.TSN_seq)) { if (tp1->sent == SCTP_DATAGRAM_UNSENT) { printf("Warning, an unsent is now acked?\n"); } @@ -4095,8 +4060,7 @@ sctp_express_handle_sack(struct sctp_tcb asoc->nonce_wait_tsn = asoc->sending_seq; } } else { - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_wait_tsn, MAX_TSN) || - (asoc->last_acked_seq == asoc->nonce_wait_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { /* * Misbehaving peer. We need * to react to this guy @@ -4108,7 +4072,7 @@ sctp_express_handle_sack(struct sctp_tcb } } else { /* See if Resynchronization Possible */ - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_resync_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { asoc->nonce_sum_check = 1; /* * Now we must calculate what the base is. @@ -4316,7 +4280,7 @@ again: /* (section 4.2) */ /*********************************************/ /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cumack, asoc->advanced_peer_ack_point, MAX_TSN)) { + if (SCTP_TSN_GT(cumack, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = cumack; } /* PR-Sctp issues need to be addressed too */ @@ -4327,15 +4291,13 @@ again: old_adv_peer_ack_point = asoc->advanced_peer_ack_point; lchk = sctp_try_advance_peer_ack_point(stcb, asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, cumack, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cumack)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE * stuff is put into SCTP for cross checking. */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); /* * ECN Nonce: Disable Nonce Sum check when @@ -4473,8 +4435,7 @@ sctp_handle_sack(struct mbuf *m, int off tp1 = NULL; send_s = asoc->sending_seq; } - if (cum_ack == send_s || - compare_with_wrap(cum_ack, send_s, MAX_TSN)) { + if (SCTP_TSN_GE(cum_ack, send_s)) { struct mbuf *oper; /* @@ -4512,7 +4473,7 @@ sctp_handle_sack(struct mbuf *m, int off /**********************/ /* 1) check the range */ /**********************/ - if (compare_with_wrap(asoc->last_acked_seq, last_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, last_tsn)) { /* acking something behind */ return; } @@ -4574,9 +4535,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* process the new consecutive TSN first */ TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) { - if (compare_with_wrap(last_tsn, tp1->rec.data.TSN_seq, - MAX_TSN) || - last_tsn == tp1->rec.data.TSN_seq) { + if (SCTP_TSN_GE(last_tsn, tp1->rec.data.TSN_seq)) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { /* * ECN Nonce: Add the nonce to the sender's @@ -4718,8 +4677,7 @@ sctp_handle_sack(struct mbuf *m, int off * validate the biggest_tsn_acked in the gap acks if * strict adherence is wanted. */ - if ((biggest_tsn_acked == send_s) || - (compare_with_wrap(biggest_tsn_acked, send_s, MAX_TSN))) { + if (SCTP_TSN_GE(biggest_tsn_acked, send_s)) { /* * peer is either confused or we are under * attack. We must abort. @@ -4757,8 +4715,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->last_acked_seq = cum_ack; TAILQ_FOREACH_SAFE(tp1, &asoc->sent_queue, sctp_next, tp2) { - if (compare_with_wrap(tp1->rec.data.TSN_seq, cum_ack, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, cum_ack)) { break; } if (tp1->sent == SCTP_DATAGRAM_UNSENT) { @@ -4835,9 +4792,7 @@ sctp_handle_sack(struct mbuf *m, int off } if (asoc->fast_retran_loss_recovery && accum_moved) { - if (compare_with_wrap(asoc->last_acked_seq, - asoc->fast_recovery_tsn, MAX_TSN) || - asoc->last_acked_seq == asoc->fast_recovery_tsn) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->fast_recovery_tsn)) { /* Setup so we will exit RFC2582 fast recovery */ will_exit_fast_recovery = 1; } @@ -5057,8 +5012,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->nonce_wait_tsn = asoc->sending_seq; } } else { - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_wait_tsn, MAX_TSN) || - (asoc->last_acked_seq == asoc->nonce_wait_tsn)) { + if (SCTP_TSN_GE(asoc->last_acked_seq, asoc->nonce_wait_tsn)) { /* * Misbehaving peer. We need * to react to this guy @@ -5070,7 +5024,7 @@ sctp_handle_sack(struct mbuf *m, int off } } else { /* See if Resynchronization Possible */ - if (compare_with_wrap(asoc->last_acked_seq, asoc->nonce_resync_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->last_acked_seq, asoc->nonce_resync_tsn)) { asoc->nonce_sum_check = 1; /* * now we must calculate what the base is. @@ -5097,9 +5051,7 @@ sctp_handle_sack(struct mbuf *m, int off asoc->fast_retran_loss_recovery = 0; } if ((asoc->sat_t3_loss_recovery) && - ((compare_with_wrap(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn, - MAX_TSN) || - (asoc->last_acked_seq == asoc->sat_t3_recovery_tsn)))) { + SCTP_TSN_GE(asoc->last_acked_seq, asoc->sat_t3_recovery_tsn)) { /* end satellite t3 loss recovery */ asoc->sat_t3_loss_recovery = 0; } @@ -5217,7 +5169,7 @@ again: /* (section 4.2) */ /*********************************************/ /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cum_ack, asoc->advanced_peer_ack_point, MAX_TSN)) { + if (SCTP_TSN_GT(cum_ack, asoc->advanced_peer_ack_point)) { asoc->advanced_peer_ack_point = cum_ack; } /* C2. try to further move advancedPeerAckPoint ahead */ @@ -5228,8 +5180,7 @@ again: old_adv_peer_ack_point = asoc->advanced_peer_ack_point; lchk = sctp_try_advance_peer_ack_point(stcb, asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(asoc->advanced_peer_ack_point, cum_ack, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, cum_ack)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE @@ -5240,8 +5191,7 @@ again: 0xee, cum_ack, asoc->advanced_peer_ack_point, old_adv_peer_ack_point); } - if (compare_with_wrap(asoc->advanced_peer_ack_point, old_adv_peer_ack_point, - MAX_TSN)) { + if (SCTP_TSN_GT(asoc->advanced_peer_ack_point, old_adv_peer_ack_point)) { send_forward_tsn(stcb, asoc); /* @@ -5302,8 +5252,7 @@ sctp_kick_prsctp_reorder_queue(struct sc * came in */ TAILQ_FOREACH_SAFE(ctl, &strmin->inqueue, next, nctl) { - if (compare_with_wrap(tt, ctl->sinfo_ssn, MAX_SEQ) || - (tt == ctl->sinfo_ssn)) { + if (SCTP_SSN_GE(tt, ctl->sinfo_ssn)) { /* this is deliverable now */ TAILQ_REMOVE(&strmin->inqueue, ctl, next); /* subtract pending on streams */ @@ -5378,8 +5327,7 @@ sctp_flush_reassm_for_str_seq(struct sct if (chk->rec.data.stream_seq == seq) { /* It needs to be tossed */ TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) { asoc->tsn_last_delivered = chk->rec.data.TSN_seq; asoc->str_of_pdapi = chk->rec.data.stream_number; asoc->ssn_of_pdapi = chk->rec.data.stream_seq; @@ -5389,11 +5337,8 @@ sctp_flush_reassm_for_str_seq(struct sct sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && + SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) { /* * We must dump forward this streams * sequence number if the chunk is not @@ -5415,7 +5360,7 @@ sctp_flush_reassm_for_str_seq(struct sct chk->data = NULL; } sctp_free_a_chunk(stcb, chk); - } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) { /* * If the stream_seq is > than the purging one, we * are done @@ -5475,8 +5420,7 @@ sctp_handle_forward_tsn(struct sctp_tcb /*************************************************************/ new_cum_tsn = ntohl(fwd->new_cumulative_tsn); - if (compare_with_wrap(asoc->cumulative_tsn, new_cum_tsn, MAX_TSN) || - asoc->cumulative_tsn == new_cum_tsn) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, new_cum_tsn)) { /* Already got there ... */ return; } @@ -5537,7 +5481,7 @@ sctp_handle_forward_tsn(struct sctp_tcb if (!SCTP_IS_TSN_PRESENT(asoc->mapping_array, i) && !SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, i)) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); - if (compare_with_wrap(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn + i, asoc->highest_tsn_inside_nr_map)) { asoc->highest_tsn_inside_nr_map = asoc->mapping_array_base_tsn + i; } } @@ -5563,13 +5507,10 @@ sctp_handle_forward_tsn(struct sctp_tcb * queue. */ TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { - if ((compare_with_wrap(new_cum_tsn, - chk->rec.data.TSN_seq, MAX_TSN)) || - (new_cum_tsn == chk->rec.data.TSN_seq)) { + if (SCTP_TSN_GE(new_cum_tsn, chk->rec.data.TSN_seq)) { /* It needs to be tossed */ TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); - if (compare_with_wrap(chk->rec.data.TSN_seq, - asoc->tsn_last_delivered, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, asoc->tsn_last_delivered)) { asoc->tsn_last_delivered = chk->rec.data.TSN_seq; asoc->str_of_pdapi = chk->rec.data.stream_number; asoc->ssn_of_pdapi = chk->rec.data.stream_seq; @@ -5579,11 +5520,8 @@ sctp_handle_forward_tsn(struct sctp_tcb sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* Clear up any stream problem */ - if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != - SCTP_DATA_UNORDERED && - (compare_with_wrap(chk->rec.data.stream_seq, - asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, - MAX_SEQ))) { + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != SCTP_DATA_UNORDERED && + SCTP_SSN_GT(chk->rec.data.stream_seq, asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered)) { /* * We must dump forward this streams * sequence number if the chunk is not @@ -5681,17 +5619,15 @@ sctp_handle_forward_tsn(struct sctp_tcb stcb->asoc.control_pdapi = sv; break; } else if ((ctl->sinfo_stream == stseq->stream) && - (compare_with_wrap(ctl->sinfo_ssn, stseq->sequence, MAX_SEQ))) { + SCTP_SSN_GT(ctl->sinfo_ssn, stseq->sequence)) { /* We are past our victim SSN */ break; } } strm = &asoc->strmin[stseq->stream]; - if (compare_with_wrap(stseq->sequence, - strm->last_sequence_delivered, MAX_SEQ)) { + if (SCTP_SSN_GT(stseq->sequence, strm->last_sequence_delivered)) { /* Update the sequence number */ - strm->last_sequence_delivered = - stseq->sequence; + strm->last_sequence_delivered = stseq->sequence; } /* now kick the stream the new way */ /* sa_ignore NO_NULL_CHK */ Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_input.c Thu Dec 30 21:32:35 2010 (r216825) @@ -2922,14 +2922,15 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch net = lchk->whoTo; break; } - if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN)) + if (SCTP_TSN_GT(lchk->rec.data.TSN_seq, tsn)) { break; + } } if (net == NULL) /* default is we use the primary */ net = stcb->asoc.primary_destination; - if (compare_with_wrap(tsn, stcb->asoc.last_cwr_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(tsn, stcb->asoc.last_cwr_tsn)) { /* * JRS - Use the congestion control given in the pluggable * CC module @@ -2970,8 +2971,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun * don't need to worry about more than one! */ ecne = mtod(chk->data, struct sctp_ecne_chunk *); - if (compare_with_wrap(ntohl(cp->tsn), ntohl(ecne->tsn), - MAX_TSN) || (cp->tsn == ecne->tsn)) { + if (SCTP_TSN_GE(ntohl(cp->tsn), ntohl(ecne->tsn))) { /* this covers this ECNE, we can remove it */ stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, @@ -3060,8 +3060,7 @@ process_chunk_drop(struct sctp_tcb *stcb /* found it */ break; } - if (compare_with_wrap(tp1->rec.data.TSN_seq, tsn, - MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, tsn)) { /* not found */ tp1 = NULL; break; @@ -3668,8 +3667,7 @@ sctp_handle_str_reset_request_out(struct if (trunc) { sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_DENIED); asoc->last_reset_action[0] = SCTP_STREAM_RESET_DENIED; - } else if ((tsn == asoc->cumulative_tsn) || - (compare_with_wrap(asoc->cumulative_tsn, tsn, MAX_TSN))) { + } else if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* we can do it now */ sctp_reset_in_stream(stcb, number_entries, req->list_of_streams); sctp_add_stream_reset_result(chk, seq, SCTP_STREAM_RESET_PERFORMED); @@ -4613,8 +4611,7 @@ process_control_chunks: stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && (num_seg == 0) && - ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || - (cum_ack == stcb->asoc.last_acked_seq)) && + SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && (stcb->asoc.saw_sack_with_frags == 0) && (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) @@ -4707,8 +4704,7 @@ process_control_chunks: stcb->asoc.seen_a_sack_this_pkt = 1; if ((stcb->asoc.pr_sctp_cnt == 0) && (num_seg == 0) && (num_nr_seg == 0) && - ((compare_with_wrap(cum_ack, stcb->asoc.last_acked_seq, MAX_TSN)) || - (cum_ack == stcb->asoc.last_acked_seq)) && + SCTP_TSN_GE(cum_ack, stcb->asoc.last_acked_seq) && (stcb->asoc.saw_sack_with_frags == 0) && (stcb->asoc.saw_sack_with_nr_frags == 0) && (!TAILQ_EMPTY(&stcb->asoc.sent_queue))) { @@ -5353,8 +5349,7 @@ sctp_process_ecn_marked_a(struct sctp_tc * don't want the point falling way behind by more than * 2^^31 and then having it be incorrect. */ - if (compare_with_wrap(stcb->asoc.cumulative_tsn, - stcb->asoc.last_echo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; } } else if ((ecn_bits & SCTP_ECT0_BIT) == SCTP_ECT0_BIT) { @@ -5363,8 +5358,7 @@ sctp_process_ecn_marked_a(struct sctp_tc * don't want the point falling way behind by more than * 2^^31 and then having it be incorrect. */ - if (compare_with_wrap(stcb->asoc.cumulative_tsn, - stcb->asoc.last_echo_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.cumulative_tsn, stcb->asoc.last_echo_tsn)) { stcb->asoc.last_echo_tsn = stcb->asoc.cumulative_tsn; } } @@ -5381,8 +5375,7 @@ sctp_process_ecn_marked_b(struct sctp_tc * chunk to the output chunk queue. The incoming CWR will * remove this chunk. */ - if (compare_with_wrap(high_tsn, stcb->asoc.last_echo_tsn, - MAX_TSN)) { + if (SCTP_TSN_GT(high_tsn, stcb->asoc.last_echo_tsn)) { /* Yep, we need to add a ECNE */ sctp_send_ecn_echo(stcb, net, high_tsn); stcb->asoc.last_echo_tsn = high_tsn; @@ -5621,12 +5614,12 @@ sctp_common_input_processing(struct mbuf int was_a_gap; uint32_t highest_tsn; - if (compare_with_wrap(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.highest_tsn_inside_nr_map, stcb->asoc.highest_tsn_inside_map)) { highest_tsn = stcb->asoc.highest_tsn_inside_nr_map; } else { highest_tsn = stcb->asoc.highest_tsn_inside_map; } - was_a_gap = compare_with_wrap(highest_tsn, stcb->asoc.cumulative_tsn, MAX_TSN); + was_a_gap = SCTP_TSN_GT(highest_tsn, stcb->asoc.cumulative_tsn); stcb->asoc.send_sack = 1; sctp_sack_check(stcb, was_a_gap, &abort_flag); if (abort_flag) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_output.c Thu Dec 30 21:32:35 2010 (r216825) @@ -6468,7 +6468,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st if (chk->rec.chunk_id.id == SCTP_ASCONF) { if (chk->data) { acp = mtod(chk->data, struct sctp_asconf_chunk *); - if (compare_with_wrap(ntohl(acp->serial_number), asoc->asconf_seq_out_acked, MAX_TSN)) { + if (SCTP_TSN_GT(ntohl(acp->serial_number), asoc->asconf_seq_out_acked)) { /* Not Acked yet */ break; } @@ -6516,8 +6516,7 @@ sctp_clean_up_datalist(struct sctp_tcb * } /* on to the sent queue */ tp1 = TAILQ_LAST(&asoc->sent_queue, sctpchunk_listhead); - if ((tp1) && (compare_with_wrap(tp1->rec.data.TSN_seq, - data_list[i]->rec.data.TSN_seq, MAX_TSN))) { + if ((tp1) && SCTP_TSN_GT(tp1->rec.data.TSN_seq, data_list[i]->rec.data.TSN_seq)) { struct sctp_tmit_chunk *tpp; /* need to move back */ @@ -6528,8 +6527,7 @@ sctp_clean_up_datalist(struct sctp_tcb * goto all_done; } tp1 = tpp; - if (compare_with_wrap(tp1->rec.data.TSN_seq, - data_list[i]->rec.data.TSN_seq, MAX_TSN)) { + if (SCTP_TSN_GT(tp1->rec.data.TSN_seq, data_list[i]->rec.data.TSN_seq)) { goto back_up_more; } TAILQ_INSERT_AFTER(&asoc->sent_queue, tp1, data_list[i], sctp_next); @@ -10002,7 +10000,7 @@ sctp_send_sack(struct sctp_tcb *stcb) if (a_chk->whoTo) { atomic_add_int(&a_chk->whoTo->ref_count, 1); } - if (compare_with_wrap(asoc->highest_tsn_inside_map, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->highest_tsn_inside_nr_map)) { highest_tsn = asoc->highest_tsn_inside_map; } else { highest_tsn = asoc->highest_tsn_inside_nr_map; @@ -10097,15 +10095,15 @@ sctp_send_sack(struct sctp_tcb *stcb) } } - if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn, asoc->cumulative_tsn)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } if (((type == SCTP_SELECTIVE_ACK) && - compare_with_wrap(highest_tsn, asoc->cumulative_tsn, MAX_TSN)) || + SCTP_TSN_GT(highest_tsn, asoc->cumulative_tsn)) || ((type == SCTP_NR_SELECTIVE_ACK) && - compare_with_wrap(asoc->highest_tsn_inside_map, asoc->cumulative_tsn, MAX_TSN))) { + SCTP_TSN_GT(asoc->highest_tsn_inside_map, asoc->cumulative_tsn))) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { tsn_map = asoc->mapping_array[i]; @@ -10177,12 +10175,12 @@ sctp_send_sack(struct sctp_tcb *stcb) siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + asoc->highest_tsn_inside_nr_map + 7) / 8; } - if (compare_with_wrap(asoc->mapping_array_base_tsn, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->mapping_array_base_tsn, asoc->cumulative_tsn)) { offset = 1; } else { offset = asoc->mapping_array_base_tsn - asoc->cumulative_tsn; } - if (compare_with_wrap(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn, MAX_TSN)) { + if (SCTP_TSN_GT(asoc->highest_tsn_inside_nr_map, asoc->cumulative_tsn)) { /* we have a gap .. maybe */ for (i = 0; i < siz; i++) { tsn_map = asoc->nr_mapping_array[i]; @@ -11075,8 +11073,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str if (chk->rec.chunk_id.id == SCTP_ECN_CWR) { /* found a previous ECN_CWR update it if needed */ cwr = mtod(chk->data, struct sctp_cwr_chunk *); - if (compare_with_wrap(high_tsn, ntohl(cwr->tsn), - MAX_TSN)) { + if (SCTP_TSN_GT(high_tsn, ntohl(cwr->tsn))) { cwr->tsn = htonl(high_tsn); } return; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Dec 30 18:29:22 2010 (r216824) +++ head/sys/netinet/sctp_pcb.c Thu Dec 30 21:32:35 2010 (r216825) @@ -6476,8 +6476,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, cnt = 0; /* First look in the re-assembly queue */ TAILQ_FOREACH_SAFE(chk, &asoc->reasmqueue, sctp_next, nchk) { - if (compare_with_wrap(chk->rec.data.TSN_seq, - cumulative_tsn_p1, MAX_TSN)) { + if (SCTP_TSN_GT(chk->rec.data.TSN_seq, cumulative_tsn_p1)) { /* Yep it is above cum-ack */ cnt++; SCTP_CALC_TSN_TO_GAP(gap, chk->rec.data.TSN_seq, asoc->mapping_array_base_tsn); @@ -6495,8 +6494,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* Ok that was fun, now we will drain all the inbound streams? */ for (strmat = 0; strmat < asoc->streamincnt; strmat++) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 22:33:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC0EA106564A; Thu, 30 Dec 2010 22:33:55 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AACD98FC13; Thu, 30 Dec 2010 22:33:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUMXtBi052797; Thu, 30 Dec 2010 22:33:55 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUMXtNi052794; Thu, 30 Dec 2010 22:33:55 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012302233.oBUMXtNi052794@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 30 Dec 2010 22:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216826 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 22:33:55 -0000 Author: jilles Date: Thu Dec 30 22:33:55 2010 New Revision: 216826 URL: http://svn.freebsd.org/changeset/base/216826 Log: sh: Avoid side effects from builtins in optimized command substitution. Change the criterion for builtins to be safe to execute in the same process in optimized command substitution from a blacklist of only cd, . and eval to a whitelist. This avoids clobbering the main shell environment such as by $(exit 4) and $(set -x). The builtins jobid, jobs, times and trap can still show information not available in a child process; this is deliberately permitted. (Changing traps is not.) For some builtins, whether they are safe depends on the arguments passed to them. Some of these are always considered unsafe to keep things simple; this only harms efficiency a little in the rare case they are used alone in a command substitution. Added: head/tools/regression/bin/sh/expansion/cmdsubst10.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Thu Dec 30 21:32:35 2010 (r216825) +++ head/bin/sh/eval.c Thu Dec 30 22:33:55 2010 (r216826) @@ -643,7 +643,31 @@ out: result->fd, result->buf, result->nleft, result->jp)); } - +/* + * Check if a builtin can safely be executed in the same process, + * even though it should be in a subshell (command substitution). + * Note that jobid, jobs, times and trap can show information not + * available in a child process; this is deliberate. + * The arguments should already have been expanded. + */ +static int +safe_builtin(int idx, int argc, char **argv) +{ + if (idx == BLTINCMD || idx == COMMANDCMD || idx == ECHOCMD || + idx == FALSECMD || idx == JOBIDCMD || idx == JOBSCMD || + idx == KILLCMD || idx == PRINTFCMD || idx == PWDCMD || + idx == TESTCMD || idx == TIMESCMD || idx == TRUECMD || + idx == TYPECMD) + return (1); + if (idx == EXPORTCMD || idx == TRAPCMD || idx == ULIMITCMD || + idx == UMASKCMD) + return (argc <= 1 || (argc == 2 && argv[1][0] == '-')); + if (idx == SETCMD) + return (argc <= 1 || (argc == 2 && (argv[1][0] == '-' || + argv[1][0] == '+') && argv[1][1] == 'o' && + argv[1][2] == '\0')); + return (0); +} /* * Execute a simple command. @@ -861,10 +885,8 @@ evalcommand(union node *cmd, int flags, || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 - && (cmdentry.cmdtype != CMDBUILTIN - || cmdentry.u.index == CDCMD - || cmdentry.u.index == DOTCMD - || cmdentry.u.index == EVALCMD))) { + && (cmdentry.cmdtype != CMDBUILTIN || + !safe_builtin(cmdentry.u.index, argc, argv)))) { jp = makejob(cmd, 1); mode = cmd->ncmd.backgnd; if (flags & EV_BACKCMD) { Added: head/tools/regression/bin/sh/expansion/cmdsubst10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst10.0 Thu Dec 30 22:33:55 2010 (r216826) @@ -0,0 +1,51 @@ +# $FreeBSD$ + +a1=$(alias) +: $(alias testalias=abcd) +a2=$(alias) +[ "$a1" = "$a2" ] || echo Error at line $LINENO + +alias testalias2=abcd +a1=$(alias) +: $(unalias testalias2) +a2=$(alias) +[ "$a1" = "$a2" ] || echo Error at line $LINENO + +[ "$(command -V pwd)" = "$(command -V pwd; exit $?)" ] || echo Error at line $LINENO + +v=1 +: $(export v=2) +[ "$v" = 1 ] || echo Error at line $LINENO + +rotest=1 +: $(readonly rotest=2) +[ "$rotest" = 1 ] || echo Error at line $LINENO + +set +u +: $(set -u) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +set +u +: $(set -o nounset) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +set +u +: $(command set -u) +case $- in +*u*) echo Error at line $LINENO ;; +esac +set +u + +umask 77 +u1=$(umask) +: $(umask 022) +u2=$(umask) +[ "$u1" = "$u2" ] || echo Error at line $LINENO + +dummy=$(exit 3); [ $? -eq 3 ] || echo Error at line $LINENO From owner-svn-src-all@FreeBSD.ORG Thu Dec 30 23:50:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B7C106564A; Thu, 30 Dec 2010 23:50:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 081A08FC0A; Thu, 30 Dec 2010 23:50:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBUNoQ4P054665; Thu, 30 Dec 2010 23:50:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBUNoPkj054658; Thu, 30 Dec 2010 23:50:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012302350.oBUNoPkj054658@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 30 Dec 2010 23:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216828 - in head/sys: conf dev/mii modules/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 30 Dec 2010 23:50:26 -0000 Author: yongari Date: Thu Dec 30 23:50:25 2010 New Revision: 216828 URL: http://svn.freebsd.org/changeset/base/216828 Log: Add RDC Semiconductor R6040 10/100 PHY driver. Added: head/sys/dev/mii/rdcphy.c (contents, props changed) head/sys/dev/mii/rdcphyreg.h (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/dev/mii/miidevs head/sys/modules/mii/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Dec 30 23:35:23 2010 (r216827) +++ head/sys/conf/NOTES Thu Dec 30 23:50:25 2010 (r216828) @@ -1870,6 +1870,7 @@ device nsphy # NatSemi DP83840A device nsphyter # NatSemi DP83843/DP83815 device pnaphy # HomePNA device qsphy # Quality Semiconductor QS6612 +device rdcphy # RDC Semiconductor R6040 device rgephy # RealTek 8169S/8110S/8211B/8211C device rlphy # RealTek 8139 device rlswitch # RealTek 8305 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Dec 30 23:35:23 2010 (r216827) +++ head/sys/conf/files Thu Dec 30 23:50:25 2010 (r216828) @@ -1324,6 +1324,7 @@ dev/mii/nsphy.c optional miibus | nsph dev/mii/nsphyter.c optional miibus | nsphyter dev/mii/pnaphy.c optional miibus | pnaphy dev/mii/qsphy.c optional miibus | qsphy +dev/mii/rdcphy.c optional miibus | rdcphy dev/mii/rgephy.c optional miibus | rgephy dev/mii/rlphy.c optional miibus | rlphy dev/mii/rlswitch.c optional rlswitch Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Thu Dec 30 23:35:23 2010 (r216827) +++ head/sys/dev/mii/miidevs Thu Dec 30 23:50:25 2010 (r216828) @@ -59,6 +59,7 @@ oui JMICRON 0x001b8c JMicron Technolog oui LEVEL1 0x00207b Level 1 oui NATSEMI 0x080017 National Semiconductor oui QUALSEMI 0x006051 Quality Semiconductor +oui RDC 0x000bb4 RDC Semiconductor oui REALTEK 0x000020 RealTek Semicondctor oui SEEQ 0x00a07d Seeq oui SIS 0x00e006 Silicon Integrated Systems @@ -213,6 +214,9 @@ model NATSEMI DP83865 0x0007 DP83865 10 /* Quality Semiconductor PHYs */ model QUALSEMI QS6612 0x0000 QS6612 10/100 media interface +/* RDC Semiconductor PHYs */ +model RDC R6040 0x0003 R6040 10/100 media interface + /* RealTek Semiconductor PHYs */ model REALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface model xxREALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch Added: head/sys/dev/mii/rdcphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/rdcphy.c Thu Dec 30 23:50:25 2010 (r216828) @@ -0,0 +1,267 @@ +/*- + * Copyright (c) 2010, Pyun YongHyeon + * 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 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 +__FBSDID("$FreeBSD$"); + +/* + * Driver for the RDC Semiconductor R6040 10/100 PHY. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "miidevs.h" + +#include + +#include "miibus_if.h" + +static device_probe_t rdcphy_probe; +static device_attach_t rdcphy_attach; + +struct rdcphy_softc { + struct mii_softc mii_sc; + int mii_model; + int mii_link_tick; +#define RDCPHY_MANNEG_TICK 3 +}; + +static device_method_t rdcphy_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, rdcphy_probe), + DEVMETHOD(device_attach, rdcphy_attach), + DEVMETHOD(device_detach, mii_phy_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + KOBJMETHOD_END +}; + +static devclass_t rdcphy_devclass; + +static driver_t rdcphy_driver = { + "rdcphy", + rdcphy_methods, + sizeof(struct rdcphy_softc) +}; + +DRIVER_MODULE(rdcphy, miibus, rdcphy_driver, rdcphy_devclass, 0, 0); + +static int rdcphy_service(struct mii_softc *, struct mii_data *, int); +static void rdcphy_status(struct mii_softc *); + +static const struct mii_phydesc rdcphys[] = { + MII_PHY_DESC(RDC, R6040), + MII_PHY_END +}; + +static int +rdcphy_probe(device_t dev) +{ + + return (mii_phy_dev_probe(dev, rdcphys, BUS_PROBE_DEFAULT)); +} + +static int +rdcphy_attach(device_t dev) +{ + struct rdcphy_softc *rsc; + struct mii_softc *sc; + struct mii_attach_args *ma; + struct mii_data *mii; + + rsc = device_get_softc(dev); + sc = &rsc->mii_sc; + ma = device_get_ivars(dev); + sc->mii_dev = device_get_parent(dev); + mii = ma->mii_data; + LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + + sc->mii_flags = miibus_get_flags(dev); + sc->mii_inst = mii->mii_instance++; + sc->mii_phy = ma->mii_phyno; + sc->mii_service = rdcphy_service; + sc->mii_pdata = mii; + + rsc->mii_model = MII_MODEL(ma->mii_id2); + if (bootverbose) + device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n", + MII_OUI(ma->mii_id1, ma->mii_id2), MII_MODEL(ma->mii_id2), + MII_REV(ma->mii_id2)); + + mii_phy_reset(sc); + + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + if (sc->mii_capabilities & BMSR_EXTSTAT) + sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); + device_printf(dev, " "); + mii_phy_add_media(sc); + printf("\n"); + + MIIBUS_MEDIAINIT(sc->mii_dev); + return (0); +} + +static int +rdcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) +{ + struct rdcphy_softc *rsc; + struct ifmedia_entry *ife; + + rsc = (struct rdcphy_softc *)sc; + ife = mii->mii_media.ifm_cur; + + switch (cmd) { + case MII_POLLSTAT: + break; + + case MII_MEDIACHG: + /* + * If the interface is not up, don't do anything. + */ + if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + break; + + mii_phy_setmedia(sc); + switch (IFM_SUBTYPE(ife->ifm_media)) { + case IFM_100_TX: + case IFM_10_T: + /* + * Report fake lost link event to parent + * driver. This will stop MAC of parent + * driver and make it possible to reconfigure + * MAC after completion of link establishment. + * Note, the parent MAC seems to require + * restarting MAC when underlying any PHY + * configuration was changed even if the + * resolved speed/duplex was not changed at + * all. + */ + mii->mii_media_status = 0; + mii->mii_media_active = IFM_ETHER | IFM_NONE; + rsc->mii_link_tick = RDCPHY_MANNEG_TICK; + /* Immediately report link down. */ + mii_phy_update(sc, MII_MEDIACHG); + return (0); + default: + break; + } + break; + + case MII_TICK: + if (mii_phy_tick(sc) == EJUSTRETURN) + return (0); + if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { + /* + * It seems the PHY hardware does not correctly + * report link status changes when manual link + * configuration is in progress. It is also + * possible for the PHY to complete establishing + * a link within one second such that mii(4) + * did not notice the link change. To workaround + * the issue, emulate lost link event and wait + * for 3 seconds when manual link configuration + * is in progress. 3 seconds would be long + * enough to absorb transient link flips. + */ + if (rsc->mii_link_tick > 0) { + rsc->mii_link_tick--; + return (0); + } + } + break; + } + + /* Update the media status. */ + rdcphy_status(sc); + + /* Callback if something changed. */ + mii_phy_update(sc, cmd); + return (0); +} + +static void +rdcphy_status(struct mii_softc *sc) +{ + struct mii_data *mii; + struct ifmedia_entry *ife; + int bmsr, bmcr, physts; + + mii = sc->mii_pdata; + ife = mii->mii_media.ifm_cur; + + mii->mii_media_status = IFM_AVALID; + mii->mii_media_active = IFM_ETHER; + + bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); + physts = PHY_READ(sc, MII_RDCPHY_STATUS); + + if ((physts & STATUS_LINK_UP) != 0) + mii->mii_media_status |= IFM_ACTIVE; + + bmcr = PHY_READ(sc, MII_BMCR); + if ((bmcr & BMCR_ISO) != 0) { + mii->mii_media_active |= IFM_NONE; + mii->mii_media_status = 0; + return; + } + + if ((bmcr & BMCR_LOOP) != 0) + mii->mii_media_active |= IFM_LOOP; + + if ((bmcr & BMCR_AUTOEN) != 0) { + if ((bmsr & BMSR_ACOMP) == 0) { + /* Erg, still trying, I guess... */ + mii->mii_media_active |= IFM_NONE; + return; + } + } + + switch (physts & STATUS_SPEED_MASK) { + case STATUS_SPEED_100: + mii->mii_media_active |= IFM_100_TX; + break; + case STATUS_SPEED_10: + mii->mii_media_active |= IFM_10_T; + break; + default: + mii->mii_media_active |= IFM_NONE; + return; + } + if ((physts & STATUS_FULL_DUPLEX) != 0) + mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); + else + mii->mii_media_active |= IFM_HDX; +} Added: head/sys/dev/mii/rdcphyreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/rdcphyreg.h Thu Dec 30 23:50:25 2010 (r216828) @@ -0,0 +1,73 @@ +/*- + * Copyright (c) 2010, Pyun YongHyeon + * 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 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 _DEV_MII_RDCPHYREG_H_ +#define _DEV_MII_RDCPHYREG_H_ + +#define MII_RDCPHY_DEBUG 0x11 +#define DEBUG_JABBER_DIS 0x0040 +#define DEBUG_LOOP_BACK_10MBPS 0x0400 + +#define MII_RDCPHY_CTRL 0x14 +#define CTRL_SQE_ENB 0x0100 +#define CTRL_NEG_POLARITY 0x0400 +#define CTRL_AUTO_POLARITY 0x0800 +#define CTRL_MDIXSEL_RX 0x2000 +#define CTRL_MDIXSEL_TX 0x4000 +#define CTRL_AUTO_MDIX_DIS 0x8000 + +#define MII_RDCPHY_CTRL2 0x15 +#define CTRL2_LED_DUPLEX 0x0000 +#define CTRL2_LED_DUPLEX_COL 0x0008 +#define CTRL2_LED_ACT 0x0010 +#define CTRL2_LED_SPEED_ACT 0x0018 +#define CTRL2_LED_BLK_100MBPS_DIS 0x0020 +#define CTRL2_LED_BLK_10MBPS_DIS 0x0040 +#define CTRL2_LED_BLK_LINK_ACT_DIS 0x0080 +#define CTRL2_SDT_THRESH_MASK 0x3E00 +#define CTRL2_TIMING_ERR_SEL 0x4000 +#define CTRL2_LED_BLK_80MS 0x8000 +#define CTRL2_LED_BLK_160MS 0x0000 +#define CTRL2_LED_MASK 0x0018 + +#define MII_RDCPHY_STATUS 0x16 +#define STATUS_AUTO_MDIX_RX 0x0200 +#define STATUS_AUTO_MDIX_TX 0x0400 +#define STATUS_NEG_POLARITY 0x0800 +#define STATUS_FULL_DUPLEX 0x1000 +#define STATUS_SPEED_10 0x0000 +#define STATUS_SPEED_100 0x2000 +#define STATUS_SPEED_MASK 0x6000 +#define STATUS_LINK_UP 0x8000 + +/* Analog test register 2 */ +#define MII_RDCPHY_TEST2 0x1A +#define TEST2_PWR_DOWN 0x0200 + +#endif /* _DEV_MII_RDCPHYREG_H_ */ Modified: head/sys/modules/mii/Makefile ============================================================================== --- head/sys/modules/mii/Makefile Thu Dec 30 23:35:23 2010 (r216827) +++ head/sys/modules/mii/Makefile Thu Dec 30 23:50:25 2010 (r216828) @@ -8,8 +8,8 @@ SRCS+= ciphy.c device_if.h SRCS+= e1000phy.c exphy.c gentbi.c icsphy.c inphy.c ip1000phy.c jmphy.c SRCS+= lxtphy.c miibus_if.c miibus_if.h mii.c miidevs.h mii_physubr.c SRCS+= mlphy.c nsgphy.c nsphy.c nsphyter.c pci_if.h pnaphy.c qsphy.c -SRCS+= rgephy.c rlphy.c ruephy.c tdkphy.c tlphy.c truephy.c ukphy.c -SRCS+= ukphy_subr.c +SRCS+= rdcphy.c rgephy.c rlphy.c ruephy.c tdkphy.c tlphy.c truephy.c +SRCS+= ukphy.c ukphy_subr.c SRCS+= xmphy.c EXPORT_SYMS= mii_attach \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 00:21:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBF1C106566C; Fri, 31 Dec 2010 00:21:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98BD8FC15; Fri, 31 Dec 2010 00:21:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBV0Lfph055393; Fri, 31 Dec 2010 00:21:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBV0Lfpc055387; Fri, 31 Dec 2010 00:21:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012310021.oBV0Lfpc055387@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 00:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216829 - in head/sys: boot/forth conf dev/vte i386/conf modules modules/vte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 00:21:41 -0000 Author: yongari Date: Fri Dec 31 00:21:41 2010 New Revision: 216829 URL: http://svn.freebsd.org/changeset/base/216829 Log: Add driver for DM&P Vortex86 RDC R6040 Fast Ethernet. The controller is commonly found on DM&P Vortex86 x86 SoC. The driver supports all hardware features except flow control. The flow control was intentionally disabled due to silicon bug. DM&P Electronics, Inc. provided all necessary information including sample board to write driver and answered many questions I had. Many thanks for their support of FreeBSD. H/W donated by: DM&P Electronics, Inc. Added: head/sys/dev/vte/ head/sys/dev/vte/if_vte.c (contents, props changed) head/sys/dev/vte/if_vtereg.h (contents, props changed) head/sys/dev/vte/if_vtevar.h (contents, props changed) head/sys/modules/vte/ head/sys/modules/vte/Makefile (contents, props changed) Modified: head/sys/boot/forth/loader.conf head/sys/conf/NOTES head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Thu Dec 30 23:50:25 2010 (r216828) +++ head/sys/boot/forth/loader.conf Fri Dec 31 00:21:41 2010 (r216829) @@ -328,6 +328,7 @@ if_tl_load="NO" # Texas Instruments TN if_tx_load="NO" # SMC 83c17x Fast Ethernet if_txp_load="NO" # 3Com 3XP Typhoon/Sidewinder (3CR990) if_vge_load="NO" # VIA VT6122 PCI Gigabit Ethernet +if_vte_load="NO" # DM&P Vortex86 RDC R6040 Fast Ethernet if_uath_load="NO" # Atheros USB wireless for AR5005UG & AR5005UX if_udav_load="NO" # Davicom DM9601 USB Ethernet if_upgt_load="NO" # Conexant/Intersil PrismGT USB wireless Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Dec 30 23:50:25 2010 (r216828) +++ head/sys/conf/NOTES Fri Dec 31 00:21:41 2010 (r216829) @@ -1995,6 +1995,7 @@ device xmphy # XaQti XMAC II # Technologies VT3043 `Rhine I' and VT86C100A `Rhine II' chips, # including the D-Link DFE520TX and D-Link DFE530TX (see 'rl' for # DFE530TX+), the Hawking Technologies PN102TX, and the AOpen/Acer ALN-320. +# vte: DM&P Vortex86 RDC R6040 Fast Ethernet # vx: 3Com 3C590 and 3C595 # wb: Support for fast ethernet adapters based on the Winbond W89C840F chip. # Note: this is not the same as the Winbond W89C940F, which is a @@ -2067,6 +2068,7 @@ device stge # Sundance/Tamarack TC9021 device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II +device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Dec 30 23:50:25 2010 (r216828) +++ head/sys/conf/files Fri Dec 31 00:21:41 2010 (r216829) @@ -1876,6 +1876,7 @@ dev/utopia/utopia.c optional utopia dev/vge/if_vge.c optional vge dev/vkbd/vkbd.c optional vkbd dev/vr/if_vr.c optional vr pci +dev/vte/if_vte.c optional vte pci dev/vx/if_vx.c optional vx dev/vx/if_vx_eisa.c optional vx eisa dev/vx/if_vx_pci.c optional vx pci Added: head/sys/dev/vte/if_vte.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vte/if_vte.c Fri Dec 31 00:21:41 2010 (r216829) @@ -0,0 +1,2056 @@ +/*- + * Copyright (c) 2010, Pyun YongHyeon + * 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 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. + */ + +/* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +#if 0 +#include "if_vtereg.h" +#include "if_vtevar.h" +#else +#include +#include +#endif + +/* "device miibus" required. See GENERIC if you get errors here. */ +#include "miibus_if.h" + +MODULE_DEPEND(vte, pci, 1, 1, 1); +MODULE_DEPEND(vte, ether, 1, 1, 1); +MODULE_DEPEND(vte, miibus, 1, 1, 1); + +/* Tunables. */ +static int tx_deep_copy = 1; +TUNABLE_INT("hw.vte.tx_deep_copy", &tx_deep_copy); + +/* + * Devices supported by this driver. + */ +static const struct vte_ident vte_ident_table[] = { + { VENDORID_RDC, DEVICEID_RDC_R6040, "RDC R6040 FastEthernet"}, + { 0, 0, NULL} +}; + +static int vte_attach(device_t); +static int vte_detach(device_t); +static int vte_dma_alloc(struct vte_softc *); +static void vte_dma_free(struct vte_softc *); +static void vte_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static struct vte_txdesc * + vte_encap(struct vte_softc *, struct mbuf **); +static const struct vte_ident * + vte_find_ident(device_t); +#ifndef __NO_STRICT_ALIGNMENT +static struct mbuf * + vte_fixup_rx(struct ifnet *, struct mbuf *); +#endif +static void vte_get_macaddr(struct vte_softc *); +static void vte_init(void *); +static void vte_init_locked(struct vte_softc *); +static int vte_init_rx_ring(struct vte_softc *); +static int vte_init_tx_ring(struct vte_softc *); +static void vte_intr(void *); +static int vte_ioctl(struct ifnet *, u_long, caddr_t); +static void vte_mac_config(struct vte_softc *); +static int vte_miibus_readreg(device_t, int, int); +static void vte_miibus_statchg(device_t); +static int vte_miibus_writereg(device_t, int, int, int); +static int vte_mediachange(struct ifnet *); +static int vte_mediachange_locked(struct ifnet *); +static void vte_mediastatus(struct ifnet *, struct ifmediareq *); +static int vte_newbuf(struct vte_softc *, struct vte_rxdesc *); +static int vte_probe(device_t); +static void vte_reset(struct vte_softc *); +static int vte_resume(device_t); +static void vte_rxeof(struct vte_softc *); +static void vte_rxfilter(struct vte_softc *); +static int vte_shutdown(device_t); +static void vte_start(struct ifnet *); +static void vte_start_locked(struct vte_softc *); +static void vte_start_mac(struct vte_softc *); +static void vte_stats_clear(struct vte_softc *); +static void vte_stats_update(struct vte_softc *); +static void vte_stop(struct vte_softc *); +static void vte_stop_mac(struct vte_softc *); +static int vte_suspend(device_t); +static void vte_sysctl_node(struct vte_softc *); +static void vte_tick(void *); +static void vte_txeof(struct vte_softc *); +static void vte_watchdog(struct vte_softc *); +static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_vte_int_mod(SYSCTL_HANDLER_ARGS); + +static device_method_t vte_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, vte_probe), + DEVMETHOD(device_attach, vte_attach), + DEVMETHOD(device_detach, vte_detach), + DEVMETHOD(device_shutdown, vte_shutdown), + DEVMETHOD(device_suspend, vte_suspend), + DEVMETHOD(device_resume, vte_resume), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, vte_miibus_readreg), + DEVMETHOD(miibus_writereg, vte_miibus_writereg), + DEVMETHOD(miibus_statchg, vte_miibus_statchg), + + KOBJMETHOD_END +}; + +static driver_t vte_driver = { + "vte", + vte_methods, + sizeof(struct vte_softc) +}; + +static devclass_t vte_devclass; + +DRIVER_MODULE(vte, pci, vte_driver, vte_devclass, 0, 0); +DRIVER_MODULE(miibus, vte, miibus_driver, miibus_devclass, 0, 0); + +static int +vte_miibus_readreg(device_t dev, int phy, int reg) +{ + struct vte_softc *sc; + int i; + + sc = device_get_softc(dev); + + CSR_WRITE_2(sc, VTE_MMDIO, MMDIO_READ | + (phy << MMDIO_PHY_ADDR_SHIFT) | (reg << MMDIO_REG_ADDR_SHIFT)); + for (i = VTE_PHY_TIMEOUT; i > 0; i--) { + DELAY(5); + if ((CSR_READ_2(sc, VTE_MMDIO) & MMDIO_READ) == 0) + break; + } + + if (i == 0) { + device_printf(sc->vte_dev, "phy read timeout : %d\n", reg); + return (0); + } + + return (CSR_READ_2(sc, VTE_MMRD)); +} + +static int +vte_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct vte_softc *sc; + int i; + + sc = device_get_softc(dev); + + CSR_WRITE_2(sc, VTE_MMWD, val); + CSR_WRITE_2(sc, VTE_MMDIO, MMDIO_WRITE | + (phy << MMDIO_PHY_ADDR_SHIFT) | (reg << MMDIO_REG_ADDR_SHIFT)); + for (i = VTE_PHY_TIMEOUT; i > 0; i--) { + DELAY(5); + if ((CSR_READ_2(sc, VTE_MMDIO) & MMDIO_WRITE) == 0) + break; + } + + if (i == 0) + device_printf(sc->vte_dev, "phy write timeout : %d\n", reg); + + return (0); +} + +static void +vte_miibus_statchg(device_t dev) +{ + struct vte_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint16_t val; + + sc = device_get_softc(dev); + + mii = device_get_softc(sc->vte_miibus); + ifp = sc->vte_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->vte_flags &= ~VTE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->vte_flags |= VTE_FLAG_LINK; + break; + default: + break; + } + } + + /* Stop RX/TX MACs. */ + vte_stop_mac(sc); + /* Program MACs with resolved duplex and flow control. */ + if ((sc->vte_flags & VTE_FLAG_LINK) != 0) { + /* + * Timer waiting time : (63 + TIMER * 64) MII clock. + * MII clock : 25MHz(100Mbps) or 2.5MHz(10Mbps). + */ + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) + val = 18 << VTE_IM_TIMER_SHIFT; + else + val = 1 << VTE_IM_TIMER_SHIFT; + val |= sc->vte_int_rx_mod << VTE_IM_BUNDLE_SHIFT; + /* 48.6us for 100Mbps, 50.8us for 10Mbps */ + CSR_WRITE_2(sc, VTE_MRICR, val); + + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) + val = 18 << VTE_IM_TIMER_SHIFT; + else + val = 1 << VTE_IM_TIMER_SHIFT; + val |= sc->vte_int_tx_mod << VTE_IM_BUNDLE_SHIFT; + /* 48.6us for 100Mbps, 50.8us for 10Mbps */ + CSR_WRITE_2(sc, VTE_MTICR, val); + + vte_mac_config(sc); + vte_start_mac(sc); + } +} + +static void +vte_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct vte_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + VTE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VTE_UNLOCK(sc); + return; + } + mii = device_get_softc(sc->vte_miibus); + + mii_pollstat(mii); + VTE_UNLOCK(sc); + ifmr->ifm_status = mii->mii_media_status; + ifmr->ifm_active = mii->mii_media_active; +} + +static int +vte_mediachange(struct ifnet *ifp) +{ + struct vte_softc *sc; + int error; + + sc = ifp->if_softc; + VTE_LOCK(sc); + error = vte_mediachange_locked(ifp); + VTE_UNLOCK(sc); + return (error); +} + +static int +vte_mediachange_locked(struct ifnet *ifp) +{ + struct vte_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + mii = device_get_softc(sc->vte_miibus); + if (mii->mii_instance != 0) { + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + mii_phy_reset(miisc); + } + error = mii_mediachg(mii); + + return (error); +} + +static const struct vte_ident * +vte_find_ident(device_t dev) +{ + const struct vte_ident *ident; + uint16_t vendor, devid; + + vendor = pci_get_vendor(dev); + devid = pci_get_device(dev); + for (ident = vte_ident_table; ident->name != NULL; ident++) { + if (vendor == ident->vendorid && devid == ident->deviceid) + return (ident); + } + + return (NULL); +} + +static int +vte_probe(device_t dev) +{ + const struct vte_ident *ident; + + ident = vte_find_ident(dev); + if (ident != NULL) { + device_set_desc(dev, ident->name); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static void +vte_get_macaddr(struct vte_softc *sc) +{ + uint16_t mid; + + /* + * It seems there is no way to reload station address and + * it is supposed to be set by BIOS. + */ + mid = CSR_READ_2(sc, VTE_MID0L); + sc->vte_eaddr[0] = (mid >> 0) & 0xFF; + sc->vte_eaddr[1] = (mid >> 8) & 0xFF; + mid = CSR_READ_2(sc, VTE_MID0M); + sc->vte_eaddr[2] = (mid >> 0) & 0xFF; + sc->vte_eaddr[3] = (mid >> 8) & 0xFF; + mid = CSR_READ_2(sc, VTE_MID0H); + sc->vte_eaddr[4] = (mid >> 0) & 0xFF; + sc->vte_eaddr[5] = (mid >> 8) & 0xFF; +} + +static int +vte_attach(device_t dev) +{ + struct vte_softc *sc; + struct ifnet *ifp; + uint16_t macid; + int error, rid; + + error = 0; + sc = device_get_softc(dev); + sc->vte_dev = dev; + + mtx_init(&sc->vte_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); + callout_init_mtx(&sc->vte_tick_ch, &sc->vte_mtx, 0); + sc->vte_ident = vte_find_ident(dev); + + /* Map the device. */ + pci_enable_busmaster(dev); + sc->vte_res_id = PCIR_BAR(1); + sc->vte_res_type = SYS_RES_MEMORY; + sc->vte_res = bus_alloc_resource_any(dev, sc->vte_res_type, + &sc->vte_res_id, RF_ACTIVE); + if (sc->vte_res == NULL) { + sc->vte_res_id = PCIR_BAR(0); + sc->vte_res_type = SYS_RES_IOPORT; + sc->vte_res = bus_alloc_resource_any(dev, sc->vte_res_type, + &sc->vte_res_id, RF_ACTIVE); + if (sc->vte_res == NULL) { + device_printf(dev, "cannot map memory/ports.\n"); + mtx_destroy(&sc->vte_mtx); + return (ENXIO); + } + } + if (bootverbose) { + device_printf(dev, "using %s space register mapping\n", + sc->vte_res_type == SYS_RES_MEMORY ? "memory" : "I/O"); + device_printf(dev, "MAC Identifier : 0x%04x\n", + CSR_READ_2(sc, VTE_MACID)); + macid = CSR_READ_2(sc, VTE_MACID_REV); + device_printf(dev, "MAC Id. 0x%02x, Rev. 0x%02x\n", + (macid & VTE_MACID_MASK) >> VTE_MACID_SHIFT, + (macid & VTE_MACID_REV_MASK) >> VTE_MACID_REV_SHIFT); + } + + rid = 0; + sc->vte_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->vte_irq == NULL) { + device_printf(dev, "cannot allocate IRQ resources.\n"); + error = ENXIO; + goto fail; + } + + /* Reset the ethernet controller. */ + vte_reset(sc); + + if ((error = vte_dma_alloc(sc) != 0)) + goto fail; + + /* Create device sysctl node. */ + vte_sysctl_node(sc); + + /* Load station address. */ + vte_get_macaddr(sc); + + ifp = sc->vte_ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + device_printf(dev, "cannot allocate ifnet structure.\n"); + error = ENXIO; + goto fail; + } + + ifp->if_softc = sc; + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = vte_ioctl; + ifp->if_start = vte_start; + ifp->if_init = vte_init; + ifp->if_snd.ifq_drv_maxlen = VTE_TX_RING_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); + + /* + * Set up MII bus. + * BIOS would have initialized VTE_MPSCCR to catch PHY + * status changes so driver may be able to extract + * configured PHY address. Since it's common to see BIOS + * fails to initialize the register(including the sample + * board I have), let mii(4) probe it. This is more + * reliable than relying on BIOS's initialization. + * + * Advertising flow control capability to mii(4) was + * intentionally disabled due to severe problems in TX + * pause frame generation. See vte_rxeof() for more + * details. + */ + error = mii_attach(dev, &sc->vte_miibus, ifp, vte_mediachange, + vte_mediastatus, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + goto fail; + } + + ether_ifattach(ifp, sc->vte_eaddr); + + /* VLAN capability setup. */ + ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capenable = ifp->if_capabilities; + /* Tell the upper layer we support VLAN over-sized frames. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); + + error = bus_setup_intr(dev, sc->vte_irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, vte_intr, sc, &sc->vte_intrhand); + if (error != 0) { + device_printf(dev, "could not set up interrupt handler.\n"); + ether_ifdetach(ifp); + goto fail; + } + +fail: + if (error != 0) + vte_detach(dev); + + return (error); +} + +static int +vte_detach(device_t dev) +{ + struct vte_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + + ifp = sc->vte_ifp; + if (device_is_attached(dev)) { + VTE_LOCK(sc); + vte_stop(sc); + VTE_UNLOCK(sc); + callout_drain(&sc->vte_tick_ch); + ether_ifdetach(ifp); + } + + if (sc->vte_miibus != NULL) { + device_delete_child(dev, sc->vte_miibus); + sc->vte_miibus = NULL; + } + bus_generic_detach(dev); + + if (sc->vte_intrhand != NULL) { + bus_teardown_intr(dev, sc->vte_irq, sc->vte_intrhand); + sc->vte_intrhand = NULL; + } + if (sc->vte_irq != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vte_irq); + sc->vte_irq = NULL; + } + if (sc->vte_res != NULL) { + bus_release_resource(dev, sc->vte_res_type, sc->vte_res_id, + sc->vte_res); + sc->vte_res = NULL; + } + if (ifp != NULL) { + if_free(ifp); + sc->vte_ifp = NULL; + } + vte_dma_free(sc); + mtx_destroy(&sc->vte_mtx); + + return (0); +} + +#define VTE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +static void +vte_sysctl_node(struct vte_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct vte_hw_stats *stats; + int error; + + stats = &sc->vte_stats; + ctx = device_get_sysctl_ctx(sc->vte_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vte_dev)); + + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->vte_int_rx_mod, 0, + sysctl_hw_vte_int_mod, "I", "vte RX interrupt moderation"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->vte_int_tx_mod, 0, + sysctl_hw_vte_int_mod, "I", "vte TX interrupt moderation"); + /* Pull in device tunables. */ + sc->vte_int_rx_mod = VTE_IM_RX_BUNDLE_DEFAULT; + error = resource_int_value(device_get_name(sc->vte_dev), + device_get_unit(sc->vte_dev), "int_rx_mod", &sc->vte_int_rx_mod); + if (error == 0) { + if (sc->vte_int_rx_mod < VTE_IM_BUNDLE_MIN || + sc->vte_int_rx_mod > VTE_IM_BUNDLE_MAX) { + device_printf(sc->vte_dev, "int_rx_mod value out of " + "range; using default: %d\n", + VTE_IM_RX_BUNDLE_DEFAULT); + sc->vte_int_rx_mod = VTE_IM_RX_BUNDLE_DEFAULT; + } + } + + sc->vte_int_tx_mod = VTE_IM_TX_BUNDLE_DEFAULT; + error = resource_int_value(device_get_name(sc->vte_dev), + device_get_unit(sc->vte_dev), "int_tx_mod", &sc->vte_int_tx_mod); + if (error == 0) { + if (sc->vte_int_tx_mod < VTE_IM_BUNDLE_MIN || + sc->vte_int_tx_mod > VTE_IM_BUNDLE_MAX) { + device_printf(sc->vte_dev, "int_tx_mod value out of " + "range; using default: %d\n", + VTE_IM_TX_BUNDLE_DEFAULT); + sc->vte_int_tx_mod = VTE_IM_TX_BUNDLE_DEFAULT; + } + } + + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "VTE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* RX statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "RX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VTE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_frames, "Good frames"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "good_bcast_frames", + &stats->rx_bcast_frames, "Good broadcast frames"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "good_mcast_frames", + &stats->rx_mcast_frames, "Good multicast frames"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "runt", + &stats->rx_runts, "Too short frames"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "crc_errs", + &stats->rx_crcerrs, "CRC errors"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "long_frames", + &stats->rx_long_frames, + "Frames that have longer length than maximum packet length"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "fifo_full", + &stats->rx_fifo_full, "FIFO full"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "desc_unavail", + &stats->rx_desc_unavail, "Descriptor unavailable frames"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "Pause control frames"); + + /* TX statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "TX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VTE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_frames, "Good frames"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "underruns", + &stats->tx_underruns, "FIFO underruns"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_late_colls, "Late collisions"); + VTE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause_frames, "Pause control frames"); +} + +#undef VTE_SYSCTL_STAT_ADD32 + +struct vte_dmamap_arg { + bus_addr_t vte_busaddr; +}; + +static void +vte_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct vte_dmamap_arg *ctx; + + if (error != 0) + return; + + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + ctx = (struct vte_dmamap_arg *)arg; + ctx->vte_busaddr = segs[0].ds_addr; +} + +static int +vte_dma_alloc(struct vte_softc *sc) +{ + struct vte_txdesc *txd; + struct vte_rxdesc *rxd; + struct vte_dmamap_arg ctx; + int error, i; + + /* Create parent DMA tag. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->vte_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vte_cdata.vte_parent_tag); + if (error != 0) { + device_printf(sc->vte_dev, + "could not create parent DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for TX descriptor ring. */ + error = bus_dma_tag_create( + sc->vte_cdata.vte_parent_tag, /* parent */ + VTE_TX_RING_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VTE_TX_RING_SZ, /* maxsize */ + 1, /* nsegments */ + VTE_TX_RING_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vte_cdata.vte_tx_ring_tag); + if (error != 0) { + device_printf(sc->vte_dev, + "could not create TX ring DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for RX free descriptor ring. */ + error = bus_dma_tag_create( + sc->vte_cdata.vte_parent_tag, /* parent */ + VTE_RX_RING_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VTE_RX_RING_SZ, /* maxsize */ + 1, /* nsegments */ + VTE_RX_RING_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vte_cdata.vte_rx_ring_tag); + if (error != 0) { + device_printf(sc->vte_dev, + "could not create RX ring DMA tag.\n"); + goto fail; + } + + /* Allocate DMA'able memory and load the DMA map for TX ring. */ + error = bus_dmamem_alloc(sc->vte_cdata.vte_tx_ring_tag, + (void **)&sc->vte_cdata.vte_tx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vte_cdata.vte_tx_ring_map); + if (error != 0) { + device_printf(sc->vte_dev, + "could not allocate DMA'able memory for TX ring.\n"); + goto fail; + } + ctx.vte_busaddr = 0; + error = bus_dmamap_load(sc->vte_cdata.vte_tx_ring_tag, + sc->vte_cdata.vte_tx_ring_map, sc->vte_cdata.vte_tx_ring, + VTE_TX_RING_SZ, vte_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.vte_busaddr == 0) { + device_printf(sc->vte_dev, + "could not load DMA'able memory for TX ring.\n"); + goto fail; + } + sc->vte_cdata.vte_tx_ring_paddr = ctx.vte_busaddr; + + /* Allocate DMA'able memory and load the DMA map for RX ring. */ + error = bus_dmamem_alloc(sc->vte_cdata.vte_rx_ring_tag, + (void **)&sc->vte_cdata.vte_rx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vte_cdata.vte_rx_ring_map); + if (error != 0) { + device_printf(sc->vte_dev, + "could not allocate DMA'able memory for RX ring.\n"); + goto fail; + } + ctx.vte_busaddr = 0; + error = bus_dmamap_load(sc->vte_cdata.vte_rx_ring_tag, + sc->vte_cdata.vte_rx_ring_map, sc->vte_cdata.vte_rx_ring, + VTE_RX_RING_SZ, vte_dmamap_cb, &ctx, 0); + if (error != 0 || ctx.vte_busaddr == 0) { + device_printf(sc->vte_dev, + "could not load DMA'able memory for RX ring.\n"); + goto fail; + } + sc->vte_cdata.vte_rx_ring_paddr = ctx.vte_busaddr; + + /* Create TX buffer parent tag. */ + error = bus_dma_tag_create( + bus_get_dma_tag(sc->vte_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vte_cdata.vte_buffer_tag); + if (error != 0) { + device_printf(sc->vte_dev, + "could not create parent buffer DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for TX buffers. */ + error = bus_dma_tag_create( + sc->vte_cdata.vte_buffer_tag, /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vte_cdata.vte_tx_tag); + if (error != 0) { + device_printf(sc->vte_dev, "could not create TX DMA tag.\n"); + goto fail; + } + + /* Create DMA tag for RX buffers. */ + error = bus_dma_tag_create( + sc->vte_cdata.vte_buffer_tag, /* parent */ + VTE_RX_BUF_ALIGN, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vte_cdata.vte_rx_tag); + if (error != 0) { + device_printf(sc->vte_dev, "could not create RX DMA tag.\n"); + goto fail; + } + /* Create DMA maps for TX buffers. */ + for (i = 0; i < VTE_TX_RING_CNT; i++) { + txd = &sc->vte_cdata.vte_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + error = bus_dmamap_create(sc->vte_cdata.vte_tx_tag, 0, + &txd->tx_dmamap); + if (error != 0) { + device_printf(sc->vte_dev, + "could not create TX dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for RX buffers. */ + if ((error = bus_dmamap_create(sc->vte_cdata.vte_rx_tag, 0, + &sc->vte_cdata.vte_rx_sparemap)) != 0) { + device_printf(sc->vte_dev, + "could not create spare RX dmamap.\n"); + goto fail; + } + for (i = 0; i < VTE_RX_RING_CNT; i++) { + rxd = &sc->vte_cdata.vte_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; + error = bus_dmamap_create(sc->vte_cdata.vte_rx_tag, 0, + &rxd->rx_dmamap); + if (error != 0) { + device_printf(sc->vte_dev, + "could not create RX dmamap.\n"); + goto fail; + } + } + +fail: + return (error); +} + +static void +vte_dma_free(struct vte_softc *sc) +{ + struct vte_txdesc *txd; + struct vte_rxdesc *rxd; + int i; + + /* TX buffers. */ + if (sc->vte_cdata.vte_tx_tag != NULL) { + for (i = 0; i < VTE_TX_RING_CNT; i++) { + txd = &sc->vte_cdata.vte_txdesc[i]; + if (txd->tx_dmamap != NULL) { + bus_dmamap_destroy(sc->vte_cdata.vte_tx_tag, + txd->tx_dmamap); + txd->tx_dmamap = NULL; + } + } + bus_dma_tag_destroy(sc->vte_cdata.vte_tx_tag); + sc->vte_cdata.vte_tx_tag = NULL; + } + /* RX buffers */ + if (sc->vte_cdata.vte_rx_tag != NULL) { + for (i = 0; i < VTE_RX_RING_CNT; i++) { + rxd = &sc->vte_cdata.vte_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { + bus_dmamap_destroy(sc->vte_cdata.vte_rx_tag, + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; + } + } + if (sc->vte_cdata.vte_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->vte_cdata.vte_rx_tag, + sc->vte_cdata.vte_rx_sparemap); + sc->vte_cdata.vte_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->vte_cdata.vte_rx_tag); + sc->vte_cdata.vte_rx_tag = NULL; + } + /* TX descriptor ring. */ + if (sc->vte_cdata.vte_tx_ring_tag != NULL) { + if (sc->vte_cdata.vte_tx_ring_map != NULL) + bus_dmamap_unload(sc->vte_cdata.vte_tx_ring_tag, + sc->vte_cdata.vte_tx_ring_map); + if (sc->vte_cdata.vte_tx_ring_map != NULL && + sc->vte_cdata.vte_tx_ring != NULL) + bus_dmamem_free(sc->vte_cdata.vte_tx_ring_tag, + sc->vte_cdata.vte_tx_ring, + sc->vte_cdata.vte_tx_ring_map); + sc->vte_cdata.vte_tx_ring = NULL; + sc->vte_cdata.vte_tx_ring_map = NULL; + bus_dma_tag_destroy(sc->vte_cdata.vte_tx_ring_tag); + sc->vte_cdata.vte_tx_ring_tag = NULL; + } + /* RX ring. */ + if (sc->vte_cdata.vte_rx_ring_tag != NULL) { + if (sc->vte_cdata.vte_rx_ring_map != NULL) + bus_dmamap_unload(sc->vte_cdata.vte_rx_ring_tag, + sc->vte_cdata.vte_rx_ring_map); + if (sc->vte_cdata.vte_rx_ring_map != NULL && + sc->vte_cdata.vte_rx_ring != NULL) + bus_dmamem_free(sc->vte_cdata.vte_rx_ring_tag, + sc->vte_cdata.vte_rx_ring, + sc->vte_cdata.vte_rx_ring_map); + sc->vte_cdata.vte_rx_ring = NULL; + sc->vte_cdata.vte_rx_ring_map = NULL; + bus_dma_tag_destroy(sc->vte_cdata.vte_rx_ring_tag); + sc->vte_cdata.vte_rx_ring_tag = NULL; + } + if (sc->vte_cdata.vte_buffer_tag != NULL) { + bus_dma_tag_destroy(sc->vte_cdata.vte_buffer_tag); + sc->vte_cdata.vte_buffer_tag = NULL; + } + if (sc->vte_cdata.vte_parent_tag != NULL) { + bus_dma_tag_destroy(sc->vte_cdata.vte_parent_tag); + sc->vte_cdata.vte_parent_tag = NULL; + } +} + +static int +vte_shutdown(device_t dev) +{ + + return (vte_suspend(dev)); +} + +static int +vte_suspend(device_t dev) +{ + struct vte_softc *sc; + struct ifnet *ifp; + + sc = device_get_softc(dev); + + VTE_LOCK(sc); + ifp = sc->vte_ifp; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + vte_stop(sc); + VTE_UNLOCK(sc); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 00:24:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCD49106566B; Fri, 31 Dec 2010 00:24:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCD758FC08; Fri, 31 Dec 2010 00:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBV0O8Wj055494; Fri, 31 Dec 2010 00:24:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBV0O8wt055492; Fri, 31 Dec 2010 00:24:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012310024.oBV0O8wt055492@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 00:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216830 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 00:24:08 -0000 Author: yongari Date: Fri Dec 31 00:24:08 2010 New Revision: 216830 URL: http://svn.freebsd.org/changeset/base/216830 Log: Add vte(4) to the list of supported network interface. Modified: head/usr.sbin/sysinstall/devices.c Modified: head/usr.sbin/sysinstall/devices.c ============================================================================== --- head/usr.sbin/sysinstall/devices.c Fri Dec 31 00:21:41 2010 (r216829) +++ head/usr.sbin/sysinstall/devices.c Fri Dec 31 00:24:08 2010 (r216830) @@ -169,6 +169,7 @@ static struct _devname { NETWORK("urtw", "Realtek 8187L USB wireless adapter"), NETWORK("vge", "VIA VT612x PCI Gigabit Ethernet card"), NETWORK("vr", "VIA VT3043/VT86C100A Rhine PCI Ethernet card"), + NETWORK("vte", "DM&P Vortex86 RDC R6040 Fast Ethernet"), NETWORK("vlan", "IEEE 802.1Q VLAN network interface"), NETWORK("vx", "3COM 3c590 / 3c595 Ethernet card"), NETWORK("wb", "Winbond W89C840F PCI Ethernet card"), From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 00:46:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17047106564A; Fri, 31 Dec 2010 00:46:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 05B128FC0A; Fri, 31 Dec 2010 00:46:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBV0kUeG055979; Fri, 31 Dec 2010 00:46:30 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBV0kU9C055973; Fri, 31 Dec 2010 00:46:30 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012310046.oBV0kU9C055973@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 00:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216831 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 00:46:31 -0000 Author: yongari Date: Fri Dec 31 00:46:30 2010 New Revision: 216831 URL: http://svn.freebsd.org/changeset/base/216831 Log: Add vte(4) man page and hook up vte(4) to the build. Also add Xr to appropriate man pages. Added: head/share/man/man4/vte.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/altq.4 head/share/man/man4/miibus.4 head/share/man/man4/vlan.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Dec 31 00:24:08 2010 (r216830) +++ head/share/man/man4/Makefile Fri Dec 31 00:46:30 2010 (r216831) @@ -482,6 +482,7 @@ MAN= aac.4 \ vlan.4 \ vpo.4 \ vr.4 \ + vte.4 \ watchdog.4 \ wb.4 \ wi.4 \ Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Fri Dec 31 00:24:08 2010 (r216830) +++ head/share/man/man4/altq.4 Fri Dec 31 00:46:30 2010 (r216831) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd December 30, 2010 .Dt ALTQ 4 .Os .Sh NAME @@ -165,6 +165,7 @@ They have been applied to the following .Xr ural 4 , .Xr vge 4 , .Xr vr 4 , +.Xr vte 4 , .Xr wi 4 , and .Xr xl 4 . Modified: head/share/man/man4/miibus.4 ============================================================================== --- head/share/man/man4/miibus.4 Fri Dec 31 00:24:08 2010 (r216830) +++ head/share/man/man4/miibus.4 Fri Dec 31 00:46:30 2010 (r216831) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd December 30, 2010 .Dt MIIBUS 4 .Os .Sh NAME @@ -119,6 +119,8 @@ Davicom DM9601 USB Ethernet VIA VT612x PCI Gigabit Ethernet .It Xr vr 4 VIA Rhine, Rhine II +.It Xr vte 4 +DM&P Vortex86 RDC R6040 Fast Ethernet .It Xr wb 4 Winbond W89C840F .It Xr xl 4 @@ -173,6 +175,7 @@ but as a result are not well behaved new .Xr udav 4 , .Xr vge 4 , .Xr vr 4 , +.Xr vte 4 , .Xr wb 4 , .Xr xl 4 .Sh STANDARDS Modified: head/share/man/man4/vlan.4 ============================================================================== --- head/share/man/man4/vlan.4 Fri Dec 31 00:24:08 2010 (r216830) +++ head/share/man/man4/vlan.4 Fri Dec 31 00:46:30 2010 (r216831) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd December 30, 2010 .Dt VLAN 4 .Os .Sh NAME @@ -184,6 +184,7 @@ natively: .Xr tl 4 , .Xr tx 4 , .Xr vr 4 , +.Xr vte 4 , and .Xr xl 4 . .Pp Added: head/share/man/man4/vte.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/vte.4 Fri Dec 31 00:46:30 2010 (r216831) @@ -0,0 +1,152 @@ +.\" Copyright (c) 2010 Pyun YongHyeon +.\" 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 December 30, 2010 +.Dt VTE 4 +.Os +.Sh NAME +.Nm vte +.Nd Vortex86 RDC R6040 Fast Ethernet driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device miibus" +.Cd "device vte" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_vte_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for RDC R6040 Fast Ethernet controller +which is commonly found on Vortex86 System On a Chip (SoC). +.Pp +The RDC R6040 has integrated 10/100 PHY for 10/100Mbps support in full +or half-duplex. +The controller supports interrupt moderation mechanism, a 64-bit multicast +hash filter, VLAN over-size frame and four station addresses. +The +.Nm +device driver uses three station addresses out of four as perfect +perfect multicast filter. +.Pp +The +.Nm +driver supports the following media types: +.Bl -tag -width ".Cm 10baseT/UTP" +.It Cm autoselect +Enable autoselection of the media type and options. +The user can manually override +the autoselected mode by adding media options to +.Xr rc.conf 5 . +.It Cm 10baseT/UTP +Set 10Mbps operation. +.It Cm 100baseTX +Set 100Mbps (Fast Ethernet) operation. +.El +.Pp +The +.Nm +driver supports the following media options: +.Bl -tag -width ".Cm full-duplex" +.It Cm full-duplex +Force full duplex operation. +.It Cm half-duplex +Force half duplex operation. +.El +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +DM&P Vortex86 RDC R6040 Fast Ethernet controller +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vte.tx_deep_copy +The RDC R6040 controller has no auto-padding support for short +frames and the controller's DMA engine does not have capability to +handle multiple buffers for a TX frame such that driver has to +create a single contiguous TX buffer. +This hardware limitation leads to poor TX performance since most of +CPU cycles are wasted on both de-fragmenting mbuf chains and padding. +This tunable enables deep copy operation for TX frames such that +driver will spend less CPU cycles in de-fragmentation with the +cost of extra TX buffer memory. +The default value is 1 to use deep copy. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.vte.%d.rx_mod +Maximum number of packets to fire RX completion interrupt. +The accepted range is 0 to 15, the default is 15. +.It Va dev.vte.%d.tx_mod +Maximum number of packets to fire TX completion interrupt. +The accepted range is 0 to 15, the default is 15. +.It Va dev.vte.%d.stats +Show hardware MAC statistics maintained in driver. +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr miibus 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Rs +.%T "DM&P Electronics Inc. Vortex86" +.%U http://www.dmp.com.tw +.Re +.Sh HISTORY +The +.Nm +driver was written by +.An Pyun YongHyeon +.Aq yongari@FreeBSD.org . +It first appeared in +.Fx 8.3 . From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 01:10:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0D61065672; Fri, 31 Dec 2010 01:10:42 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE968FC08; Fri, 31 Dec 2010 01:10:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBV1AgDL056520; Fri, 31 Dec 2010 01:10:42 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBV1Agjr056518; Fri, 31 Dec 2010 01:10:42 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201012310110.oBV1Agjr056518@svn.freebsd.org> From: Brian Somers Date: Fri, 31 Dec 2010 01:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216832 - head/usr.sbin/newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 01:10:42 -0000 Author: brian Date: Fri Dec 31 01:10:42 2010 New Revision: 216832 URL: http://svn.freebsd.org/changeset/base/216832 Log: Make -S functional. MFC after: 1 week Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Fri Dec 31 00:46:30 2010 (r216831) +++ head/usr.sbin/newsyslog/newsyslog.c Fri Dec 31 01:10:42 2010 (r216832) @@ -599,7 +599,7 @@ parse_args(int argc, char **argv) *p = '\0'; /* Parse command line options. */ - while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:")) != -1) + while ((ch = getopt(argc, argv, "a:d:f:nrst:vCD:FNPR:S:")) != -1) switch (ch) { case 'a': archtodir++; From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 01:23:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B7D0106566B; Fri, 31 Dec 2010 01:23:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B54F8FC0C; Fri, 31 Dec 2010 01:23:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBV1N54k056801; Fri, 31 Dec 2010 01:23:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBV1N5f4056799; Fri, 31 Dec 2010 01:23:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012310123.oBV1N5f4056799@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 01:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216833 - head/sys/dev/vte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 01:23:05 -0000 Author: yongari Date: Fri Dec 31 01:23:04 2010 New Revision: 216833 URL: http://svn.freebsd.org/changeset/base/216833 Log: Remove debugging leftovers. Modified: head/sys/dev/vte/if_vte.c Modified: head/sys/dev/vte/if_vte.c ============================================================================== --- head/sys/dev/vte/if_vte.c Fri Dec 31 01:10:42 2010 (r216832) +++ head/sys/dev/vte/if_vte.c Fri Dec 31 01:23:04 2010 (r216833) @@ -66,13 +66,8 @@ __FBSDID("$FreeBSD$"); #include -#if 0 -#include "if_vtereg.h" -#include "if_vtevar.h" -#else #include #include -#endif /* "device miibus" required. See GENERIC if you get errors here. */ #include "miibus_if.h" From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 01:27:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 11A06106567A; Fri, 31 Dec 2010 01:27:04 +0000 (UTC) Date: Fri, 31 Dec 2010 01:27:04 +0000 From: Alexander Best To: Pawel Jakub Dawidek Message-ID: <20101231012704.GA74407@freebsd.org> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012301806.oBUI6VcW046731@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 01:27:04 -0000 On Thu Dec 30 10, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Dec 30 18:06:31 2010 > New Revision: 216823 > URL: http://svn.freebsd.org/changeset/base/216823 > > Log: > For compatibility with Linux and Solaris add poweroff(8). any thoughts on adding a 'shutdown -c' switch for compatibility reasons? right now the only way to revert a scheduled shutdown is to send a sigterm. 'shutdown -c' would provide an easier way and in addition to that using 'shutdown -c reason', admins could issue a notice to users why a scheduled shutdown was aborted. this is the explanation for the -c option from the linux shutdown(8) manual: "-c Cancel an already running shutdown. With this option it is of course not possible to give the time argument, but you can enter a explanatory message on the command line that will be sent to all users." cheers. alex > > It is implemented as a hard link to shutdown(8) and it is equivalent of: > > # shutdown -p now > > While I'm here put one line of usage into one line of C code so it is easier to > grep(1) and separate unrelated code with empty line. > > MFC after: 2 weeks > > Modified: > head/sbin/shutdown/Makefile > head/sbin/shutdown/shutdown.8 > head/sbin/shutdown/shutdown.c > > Modified: head/sbin/shutdown/Makefile > ============================================================================== > --- head/sbin/shutdown/Makefile Thu Dec 30 16:56:20 2010 (r216822) > +++ head/sbin/shutdown/Makefile Thu Dec 30 18:06:31 2010 (r216823) > @@ -3,6 +3,8 @@ > > PROG= shutdown > MAN= shutdown.8 > +LINKS= ${BINDIR}/shutdown ${BINDIR}/poweroff > +MLINKS= shutdown.8 poweroff.8 > > BINOWN= root > BINGRP= operator > > Modified: head/sbin/shutdown/shutdown.8 > ============================================================================== > --- head/sbin/shutdown/shutdown.8 Thu Dec 30 16:56:20 2010 (r216822) > +++ head/sbin/shutdown/shutdown.8 Thu Dec 30 18:06:31 2010 (r216823) > @@ -28,11 +28,12 @@ > .\" @(#)shutdown.8 8.2 (Berkeley) 4/27/95 > .\" $FreeBSD$ > .\" > -.Dd December 23, 2008 > +.Dd December 30, 2010 > .Dt SHUTDOWN 8 > .Os > .Sh NAME > -.Nm shutdown > +.Nm shutdown , > +.Nm poweroff > .Nd "close down the system at a given time" > .Sh SYNOPSIS > .Nm > @@ -47,6 +48,7 @@ > .Oc > .Ar time > .Op Ar warning-message ... > +.Nm poweroff > .Sh DESCRIPTION > The > .Nm > @@ -173,6 +175,13 @@ When run without options, the > utility will place the system into single user mode at the > .Ar time > specified. > +.Pp > +Calling utility as > +.Nm poweroff > +is equivalent of calling: > +.Bd -literal -offset indent > +shutdown -p now > +.Ed > .Sh FILES > .Bl -tag -width /var/run/nologin -compact > .It Pa /var/run/nologin > > Modified: head/sbin/shutdown/shutdown.c > ============================================================================== > --- head/sbin/shutdown/shutdown.c Thu Dec 30 16:56:20 2010 (r216822) > +++ head/sbin/shutdown/shutdown.c Thu Dec 30 18:06:31 2010 (r216823) > @@ -115,8 +115,31 @@ main(int argc, char **argv) > if (geteuid()) > errx(1, "NOT super-user"); > #endif > + > nosync = NULL; > readstdin = 0; > + > + /* > + * Test for the special case where the utility is called as > + * "poweroff", for which it runs 'shutdown -p now'. > + */ > + if ((p = rindex(argv[0], '/')) == NULL) > + p = argv[0]; > + else > + ++p; > + if (strcmp(p, "poweroff") == 0) { > + if (getopt(argc, argv, "") != -1) > + usage((char *)NULL); > + argc -= optind; > + argv += optind; > + if (argc != 0) > + usage((char *)NULL); > + dopower = 1; > + offset = 0; > + (void)time(&shuttime); > + goto poweroff; > + } > + > while ((ch = getopt(argc, argv, "-hknopr")) != -1) > switch (ch) { > case '-': > @@ -161,6 +184,7 @@ main(int argc, char **argv) > > getoffset(*argv++); > > +poweroff: > if (*argv) { > for (p = mbuf, len = sizeof(mbuf); *argv; ++argv) { > arglen = strlen(*argv); > @@ -510,7 +534,7 @@ usage(const char *cp) > if (cp != NULL) > warnx("%s", cp); > (void)fprintf(stderr, > - "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]]" > - " time [warning-message ...]\n"); > + "usage: shutdown [-] [-h | -p | -r | -k] [-o [-n]] time [warning-message ...]\n" > + " poweroff\n"); > exit(1); > } -- a13x From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 03:29:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A888106566B; Fri, 31 Dec 2010 03:29:44 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from outbound.icp-qv1-irony-out1.iinet.net.au (outbound.icp-qv1-irony-out1.iinet.net.au [203.59.1.106]) by mx1.freebsd.org (Postfix) with ESMTP id C78CB8FC08; Fri, 31 Dec 2010 03:29:42 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAIfVHE18lWAs/2dsb2JhbACDcKBOc7ANjyyBIIM2dASOOw X-IronPort-AV: E=Sophos;i="4.60,253,1291564800"; d="scan'208";a="744818822" Received: from unknown (HELO lstewart-laptop.caia.swin.edu.au) ([124.149.96.44]) by outbound.icp-qv1-irony-out1.iinet.net.au with ESMTP; 31 Dec 2010 11:01:33 +0800 Message-ID: <4D1D478B.8070105@freebsd.org> Date: Fri, 31 Dec 2010 14:01:31 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101225 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Warner Losh References: <201007152228.o6FMSJi3019698@svn.freebsd.org> In-Reply-To: <201007152228.o6FMSJi3019698@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r210144 - head/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 03:29:44 -0000 Hi Warner, On 07/16/10 08:28, Warner Losh wrote: > Author: imp > Date: Thu Jul 15 22:28:19 2010 > New Revision: 210144 > URL: http://svn.freebsd.org/changeset/base/210144 > > Log: > Put warnings out to stderr rather than stdout. > > MFC after: 3 days > > Modified: > head/usr.sbin/config/config.y > head/usr.sbin/config/mkmakefile.c > head/usr.sbin/config/mkoptions.c Attempting to "make universe" on stable/8 without this diff currently results in the make bailing because of config warnings ending up in make variables when a LINT kernel is built. Building a head tree on stable/8 using the following command will demonstrate the problem: make -v -dl universe_kernels KERNCONFS=LINT e.g. ########## lstewart@lstewart3:head> sudo make -v -dl universe_kernels KERNCONFS=LINT (cd /work/svn/freebsd_mirror/head && env __MAKE_CONF=/dev/null make buildkernel TARGET=amd64 TARGET_ARCH=WARNING: duplicate option `GEOM_PART_BSD' encountered. WARNING: duplicate option `GEOM_PART_EBR' encountered. WARNING: duplicate option `GEOM_PART_EBR_COMPAT' encountered. WARNING: duplicate option `GEOM_PART_MBR' encountered. WARNING: duplicate option `DEV_MEM' encountered. WARNING: duplicate device `mem' encountered. WARNING: duplicate option `DEV_ISA' encountered. WARNING: duplicate device `isa' encountered. amd64 KERNCONF=LINT > _.amd64.LINT 2>&1 || (echo "amd64 LINT kernel failed," "check _.amd64.LINT for details"| cat)) Syntax error: Unterminated quoted string *** Error code 2 Stop in /work/svn/freebsd_mirror/head. ########## Jilles deserves the credit for doing all the detective work after I complained about this problem on IRC today. Is there a reason the MFC was never done? Assuming not, I would appreciate if you could do it when you have a sec or give me the green light to do it instead. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 09:50:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBFD11065675; Fri, 31 Dec 2010 09:50:15 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB9108FC24; Fri, 31 Dec 2010 09:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBV9oFDn067487; Fri, 31 Dec 2010 09:50:15 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBV9oFm6067485; Fri, 31 Dec 2010 09:50:15 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012310950.oBV9oFm6067485@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 09:50:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216835 - head/sys/dev/mwl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 09:50:15 -0000 Author: bschmidt Date: Fri Dec 31 09:50:15 2010 New Revision: 216835 URL: http://svn.freebsd.org/changeset/base/216835 Log: The mwl's HAL manages an array of MWL_MBSS_MAX VAPs where the first 8 are supposed to be APs and the later 24 are pre-configured as STAs. A wrong condition during initialization is responsible for not configuring the last 8 array members. This is results in being able to create more than 8, possible uninitialized, AP-VAPs. PR: kern/153549 Submitted by: Erik Fonnesbeck MFC after: 2 weeks Modified: head/sys/dev/mwl/mwlhal.c Modified: head/sys/dev/mwl/mwlhal.c ============================================================================== --- head/sys/dev/mwl/mwlhal.c Fri Dec 31 02:19:38 2010 (r216834) +++ head/sys/dev/mwl/mwlhal.c Fri Dec 31 09:50:15 2010 (r216835) @@ -279,7 +279,7 @@ mwl_hal_attach(device_t dev, uint16_t de hvap->vap_type = MWL_HAL_STA; hvap->bss_type = htole16(WL_MAC_TYPE_PRIMARY_CLIENT); hvap->macid = i; - for (i++; i < MWL_MBSS_STA_MAX; i++) { + for (i++; i < MWL_MBSS_MAX; i++) { hvap = &mh->mh_vaps[i]; hvap->vap_type = MWL_HAL_STA; hvap->bss_type = htole16(WL_MAC_TYPE_SECONDARY_CLIENT); From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 11:55:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C7DF106566B; Fri, 31 Dec 2010 11:55:40 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E589B8FC0A; Fri, 31 Dec 2010 11:55:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVBtdQs071923; Fri, 31 Dec 2010 11:55:39 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVBtdFc071921; Fri, 31 Dec 2010 11:55:39 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201012311155.oBVBtdFc071921@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 31 Dec 2010 11:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216836 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 11:55:40 -0000 Author: gavin Date: Fri Dec 31 11:55:39 2010 New Revision: 216836 URL: http://svn.freebsd.org/changeset/base/216836 Log: For committers listed as alumni, add the date that their commit bit was returned where this information is missing and easy to determine. Move adrian@ back to the "Active committers" section. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Dec 31 09:50:15 2010 (r216835) +++ head/share/misc/committers-src.dot Fri Dec 31 11:55:39 2010 (r216836) @@ -28,31 +28,31 @@ node [color=grey62, style=filled, bgcolo # Alumni go here.. Try to keep things sorted. -adrian [label="Adrian Chadd\nadrian@FreeBSD.org\n2000/07/03\n2006/05/30"] alm [label="Andrew Moore\nalm@FreeBSD.org\n1993/06/12\n????/??/??"] archie [label="Archie Cobbs\narchie@FreeBSD.org\n1998/11/06\n2006/06/09"] asmodai [label="Jeroen Ruigrok\nasmodai@FreeBSD.org\n1999/12/16\n2001/11/16"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] -furuta [label="Atsushi Furuta\nfuruta@FreeBSD.org\n2000/06/21\n????/??/??"] +furuta [label="Atsushi Furuta\nfuruta@FreeBSD.org\n2000/06/21\n2003/03/08"] jtc [label="J.T. Conklin\njtc@FreeBSD.org\n1993/06/12\n????/??/??"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] -mb [label="Maxim Bolotin\nmb@FreeBSD.org\n2000/04/06\n????/??/??"] +mb [label="Maxim Bolotin\nmb@FreeBSD.org\n2000/04/06\n2003/03/08"] nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/12\n2003/12/15"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] -rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n????/??/??"] -shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n????/??/??"] +rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2003/03/08"] +shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n2006/04/06"] sheldonh [label="Sheldon Hearn\nsheldonh@FreeBSD.org\n1999/06/14\n2006/05/13"] shin [label="Yoshinobu Inoue\nshin@FreeBSD.org\n1999/07/29\n2003/03/08"] tmm [label="Thomas Moestl\ntmm@FreeBSD.org\n2001/03/07\n2006/07/12"] -toshi [label="Toshihiko Arai\ntoshi@FreeBSD.org\n2000/07/06\n????/??/??"] +toshi [label="Toshihiko Arai\ntoshi@FreeBSD.org\n2000/07/06\n2003/03/08"] tshiozak [label="Takuya SHIOZAKI\ntshiozak@FreeBSD.org\n2001/04/25\n2003/03/08"] -uch [label="UCHIYAMA Yasushi\nuch@FreeBSD.org\n2000/06/21\n????/??/??"] +uch [label="UCHIYAMA Yasushi\nuch@FreeBSD.org\n2000/06/21\n2002/04/24"] node [color=lightblue2, style=filled, bgcolor=black]; # Current src committers go here. Try to keep things sorted. ache [label="Andrey Chernov\nache@FreeBSD.org\n1993/10/31"] +adrian [label="Adrian Chadd\nadrian@FreeBSD.org\n2000/07/03"] ae [label="Andrey V. Elsukov\nae@FreeBSD.org\n2010/06/03"] akiyama [label="Shunsuke Akiyama\nakiyama@FreeBSD.org\n2000/06/19"] ambrisko [label="Doug Ambrisko\nambrisko@FreeBSD.org\n2001/12/19"] From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 12:48:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E8231065674; Fri, 31 Dec 2010 12:48:43 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE6E8FC1D; Fri, 31 Dec 2010 12:48:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVCmhC7073192; Fri, 31 Dec 2010 12:48:43 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVCmhTp073190; Fri, 31 Dec 2010 12:48:43 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012311248.oBVCmhTp073190@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 12:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216837 - stable/8/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 12:48:43 -0000 Author: bschmidt Date: Fri Dec 31 12:48:43 2010 New Revision: 216837 URL: http://svn.freebsd.org/changeset/base/216837 Log: MFC r216049: Some drivers rely on the existence of certain keys. The Atheros 9xxx driver for example requests the NetCfgInstanceId but doesn't check the returned status code and will happily access random memory instead. Submitted by: Paul B Mahol Modified: stable/8/sys/compat/ndis/kern_ndis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 11:55:39 2010 (r216836) +++ stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 12:48:43 2010 (r216837) @@ -331,6 +331,16 @@ ndis_create_sysctls(arg) ndis_add_sysctl(sc, "NdisVersion", "NDIS API Version", "0x00050001", CTLFLAG_RD); + /* + * Some miniport drivers rely on the existence of the SlotNumber, + * NetCfgInstanceId and DriverDesc keys. + */ + ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD); + ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId", + "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD); + ndis_add_sysctl(sc, "DriverDesc", "Driver Description", + "NDIS Network Adapter", CTLFLAG_RD); + /* Bus type (PCI, PCMCIA, etc...) */ sprintf(buf, "%d", (int)sc->ndis_iftype); ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD); From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 12:53:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 955D9106566B; Fri, 31 Dec 2010 12:53:07 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69A8B8FC0C; Fri, 31 Dec 2010 12:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVCr786073326; Fri, 31 Dec 2010 12:53:07 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVCr7sA073324; Fri, 31 Dec 2010 12:53:07 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012311253.oBVCr7sA073324@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 12:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216838 - stable/8/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 12:53:07 -0000 Author: bschmidt Date: Fri Dec 31 12:53:07 2010 New Revision: 216838 URL: http://svn.freebsd.org/changeset/base/216838 Log: MFC r216050: Add a dummy for IoOpenDeviceRegistryKey(). With that change the Atheros 9xxx driver is actually usable and does not panic anymore. Submitted by: Paul B Mahol Modified: stable/8/sys/compat/ndis/subr_ntoskrnl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:48:43 2010 (r216837) +++ stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:53:07 2010 (r216838) @@ -228,6 +228,8 @@ static void srand(unsigned int); static void KeQuerySystemTime(uint64_t *); static uint32_t KeTickCount(void); static uint8_t IoIsWdmVersionAvailable(uint8_t, uint8_t); +static int32_t IoOpenDeviceRegistryKey(struct device_object *, uint32_t, + uint32_t, void **); static void ntoskrnl_thrfunc(void *); static ndis_status PsCreateSystemThread(ndis_handle *, uint32_t, void *, ndis_handle, void *, void *, void *); @@ -3199,6 +3201,13 @@ IoIsWdmVersionAvailable(uint8_t major, u return (FALSE); } +static int32_t +IoOpenDeviceRegistryKey(struct device_object *devobj, uint32_t type, + uint32_t mask, void **key) +{ + return (NDIS_STATUS_INVALID_DEVICE_REQUEST); +} + static ndis_status IoGetDeviceObjectPointer(name, reqaccess, fileobj, devobj) unicode_string *name; @@ -4378,6 +4387,7 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_SFUNC(MmUnmapIoSpace, 2), IMPORT_SFUNC(KeInitializeSpinLock, 1), IMPORT_SFUNC(IoIsWdmVersionAvailable, 2), + IMPORT_SFUNC(IoOpenDeviceRegistryKey, 4), IMPORT_SFUNC(IoGetDeviceObjectPointer, 4), IMPORT_SFUNC(IoGetDeviceProperty, 5), IMPORT_SFUNC(IoAllocateWorkItem, 1), From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 12:59:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E32C1106566B; Fri, 31 Dec 2010 12:59:17 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D134A8FC17; Fri, 31 Dec 2010 12:59:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVCxHdA073496; Fri, 31 Dec 2010 12:59:17 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVCxHww073490; Fri, 31 Dec 2010 12:59:17 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201012311259.oBVCxHww073490@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 31 Dec 2010 12:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216839 - stable/8/sys/compat/ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 12:59:18 -0000 Author: bschmidt Date: Fri Dec 31 12:59:17 2010 New Revision: 216839 URL: http://svn.freebsd.org/changeset/base/216839 Log: MFC r216242: Implement NdisGetRoutineAddress and MmGetSystemRoutineAddress used in newer Ralink drivers. Submitted by: Paul B Mahol Modified: stable/8/sys/compat/ndis/kern_ndis.c stable/8/sys/compat/ndis/ndis_var.h stable/8/sys/compat/ndis/ntoskrnl_var.h stable/8/sys/compat/ndis/subr_ndis.c stable/8/sys/compat/ndis/subr_ntoskrnl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/ndis/kern_ndis.c ============================================================================== --- stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/kern_ndis.c Fri Dec 31 12:59:17 2010 (r216839) @@ -433,6 +433,19 @@ ndis_flush_sysctls(arg) return (0); } +void * +ndis_get_routine_address(functbl, name) + struct image_patch_table *functbl; + char *name; +{ + int i; + + for (i = 0; functbl[i].ipt_name != NULL; i++) + if (strcmp(name, functbl[i].ipt_name) == 0) + return (functbl[i].ipt_wrap); + return (NULL); +} + static void ndis_return(dobj, arg) device_object *dobj; Modified: stable/8/sys/compat/ndis/ndis_var.h ============================================================================== --- stable/8/sys/compat/ndis/ndis_var.h Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/ndis_var.h Fri Dec 31 12:59:17 2010 (r216839) @@ -1729,6 +1729,7 @@ extern int ndis_mtop(struct mbuf *, ndis extern int ndis_ptom(struct mbuf **, ndis_packet *); extern int ndis_get_info(void *, ndis_oid, void *, int *); extern int ndis_set_info(void *, ndis_oid, void *, int *); +extern void *ndis_get_routine_address(struct image_patch_table *, char *); extern int ndis_get_supported_oids(void *, ndis_oid **, int *); extern int ndis_send_packets(void *, ndis_packet **, int); extern int ndis_send_packet(void *, ndis_packet *); Modified: stable/8/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- stable/8/sys/compat/ndis/ntoskrnl_var.h Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/ntoskrnl_var.h Fri Dec 31 12:59:17 2010 (r216839) @@ -1466,6 +1466,7 @@ extern uint32_t IoConnectInterrupt(kinte kspin_lock *, uint32_t, uint8_t, uint8_t, uint8_t, uint8_t, uint32_t, uint8_t); extern uint8_t MmIsAddressValid(void *); +extern void *MmGetSystemRoutineAddress(unicode_string *); extern void *MmMapIoSpace(uint64_t, uint32_t, uint32_t); extern void MmUnmapIoSpace(void *, size_t); extern void MmBuildMdlForNonPagedPool(mdl *); Modified: stable/8/sys/compat/ndis/subr_ndis.c ============================================================================== --- stable/8/sys/compat/ndis/subr_ndis.c Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/subr_ndis.c Fri Dec 31 12:59:17 2010 (r216839) @@ -197,6 +197,7 @@ static ndis_status NdisMMapIoSpace(void ndis_physaddr, uint32_t); static void NdisMUnmapIoSpace(ndis_handle, void *, uint32_t); static uint32_t NdisGetCacheFillSize(void); +static void *NdisGetRoutineAddress(unicode_string *); static uint32_t NdisMGetDmaAlignment(ndis_handle); static ndis_status NdisMInitializeScatterGatherDma(ndis_handle, uint8_t, uint32_t); @@ -1642,6 +1643,17 @@ NdisGetCacheFillSize(void) return (128); } +static void * +NdisGetRoutineAddress(ustr) + unicode_string *ustr; +{ + ansi_string astr; + + if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE)) + return (NULL); + return (ndis_get_routine_address(ndis_functbl, astr.as_buf)); +} + static uint32_t NdisMGetDmaAlignment(handle) ndis_handle handle; @@ -3246,6 +3258,7 @@ image_patch_table ndis_functbl[] = { IMPORT_SFUNC(NdisInitializeString, 2), IMPORT_SFUNC(NdisFreeString, 1), IMPORT_SFUNC(NdisGetCurrentSystemTime, 1), + IMPORT_SFUNC(NdisGetRoutineAddress, 1), IMPORT_SFUNC(NdisGetSystemUpTime, 1), IMPORT_SFUNC(NdisGetVersion, 0), IMPORT_SFUNC(NdisMSynchronizeWithInterrupt, 3), Modified: stable/8/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:53:07 2010 (r216838) +++ stable/8/sys/compat/ndis/subr_ntoskrnl.c Fri Dec 31 12:59:17 2010 (r216839) @@ -2589,6 +2589,17 @@ MmGetPhysicalAddress(void *base) return (pmap_extract(kernel_map->pmap, (vm_offset_t)base)); } +void * +MmGetSystemRoutineAddress(ustr) + unicode_string *ustr; +{ + ansi_string astr; + + if (RtlUnicodeStringToAnsiString(&astr, ustr, TRUE)) + return (NULL); + return (ndis_get_routine_address(ntoskrnl_functbl, astr.as_buf)); +} + uint8_t MmIsAddressValid(vaddr) void *vaddr; @@ -4382,6 +4393,7 @@ image_patch_table ntoskrnl_functbl[] = { IMPORT_SFUNC(MmUnmapLockedPages, 2), IMPORT_SFUNC(MmBuildMdlForNonPagedPool, 1), IMPORT_SFUNC(MmGetPhysicalAddress, 1), + IMPORT_SFUNC(MmGetSystemRoutineAddress, 1), IMPORT_SFUNC(MmIsAddressValid, 1), IMPORT_SFUNC(MmMapIoSpace, 3 + 1), IMPORT_SFUNC(MmUnmapIoSpace, 2), From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 13:07:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C2D7106566C; Fri, 31 Dec 2010 13:07:22 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39D3B8FC14; Fri, 31 Dec 2010 13:07:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVD7MgE073710; Fri, 31 Dec 2010 13:07:22 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVD7MKm073708; Fri, 31 Dec 2010 13:07:22 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201012311307.oBVD7MKm073708@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 31 Dec 2010 13:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216840 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 13:07:22 -0000 Author: gavin Date: Fri Dec 31 13:07:21 2010 New Revision: 216840 URL: http://svn.freebsd.org/changeset/base/216840 Log: Move alumni committers from the active section. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Fri Dec 31 12:59:17 2010 (r216839) +++ head/share/misc/committers-src.dot Fri Dec 31 13:07:21 2010 (r216840) @@ -29,19 +29,41 @@ node [color=grey62, style=filled, bgcolo # Alumni go here.. Try to keep things sorted. alm [label="Andrew Moore\nalm@FreeBSD.org\n1993/06/12\n????/??/??"] +anholt [label="Eric Anholt\nanholt@FreeBSD.org\n2002/04/22\n2008/08/07"] archie [label="Archie Cobbs\narchie@FreeBSD.org\n1998/11/06\n2006/06/09"] asmodai [label="Jeroen Ruigrok\nasmodai@FreeBSD.org\n1999/12/16\n2001/11/16"] +benjsc [label="Benjamin Close\nbenjsc@FreeBSD.org\n2007/02/09\n2010/09/15"] +bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29\n2009/09/13"] +bmilekic [label="Bosko Milekic\nbmilekic@FreeBSD.org\n2000/09/21\n2008/11/10"] cjc [label="Crist J. Clark\ncjc@FreeBSD.org\n2001/06/01\n2006/12/29"] +dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20\n2010/09/22"] +dhartmei [label="Daniel Hartmeier\ndhartmei@FreeBSD.org\n2004/04/06\n2008/12/08"] +dmlb [label="Duncan Barclay\ndmlb@FreeBSD.org\n2001/12/14\n2008/11/10"] +eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2004/05/20\n2008/11/10"] furuta [label="Atsushi Furuta\nfuruta@FreeBSD.org\n2000/06/21\n2003/03/08"] +jake [label="Jake Burkholder\njake@FreeBSD.org\n2000/05/16\n2008/11/10"] +jayanth [label="Jayanth Vijayaraghavan\njayanth@FreeBSD.org\n2000/05/08\n2008/11/10"] +jdp [label="John Polstra\njdp@FreeBSD.org\n????/??/??\n2008/02/26"] +jkh [label="Jordan K. Hubbard\njkh@FreeBSD.org\n1993/06/12\n2008/06/13"] +joe [label="Josef Karthauser\njoe@FreeBSD.org\n1999/10/22\n2008/08/10"] jtc [label="J.T. Conklin\njtc@FreeBSD.org\n1993/06/12\n????/??/??"] keichii [label="Michael Wu\nkeichii@FreeBSD.org\n2001/03/07\n2006/04/28"] +linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30\n2008/05/04"] mb [label="Maxim Bolotin\nmb@FreeBSD.org\n2000/04/06\n2003/03/08"] +marks [label="Mark Santcroos\nmarks@FreeBSD.org\n2004/03/18\n2008/09/29"] +murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05\n2010/07/25"] nate [label="Nate Willams\nnate@FreeBSD.org\n1993/06/12\n2003/12/15"] +njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\nnon@FreeBSD.org\n2000/06/19\n2007/03/06"] +onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21\n2008/11/10"] rgrimes [label="Rod Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2003/03/08"] +rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16\n2010/11/04"] +rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25\n2010/12/03"] shafeeq [label="Shafeeq Sinnamohideen\nshafeeq@FreeBSD.org\n2000/06/19\n2006/04/06"] sheldonh [label="Sheldon Hearn\nsheldonh@FreeBSD.org\n1999/06/14\n2006/05/13"] +shiba [label="Takeshi Shibagaki\nshiba@FreeBSD.org\n2000/06/19\n2008/11/10"] shin [label="Yoshinobu Inoue\nshin@FreeBSD.org\n1999/07/29\n2003/03/08"] +snb [label="Nick Barkas\nsnb@FreeBSD.org\n2009/05/05\n2010/11/04"] tmm [label="Thomas Moestl\ntmm@FreeBSD.org\n2001/03/07\n2006/07/12"] toshi [label="Toshihiko Arai\ntoshi@FreeBSD.org\n2000/07/06\n2003/03/08"] tshiozak [label="Takuya SHIOZAKI\ntshiozak@FreeBSD.org\n2001/04/25\n2003/03/08"] @@ -60,14 +82,10 @@ anchie [label="Ana Kukec\nanchie@FreeBSD andre [label="Andre Oppermann\nandre@FreeBSD.org\n2003/11/12"] andreast [label="Andreas Tobler\nandreast@FreeBSD.org\n2010/09/05"] andrew [label="Andrew Turner\nandrew@FreeBSD.org\n2010/07/19"] -anholt [label="Eric Anholt\nanholt@FreeBSD.org\n2002/04/22"] antoine [label="Antoine Brodin\nantoine@FreeBSD.org\n2008/02/03"] ariff [label="Ariff Abdullah\nariff@FreeBSD.org\n2005/11/14"] avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"] -benjsc [label="Benjamin Close\nbenjsc@FreeBSD.org\n2007/02/09"] benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"] -bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2002/01/29"] -bmilekic [label="Bosko Milekic\nbmilekic@FreeBSD.org\n????/??/??"] bms [label="Bruce M Simpson\nbms@FreeBSD.org\n2003/08/06"] brian [label="Brian Somers\nbrian@FreeBSD.org\n1996/12/16"] brooks [label="Brooks Davis\nbrooks@FreeBSD.org\n2001/06/21"] @@ -81,17 +99,13 @@ cokane [label="Coleman Kane\ncokane@Free cperciva [label="Colin Percival\ncperciva@FreeBSD.org\n2004/01/20"] csjp [label="Christian S.J. Peron\ncsjp@FreeBSD.org\n2004/05/04"] davidxu [label="David Xu\ndavidxu@FreeBSD.org\n2002/09/02"] -dds [label="Diomidis Spinellis\ndds@FreeBSD.org\n2003/06/20"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] des [label="Dag-Erling Smorgrav\ndes@FreeBSD.org\n1998/04/03"] dg [label="David Greenman\ndg@FreeBSD.org\n1993/06/14"] -dhartmei [label="Daniel Hartmeier\ndhartmei@FreeBSD.org\n2004/04/06"] dim [label="Dimitry Andric\ndim@FreeBSD.org\n2010/08/30"] -dmlb [label="Duncan Barclay\ndmlb@FreeBSD.org\n2001/12/14"] dwmalone [label="David Malone\ndwmalone@FreeBSD.org\n2000/07/11"] ed [label="Ed Schouten\ned@FreeBSD.org\n2008/05/22"] edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2007/06/25"] -eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2004/05/20"] emaste [label="Ed Maste\nemaste@FreeBSD.org\n2005/10/04"] emax [label="Maksim Yevmenkin\nemax@FreeBSD.org\n2003/10/12"] eri [label="Ermal Luci\neri@FreeBSD.org\n2008/06/11"] @@ -112,20 +126,15 @@ gshapiro [label="Gregory Shapiro\ngshapi iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] imp [label="Warner Losh\nimp@FreeBSD.org\n1996/09/20"] ivoras [label="Ivan Voras\nivoras@FreeBSD.org\n2008/06/10"] -jake [label="Jake Burkholder\njake@FreeBSD.org\n2000/05/16"] jamie [label="Jamie Gritton\njamie@FreeBSD.org\n2009/01/28"] -jayanth [label="Jayanth Vijayaraghavan\njayanth@FreeBSD.org\n2000/05/08"] jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] -jdp [label="John Polstra\njdp@FreeBSD.org\n????/??/??"] jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] jilles [label="Jilles Tjoelker\njilles@FreeBSD.org\n2009/05/22"] jinmei [label="JINMEI Tatuya\njinmei@FreeBSD.org\n2007/03/17"] -jkh [label="Jordan K. Hubbard\njkh@FreeBSD.org\n1993/06/12"] jkim [label="Jung-uk Kim\njkim@FreeBSD.org\n2005/07/06"] jkoshy [label="A. Joseph Koshy\njkoshy@FreeBSD.org\n1998/05/13"] jls [label="Jordan Sissel\njls@FreeBSD.org\n2006/12/06"] -joe [label="Josef Karthauser\njoe@FreeBSD.org\n1999/10/22"] joerg [label="Joerg Wunsch\njoerg@FreeBSD.org\n1993/11/14"] jon [label="Jonathan Chen\njon@FreeBSD.org\n2000/10/17"] jonathan [label="Jonathan Anderson\njonathan@FreeBSD.org\n2010/10/07"] @@ -136,12 +145,10 @@ kevlo [label="Kevin Lo\nkevlo@FreeBSD.or kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] -linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] lulf [label="Ulf Lilleengen\nlulf@FreeBSD.org\n2007/10/24"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] markm [label="Mark Murray\nmarkm@FreeBSD.org\n199?/??/??"] -marks [label="Mark Santcroos\nmarks@FreeBSD.org\n2004/03/18"] markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n2006/06/01"] matteo [label="Matteo Riondato\nmatteo@FreeBSD.org\n2006/01/18"] mav [label="Alexander Motin\nmav@FreeBSD.org\n2007/04/12"] @@ -150,16 +157,13 @@ mdf [label="Matthew Fleming\nmdf@FreeBSD mjacob [label="Matt Jacob\nmjacob@FreeBSD.org\n1997/08/13"] mlaier [label="Max Laier\nmlaier@FreeBSD.org\n2004/02/10"] mr [label="Michael Reifenberger\nmr@FreeBSD.org\n2001/09/30"] -murray [label="Murray Stokely\nmurray@FreeBSD.org\n2000/04/05"] neel [label="Neel Natu\nneel@FreeBSD.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetchild@FreeBSD.org\n2005/03/31"] -njl [label="Nate Lawson\nnjl@FreeBSD.org\n2002/08/07"] nork [label="Norikatsu Shigemura\nnork@FreeBSD.org\n2009/06/09"] np [label="Navdeep Parhar\nnp@FreeBSD.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhitehorn@FreeBSD.org\n2008/07/03"] obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] -onoe [label="Atsushi Onoe\nonoe@FreeBSD.org\n2000/07/21"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n????/??/??"] philip [label="Philip Paeps\nphilip@FreBSD.org\n2004/01/21"] @@ -173,10 +177,8 @@ rafan [label="Rong-En Fan\nrafan@FreeBSD randi [label="Randi Harper\nrandi@FreeBSD.org\n2010/04/20"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] -rink [label="Rink Springer\nrink@FreeBSD.org\n2006/01/16"] rnoland [label="Robert Noland\nrnoland@FreeBSD.org\n2008/09/15"] roberto [label="Ollivier Robert\nroberto@FreeBSD.org\n1995/02/22"] -rpaulo [label="Rui Paulo\nrpaulo@FreeBSD.org\n2007/09/25"] rrs [label="Randall R Stewart\nrrs@FreeBSD.org\n2007/02/08"] rse [label="Ralf S. Engelschall\nrse@FreeBSD.org\n1997/07/31"] rstone [label="Ryan Stone\nrstone@FreeBSD.org\n2010/04/19"] @@ -187,10 +189,8 @@ sanpei [label="MIHIRA Sanpei Yoshiro\nsa scf [label="Sean C. Farley\nscf@FreeBSD.org\n2007/06/24"] schweikh [label="Jens Schweikhardt\nschweikh@FreeBSD.org\n2001/04/06"] sepotvin [label="Stephane E. Potvin\nsepotvin@FreeBSD.org\n2007/02/15"] -shiba [label="Takeshi Shibagaki\nshiba@FreeBSD.org\n2000/06/19"] simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] -snb [label="Nick Barkas\nsnb@FreeBSD.org\n2009/05/05"] sson [label="Stacey Son\nsson@FreeBSD.org\n2008/07/08"] suz [label="SUZUKI Shinsuke\nsuz@FreeBSD.org\n2002/03/26"] syrinx [label="Shteryana Shopova\nsyrinx@FreeBSD.org\n2006/10/07"] From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 14:03:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF4641065670; Fri, 31 Dec 2010 14:03:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B32868FC08; Fri, 31 Dec 2010 14:03:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVE3v9E074913; Fri, 31 Dec 2010 14:03:57 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVE3vMD074911; Fri, 31 Dec 2010 14:03:57 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201012311403.oBVE3vMD074911@svn.freebsd.org> From: Rick Macklem Date: Fri, 31 Dec 2010 14:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216841 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 14:03:58 -0000 Author: rmacklem Date: Fri Dec 31 14:03:57 2010 New Revision: 216841 URL: http://svn.freebsd.org/changeset/base/216841 Log: MFC: r216510 Fix two vnode locking problems in nfsd_recalldelegation() in the experimental NFSv4 server. The first was a bogus use of VOP_ISLOCKED() in a KASSERT() and the second was the need to lock the vnode for the nfsrv_checkremove() call. Also, delete a "__unused" that was bogus, since the argument is used. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 31 13:07:21 2010 (r216840) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Dec 31 14:03:57 2010 (r216841) @@ -4275,7 +4275,7 @@ nfsrv_clientconflict(struct nfsclient *c */ static int nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, - __unused vnode_t vp) + vnode_t vp) { struct nfsclient *clp = stp->ls_clp; int gotlock, error, retrycnt, zapped_clp; @@ -4568,8 +4568,6 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO int32_t starttime; int error; - KASSERT(!VOP_ISLOCKED(vp), ("vp %p is locked", vp)); - /* * First, check to see if the server is currently running and it has * been called for a regular file when issuing delegations. @@ -4578,6 +4576,7 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO nfsrv_issuedelegs == 0) return; + KASSERT((VOP_ISLOCKED(vp) != LK_EXCLUSIVE), ("vp %p is locked", vp)); /* * First, get a reference on the nfsv4rootfs_lock so that an * exclusive lock cannot be acquired by another thread. @@ -4593,7 +4592,12 @@ nfsd_recalldelegation(vnode_t vp, NFSPRO NFSGETNANOTIME(&mytime); starttime = (u_int32_t)mytime.tv_sec; do { - error = nfsrv_checkremove(vp, 0, p); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + if ((vp->v_iflag & VI_DOOMED) == 0) + error = nfsrv_checkremove(vp, 0, p); + else + error = EPERM; + VOP_UNLOCK(vp, 0); if (error == NFSERR_DELAY) { NFSGETNANOTIME(&mytime); if (((u_int32_t)mytime.tv_sec - starttime) > From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 14:27:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33AD21065674; Fri, 31 Dec 2010 14:27:10 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C83108FC15; Fri, 31 Dec 2010 14:27:08 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 9E8B245DF4; Fri, 31 Dec 2010 14:57:48 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5260645C9C; Fri, 31 Dec 2010 14:57:43 +0100 (CET) Date: Fri, 31 Dec 2010 14:57:39 +0100 From: Pawel Jakub Dawidek To: Alexander Best Message-ID: <20101231135739.GB1892@garage.freebsd.pl> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231012704.GA74407@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GPJrCs/72TxItFYR" Content-Disposition: inline In-Reply-To: <20101231012704.GA74407@freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 14:27:10 -0000 --GPJrCs/72TxItFYR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 31, 2010 at 01:27:04AM +0000, Alexander Best wrote: > On Thu Dec 30 10, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Thu Dec 30 18:06:31 2010 > > New Revision: 216823 > > URL: http://svn.freebsd.org/changeset/base/216823 > >=20 > > Log: > > For compatibility with Linux and Solaris add poweroff(8). >=20 > any thoughts on adding a 'shutdown -c' switch for compatibility reasons? > right now the only way to revert a scheduled shutdown is to send a sigter= m. > 'shutdown -c' would provide an easier way and in addition to that using > 'shutdown -c reason', admins could issue a notice to users why a scheduled > shutdown was aborted. >=20 > this is the explanation for the -c option from the linux shutdown(8) manu= al: >=20 > "-c > Cancel an already running shutdown. With this option it is of course = not > possible to give the time argument, but you can enter a explanatory m= essage > on the command line that will be sent to all users." I'm not against such a change:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --GPJrCs/72TxItFYR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0d4VMACgkQForvXbEpPzToDACgt3CXvIRCk4FXwibt7RxrIZAn iucAoOb4gbpNsGV1IeZqz6UbjDg4nt6J =F3dj -----END PGP SIGNATURE----- --GPJrCs/72TxItFYR-- From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 14:43:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8A25106566C; Fri, 31 Dec 2010 14:43:09 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 85DCE8FC19; Fri, 31 Dec 2010 14:43:09 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 8B5BB1DD413; Fri, 31 Dec 2010 15:43:08 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 7420E1721E; Fri, 31 Dec 2010 15:43:08 +0100 (CET) Date: Fri, 31 Dec 2010 15:43:08 +0100 From: Jilles Tjoelker To: Pawel Jakub Dawidek Message-ID: <20101231144308.GA55052@stack.nl> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012301806.oBUI6VcW046731@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 14:43:10 -0000 On Thu, Dec 30, 2010 at 06:06:31PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Dec 30 18:06:31 2010 > New Revision: 216823 > URL: http://svn.freebsd.org/changeset/base/216823 > Log: > For compatibility with Linux and Solaris add poweroff(8). > It is implemented as a hard link to shutdown(8) and it is equivalent of: > # shutdown -p now If we go that way, then for consistency reboot(8) and halt(8) should also be equivalent to calling shutdown -r now and shutdown -h now respectively, unless conflicting options are given. Linux has a -f option for what's currently reboot's and halt's default action, and fastboot(8)/fasthalt(8) could also retain the current behaviour. I would be in favour of this change. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 15:20:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36DF410656A9; Fri, 31 Dec 2010 15:20:12 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 984148FC1E; Fri, 31 Dec 2010 15:20:06 +0000 (UTC) Received: by bwz12 with SMTP id 12so5092639bwz.13 for ; Fri, 31 Dec 2010 07:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=ks4nFFaFfSJSQTIvx5tjjUA3O+tT/DQZtljlIdQphHg=; b=qOVplFrJC/4MjIz8LpvRm/KCz4oHH2pIFrU9xnfJvjAryUHeqeIlgOgHAME1ylF9Vt oosrOF++vU1OyofuxOc6h/LqHjIRzq/vxcALtUs0bJgexSk20QRZSL2RwJnDUvZiRTyk 9PZY9mywjBZrMNa76Q/Zf8qb/78pgJuFvs2qw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=KCD8Jzge5fSSHWkfikz9tm7OyW6SvcwHhmx6GtUBZSYqW2XOAsDQYqWIQreQOwXp50 nFvdmgumECIZMFflcQ10ezYWYFYlk7mTrTS92xEhGuHJDXt+ap0smT+5GcCpXkJIiHLj hrg7jz1QiFNDtjx/s/RLl674jLf1j3OR3mU1Q= Received: by 10.204.140.70 with SMTP id h6mr7870166bku.117.1293807110260; Fri, 31 Dec 2010 06:51:50 -0800 (PST) Received: from ernst.jennejohn.org (p578E36F8.dip.t-dialin.net [87.142.54.248]) by mx.google.com with ESMTPS id a17sm9949998bku.23.2010.12.31.06.51.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Dec 2010 06:51:49 -0800 (PST) Date: Fri, 31 Dec 2010 15:51:46 +0100 From: Gary Jennejohn To: Gavin Atkinson Message-ID: <20101231155146.6ca5d336@ernst.jennejohn.org> In-Reply-To: <201012311155.oBVBtdFc071921@svn.freebsd.org> References: <201012311155.oBVBtdFc071921@svn.freebsd.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r216836 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: "SVN commit messages 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, 31 Dec 2010 15:20:12 -0000 On Fri, 31 Dec 2010 11:55:39 +0000 (UTC) Gavin Atkinson wrote: > Author: gavin > Date: Fri Dec 31 11:55:39 2010 > New Revision: 216836 > URL: http://svn.freebsd.org/changeset/base/216836 > > Log: > For committers listed as alumni, add the date that their commit bit was > returned where this information is missing and easy to determine. Move > adrian@ back to the "Active committers" section. > Hmm, I (gj@) should be in there somewhere, since I was a src committer from about 1995 until about 2007 or so. Can't find myself :( For that matter, I'm not in committers-ports.dot either, although I am still active as a ports committer. Ah well, just administrative trivia. -- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 15:35:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 220AA106566C; Fri, 31 Dec 2010 15:35:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id A17238FC0A; Fri, 31 Dec 2010 15:35:09 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 3D81F41C72F; Fri, 31 Dec 2010 16:35:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id g3--+crR1VuD; Fri, 31 Dec 2010 16:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id A3BE041C72C; Fri, 31 Dec 2010 16:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 1B19244490B; Fri, 31 Dec 2010 15:31:44 +0000 (UTC) Date: Fri, 31 Dec 2010 15:31:44 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Gary Jennejohn In-Reply-To: <20101231155146.6ca5d336@ernst.jennejohn.org> Message-ID: <20101231153027.L6126@maildrop.int.zabbadoz.net> References: <201012311155.oBVBtdFc071921@svn.freebsd.org> <20101231155146.6ca5d336@ernst.jennejohn.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gavin Atkinson , src-committers@freebsd.org Subject: Re: svn commit: r216836 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 15:35:10 -0000 On Fri, 31 Dec 2010, Gary Jennejohn wrote: > On Fri, 31 Dec 2010 11:55:39 +0000 (UTC) > Gavin Atkinson wrote: > >> Author: gavin >> Date: Fri Dec 31 11:55:39 2010 >> New Revision: 216836 >> URL: http://svn.freebsd.org/changeset/base/216836 >> >> Log: >> For committers listed as alumni, add the date that their commit bit was >> returned where this information is missing and easy to determine. Move >> adrian@ back to the "Active committers" section. >> > > Hmm, I (gj@) should be in there somewhere, since I was a src committer > from about 1995 until about 2007 or so. Can't find myself :( http://www.freebsd.org/cgi/cvsweb.cgi/CVSROOT-src/access.diff?r1=1.766;r2=1.767 You should be able to fix that yourself. > For that matter, I'm not in committers-ports.dot either, although I am > still active as a ports committer. You should be able to fix that yourself. If in doubt, with all the SVN, ask a src committer for review. -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 16:57:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 122A0106564A for ; Fri, 31 Dec 2010 16:57:56 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp03.sth.basefarm.net (ch-smtp03.sth.basefarm.net [80.76.149.214]) by mx1.freebsd.org (Postfix) with ESMTP id 970CE8FC08 for ; Fri, 31 Dec 2010 16:57:55 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:17511 helo=falcon.midgard.homeip.net) by ch-smtp03.sth.basefarm.net with esmtp (Exim 4.72) (envelope-from ) id 1PYiGf-0006LW-AF for svn-src-all@freebsd.org; Fri, 31 Dec 2010 17:55:55 +0100 Received: (qmail 28127 invoked from network); 31 Dec 2010 17:55:52 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 31 Dec 2010 17:55:52 +0100 Received: (qmail 24896 invoked by uid 1001); 31 Dec 2010 17:55:52 +0100 Date: Fri, 31 Dec 2010 17:55:52 +0100 From: Erik Trulsson To: Jilles Tjoelker Message-ID: <20101231165552.GA24854@owl.midgard.homeip.net> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231144308.GA55052@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101231144308.GA55052@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1PYiGf-0006LW-AF. X-Scan-Signature: ch-smtp03.sth.basefarm.net 1PYiGf-0006LW-AF 6e91ac21ff40f75aa3d260eae10a39ba Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 16:57:56 -0000 On Fri, Dec 31, 2010 at 03:43:08PM +0100, Jilles Tjoelker wrote: > On Thu, Dec 30, 2010 at 06:06:31PM +0000, Pawel Jakub Dawidek wrote: > > Author: pjd > > Date: Thu Dec 30 18:06:31 2010 > > New Revision: 216823 > > URL: http://svn.freebsd.org/changeset/base/216823 > > > Log: > > For compatibility with Linux and Solaris add poweroff(8). > > > It is implemented as a hard link to shutdown(8) and it is equivalent of: > > > # shutdown -p now > > If we go that way, then for consistency reboot(8) and halt(8) should > also be equivalent to calling shutdown -r now and shutdown -h now > respectively, unless conflicting options are given. Linux has a -f > option for what's currently reboot's and halt's default action, and > fastboot(8)/fasthalt(8) could also retain the current behaviour. > > I would be in favour of this change. I would not be in favour of such a change. Adding a new command that did not previously exist in FreeBSD (e.g. poweroff(8)) is one thing, and is unlikely to break anything or confuse anybody. Changing the meaning of a command that is already present in FreeBSD is something else, which is far more likely to cause problems. Such changes should generally be avoided unless there is some really good reason to do it, and I don't think such a reason exists in this case. -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 17:39:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAEAB106567A; Fri, 31 Dec 2010 17:39:31 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA1058FC08; Fri, 31 Dec 2010 17:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVHdVUU083482; Fri, 31 Dec 2010 17:39:31 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVHdVvo083480; Fri, 31 Dec 2010 17:39:31 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012311739.oBVHdVvo083480@svn.freebsd.org> From: Colin Percival Date: Fri, 31 Dec 2010 17:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216843 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 17:39:31 -0000 Author: cperciva Date: Fri Dec 31 17:39:31 2010 New Revision: 216843 URL: http://svn.freebsd.org/changeset/base/216843 Log: Make i386_set_ldt work on i386/XEN, step 1/5. Lock the vm page queue mutex around calls to pte_store. As with many other uses of the vm page queue mutex in i386/xen/pmap.c, this is bogus and needs to be replaced at some future date by a spin lock dedicated to protecting the queue of pending xen page mapping hypervisor calls. (But for now, bogus locking is better than a panic.) MFC after: 3 days Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Dec 31 15:16:18 2010 (r216842) +++ head/sys/i386/xen/pmap.c Fri Dec 31 17:39:31 2010 (r216843) @@ -3647,7 +3647,9 @@ pmap_map_readonly(pmap_t pmap, vm_offset for (i = 0; i < npages; i++) { pt_entry_t *pte; pte = pmap_pte(pmap, (vm_offset_t)(va + i*PAGE_SIZE)); + vm_page_lock_queues(); pte_store(pte, xpmap_mtop(*pte & ~(PG_RW|PG_M))); + vm_page_unlock_queues(); PMAP_MARK_PRIV(xpmap_mtop(*pte)); pmap_pte_release(pte); } @@ -3661,7 +3663,9 @@ pmap_map_readwrite(pmap_t pmap, vm_offse pt_entry_t *pte; pte = pmap_pte(pmap, (vm_offset_t)(va + i*PAGE_SIZE)); PMAP_MARK_UNPRIV(xpmap_mtop(*pte)); + vm_page_lock_queues(); pte_store(pte, xpmap_mtop(*pte) | (PG_RW|PG_M)); + vm_page_unlock_queues(); pmap_pte_release(pte); } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 17:39:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C11CF1065674; Fri, 31 Dec 2010 17:39:58 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B04A38FC13; Fri, 31 Dec 2010 17:39:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVHdwsf083528; Fri, 31 Dec 2010 17:39:58 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVHdwBG083526; Fri, 31 Dec 2010 17:39:58 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012311739.oBVHdwBG083526@svn.freebsd.org> From: Colin Percival Date: Fri, 31 Dec 2010 17:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216844 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 17:39:58 -0000 Author: cperciva Date: Fri Dec 31 17:39:58 2010 New Revision: 216844 URL: http://svn.freebsd.org/changeset/base/216844 Log: Make i386_set_ldt work on i386/XEN, step 2/5. Don't map physical to machine page numbers in pte_load_store, since it uses PT_SET_VA (which takes a physical page number and converts it to a machine page number). MFC after: 3 days Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Dec 31 17:39:31 2010 (r216843) +++ head/sys/i386/include/pmap.h Fri Dec 31 17:39:58 2010 (r216844) @@ -253,7 +253,6 @@ pte_load_store(pt_entry_t *ptep, pt_entr { pt_entry_t r; - v = xpmap_ptom(v); r = *ptep; PT_SET_VA(ptep, v, TRUE); return (r); From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 17:40:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CC2C1065670; Fri, 31 Dec 2010 17:40:31 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BED28FC34; Fri, 31 Dec 2010 17:40:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVHeV74083583; Fri, 31 Dec 2010 17:40:31 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVHeV1s083581; Fri, 31 Dec 2010 17:40:31 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012311740.oBVHeV1s083581@svn.freebsd.org> From: Colin Percival Date: Fri, 31 Dec 2010 17:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216845 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 17:40:31 -0000 Author: cperciva Date: Fri Dec 31 17:40:30 2010 New Revision: 216845 URL: http://svn.freebsd.org/changeset/base/216845 Log: Make i386_set_ldt work on i386/XEN, step 3/5. Synchronize reality with comment: The user_ldt_alloc function is supposed to return with dt_lock held. Due to broken locking in i386/xen/pmap.c, we drop dt_lock during the call to pmap_map_readonly and then pick it up again; this can be removed once the Xen pmap locking is fixed. MFC after: 3 days Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Dec 31 17:39:58 2010 (r216844) +++ head/sys/i386/i386/sys_machdep.c Fri Dec 31 17:40:30 2010 (r216845) @@ -450,6 +450,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 0; + mtx_lock_spin(&dt_lock); if ((pldt = mdp->md_ldt)) { if (len > pldt->ldt_len) len = pldt->ldt_len; @@ -458,8 +459,10 @@ user_ldt_alloc(struct mdproc *mdp, int l } else { bcopy(ldt, new_ldt->ldt_base, PAGE_SIZE); } + mtx_unlock_spin(&dt_lock); /* XXX kill once pmap locking fixed. */ pmap_map_readonly(kernel_pmap, (vm_offset_t)new_ldt->ldt_base, new_ldt->ldt_len*sizeof(union descriptor)); + mtx_lock_spin(&dt_lock); /* XXX kill once pmap locking fixed. */ return (new_ldt); } #else From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 17:41:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCB6E10656A3; Fri, 31 Dec 2010 17:41:14 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB95A8FC0C; Fri, 31 Dec 2010 17:41:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVHfEde083634; Fri, 31 Dec 2010 17:41:14 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVHfENF083632; Fri, 31 Dec 2010 17:41:14 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012311741.oBVHfENF083632@svn.freebsd.org> From: Colin Percival Date: Fri, 31 Dec 2010 17:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216846 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 17:41:14 -0000 Author: cperciva Date: Fri Dec 31 17:41:14 2010 New Revision: 216846 URL: http://svn.freebsd.org/changeset/base/216846 Log: Make i386_set_ldt work on i386/XEN, step 4/5. Use xen_update_descriptor to update the LDT rather than bcopy. Under Xen, pages used for holding LDTs must be read-only, so we can't make the change ourselves. Ths obvious alternative of "remap the page read-write, make the change, then map it read-only again" doesn't work since Xen won't allow an LDT page to be remapped as R/W. An arguably better solution is used by NetBSD: They don't modify LDTs in-place at all, but instead copy the entire LDT, modify the new version, then atomically swap. MFC after: 3 days Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Dec 31 17:40:30 2010 (r216845) +++ head/sys/i386/i386/sys_machdep.c Fri Dec 31 17:41:14 2010 (r216846) @@ -761,10 +761,14 @@ i386_set_ldt_data(struct thread *td, int mtx_assert(&dt_lock, MA_OWNED); - /* Fill in range */ - bcopy(descs, - &((union descriptor *)(pldt->ldt_base))[start], - num * sizeof(union descriptor)); + while (num) { + xen_update_descriptor( + &((union descriptor *)(pldt->ldt_base))[start], + descs); + num--; + start++; + descs++; + } return (0); } #else From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 17:42:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 081AC10656A6; Fri, 31 Dec 2010 17:42:26 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAE5C8FC1A; Fri, 31 Dec 2010 17:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVHgPKo083696; Fri, 31 Dec 2010 17:42:25 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVHgP8h083693; Fri, 31 Dec 2010 17:42:25 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201012311742.oBVHgP8h083693@svn.freebsd.org> From: Colin Percival Date: Fri, 31 Dec 2010 17:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216847 - in head/sys/i386: i386 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 17:42:26 -0000 Author: cperciva Date: Fri Dec 31 17:42:25 2010 New Revision: 216847 URL: http://svn.freebsd.org/changeset/base/216847 Log: Make i386_set_ldt work on i386/XEN, step 5/5. When cleaning up a thread, reset its LDT to the default LDT. Note: Casting the LDT pointer to an int and storing it in pc_currentldt is wildly bogus, but is harmless since pc_currentldt is a write-only variable. MFC after: 3 days Modified: head/sys/i386/i386/sys_machdep.c head/sys/i386/include/segments.h Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Fri Dec 31 17:41:14 2010 (r216846) +++ head/sys/i386/i386/sys_machdep.c Fri Dec 31 17:42:25 2010 (r216847) @@ -523,8 +523,13 @@ user_ldt_free(struct thread *td) } if (td == PCPU_GET(curthread)) { +#ifdef XEN + i386_reset_ldt(&default_proc_ldt); + PCPU_SET(currentldt, (int)&default_proc_ldt); +#else lldt(_default_ldt); PCPU_SET(currentldt, _default_ldt); +#endif } mdp->md_ldt = NULL; Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Fri Dec 31 17:41:14 2010 (r216846) +++ head/sys/i386/include/segments.h Fri Dec 31 17:42:25 2010 (r216847) @@ -257,6 +257,7 @@ struct region_descriptor { #ifdef _KERNEL extern int _default_ldt; #ifdef XEN +extern struct proc_ldt default_proc_ldt; extern union descriptor *gdt; extern union descriptor *ldt; #else From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 18:07:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A688106564A; Fri, 31 Dec 2010 18:07:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 198F18FC08; Fri, 31 Dec 2010 18:07:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVI7GFE084245; Fri, 31 Dec 2010 18:07:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVI7Go7084242; Fri, 31 Dec 2010 18:07:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012311807.oBVI7Go7084242@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 18:07:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216848 - in head: . sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 18:07:17 -0000 Author: bz Date: Fri Dec 31 18:07:16 2010 New Revision: 216848 URL: http://svn.freebsd.org/changeset/base/216848 Log: Happy New Year 2011. Approved by: core (kib) Modified: head/COPYRIGHT head/sys/sys/copyright.h Modified: head/COPYRIGHT ============================================================================== --- head/COPYRIGHT Fri Dec 31 17:42:25 2010 (r216847) +++ head/COPYRIGHT Fri Dec 31 18:07:16 2010 (r216848) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/sys/sys/copyright.h ============================================================================== --- head/sys/sys/copyright.h Fri Dec 31 17:42:25 2010 (r216847) +++ head/sys/sys/copyright.h Fri Dec 31 18:07:16 2010 (r216848) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2010 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2010 The FreeBSD Project.\n" + "Copyright (c) 1992-2011 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 18:16:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29B031065670; Fri, 31 Dec 2010 18:16:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 187808FC0A; Fri, 31 Dec 2010 18:16:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVIGFcY084510; Fri, 31 Dec 2010 18:16:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVIGF71084507; Fri, 31 Dec 2010 18:16:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012311816.oBVIGF71084507@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 18:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216849 - in stable/8: . sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 18:16:16 -0000 Author: bz Date: Fri Dec 31 18:16:15 2010 New Revision: 216849 URL: http://svn.freebsd.org/changeset/base/216849 Log: MFC r216848: Happy New Year 2011. Approved by: core (kib) Modified: stable/8/COPYRIGHT (contents, props changed) stable/8/sys/sys/copyright.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/COPYRIGHT ============================================================================== --- stable/8/COPYRIGHT Fri Dec 31 18:07:16 2010 (r216848) +++ stable/8/COPYRIGHT Fri Dec 31 18:16:15 2010 (r216849) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/8/sys/sys/copyright.h ============================================================================== --- stable/8/sys/sys/copyright.h Fri Dec 31 18:07:16 2010 (r216848) +++ stable/8/sys/sys/copyright.h Fri Dec 31 18:16:15 2010 (r216849) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2010 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2010 The FreeBSD Project.\n" + "Copyright (c) 1992-2011 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 18:16:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E84B1065670; Fri, 31 Dec 2010 18:16:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4328FC16; Fri, 31 Dec 2010 18:16:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVIGivw084554; Fri, 31 Dec 2010 18:16:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVIGi3a084551; Fri, 31 Dec 2010 18:16:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012311816.oBVIGi3a084551@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 18:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216850 - in stable/7: . sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 18:16:44 -0000 Author: bz Date: Fri Dec 31 18:16:44 2010 New Revision: 216850 URL: http://svn.freebsd.org/changeset/base/216850 Log: MFC r216848: Happy New Year 2011. Approved by: core (kib) Modified: stable/7/COPYRIGHT (contents, props changed) stable/7/sys/sys/copyright.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/COPYRIGHT ============================================================================== --- stable/7/COPYRIGHT Fri Dec 31 18:16:15 2010 (r216849) +++ stable/7/COPYRIGHT Fri Dec 31 18:16:44 2010 (r216850) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: stable/7/sys/sys/copyright.h ============================================================================== --- stable/7/sys/sys/copyright.h Fri Dec 31 18:16:15 2010 (r216849) +++ stable/7/sys/sys/copyright.h Fri Dec 31 18:16:44 2010 (r216850) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2010 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2010 The FreeBSD Project.\n" + "Copyright (c) 1992-2011 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 18:20:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 464141065670; Fri, 31 Dec 2010 18:20:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3506C8FC08; Fri, 31 Dec 2010 18:20:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVIKID7084718; Fri, 31 Dec 2010 18:20:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVIKIof084715; Fri, 31 Dec 2010 18:20:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201012311820.oBVIKIof084715@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 31 Dec 2010 18:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216851 - in head: bin/sh tools/regression/bin/sh/errors X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 18:20:18 -0000 Author: jilles Date: Fri Dec 31 18:20:17 2010 New Revision: 216851 URL: http://svn.freebsd.org/changeset/base/216851 Log: sh: Check if dup2 for redirection from/to a file succeeds. A failure (e.g. caused by ulimit -n being set very low) is a redirection error. Example: ulimit -n 9; exec 9<. Added: head/tools/regression/bin/sh/errors/redirection-error7.0 (contents, props changed) Modified: head/bin/sh/redir.c Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Fri Dec 31 18:16:44 2010 (r216850) +++ head/bin/sh/redir.c Fri Dec 31 18:20:17 2010 (r216851) @@ -155,6 +155,7 @@ openredirect(union node *redir, char mem int fd = redir->nfile.fd; char *fname; int f; + int e; /* * We suppress interrupts so that we won't leave open file @@ -173,7 +174,11 @@ openredirect(union node *redir, char mem error("cannot open %s: %s", fname, strerror(errno)); movefd: if (f != fd) { - dup2(f, fd); + if (dup2(f, fd) == -1) { + e = errno; + close(f); + error("%d: %s", fd, strerror(e)); + } close(f); } break; Added: head/tools/regression/bin/sh/errors/redirection-error7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/errors/redirection-error7.0 Fri Dec 31 18:20:17 2010 (r216851) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +! dummy=$( + exec 3>&1 >&2 2>&3 + ulimit -n 9 + exec 9<. +) && [ -n "$dummy" ] From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 18:32:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8221065672; Fri, 31 Dec 2010 18:32:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEEF88FC15; Fri, 31 Dec 2010 18:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVIWDhc084984; Fri, 31 Dec 2010 18:32:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVIWD4u084981; Fri, 31 Dec 2010 18:32:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012311832.oBVIWD4u084981@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 18:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216852 - in releng/8.2: . sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 18:32:14 -0000 Author: bz Date: Fri Dec 31 18:32:13 2010 New Revision: 216852 URL: http://svn.freebsd.org/changeset/base/216852 Log: MFC r216848: Happy New Year 2011. Approved by: core (kib) Approved by: re (kib) Modified: releng/8.2/COPYRIGHT (contents, props changed) releng/8.2/sys/sys/copyright.h Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/COPYRIGHT ============================================================================== --- releng/8.2/COPYRIGHT Fri Dec 31 18:20:17 2010 (r216851) +++ releng/8.2/COPYRIGHT Fri Dec 31 18:32:13 2010 (r216852) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: releng/8.2/sys/sys/copyright.h ============================================================================== --- releng/8.2/sys/sys/copyright.h Fri Dec 31 18:20:17 2010 (r216851) +++ releng/8.2/sys/sys/copyright.h Fri Dec 31 18:32:13 2010 (r216852) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2010 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2010 The FreeBSD Project.\n" + "Copyright (c) 1992-2011 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 18:36:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19988106566B; Fri, 31 Dec 2010 18:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08E8E8FC08; Fri, 31 Dec 2010 18:36:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVIa7im085163; Fri, 31 Dec 2010 18:36:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVIa74W085160; Fri, 31 Dec 2010 18:36:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012311836.oBVIa74W085160@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 18:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216853 - in releng/7.4: . sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 18:36:08 -0000 Author: bz Date: Fri Dec 31 18:36:07 2010 New Revision: 216853 URL: http://svn.freebsd.org/changeset/base/216853 Log: MFC r216848: Happy New Year 2011. Approved by: core (kib) Approved by: re (kib) Modified: releng/7.4/COPYRIGHT (contents, props changed) releng/7.4/sys/sys/copyright.h Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/COPYRIGHT ============================================================================== --- releng/7.4/COPYRIGHT Fri Dec 31 18:32:13 2010 (r216852) +++ releng/7.4/COPYRIGHT Fri Dec 31 18:36:07 2010 (r216853) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved. +Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: releng/7.4/sys/sys/copyright.h ============================================================================== --- releng/7.4/sys/sys/copyright.h Fri Dec 31 18:32:13 2010 (r216852) +++ releng/7.4/sys/sys/copyright.h Fri Dec 31 18:36:07 2010 (r216853) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2010 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2011 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2010 The FreeBSD Project.\n" + "Copyright (c) 1992-2011 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 19:00:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F385510656A4; Fri, 31 Dec 2010 19:00:58 +0000 (UTC) Date: Fri, 31 Dec 2010 19:00:58 +0000 From: Alexander Best To: Erik Trulsson Message-ID: <20101231190058.GA79467@freebsd.org> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231144308.GA55052@stack.nl> <20101231165552.GA24854@owl.midgard.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101231165552.GA24854@owl.midgard.homeip.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Jilles Tjoelker Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 19:00:59 -0000 On Fri Dec 31 10, Erik Trulsson wrote: > On Fri, Dec 31, 2010 at 03:43:08PM +0100, Jilles Tjoelker wrote: > > On Thu, Dec 30, 2010 at 06:06:31PM +0000, Pawel Jakub Dawidek wrote: > > > Author: pjd > > > Date: Thu Dec 30 18:06:31 2010 > > > New Revision: 216823 > > > URL: http://svn.freebsd.org/changeset/base/216823 > > > > > Log: > > > For compatibility with Linux and Solaris add poweroff(8). > > > > > It is implemented as a hard link to shutdown(8) and it is equivalent of: > > > > > # shutdown -p now > > > > If we go that way, then for consistency reboot(8) and halt(8) should > > also be equivalent to calling shutdown -r now and shutdown -h now > > respectively, unless conflicting options are given. Linux has a -f > > option for what's currently reboot's and halt's default action, and > > fastboot(8)/fasthalt(8) could also retain the current behaviour. > > > > I would be in favour of this change. > > I would not be in favour of such a change. Adding a new command that > did not previously exist in FreeBSD (e.g. poweroff(8)) is one thing, > and is unlikely to break anything or confuse anybody. > > Changing the meaning of a command that is already present in FreeBSD is > something else, which is far more likely to cause problems. Such > changes should generally be avoided unless there is some really good > reason to do it, and I don't think such a reason exists in this case. of course you have a point there. on the other hand one can argue that the current behavior is non-intuitive. most of the time users want to reboot or halt a system nicely including execution of the rc.shutdown scripts. the names "reboot" and "halt" suggest that these commands do exactly what i described beforehand: to reboot or halt the system regularly. in fact reboot and halt will not execute certain scripts and thus it is recomended to use "shutdown -r now" or "shutdown -h now". why should executables for a regular reboot and halt *not exist*, while executables for a non-regular reboot and halt *do exist*? even more: there are 2 executables for a non-reguar reboot and 2 for a non-regular halt (reboot/fastboot and halt/fasthalt). another thought: running 'reboot' instead of 'shutdown -r now' *can* cause harm to the system, because an important rc.shutdown script wasn't executed. however running 'shutdown -r now' in single-user mode e.g. will cause a few sterr warnings; however it *cannot* cause any harm. so if the semantics for reboot and halt get changed, nothing bad can happen except for a few people wondering why suddenly reboot and halt execute rc.shutdown scripts in single user mode and produce warnings. so i vote for the following: change 'reboot' to execute 'shutdown -r now'. change 'halt' to execute 'shutdown -h now'. fastboot and fasthalt should keep their current semantical behavior and would need to become exectables rather than hardlinks to reboot/halt. just my 0.02$. cheers. alex > > > -- > > Erik Trulsson > ertr1013@student.uu.se -- a13x From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 21:06:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90EEB106566C; Fri, 31 Dec 2010 21:06:52 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6331E8FC19; Fri, 31 Dec 2010 21:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVL6q9B088690; Fri, 31 Dec 2010 21:06:52 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVL6qJH088688; Fri, 31 Dec 2010 21:06:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012312106.oBVL6qJH088688@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 21:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216855 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 21:06:52 -0000 Author: bz Date: Fri Dec 31 21:06:52 2010 New Revision: 216855 URL: http://svn.freebsd.org/changeset/base/216855 Log: Move the increment operation under the lock and split the condition variable into two so that we can see on which one we are waiting. This might also more properly propagate the update of the flowclean_cycles flag and avoid "hangs" people were seeing. Suggested by: rwatson [1] Sponsored by: ISPsystem [1] Reviewed by: julian [1] Updated by: Mikolaj Golub (to.my.trociny gmail.com) Tested by: Mikolaj Golub (to.my.trociny gmail.com) MFC After: 1 week [1] Early 2010, initial version. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Dec 31 20:39:27 2010 (r216854) +++ head/sys/net/flowtable.c Fri Dec 31 21:06:52 2010 (r216855) @@ -195,7 +195,8 @@ static VNET_DEFINE(uma_zone_t, flow_ipv6 #define V_flow_ipv6_zone VNET(flow_ipv6_zone) -static struct cv flowclean_cv; +static struct cv flowclean_f_cv; +static struct cv flowclean_c_cv; static struct mtx flowclean_lock; static uint32_t flowclean_cycles; static uint32_t flowclean_freq; @@ -951,7 +952,7 @@ flow_full(struct flowtable *ft) if ((ft->ft_flags & FL_HASH_ALL) == 0) ft->ft_udp_idle = ft->ft_fin_wait_idle = ft->ft_syn_idle = ft->ft_tcp_idle = 5; - cv_broadcast(&flowclean_cv); + cv_broadcast(&flowclean_c_cv); } else if (!full && ft->ft_full) { flowclean_freq = 20*hz; if ((ft->ft_flags & FL_HASH_ALL) == 0) @@ -1560,14 +1561,14 @@ flowtable_cleaner(void) } VNET_LIST_RUNLOCK(); - flowclean_cycles++; /* * The 10 second interval between cleaning checks * is arbitrary */ mtx_lock(&flowclean_lock); - cv_broadcast(&flowclean_cv); - cv_timedwait(&flowclean_cv, &flowclean_lock, flowclean_freq); + flowclean_cycles++; + cv_broadcast(&flowclean_f_cv); + cv_timedwait(&flowclean_c_cv, &flowclean_lock, flowclean_freq); mtx_unlock(&flowclean_lock); } } @@ -1580,8 +1581,8 @@ flowtable_flush(void *unused __unused) mtx_lock(&flowclean_lock); start = flowclean_cycles; while (start == flowclean_cycles) { - cv_broadcast(&flowclean_cv); - cv_wait(&flowclean_cv, &flowclean_lock); + cv_broadcast(&flowclean_c_cv); + cv_wait(&flowclean_f_cv, &flowclean_lock); } mtx_unlock(&flowclean_lock); } @@ -1613,7 +1614,8 @@ static void flowtable_init(const void *unused __unused) { - cv_init(&flowclean_cv, "flowcleanwait"); + cv_init(&flowclean_c_cv, "c_flowcleanwait"); + cv_init(&flowclean_f_cv, "f_flowcleanwait"); mtx_init(&flowclean_lock, "flowclean lock", NULL, MTX_DEF); EVENTHANDLER_REGISTER(ifnet_departure_event, flowtable_flush, NULL, EVENTHANDLER_PRI_ANY); From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 21:20:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB8F51065694; Fri, 31 Dec 2010 21:20:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB72A8FC27; Fri, 31 Dec 2010 21:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVLKWZ6089014; Fri, 31 Dec 2010 21:20:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVLKWbM089012; Fri, 31 Dec 2010 21:20:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012312120.oBVLKWbM089012@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 21:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216856 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 21:20:32 -0000 Author: bz Date: Fri Dec 31 21:20:32 2010 New Revision: 216856 URL: http://svn.freebsd.org/changeset/base/216856 Log: Print the vnet pointer under DDB when iterating over flowtables of each virtual network stack instance. Sponsored by: ISPsystem [1] Reviewed by: julian [1] MFC after: 1 week [1] Early 2010. Modified: head/sys/net/flowtable.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Fri Dec 31 21:06:52 2010 (r216855) +++ head/sys/net/flowtable.c Fri Dec 31 21:20:32 2010 (r216856) @@ -1809,6 +1809,9 @@ DB_SHOW_COMMAND(flowtables, db_show_flow VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); +#ifdef VIMAGE + db_printf("vnet %p\n", vnet_iter); +#endif flowtable_show_vnet(); CURVNET_RESTORE(); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 21:47:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6C41065675; Fri, 31 Dec 2010 21:47:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD4E58FC15; Fri, 31 Dec 2010 21:47:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVLlB2Q089665; Fri, 31 Dec 2010 21:47:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVLlBHO089663; Fri, 31 Dec 2010 21:47:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012312147.oBVLlBHO089663@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 21:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216857 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 21:47:12 -0000 Author: bz Date: Fri Dec 31 21:47:11 2010 New Revision: 216857 URL: http://svn.freebsd.org/changeset/base/216857 Log: Try to catch a possible divide-by-zero as early as possible if "mtu" is 0 (also test for negative MTUs if checking it anyway). An MTU of 0 is arguably a bug elsewhere, but this at least gives us some more debugging hints. Sponsored by: ISPsystem (Early 2010) MFC after: 1 week Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Dec 31 21:20:32 2010 (r216856) +++ head/sys/netinet/ip_output.c Fri Dec 31 21:47:11 2010 (r216857) @@ -323,6 +323,9 @@ again: } else { mtu = ifp->if_mtu; } + /* Catch a possible divide by zero later. */ + KASSERT(mtu > 0, ("%s: mtu %d <= 0, rte=%p (rt_flags=0x%08x) ifp=%p", + __func__, mtu, rte, (rte != NULL) ? rte->rt_flags : 0, ifp)); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { m->m_flags |= M_MCAST; /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 21:52:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A50106564A; Fri, 31 Dec 2010 21:52:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 284058FC14; Fri, 31 Dec 2010 21:52:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVLqpfv089819; Fri, 31 Dec 2010 21:52:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVLqp7n089817; Fri, 31 Dec 2010 21:52:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012312152.oBVLqp7n089817@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 21:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216858 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 21:52:52 -0000 Author: yongari Date: Fri Dec 31 21:52:51 2010 New Revision: 216858 URL: http://svn.freebsd.org/changeset/base/216858 Log: Remove duplicated "perfect" Pointed out by: pluknet Modified: head/share/man/man4/vte.4 Modified: head/share/man/man4/vte.4 ============================================================================== --- head/share/man/man4/vte.4 Fri Dec 31 21:47:11 2010 (r216857) +++ head/share/man/man4/vte.4 Fri Dec 31 21:52:51 2010 (r216858) @@ -58,7 +58,7 @@ hash filter, VLAN over-size frame and fo The .Nm device driver uses three station addresses out of four as perfect -perfect multicast filter. +multicast filter. .Pp The .Nm From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 21:57:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFCFF1065679; Fri, 31 Dec 2010 21:57:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B00118FC14; Fri, 31 Dec 2010 21:57:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVLvsFM089960; Fri, 31 Dec 2010 21:57:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVLvsuP089958; Fri, 31 Dec 2010 21:57:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012312157.oBVLvsuP089958@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 21:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216859 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 21:57:54 -0000 Author: bz Date: Fri Dec 31 21:57:54 2010 New Revision: 216859 URL: http://svn.freebsd.org/changeset/base/216859 Log: Use NULL rather than 0 to invalidate a pointer. Rather than duplicating the LLE_FREE_LOCKED() macro code in LLE_FREE(), call it directly (like we do for the RT_* macros). Sponsored by: ISPsystem [1] Reviewed by: julian [1] MFC After: 1 week [1] Early 2010. Modified: head/sys/net/if_llatbl.h Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Fri Dec 31 21:52:51 2010 (r216858) +++ head/sys/net/if_llatbl.h Fri Dec 31 21:57:54 2010 (r216859) @@ -116,19 +116,12 @@ struct llentry { LLE_WUNLOCK(lle); \ } \ /* guard against invalid refs */ \ - lle = 0; \ + lle = NULL; \ } while (0) #define LLE_FREE(lle) do { \ LLE_WLOCK(lle); \ - if ((lle)->lle_refcnt <= 1) \ - (lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\ - else { \ - (lle)->lle_refcnt--; \ - LLE_WUNLOCK(lle); \ - } \ - /* guard against invalid refs */ \ - lle = NULL; \ + LLE_FREE_LOCKED(lle); \ } while (0) From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 22:01:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360ED1065672; Fri, 31 Dec 2010 22:01:42 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 951078FC15; Fri, 31 Dec 2010 22:01:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id oBVLvHqi034356; Fri, 31 Dec 2010 14:57:18 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D1E51BD.8090707@bsdimp.com> Date: Fri, 31 Dec 2010 14:57:17 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: Jilles Tjoelker References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231144308.GA55052@stack.nl> In-Reply-To: <20101231144308.GA55052@stack.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 22:01:42 -0000 On 12/31/2010 07:43, Jilles Tjoelker wrote: > On Thu, Dec 30, 2010 at 06:06:31PM +0000, Pawel Jakub Dawidek wrote: >> Author: pjd >> Date: Thu Dec 30 18:06:31 2010 >> New Revision: 216823 >> URL: http://svn.freebsd.org/changeset/base/216823 >> Log: >> For compatibility with Linux and Solaris add poweroff(8). >> It is implemented as a hard link to shutdown(8) and it is equivalent of: >> # shutdown -p now > If we go that way, then for consistency reboot(8) and halt(8) should > also be equivalent to calling shutdown -r now and shutdown -h now > respectively, unless conflicting options are given. Linux has a -f > option for what's currently reboot's and halt's default action, and > fastboot(8)/fasthalt(8) could also retain the current behaviour. > > I would be in favour of this change. I'm not sure I'd go this far. I really *LIKE* that halt/reboot is the low-level interface that shutdown -r now calls. I'm not sure that moving away from this would be a good idea. It cuts out many levels of indirection that can be useful in many instances. Warner From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 22:18:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3C3C1065670; Fri, 31 Dec 2010 22:18:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B37928FC0C; Fri, 31 Dec 2010 22:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVMIf1e090419; Fri, 31 Dec 2010 22:18:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVMIfTB090417; Fri, 31 Dec 2010 22:18:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201012312218.oBVMIfTB090417@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 31 Dec 2010 22:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216860 - head/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 22:18:41 -0000 Author: yongari Date: Fri Dec 31 22:18:41 2010 New Revision: 216860 URL: http://svn.freebsd.org/changeset/base/216860 Log: Fix endianness bug introduced in r205091. After controller updates control word in a RX LE, driver converts it to host byte order. The checksum value in the control word is stored in big endian form by controller. r205091 didn't account for the host byte order conversion such that the checksum value was incorrectly interpreted on big endian architectures which in turn made all TCP/UDP frames dropped. Make RX checksum offload work on any architectures by swapping the checksum value. Reported by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Tested by: Sreekanth M. ( kanthms <> netlogicmicro dot com ) Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Fri Dec 31 21:57:54 2010 (r216859) +++ head/sys/dev/msk/if_msk.c Fri Dec 31 22:18:41 2010 (r216860) @@ -3070,7 +3070,7 @@ msk_rxcsum(struct msk_if_softc *sc_if, u default: return; } - csum = ntohs(sc_if->msk_csum & 0xFFFF); + csum = bswap16(sc_if->msk_csum & 0xFFFF); /* Checksum fixup for IP options. */ len = hlen - sizeof(struct ip); if (len > 0) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 22:37:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 172F0106572E for ; Fri, 31 Dec 2010 22:37:51 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 8E18D8FC0C for ; Fri, 31 Dec 2010 22:37:50 +0000 (UTC) Received: from c83-255-61-120.bredband.comhem.se ([83.255.61.120]:42218 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.72) (envelope-from ) id 1PYnVD-0006Eg-9N for svn-src-all@freebsd.org; Fri, 31 Dec 2010 23:31:17 +0100 Received: (qmail 29696 invoked from network); 31 Dec 2010 23:31:14 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 31 Dec 2010 23:31:14 +0100 Received: (qmail 26547 invoked by uid 1001); 31 Dec 2010 23:31:14 +0100 Date: Fri, 31 Dec 2010 23:31:14 +0100 From: Erik Trulsson To: Alexander Best Message-ID: <20101231223114.GA26424@owl.midgard.homeip.net> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231144308.GA55052@stack.nl> <20101231165552.GA24854@owl.midgard.homeip.net> <20101231190058.GA79467@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101231190058.GA79467@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: 83.255.61.120 X-Scan-Result: No virus found in message 1PYnVD-0006Eg-9N. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1PYnVD-0006Eg-9N 13b5383d8fc521877b3a1e5aaf210234 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Jilles Tjoelker Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 22:37:51 -0000 On Fri, Dec 31, 2010 at 07:00:58PM +0000, Alexander Best wrote: [snip] > another thought: running 'reboot' instead of 'shutdown -r now' *can* cause > harm to the system, because an important rc.shutdown script wasn't executed. > however running 'shutdown -r now' in single-user mode e.g. will cause a few > sterr warnings; however it *cannot* cause any harm. Oh, yes, it can! (And I have been burnt by it once, after which I got very careful about not using 'shutdown -r now' from single user mode.) Take a look at /etc/rc.d/mixer At shutdown it saves the current state of the soundcard mixer values into a file and at start it restores the mixer values from that file. If you boot into single user mode the start function will of course not be executed leaving the mixer values at their default values. If you then use 'shutdown' these default values are what will be saved, overwriting whatever values had been saved before, while if you had instead had used 'reboot' the old saved values would have been left untouched. If you never change the mixer values from their defaukt you won't notice anything, but otherwise it might take a while to figure out why the sound is at the 'wrong' volume. This is one example I have found where bad things can happen if you use 'shutdown' when you should have used 'reboot'. I am fairly sure that there are other instances that I just haven't run into (yet.) -- Erik Trulsson ertr1013@student.uu.se From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 22:49:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC21E106564A; Fri, 31 Dec 2010 22:49:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9190A8FC08; Fri, 31 Dec 2010 22:49:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oBVMnDWZ091087; Fri, 31 Dec 2010 22:49:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oBVMnDUE091085; Fri, 31 Dec 2010 22:49:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201012312249.oBVMnDUE091085@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 31 Dec 2010 22:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216861 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 22:49:13 -0000 Author: bz Date: Fri Dec 31 22:49:13 2010 New Revision: 216861 URL: http://svn.freebsd.org/changeset/base/216861 Log: Mfp4 CH177924: Add and export constants of array sizes of jail parameters as compiled into the kernel. This is the least intrusive way to allow kvm to read the (sparse) arrays independent of the options the kernel was compiled with. Reviewed by: jhb (originally) MFC after: 1 week Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Dec 31 22:18:41 2010 (r216860) +++ head/sys/kern/kern_jail.c Fri Dec 31 22:49:13 2010 (r216861) @@ -140,7 +140,9 @@ static int prison_restrict_ip6(struct pr #define PD_LIST_XLOCKED 0x10 /* - * Parameter names corresponding to PR_* flag values + * Parameter names corresponding to PR_* flag values. Size values are for kvm + * as we cannot figure out the size of a sparse array, or an array without a + * terminating entry. */ static char *pr_flag_names[] = { [0] = "persist", @@ -151,6 +153,7 @@ static char *pr_flag_names[] = { [8] = "ip6.saddrsel", #endif }; +const size_t pr_flag_names_size = sizeof(pr_flag_names); static char *pr_flag_nonames[] = { [0] = "nopersist", @@ -161,6 +164,7 @@ static char *pr_flag_nonames[] = { [8] = "ip6.nosaddrsel", #endif }; +const size_t pr_flag_nonames_size = sizeof(pr_flag_nonames); struct jailsys_flags { const char *name; @@ -178,6 +182,7 @@ struct jailsys_flags { { "ip6", PR_IP6_USER | PR_IP6_DISABLE, PR_IP6_USER }, #endif }; +const size_t pr_flag_jailsys_size = sizeof(pr_flag_jailsys); static char *pr_allow_names[] = { "allow.set_hostname", @@ -188,6 +193,7 @@ static char *pr_allow_names[] = { "allow.quotas", "allow.socket_af", }; +const size_t pr_allow_names_size = sizeof(pr_allow_names); static char *pr_allow_nonames[] = { "allow.noset_hostname", @@ -198,6 +204,7 @@ static char *pr_allow_nonames[] = { "allow.noquotas", "allow.nosocket_af", }; +const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); #define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME #define JAIL_DEFAULT_ENFORCE_STATFS 2 From owner-svn-src-all@FreeBSD.ORG Fri Dec 31 23:39:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 7060310656C7; Fri, 31 Dec 2010 23:39:24 +0000 (UTC) Date: Fri, 31 Dec 2010 23:39:24 +0000 From: Alexander Best To: Erik Trulsson Message-ID: <20101231233924.GA12978@freebsd.org> References: <201012301806.oBUI6VcW046731@svn.freebsd.org> <20101231144308.GA55052@stack.nl> <20101231165552.GA24854@owl.midgard.homeip.net> <20101231190058.GA79467@freebsd.org> <20101231223114.GA26424@owl.midgard.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101231223114.GA26424@owl.midgard.homeip.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Jilles Tjoelker Subject: Re: svn commit: r216823 - head/sbin/shutdown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 31 Dec 2010 23:39:24 -0000 On Fri Dec 31 10, Erik Trulsson wrote: > On Fri, Dec 31, 2010 at 07:00:58PM +0000, Alexander Best wrote: > > [snip] > > > another thought: running 'reboot' instead of 'shutdown -r now' *can* cause > > harm to the system, because an important rc.shutdown script wasn't executed. > > however running 'shutdown -r now' in single-user mode e.g. will cause a few > > sterr warnings; however it *cannot* cause any harm. > > Oh, yes, it can! (And I have been burnt by it once, after which I got > very careful about not using 'shutdown -r now' from single user mode.) > > Take a look at /etc/rc.d/mixer > At shutdown it saves the current state of the soundcard mixer values > into a file and at start it restores the mixer values from that file. > If you boot into single user mode the start function will of course not > be executed leaving the mixer values at their default values. If you > then use 'shutdown' these default values are what will be saved, > overwriting whatever values had been saved before, while if you had > instead had used 'reboot' the old saved values would have been left > untouched. > If you never change the mixer values from their defaukt you won't notice > anything, but otherwise it might take a while to figure out why the > sound is at the 'wrong' volume. > > This is one example I have found where bad things can happen if you use > 'shutdown' when you should have used 'reboot'. I am fairly sure that > there are other instances that I just haven't run into (yet.) that's a very good argument and in fact i remember to have also once been bitten by the 'mixer' case. so after a some more thoughts: just leave it the way it is. it would be nice to have two commands which would do 'shutdown -r now' and 'shutdown -h now', but i can't think of a name: slowboot/slowhalt? ;) cheers. alex > > > > > -- > > Erik Trulsson > ertr1013@student.uu.se -- a13x