From owner-svn-src-stable-7@FreeBSD.ORG Sun Oct 12 10:03:12 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12AF11065690; Sun, 12 Oct 2008 10:03:12 +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 C043D8FC12; Sun, 12 Oct 2008 10:03:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9CA3BFj041631; Sun, 12 Oct 2008 10:03:11 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9CA3BBm041628; Sun, 12 Oct 2008 10:03:11 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810121003.m9CA3BBm041628@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Oct 2008 10:03:11 +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: r183795 - in stable/7/sys: . fs/portalfs kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 10:03:12 -0000 Author: rwatson Date: Sun Oct 12 10:03:11 2008 New Revision: 183795 URL: http://svn.freebsd.org/changeset/base/183795 Log: Merge r183572, r173649, r183650, r183690, and r183764 from head to stable/7: Further minor cleanups to UNIX domain sockets: - Staticize and locally prototype functions uipc_ctloutput(), unp_dispose(), unp_init(), and unp_externalize(), none of which have been required outside of uipc_usrreq.c since uipc_proto.c was removed. - Remove stale prototype for uipc_usrreq(), which has not existed in the code since 1997 - Forward declare and staticize uipc_usrreqs structure in uipc_usrreq.c and not un.h. - Comment on why uipc_connect2() is still non-static -- it is used directly by fifofs. - Remove stale comments, tidy up whitespace. Use soconnect2() rather than directly invoking uipc_connect2() to interconnect two UNIX domain sockets. Now that portalfs doesn't directly invoke uipc_connect2(), make it a static symbol. Remove stale comment (and XXX saying so) about why we zero the file descriptor pointer in unp_freerights: we can no longer recurse into unp_gc due to unp_gc being invoked in a deferred way, but it's still a good idea. Remove stale comment: while uipc_connect2() was, until recently, not static so it could be used by fifofs (actually portalfs), it is now static. Submitted by: kensmith Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/fs/portalfs/portal_vnops.c stable/7/sys/kern/uipc_usrreq.c stable/7/sys/sys/un.h Modified: stable/7/sys/fs/portalfs/portal_vnops.c ============================================================================== --- stable/7/sys/fs/portalfs/portal_vnops.c Sun Oct 12 09:58:10 2008 (r183794) +++ stable/7/sys/fs/portalfs/portal_vnops.c Sun Oct 12 10:03:11 2008 (r183795) @@ -197,7 +197,7 @@ portal_connect(so, so2) M_NOWAIT); so2 = so3; - return (uipc_connect2(so, so2)); + return (soconnect2(so, so2)); } static int Modified: stable/7/sys/kern/uipc_usrreq.c ============================================================================== --- stable/7/sys/kern/uipc_usrreq.c Sun Oct 12 09:58:10 2008 (r183794) +++ stable/7/sys/kern/uipc_usrreq.c Sun Oct 12 10:03:11 2008 (r183795) @@ -224,10 +224,13 @@ static struct rwlock unp_global_rwlock; #define UNP_PCB_UNLOCK(unp) mtx_unlock(&(unp)->unp_mtx) #define UNP_PCB_LOCK_ASSERT(unp) mtx_assert(&(unp)->unp_mtx, MA_OWNED) +static int uipc_connect2(struct socket *, struct socket *); +static int uipc_ctloutput(struct socket *, struct sockopt *); static int unp_connect(struct socket *, struct sockaddr *, struct thread *); static int unp_connect2(struct socket *so, struct socket *so2, int); static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2); +static void unp_dispose(struct mbuf *); static void unp_shutdown(struct unpcb *); static void unp_drop(struct unpcb *, int); static void unp_gc(__unused void *, int); @@ -235,13 +238,16 @@ static void unp_scan(struct mbuf *, void static void unp_mark(struct file *); static void unp_discard(struct file *); static void unp_freerights(struct file **, int); +static void unp_init(void); static int unp_internalize(struct mbuf **, struct thread *); +static int unp_externalize(struct mbuf *, struct mbuf **); static struct mbuf *unp_addsockcred(struct thread *, struct mbuf *); /* * Definitions of protocols supported in the LOCAL domain. */ static struct domain localdomain; +static struct pr_usrreqs uipc_usrreqs; static struct protosw localsw[] = { { .pr_type = SOCK_STREAM, @@ -520,7 +526,7 @@ uipc_close(struct socket *so) UNP_GLOBAL_WUNLOCK(); } -int +static int uipc_connect2(struct socket *so1, struct socket *so2) { struct unpcb *unp, *unp2; @@ -540,8 +546,6 @@ uipc_connect2(struct socket *so1, struct return (error); } -/* control is EOPNOTSUPP */ - static void uipc_detach(struct socket *so) { @@ -986,7 +990,7 @@ uipc_sockaddr(struct socket *so, struct return (0); } -struct pr_usrreqs uipc_usrreqs = { +static struct pr_usrreqs uipc_usrreqs = { .pru_abort = uipc_abort, .pru_accept = uipc_accept, .pru_attach = uipc_attach, @@ -1005,7 +1009,7 @@ struct pr_usrreqs uipc_usrreqs = { .pru_close = uipc_close, }; -int +static int uipc_ctloutput(struct socket *so, struct sockopt *sopt) { struct unpcb *unp; @@ -1494,7 +1498,6 @@ unp_drop(struct unpcb *unp, int errno) unp2 = unp->unp_conn; if (unp2 == NULL) return; - UNP_PCB_LOCK(unp2); unp_disconnect(unp, unp2); UNP_PCB_UNLOCK(unp2); @@ -1507,19 +1510,13 @@ unp_freerights(struct file **rp, int fdc struct file *fp; for (i = 0; i < fdcount; i++) { - /* - * Zero the pointer before calling unp_discard since it may - * end up in unp_gc().. - * - * XXXRW: This is less true than it used to be. - */ fp = *rp; *rp++ = NULL; unp_discard(fp); } } -int +static int unp_externalize(struct mbuf *control, struct mbuf **controlp) { struct thread *td = curthread; /* XXX */ @@ -1539,16 +1536,13 @@ unp_externalize(struct mbuf *control, st error = 0; if (controlp != NULL) /* controlp == NULL => free control messages */ *controlp = NULL; - while (cm != NULL) { if (sizeof(*cm) > clen || cm->cmsg_len > clen) { error = EINVAL; break; } - data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; - if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS) { newfds = datalen / sizeof(struct file *); @@ -1614,7 +1608,6 @@ unp_externalize(struct mbuf *control, st CMSG_DATA(mtod(*controlp, struct cmsghdr *)), datalen); } - controlp = &(*controlp)->m_next; next: @@ -1629,7 +1622,6 @@ next: } m_freem(control); - return (error); } @@ -1640,7 +1632,7 @@ unp_zone_change(void *tag) uma_zone_set_max(unp_zone, maxsockets); } -void +static void unp_init(void) { @@ -1678,14 +1670,12 @@ unp_internalize(struct mbuf **controlp, error = 0; *controlp = NULL; - while (cm != NULL) { if (sizeof(*cm) > clen || cm->cmsg_level != SOL_SOCKET || cm->cmsg_len > clen) { error = EINVAL; goto out; } - data = CMSG_DATA(cm); datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data; @@ -1700,7 +1690,6 @@ unp_internalize(struct mbuf **controlp, error = ENOBUFS; goto out; } - cmcred = (struct cmsgcred *) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); cmcred->cmcred_pid = p->p_pid; @@ -1708,7 +1697,7 @@ unp_internalize(struct mbuf **controlp, cmcred->cmcred_gid = td->td_ucred->cr_rgid; cmcred->cmcred_euid = td->td_ucred->cr_uid; cmcred->cmcred_ngroups = MIN(td->td_ucred->cr_ngroups, - CMGROUP_MAX); + CMGROUP_MAX); for (i = 0; i < cmcred->cmcred_ngroups; i++) cmcred->cmcred_groups[i] = td->td_ucred->cr_groups[i]; @@ -1740,8 +1729,8 @@ unp_internalize(struct mbuf **controlp, } /* - * Now replace the integer FDs with pointers to - * the associated global file table entry.. + * Now replace the integer FDs with pointers to the + * associated global file table entry.. */ newlen = oldfds * sizeof(struct file *); *controlp = sbcreatecontrol(NULL, newlen, @@ -1751,7 +1740,6 @@ unp_internalize(struct mbuf **controlp, error = E2BIG; goto out; } - fdp = data; rp = (struct file **) CMSG_DATA(mtod(*controlp, struct cmsghdr *)); @@ -1787,7 +1775,6 @@ unp_internalize(struct mbuf **controlp, } controlp = &(*controlp)->m_next; - if (CMSG_SPACE(datalen) < clen) { clen -= CMSG_SPACE(datalen); cm = (struct cmsghdr *) @@ -1800,7 +1787,6 @@ unp_internalize(struct mbuf **controlp, out: m_freem(control); - return (error); } @@ -1814,7 +1800,6 @@ unp_addsockcred(struct thread *td, struc int i; ngroups = MIN(td->td_ucred->cr_ngroups, CMGROUP_MAX); - m = sbcreatecontrol(NULL, SOCKCREDSIZE(ngroups), SCM_CREDS, SOL_SOCKET); if (m == NULL) return (control); @@ -1851,7 +1836,6 @@ unp_addsockcred(struct thread *td, struc /* Prepend it to the head. */ m->m_next = control; - return (m); } @@ -2091,7 +2075,7 @@ again: free(extra_ref, M_TEMP); } -void +static void unp_dispose(struct mbuf *m) { Modified: stable/7/sys/sys/un.h ============================================================================== --- stable/7/sys/sys/un.h Sun Oct 12 09:58:10 2008 (r183794) +++ stable/7/sys/sys/un.h Sun Oct 12 10:03:11 2008 (r183795) @@ -57,27 +57,13 @@ struct sockaddr_un { #define LOCAL_CREDS 0x002 /* pass credentials to receiver */ #define LOCAL_CONNWAIT 0x004 /* connects block until accepted */ -#ifdef _KERNEL -struct mbuf; -struct socket; -struct sockopt; - -int uipc_connect2(struct socket *so1, struct socket *so2); -int uipc_ctloutput(struct socket *so, struct sockopt *sopt); -int uipc_usrreq(struct socket *so, int req, struct mbuf *m, - struct mbuf *nam, struct mbuf *control); -void unp_dispose(struct mbuf *m); -int unp_externalize(struct mbuf *mbuf, struct mbuf **controlp); -void unp_init(void); -extern struct pr_usrreqs uipc_usrreqs; - -#else /* !_KERNEL */ +#ifndef _KERNEL /* actual length of an initialized sockaddr_un */ #define SUN_LEN(su) \ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) -#endif /* _KERNEL */ +#endif /* !_KERNEL */ #endif /* __BSD_VISIBLE */ From owner-svn-src-stable-7@FreeBSD.ORG Sun Oct 12 18:49:07 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9059106568A; Sun, 12 Oct 2008 18:49:07 +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 9671E8FC19; Sun, 12 Oct 2008 18:49:07 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9CIn7Y0052646; Sun, 12 Oct 2008 18:49:07 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9CIn7eX052645; Sun, 12 Oct 2008 18:49:07 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810121849.m9CIn7eX052645@svn.freebsd.org> From: Robert Watson Date: Sun, 12 Oct 2008 18:49:07 +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: r183804 - in stable/7/sys: . kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 18:49:07 -0000 Author: rwatson Date: Sun Oct 12 18:49:07 2008 New Revision: 183804 URL: http://svn.freebsd.org/changeset/base/183804 Log: Merge r183661 from head to stable/7: Lock receive socket buffer in soo_stat() rather than commenting that we should lock it, which may marginally improve the consistency of the results. Remove comment. Approved by: re (gnn) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/sys_socket.c Modified: stable/7/sys/kern/sys_socket.c ============================================================================== --- stable/7/sys/kern/sys_socket.c Sun Oct 12 12:08:09 2008 (r183803) +++ stable/7/sys/kern/sys_socket.c Sun Oct 12 18:49:07 2008 (r183804) @@ -237,17 +237,16 @@ soo_stat(struct file *fp, struct stat *u /* * If SBS_CANTRCVMORE is set, but there's still data left in the * receive buffer, the socket is still readable. - * - * XXXRW: perhaps should lock socket buffer so st_size result is - * consistent. */ - /* Unlocked read. */ + SOCKBUF_LOCK(&so->so_rcv); if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) == 0 || so->so_rcv.sb_cc != 0) ub->st_mode |= S_IRUSR | S_IRGRP | S_IROTH; + ub->st_size = so->so_rcv.sb_cc - so->so_rcv.sb_ctl; + SOCKBUF_UNLOCK(&so->so_rcv); + /* Unlocked read. */ if ((so->so_snd.sb_state & SBS_CANTSENDMORE) == 0) ub->st_mode |= S_IWUSR | S_IWGRP | S_IWOTH; - ub->st_size = so->so_rcv.sb_cc - so->so_rcv.sb_ctl; ub->st_uid = so->so_cred->cr_uid; ub->st_gid = so->so_cred->cr_gid; return (*so->so_proto->pr_usrreqs->pru_sense)(so, ub); From owner-svn-src-stable-7@FreeBSD.ORG Sun Oct 12 23:19:24 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FA51065688; Sun, 12 Oct 2008 23:19:24 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5FCC8FC1A; Sun, 12 Oct 2008 23:19:23 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9CNJNcA057972; Sun, 12 Oct 2008 23:19:23 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9CNJNLP057971; Sun, 12 Oct 2008 23:19:23 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200810122319.m9CNJNLP057971@svn.freebsd.org> From: "Christian S.J. Peron" Date: Sun, 12 Oct 2008 23:19:23 +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: r183812 - in stable/7/sys: . netinet/libalias X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2008 23:19:24 -0000 Author: csjp Date: Sun Oct 12 23:19:23 2008 New Revision: 183812 URL: http://svn.freebsd.org/changeset/base/183812 Log: MFC revision 183744 Improve entropy in source port generation for libalias consumers. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/netinet/libalias/alias_db.c Modified: stable/7/sys/netinet/libalias/alias_db.c ============================================================================== --- stable/7/sys/netinet/libalias/alias_db.c Sun Oct 12 21:46:11 2008 (r183811) +++ stable/7/sys/netinet/libalias/alias_db.c Sun Oct 12 23:19:23 2008 (r183812) @@ -606,7 +606,7 @@ GetNewPort(struct libalias *la, struct a port_sys = ntohs(port_net); } else { /* First trial and all subsequent are random. */ - port_sys = random() & ALIAS_PORT_MASK; + port_sys = arc4random() & ALIAS_PORT_MASK; port_sys += ALIAS_PORT_BASE; port_net = htons(port_sys); } @@ -657,7 +657,7 @@ GetNewPort(struct libalias *la, struct a } #endif } - port_sys = random() & ALIAS_PORT_MASK; + port_sys = arc4random() & ALIAS_PORT_MASK; port_sys += ALIAS_PORT_BASE; port_net = htons(port_sys); } @@ -772,9 +772,9 @@ FindNewPortGroup(struct libalias *la, /* First trial and all subsequent are random. */ if (align == FIND_EVEN_ALIAS_BASE) - port_sys = random() & ALIAS_PORT_MASK_EVEN; + port_sys = arc4random() & ALIAS_PORT_MASK_EVEN; else - port_sys = random() & ALIAS_PORT_MASK; + port_sys = arc4random() & ALIAS_PORT_MASK; port_sys += ALIAS_PORT_BASE; } @@ -796,9 +796,9 @@ FindNewPortGroup(struct libalias *la, /* Find a new base to try */ if (align == FIND_EVEN_ALIAS_BASE) - port_sys = random() & ALIAS_PORT_MASK_EVEN; + port_sys = arc4random() & ALIAS_PORT_MASK_EVEN; else - port_sys = random() & ALIAS_PORT_MASK; + port_sys = arc4random() & ALIAS_PORT_MASK; port_sys += ALIAS_PORT_BASE; } From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 12:45:19 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35AE9106568E; Mon, 13 Oct 2008 12:45:19 +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 E7BF48FC1E; Mon, 13 Oct 2008 12:45:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DCjI40076491; Mon, 13 Oct 2008 12:45:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DCjIsR076490; Mon, 13 Oct 2008 12:45:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810131245.m9DCjIsR076490@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 13 Oct 2008 12:45:18 +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: r183818 - in stable/7/sys: . i386/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 12:45:19 -0000 Author: kib Date: Mon Oct 13 12:45:18 2008 New Revision: 183818 URL: http://svn.freebsd.org/changeset/base/183818 Log: MFC r180756 (by luoqi): Unbreak cc -pg support on i386 by changing mcount() to always preserve %ecx. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/i386/include/profile.h Modified: stable/7/sys/i386/include/profile.h ============================================================================== --- stable/7/sys/i386/include/profile.h Mon Oct 13 12:28:33 2008 (r183817) +++ stable/7/sys/i386/include/profile.h Mon Oct 13 12:45:18 2008 (r183818) @@ -115,7 +115,15 @@ void user(void); void \ mcount() \ { \ - uintfptr_t selfpc, frompc; \ + uintfptr_t selfpc, frompc, ecx; \ + /* \ + * In gcc 4.2, ecx might be used in the caller as the arg \ + * pointer if the stack realignment option is set (-mstackrealign) \ + * or if the caller has the force_align_arg_pointer attribute \ + * (stack realignment is ALWAYS on for main). Preserve ecx \ + * here. \ + */ \ + __asm("" : "=c" (ecx)); \ /* \ * Find the return address for mcount, \ * and the return address for mcount's caller. \ @@ -132,6 +140,7 @@ mcount() \ __asm("movl (%%ebp),%0" : "=r" (frompc)); \ frompc = ((uintfptr_t *)frompc)[1]; \ _mcount(frompc, selfpc); \ + __asm("" : : "c" (ecx)); \ } #else /* !__GNUCLIKE_ASM */ #define MCOUNT From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 13:00:22 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F65106568C; Mon, 13 Oct 2008 13:00:22 +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 205C48FC26; Mon, 13 Oct 2008 13:00:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DD0Mtl076810; Mon, 13 Oct 2008 13:00:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DD0MaR076808; Mon, 13 Oct 2008 13:00:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200810131300.m9DD0MaR076808@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 13 Oct 2008 13:00:21 +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: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 13:00:22 -0000 Author: kib Date: Mon Oct 13 13:00:21 2008 New Revision: 183819 URL: http://svn.freebsd.org/changeset/base/183819 Log: MFC r183600: Change the linprocfs /maps and procfs /map handlers to use sbuf instead of doing uiomove. Approved by: re (kensmith) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/fs/procfs/procfs_map.c Modified: stable/7/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/7/sys/compat/linprocfs/linprocfs.c Mon Oct 13 12:45:18 2008 (r183818) +++ stable/7/sys/compat/linprocfs/linprocfs.c Mon Oct 13 13:00:21 2008 (r183819) @@ -869,16 +869,13 @@ linprocfs_doprocenviron(PFS_FILL_ARGS) static int linprocfs_doprocmaps(PFS_FILL_ARGS) { - char mebuffer[512]; vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry, tmp_entry; + vm_map_entry_t entry; vm_object_t obj, tobj, lobj; vm_offset_t saved_end; vm_ooffset_t off = 0; char *name = "", *freename = NULL; - size_t len; ino_t ino; - unsigned int last_timestamp; int ref_count, shadow_count, flags; int error; struct vnode *vp; @@ -894,13 +891,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) if (uio->uio_rw != UIO_READ) return (EOPNOTSUPP); - if (uio->uio_offset != 0) - return (0); - error = 0; vm_map_lock_read(map); - for (entry = map->header.next; - ((uio->uio_resid > 0) && (entry != &map->header)); + for (entry = map->header.next; entry != &map->header; entry = entry->next) { name = ""; freename = NULL; @@ -949,7 +942,7 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) * format: * start, end, access, offset, major, minor, inode, name. */ - snprintf(mebuffer, sizeof mebuffer, + error = sbuf_printf(sb, "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n", (u_long)entry->start, (u_long)entry->end, (entry->protection & VM_PROT_READ)?"r":"-", @@ -965,26 +958,9 @@ linprocfs_doprocmaps(PFS_FILL_ARGS) ); if (freename) free(freename, M_TEMP); - len = strlen(mebuffer); - if (len > uio->uio_resid) - len = uio->uio_resid; /* - * XXX We should probably return - * EFBIG here, as in procfs. - */ - last_timestamp = map->timestamp; - vm_map_unlock_read(map); - error = uiomove(mebuffer, len, uio); - vm_map_lock_read(map); - if (error) + if (error == -1) { + error = 0; break; - if (last_timestamp + 1 != map->timestamp) { - /* - * Look again for the entry because the map was - * modified while it was unlocked. Specifically, - * the entry may have been clipped, merged, or deleted. - */ - vm_map_lookup_entry(map, saved_end - 1, &tmp_entry); - entry = tmp_entry; } } vm_map_unlock_read(map); Modified: stable/7/sys/fs/procfs/procfs_map.c ============================================================================== --- stable/7/sys/fs/procfs/procfs_map.c Mon Oct 13 12:45:18 2008 (r183818) +++ stable/7/sys/fs/procfs/procfs_map.c Mon Oct 13 13:00:21 2008 (r183819) @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -81,14 +82,11 @@ extern struct sysentvec ia32_freebsd_sys int procfs_doprocmap(PFS_FILL_ARGS) { - int len; int error, vfslocked; vm_map_t map = &p->p_vmspace->vm_map; - vm_map_entry_t entry, tmp_entry; + vm_map_entry_t entry; struct vnode *vp; - char mebuffer[MEBUFFERSIZE]; char *fullpath, *freepath; - unsigned int last_timestamp; #ifdef COMPAT_IA32 int wrap32 = 0; #endif @@ -102,9 +100,6 @@ procfs_doprocmap(PFS_FILL_ARGS) if (uio->uio_rw != UIO_READ) return (EOPNOTSUPP); - if (uio->uio_offset != 0) - return (0); - #ifdef COMPAT_IA32 if (curthread->td_proc->p_sysent == &ia32_freebsd_sysvec) { if (p->p_sysent != &ia32_freebsd_sysvec) @@ -114,9 +109,8 @@ procfs_doprocmap(PFS_FILL_ARGS) #endif vm_map_lock_read(map); - for (entry = map->header.next; - ((uio->uio_resid > 0) && (entry != &map->header)); - entry = entry->next) { + for (entry = map->header.next; entry != &map->header; + entry = entry->next) { vm_object_t obj, tobj, lobj; int ref_count, shadow_count, flags; vm_offset_t addr; @@ -198,7 +192,7 @@ procfs_doprocmap(PFS_FILL_ARGS) * format: * start, end, resident, private resident, cow, access, type. */ - snprintf(mebuffer, sizeof mebuffer, + error = sbuf_printf(sb, "0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s\n", (u_long)entry->start, (u_long)entry->end, resident, privateresident, @@ -218,25 +212,9 @@ procfs_doprocmap(PFS_FILL_ARGS) if (freepath != NULL) free(freepath, M_TEMP); - len = strlen(mebuffer); - if (len > uio->uio_resid) { - error = EFBIG; - break; - } - last_timestamp = map->timestamp; - vm_map_unlock_read(map); - error = uiomove(mebuffer, len, uio); - vm_map_lock_read(map); - if (error) + if (error == -1) { + error = 0; break; - if (last_timestamp + 1 != map->timestamp) { - /* - * Look again for the entry because the map was - * modified while it was unlocked. Specifically, - * the entry may have been clipped, merged, or deleted. - */ - vm_map_lookup_entry(map, addr - 1, &tmp_entry); - entry = tmp_entry; } } vm_map_unlock_read(map); From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 13:29:00 2008 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA68B106568E; Mon, 13 Oct 2008 13:29:00 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id A05118FC2B; Mon, 13 Oct 2008 13:29:00 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7A6749CB34D; Mon, 13 Oct 2008 15:10:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NC6+J89nSQOi; Mon, 13 Oct 2008 15:10:47 +0200 (CEST) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 562659CB53B; Mon, 13 Oct 2008 15:10:47 +0200 (CEST) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id m9DDAl70085056; Mon, 13 Oct 2008 15:10:47 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 13 Oct 2008 15:10:47 +0200 From: Roman Divacky To: Konstantin Belousov Message-ID: <20081013131047.GA84887@freebsd.org> References: <200810131300.m9DD0MaR076808@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810131300.m9DD0MaR076808@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 13:29:01 -0000 On Mon, Oct 13, 2008 at 01:00:21PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Oct 13 13:00:21 2008 > New Revision: 183819 > URL: http://svn.freebsd.org/changeset/base/183819 > > Log: > MFC r183600: > Change the linprocfs /maps and procfs /map handlers to use > sbuf instead of doing uiomove. > > Approved by: re (kensmith) what about commiting this to note this change? Index: article.sgml =================================================================== --- article.sgml (revision 183819) +++ article.sgml (working copy) @@ -380,6 +380,9 @@ third-party device drivers will need to be modified and recompiled. + A serious problem emulating /proc for Linux was fixed. Many Linux + ports are now working including the linux-flashplugin9 port. + Boot Loader Changes From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 13:43:18 2008 Return-Path: Delivered-To: svn-src-stable-7@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AC291065687; Mon, 13 Oct 2008 13:43:18 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2599F8FC12; Mon, 13 Oct 2008 13:43:18 +0000 (UTC) (envelope-from des@des.no) X-Greylist: delayed 551 seconds by postgrey-1.32 at tim.des.no; Mon, 13 Oct 2008 13:26:40 UTC Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 3F4A06D4E4; Mon, 13 Oct 2008 13:26:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id EA322844C1; Mon, 13 Oct 2008 15:17:28 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Roman Divacky References: <200810131300.m9DD0MaR076808@svn.freebsd.org> <20081013131047.GA84887@freebsd.org> Date: Mon, 13 Oct 2008 15:17:28 +0200 In-Reply-To: <20081013131047.GA84887@freebsd.org> (Roman Divacky's message of "Mon, 13 Oct 2008 15:10:47 +0200") Message-ID: <86skr0zlav.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Konstantin Belousov , svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 13:43:18 -0000 Roman Divacky writes: > what about commiting this to note this change? > > + A serious problem emulating /proc for Linux was fixed. Many Li= nux > + ports are now working including the linux-flashplugin9 port. "A serious problem was fixed"? Really? And if none of that software worked before this commit, how come they were already in ports? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 13:49:38 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C2FA1065686; Mon, 13 Oct 2008 13:49:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5138FC29; Mon, 13 Oct 2008 13:49:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KpNWV-000BGp-Fz; Mon, 13 Oct 2008 16:31:47 +0300 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 m9DDVfv5049083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Oct 2008 16:31:41 +0300 (EEST) (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.3/8.14.3) with ESMTP id m9DDVfqf024691; Mon, 13 Oct 2008 16:31:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9DDVeOg024690; Mon, 13 Oct 2008 16:31:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Oct 2008 16:31:40 +0300 From: Kostik Belousov To: Dag-Erling Sm??rgrav Message-ID: <20081013133140.GQ7782@deviant.kiev.zoral.com.ua> References: <200810131300.m9DD0MaR076808@svn.freebsd.org> <20081013131047.GA84887@freebsd.org> <86skr0zlav.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9+VnUxDxRuy97YQ+" Content-Disposition: inline In-Reply-To: <86skr0zlav.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KpNWV-000BGp-Fz 73c02d273c8661f7d1d3889c2683482b X-Terabit: YES Cc: svn-src-stable@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-stable-7@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 13:49:38 -0000 --9+VnUxDxRuy97YQ+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 13, 2008 at 03:17:28PM +0200, Dag-Erling Sm??rgrav wrote: > Roman Divacky writes: > > what about commiting this to note this change? > > > > + A serious problem emulating /proc for Linux was fixed. Many = Linux > > + ports are now working including the linux-flashplugin9 port. >=20 > "A serious problem was fixed"? Really? And if none of that software > worked before this commit, how come they were already in ports? I do not think that mentioning of this should appear in release notes, but Roman is mostly right in stating the fact. Newest glibc reads /proc/pid/maps in chunks to determine stack address for created thread. Failure of the read(2) caused new linux libraries to fail on our linuxolator. --9+VnUxDxRuy97YQ+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjzTbwACgkQC3+MBN1Mb4hesQCgpdyjk8qj5uH6tjJsUaf6lsOa opQAn1VR+cIO2RzCXAtpAOLFWcf2KPT5 =etii -----END PGP SIGNATURE----- --9+VnUxDxRuy97YQ+-- From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 14:17:54 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C269106568E; Mon, 13 Oct 2008 14:17:54 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id D93878FC1D; Mon, 13 Oct 2008 14:17:53 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 697606D4E7; Mon, 13 Oct 2008 14:17:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 4B8B684492; Mon, 13 Oct 2008 16:17:43 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kostik Belousov References: <200810131300.m9DD0MaR076808@svn.freebsd.org> <20081013131047.GA84887@freebsd.org> <86skr0zlav.fsf@ds4.des.no> <20081013133140.GQ7782@deviant.kiev.zoral.com.ua> Date: Mon, 13 Oct 2008 16:17:43 +0200 In-Reply-To: <20081013133140.GQ7782@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Mon, 13 Oct 2008 16:31:40 +0300") Message-ID: <86od1oziig.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-stable-7@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 14:17:54 -0000 Kostik Belousov writes: > Dag-Erling Sm=C3=B8rgrav writes: > > Roman Divacky writes: > > > what about commiting this to note this change? > > > + A serious problem emulating /proc for Linux was fixed. Man= y Linux > > > + ports are now working including the linux-flashplugin9 port. > > "A serious problem was fixed"? Really? And if none of that software > > worked before this commit, how come they were already in ports? > I do not think that mentioning of this should appear in release notes, > but Roman is mostly right in stating the fact. Pretend you don't really know the details of the change, and reread Roman's proposed relnotes entry. Do you think it gives a correct impression of the nature and severity of the issue? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 14:22:48 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6ADD106568C; Mon, 13 Oct 2008 14:22:48 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 692D78FC12; Mon, 13 Oct 2008 14:22:47 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 7EA019CB167; Mon, 13 Oct 2008 16:22:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Ogu9w1eMLO0; Mon, 13 Oct 2008 16:22:04 +0200 (CEST) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4B49D9CB53B; Mon, 13 Oct 2008 16:22:04 +0200 (CEST) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id m9DEM3so099794; Mon, 13 Oct 2008 16:22:03 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 13 Oct 2008 16:22:03 +0200 From: Roman Divacky To: Dag-Erling Sm??rgrav Message-ID: <20081013142203.GA99640@freebsd.org> References: <200810131300.m9DD0MaR076808@svn.freebsd.org> <20081013131047.GA84887@freebsd.org> <86skr0zlav.fsf@ds4.des.no> <20081013133140.GQ7782@deviant.kiev.zoral.com.ua> <86od1oziig.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86od1oziig.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i Cc: Kostik Belousov , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 14:22:48 -0000 On Mon, Oct 13, 2008 at 04:17:43PM +0200, Dag-Erling Sm??rgrav wrote: > Kostik Belousov writes: > > Dag-Erling Sm??rgrav writes: > > > Roman Divacky writes: > > > > what about commiting this to note this change? > > > > + A serious problem emulating /proc for Linux was fixed. Many Linux > > > > + ports are now working including the linux-flashplugin9 port. > > > "A serious problem was fixed"? Really? And if none of that software > > > worked before this commit, how come they were already in ports? > > I do not think that mentioning of this should appear in release notes, > > but Roman is mostly right in stating the fact. > > Pretend you don't really know the details of the change, and reread > Roman's proposed relnotes entry. Do you think it gives a correct > impression of the nature and severity of the issue? my intention was to advertise that flash9 works ok now. Which is a thing a lot of people care about. Feel free to submit your own wording. From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 14:44:39 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA141106568B; Mon, 13 Oct 2008 14:44:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id 86E0B8FC16; Mon, 13 Oct 2008 14:44:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtp (Exim 4.63 (FreeBSD)) (envelope-from ) id 1KpOez-000Lm5-89; Mon, 13 Oct 2008 17:44:37 +0300 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 m9DEiOra054675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Oct 2008 17:44:24 +0300 (EEST) (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.3/8.14.3) with ESMTP id m9DEiO6a048430; Mon, 13 Oct 2008 17:44:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9DEiOW9048429; Mon, 13 Oct 2008 17:44:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 13 Oct 2008 17:44:24 +0300 From: Kostik Belousov To: Dag-Erling Sm??rgrav Message-ID: <20081013144424.GU7782@deviant.kiev.zoral.com.ua> References: <200810131300.m9DD0MaR076808@svn.freebsd.org> <20081013131047.GA84887@freebsd.org> <86skr0zlav.fsf@ds4.des.no> <20081013133140.GQ7782@deviant.kiev.zoral.com.ua> <86od1oziig.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4QzzFpAwbwI4hdN6" Content-Disposition: inline In-Reply-To: <86od1oziig.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1KpOez-000Lm5-89 6e6fa0e7c0526847dc15b8347173a7a3 X-Terabit: YES Cc: svn-src-stable@freebsd.org, Roman Divacky , src-committers@freebsd.org, svn-src-stable-7@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r183819 - in stable/7/sys: . compat/linprocfs fs/procfs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 14:44:39 -0000 --4QzzFpAwbwI4hdN6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 13, 2008 at 04:17:43PM +0200, Dag-Erling Sm??rgrav wrote: > Kostik Belousov writes: > > Dag-Erling Sm??rgrav writes: > > > Roman Divacky writes: > > > > what about commiting this to note this change? > > > > + A serious problem emulating /proc for Linux was fixed. M= any Linux > > > > + ports are now working including the linux-flashplugin9 port.= > > > "A serious problem was fixed"? Really? And if none of that software > > > worked before this commit, how come they were already in ports? > > I do not think that mentioning of this should appear in release notes, > > but Roman is mostly right in stating the fact. >=20 > Pretend you don't really know the details of the change, and reread > Roman's proposed relnotes entry. Do you think it gives a correct > impression of the nature and severity of the issue? Let me restate what I said above, in more explicit way: 1. The problem fixed actually caused new glibc to fail for threaded linux processes. This is a serious problem for non-default linux-base ports. It is not a serious problem for linprocfs code itself. 2. I oppose against making any promises of the quality of the linux emulator, esp. in the release notes, esp. making a statement that "flash9 works !". --4QzzFpAwbwI4hdN6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkjzXscACgkQC3+MBN1Mb4jfzQCbBOhWiqMGkV2wKwNmDCPTwXTl r60AoI9XIrxnSevAcMZxHlY1SoX+cP7H =Pm9i -----END PGP SIGNATURE----- --4QzzFpAwbwI4hdN6-- From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 16:14:21 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 920841065686; Mon, 13 Oct 2008 16:14:21 +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 7FE268FC12; Mon, 13 Oct 2008 16:14:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DGELD0080223; Mon, 13 Oct 2008 16:14:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DGELBG080222; Mon, 13 Oct 2008 16:14:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200810131614.m9DGELBG080222@svn.freebsd.org> From: John Baldwin Date: Mon, 13 Oct 2008 16:14:21 +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: r183823 - in stable/7/sys: . boot/i386/libi386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 16:14:21 -0000 Author: jhb Date: Mon Oct 13 16:14:21 2008 New Revision: 183823 URL: http://svn.freebsd.org/changeset/base/183823 Log: MFC: Fail requests to boot an amd64 kernel on an i386-only CPU. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/libi386/bootinfo64.c Modified: stable/7/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- stable/7/sys/boot/i386/libi386/bootinfo64.c Mon Oct 13 14:05:01 2008 (r183822) +++ stable/7/sys/boot/i386/libi386/bootinfo64.c Mon Oct 13 16:14:21 2008 (r183823) @@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" @@ -124,7 +127,45 @@ bi_copymodules64(vm_offset_t addr) } /* - * Load the information expected by an i386 kernel. + * Check to see if this CPU supports long mode. + */ +static int +bi_checkcpu(void) +{ + char *cpu_vendor; + int vendor[3]; + int eflags, regs[4]; + + /* Check for presence of "cpuid". */ + eflags = read_eflags(); + write_eflags(eflags ^ PSL_ID); + if (!((eflags ^ read_eflags()) & PSL_ID)) + return (0); + + /* Fetch the vendor string. */ + do_cpuid(0, regs); + vendor[0] = regs[1]; + vendor[1] = regs[3]; + vendor[2] = regs[2]; + cpu_vendor = (char *)vendor; + + /* Check for vendors that support AMD features. */ + if (strncmp(cpu_vendor, "GenuineIntel", 12) != 0 && + strncmp(cpu_vendor, "AuthenticAMD", 12) != 0) + return (0); + + /* Has to support AMD features. */ + do_cpuid(0x80000000, regs); + if (!(regs[0] >= 0x80000001)) + return (0); + + /* Check for long mode. */ + do_cpuid(0x80000001, regs); + return (regs[3] & AMDID_LM); +} + +/* + * Load the information expected by an amd64 kernel. * * - The 'boothowto' argument is constructed * - The 'bootdev' argument is constructed @@ -145,6 +186,11 @@ bi_load64(char *args, vm_offset_t *modul char *rootdevname; int howto; + if (!bi_checkcpu()) { + printf("CPU doesn't support long mode\n"); + return (EINVAL); + } + howto = bi_getboothowto(args); /* From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 16:46:24 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AA8A106568E; Mon, 13 Oct 2008 16:46:24 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8897C8FC16; Mon, 13 Oct 2008 16:46:24 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DGkOC6080826; Mon, 13 Oct 2008 16:46:24 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DGkOA0080825; Mon, 13 Oct 2008 16:46:24 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200810131646.m9DGkOA0080825@svn.freebsd.org> From: "Christian S.J. Peron" Date: Mon, 13 Oct 2008 16:46:24 +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: r183824 - in stable/7/sys: . security/audit X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 16:46:24 -0000 Author: csjp Date: Mon Oct 13 16:46:24 2008 New Revision: 183824 URL: http://svn.freebsd.org/changeset/base/183824 Log: MFC change 181604 Fix preselection on auditpipes if they have a different selection mask Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/security/audit/audit.c Modified: stable/7/sys/security/audit/audit.c ============================================================================== --- stable/7/sys/security/audit/audit.c Mon Oct 13 16:14:21 2008 (r183823) +++ stable/7/sys/security/audit/audit.c Mon Oct 13 16:46:24 2008 (r183824) @@ -609,7 +609,8 @@ audit_proc_coredump(struct thread *td, c else sorf = AU_PRS_SUCCESS; class = au_event_class(AUE_CORE); - if (au_preselect(AUE_CORE, class, aumask, sorf) == 0) + if (au_preselect(AUE_CORE, class, aumask, sorf) == 0 && + audit_pipe_preselect(auid, AUE_CORE, class, sorf, 0) == 0) return; /* * If we are interested in seeing this audit record, allocate it. From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 13 17:33:44 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D40331065688; Mon, 13 Oct 2008 17:33:44 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C21A58FC30; Mon, 13 Oct 2008 17:33:44 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9DHXiPv081764; Mon, 13 Oct 2008 17:33:44 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9DHXibj081763; Mon, 13 Oct 2008 17:33:44 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200810131733.m9DHXibj081763@svn.freebsd.org> From: "Christian S.J. Peron" Date: Mon, 13 Oct 2008 17:33: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: r183826 - in stable/7/sys: . netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 17:33:45 -0000 Author: csjp Date: Mon Oct 13 17:33:44 2008 New Revision: 183826 URL: http://svn.freebsd.org/changeset/base/183826 Log: MFC change 182311 Fix panics with MAC kernels when a labeled security policy is used and IP options are present on an mbuf. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/netinet/ip_options.c Modified: stable/7/sys/netinet/ip_options.c ============================================================================== --- stable/7/sys/netinet/ip_options.c Mon Oct 13 17:14:29 2008 (r183825) +++ stable/7/sys/netinet/ip_options.c Mon Oct 13 17:33:44 2008 (r183826) @@ -508,9 +508,6 @@ ip_insertoptions(struct mbuf *m, struct } M_MOVE_PKTHDR(n, m); n->m_pkthdr.rcvif = NULL; -#ifdef MAC - mac_copy_mbuf(m, n); -#endif n->m_pkthdr.len += optlen; m->m_len -= sizeof(struct ip); m->m_data += sizeof(struct ip); From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 14 07:58:19 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50DF4106568F; Tue, 14 Oct 2008 07:58:19 +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 3DBE18FC14; Tue, 14 Oct 2008 07:58:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9E7wJWG099363; Tue, 14 Oct 2008 07:58:19 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9E7wJD1099361; Tue, 14 Oct 2008 07:58:19 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810140758.m9E7wJD1099361@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Oct 2008 07:58:19 +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: r183870 - in stable/7/sys: . kern netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 07:58:19 -0000 Author: rwatson Date: Tue Oct 14 07:58:18 2008 New Revision: 183870 URL: http://svn.freebsd.org/changeset/base/183870 Log: Merge r183662 and r183663 from head to stable/7: Don't pass curthread to sbreserve_locked() in tcp_do_segment(), as the netisr or ithread's socket buffer size limit is not the right limit to use. Instead, pass NULL as the other two calls to sbreserve_locked() in the TCP input path (tcp_mss()) do. In practice, this is a no-op, as ithreads and the netisr run without a process limit on socket buffer use, and a NULL thread pointer leads to not using the process's limit, if any. However, if tcp_input() is called in other contexts that do have limits, this may prevent the incorrect limit from being used. Rewrite sbreserve_locked()'s comment on NULL thread pointers, eliminating an XXXRW about the comment being stale. Approved by: re (gnn) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/uipc_sockbuf.c stable/7/sys/netinet/tcp_input.c Modified: stable/7/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/7/sys/kern/uipc_sockbuf.c Tue Oct 14 07:52:47 2008 (r183869) +++ stable/7/sys/kern/uipc_sockbuf.c Tue Oct 14 07:58:18 2008 (r183870) @@ -283,10 +283,11 @@ sbreserve_locked(struct sockbuf *sb, u_l SOCKBUF_LOCK_ASSERT(sb); /* - * td will only be NULL when we're in an interrupt (e.g. in - * tcp_input()). - * - * XXXRW: This comment needs updating, as might the code. + * When a thread is passed, we take into account the thread's socket + * buffer size limit. The caller will generally pass curthread, but + * in the TCP input path, NULL will be passed to indicate that no + * appropriate thread resource limits are available. In that case, + * we don't apply a process limit. */ if (cc > sb_max_adj) return (0); Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Tue Oct 14 07:52:47 2008 (r183869) +++ stable/7/sys/netinet/tcp_input.c Tue Oct 14 07:58:18 2008 (r183870) @@ -1215,7 +1215,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ if (newsize) if (!sbreserve_locked(&so->so_rcv, - newsize, so, curthread)) + newsize, so, NULL)) so->so_rcv.sb_flags &= ~SB_AUTOSIZE; m_adj(m, drop_hdrlen); /* delayed header drop */ sbappendstream_locked(&so->so_rcv, m); From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 14 08:03:59 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A8F3106568B; Tue, 14 Oct 2008 08:03:59 +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 082078FC1D; Tue, 14 Oct 2008 08:03:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9E83waO099594; Tue, 14 Oct 2008 08:03:58 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9E83w1N099593; Tue, 14 Oct 2008 08:03:58 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810140803.m9E83w1N099593@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Oct 2008 08:03:58 +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: r183872 - in stable/7/sys: . netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 08:03:59 -0000 Author: rwatson Date: Tue Oct 14 08:03:58 2008 New Revision: 183872 URL: http://svn.freebsd.org/changeset/base/183872 Log: Merge r183744 from head to stable/7: Fix content and spelling of comment on _ipfw_insn.len -- a count of 32-bit words, not 32-byte words. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/netinet/ip_fw.h Modified: stable/7/sys/netinet/ip_fw.h ============================================================================== --- stable/7/sys/netinet/ip_fw.h Tue Oct 14 07:59:23 2008 (r183871) +++ stable/7/sys/netinet/ip_fw.h Tue Oct 14 08:03:58 2008 (r183872) @@ -217,7 +217,7 @@ enum ipfw_opcodes { /* arguments (4 byt */ typedef struct _ipfw_insn { /* template for instructions */ enum ipfw_opcodes opcode:8; - u_int8_t len; /* numer of 32-byte words */ + u_int8_t len; /* number of 32-bit words */ #define F_NOT 0x80 #define F_OR 0x40 #define F_LEN_MASK 0x3f From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 14 08:44:27 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8624106568E; Tue, 14 Oct 2008 08:44:27 +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 B5C2A8FC23; Tue, 14 Oct 2008 08:44:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9E8iRks000568; Tue, 14 Oct 2008 08:44:27 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9E8iR24000567; Tue, 14 Oct 2008 08:44:27 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200810140844.m9E8iR24000567@svn.freebsd.org> From: Robert Watson Date: Tue, 14 Oct 2008 08:44:27 +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: r183875 - in stable/7/sys: . kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 08:44:27 -0000 Author: rwatson Date: Tue Oct 14 08:44:27 2008 New Revision: 183875 URL: http://svn.freebsd.org/changeset/base/183875 Log: Merge r183664 from head to stable/7: Remove temporary debugging KASSERT's introduced to detect protocols improperly invoking sosend(), soreceive(), and sopoll() instead of attach either specialized or _generic() versions of those functions to their pru_sosend, pru_soreceive, and pru_sopoll protosw methods. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/kern/uipc_socket.c Modified: stable/7/sys/kern/uipc_socket.c ============================================================================== --- stable/7/sys/kern/uipc_socket.c Tue Oct 14 08:41:54 2008 (r183874) +++ stable/7/sys/kern/uipc_socket.c Tue Oct 14 08:44:27 2008 (r183875) @@ -1285,10 +1285,6 @@ sosend(struct socket *so, struct sockadd struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { - /* XXXRW: Temporary debugging. */ - KASSERT(so->so_proto->pr_usrreqs->pru_sosend != sosend, - ("sosend: protocol calls sosend")); - return (so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, top, control, flags, td)); } @@ -2032,10 +2028,6 @@ soreceive(struct socket *so, struct sock struct mbuf **mp0, struct mbuf **controlp, int *flagsp) { - /* XXXRW: Temporary debugging. */ - KASSERT(so->so_proto->pr_usrreqs->pru_soreceive != soreceive, - ("soreceive: protocol calls soreceive")); - return (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, mp0, controlp, flagsp)); } @@ -2659,10 +2651,6 @@ sopoll(struct socket *so, int events, st struct thread *td) { - /* XXXRW: Temporary debugging. */ - KASSERT(so->so_proto->pr_usrreqs->pru_sopoll != sopoll, - ("sopoll: protocol calls sopoll")); - return (so->so_proto->pr_usrreqs->pru_sopoll(so, events, active_cred, td)); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Oct 14 10:09:34 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE6B1065696; Tue, 14 Oct 2008 10:09:34 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECF7E8FC15; Tue, 14 Oct 2008 10:09:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9EA9Ws6002192; Tue, 14 Oct 2008 10:09:32 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9EA9W71002188; Tue, 14 Oct 2008 10:09:32 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200810141009.m9EA9W71002188@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 14 Oct 2008 10:09:32 +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: r183877 - stable/7/share/zoneinfo X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2008 10:09:34 -0000 Author: edwin Date: Tue Oct 14 10:09:32 2008 New Revision: 183877 URL: http://svn.freebsd.org/changeset/base/183877 Log: Vendor import of tzdata2008h MFV of r183861 MFC of r183864 - Minor update for Mauritius (which I don't understand) - Syria goes to DST at 1 November instead of 1 October. - Niue is now located at the right side of the equator. Approved by: re (blackend) Modified: stable/7/share/zoneinfo/ (props changed) stable/7/share/zoneinfo/africa stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/southamerica stable/7/share/zoneinfo/zone.tab Modified: stable/7/share/zoneinfo/africa ============================================================================== --- stable/7/share/zoneinfo/africa Tue Oct 14 09:53:47 2008 (r183876) +++ stable/7/share/zoneinfo/africa Tue Oct 14 10:09:32 2008 (r183877) @@ -1,4 +1,4 @@ -# @(#)africa 8.16 +# @(#)africa 8.17 #
 
 # This data is by no means authoritative; if you think you know better,
@@ -453,11 +453,19 @@ Zone Africa/Nouakchott	-1:03:48 -	LMT	19
 # year 2008 - 2009 will, therefore, be effective as from 26 October 2008
 # and end on 29 March 2009.
 
+# From Ed Maste (2008-10-07):
+# THE TIME BILL (No. XXVII of 2008) Explanatory Memorandum states the
+# beginning / ending of summer time is 2 o'clock standard time in the
+# morning of the last Sunday of October / last Sunday of March.
+# 
+# http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Mauritius	1982	only	-	Oct	10	0:00	1:00	S
 Rule Mauritius	1983	only	-	Mar	21	0:00	0	-
-Rule Mauritius	2008	max	-	Oct	lastSun	2:00	1:00	S
-Rule Mauritius	2009	max	-	Mar	lastSun	2:00	0	-
+Rule Mauritius	2008	max	-	Oct	lastSun	2:00s	1:00	S
+Rule Mauritius	2009	max	-	Mar	lastSun	2:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Indian/Mauritius	3:50:00 -	LMT	1907		# Port Louis
 			4:00 Mauritius	MU%sT	# Mauritius Time

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Tue Oct 14 09:53:47 2008	(r183876)
+++ stable/7/share/zoneinfo/asia	Tue Oct 14 10:09:32 2008	(r183877)
@@ -1,4 +1,4 @@
-# @(#)asia	8.23
+# @(#)asia	8.24
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -1957,8 +1957,20 @@ Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	
 # compilers can't handle  or having multiple Rules (a la Israel).
 # For now, use "Apr Fri>=1", and go with IATA on a uniform Sep 30 end.
 
+# From Steffen Thorsen (2008-10-07):
+# Syria has now officially decided to end DST on 2008-11-01 this year,
+# according to the following article in the Syrian Arab News Agency (SANA).
+#
+# The article is in Arabic, and seems to tell that they will go back to
+# winter time on 2008-11-01 at 00:00 local daylight time (delaying/setting
+# clocks back 60 minutes).
+#
+# 
+# http://sana.sy/ara/2/2008/10/07/195459.htm
+# 
+
 Rule	Syria	2008	max	-	Apr	Fri>=1	0:00	1:00	S
-Rule	Syria	2008	max	-	Oct	1	0:00	0	-
+Rule	Syria	2008	max	-	Nov	1	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Tue Oct 14 09:53:47 2008	(r183876)
+++ stable/7/share/zoneinfo/southamerica	Tue Oct 14 10:09:32 2008	(r183877)
@@ -1,4 +1,4 @@
-# @(#)southamerica	8.29
+# @(#)southamerica	8.30
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -177,6 +177,22 @@ Rule	Arg	2000	only	-	Mar	3	0:00	0	-
 # http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)
 # 
 
+# From Rodrigo Severo (2008-10-06):
+# Here is some info available at a Gentoo bug related to TZ on Argentina's DST:
+# ...
+# ------- Comment #1 from [jmdocile]  2008-10-06 16:28 0000 -------
+# Hi, there is a problem with timezone-data-2008e and maybe with
+# timezone-data-2008f
+# Argentinian law [Number] 25.155 is no longer valid.
+# 
+# http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm
+# 
+# The new one is law [Number] 26.350
+# 
+# http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm
+# 
+# So there is no summer time in Argentina for now.
+
 Rule	Arg	2007	only	-	Dec	30	0:00	1:00	S
 Rule	Arg	2008	max	-	Mar	Sun>=15	0:00	0	-
 Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:00	S

Modified: stable/7/share/zoneinfo/zone.tab
==============================================================================
--- stable/7/share/zoneinfo/zone.tab	Tue Oct 14 09:53:47 2008	(r183876)
+++ stable/7/share/zoneinfo/zone.tab	Tue Oct 14 10:09:32 2008	(r183877)
@@ -1,4 +1,4 @@
-# @(#)zone.tab	8.18
+# @(#)zone.tab	8.19
 #
 # TZ zone descriptions
 #
@@ -293,7 +293,7 @@ NL	+5222+00454	Europe/Amsterdam
 NO	+5955+01045	Europe/Oslo
 NP	+2743+08519	Asia/Katmandu
 NR	-0031+16655	Pacific/Nauru
-NU	-1901+16955	Pacific/Niue
+NU	-1901-16955	Pacific/Niue
 NZ	-3652+17446	Pacific/Auckland	most locations
 NZ	-4357-17633	Pacific/Chatham	Chatham Islands
 OM	+2336+05835	Asia/Muscat

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Oct 14 12:34:11 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 901051065693
	for ;
	Tue, 14 Oct 2008 12:34:11 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id B15BA8FC1D
	for ;
	Tue, 14 Oct 2008 12:34:10 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: (qmail invoked by alias); 14 Oct 2008 12:07:28 -0000
Received: from p54A3EEED.dip.t-dialin.net (EHLO tron.homeunix.org)
	[84.163.238.237]
	by mail.gmx.net (mp003) with SMTP; 14 Oct 2008 14:07:28 +0200
X-Authenticated: #1673122
X-Provags-ID: V01U2FsdGVkX1/cUwx6X8nc72azS9F4XQmpmaCgxWgYPXzyYcuXo5
	8u2h5m4ed7rmkF
Message-ID: <48F48B7F.5030009@gmx.de>
Date: Tue, 14 Oct 2008 14:07:27 +0200
From: Christoph Mallon 
User-Agent: Thunderbird 2.0.0.17 (X11/20080927)
MIME-Version: 1.0
To: Konstantin Belousov 
References: <200810131245.m9DCjIsR076490@svn.freebsd.org>
In-Reply-To: <200810131245.m9DCjIsR076490@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.42
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r183818 - in stable/7/sys: . i386/include
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Oct 2008 12:34:11 -0000

Hi Konstantin

Konstantin Belousov wrote:
> Author: kib
> Date: Mon Oct 13 12:45:18 2008
> New Revision: 183818
> URL: http://svn.freebsd.org/changeset/base/183818
> 
> Log:
>   MFC r180756 (by luoqi):
>   Unbreak cc -pg support on i386 by changing mcount() to always preserve %ecx.
>   
>   Approved by:	re (kensmith)
> 
> Modified:
>   stable/7/sys/   (props changed)
>   stable/7/sys/i386/include/profile.h
> 
> Modified: stable/7/sys/i386/include/profile.h
> ==============================================================================
> --- stable/7/sys/i386/include/profile.h	Mon Oct 13 12:28:33 2008	(r183817)
> +++ stable/7/sys/i386/include/profile.h	Mon Oct 13 12:45:18 2008	(r183818)
> @@ -115,7 +115,15 @@ void user(void);
>  void									\
>  mcount()								\
>  {									\
> -	uintfptr_t selfpc, frompc;					\
> +	uintfptr_t selfpc, frompc, ecx;					\
> +	/*								\
> +	 * In gcc 4.2, ecx might be used in the caller as the arg	\
> +	 * pointer if the stack realignment option is set (-mstackrealign) \
> +	 * or if the caller has the force_align_arg_pointer attribute	\
> +	 * (stack realignment is ALWAYS on for main).  Preserve ecx	\
> +	 * here.							\
> +	 */								\
> +	__asm("" : "=c" (ecx));						\
>  	/*								\
>  	 * Find the return address for mcount,				\
>  	 * and the return address for mcount's caller.			\
> @@ -132,6 +140,7 @@ mcount()								\
>  	__asm("movl (%%ebp),%0" : "=r" (frompc));			\
>  	frompc = ((uintfptr_t *)frompc)[1];				\
>  	_mcount(frompc, selfpc);					\
> +	__asm("" : : "c" (ecx));					\
>  }
>  #else /* !__GNUCLIKE_ASM */
>  #define	MCOUNT

This fix is conceptually broken and an accident waiting to happen. There 
is no way to prevent the compiler from shuffling instructions and 
clobbering %ecx. Here is a simple example, which demonstrates this problem:

unsigned f(unsigned a)
{
         unsigned ecx;
         asm("nop" : "=c" (ecx));
         a = 1 << a;
         asm("nop" : : "c" (ecx));
         return a;
}

GCC compiles this to:
f:
#APP
         nop
         nop
#NO_APP
         movl    4(%esp), %ecx
         movl    $1, %eax
         sall    %cl, %eax
         ret

As you can see, %ecx gets destroyed (GCC does not emit the #APP marker 
for empty asm statements, so I added "nop" for clarity. Even then GCC 
merged the two #APP blocks!). In mcount() the compiler could choose to 
place selfpc or frompc into %ecx and change the order of statements, 
which would destroy the contents of %ecx. In fact, if -mstackrealign is 
used, the stack realignment in mcount() destroys %ecx before any of the 
inline assembler statements is executed for sure. The only safe way is 
to implement mcount() using a global asm statement:

#define _MCOUNT_DECL static __attribute((cdecl,noinline)) void _mcount

#define MCOUNT                                         \
asm(                                                   \
	".globl mcount\n\t"                            \
	".type	mcount, @function\n"                   \
	"mcount:\n\t"                                  \
	"pushl %ecx\n\t"                               \
	"pushl 4(%esp)\n\t" // my return address       \
	"pushl 4(%ebp)\n\t" // caller's return address \
	"call  _mcount\n\t"                            \
	"addl  $8, %esp\n\t"                           \
	"pop   %ecx\n\t"                               \
	"ret\n\t"                                      \
	".size   mcount, .-mcount");

Considering the whole issue, I think this is a bug/misfeature of GCC. It 
could easily restore %ecx after calling mcount(), which it does for any 
normal (i.e. non-pg-induced) function call().


On a related note, I have submitted PR i386/127387 with patch 
(http://www.freebsd.org/cgi/query-pr.cgi?pr=i386/127387) about a similar 
problem in _start() in crt1.c for x86.

Regards
	Christoph

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Oct 14 19:02:47 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 771471065687;
	Tue, 14 Oct 2008 19:02:47 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 64F118FC1D;
	Tue, 14 Oct 2008 19:02:47 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9EJ2lxg013834;
	Tue, 14 Oct 2008 19:02:47 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9EJ2lKt013833;
	Tue, 14 Oct 2008 19:02:47 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <200810141902.m9EJ2lKt013833@svn.freebsd.org>
From: Xin LI 
Date: Tue, 14 Oct 2008 19:02:47 +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: r183892 - stable/7/sys/dev/twa
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Oct 2008 19:02:47 -0000

Author: delphij
Date: Tue Oct 14 19:02:47 2008
New Revision: 183892
URL: http://svn.freebsd.org/changeset/base/183892

Log:
  MFC r183660: Limit DMA memory to lower addressable 4GB, without
  this patch, we can reliably provoke data corruption on systems
  equipped with a plenty of memory during high load.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/dev/twa/   (props changed)
  stable/7/sys/dev/twa/tw_osl_freebsd.c

Modified: stable/7/sys/dev/twa/tw_osl_freebsd.c
==============================================================================
--- stable/7/sys/dev/twa/tw_osl_freebsd.c	Tue Oct 14 18:24:40 2008	(r183891)
+++ stable/7/sys/dev/twa/tw_osl_freebsd.c	Tue Oct 14 19:02:47 2008	(r183892)
@@ -492,7 +492,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
 	if (bus_dma_tag_create(NULL,			/* parent */
 				sc->alignment,		/* alignment */
 				0,			/* boundary */
-				BUS_SPACE_MAXADDR,	/* lowaddr */
+				BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
 				BUS_SPACE_MAXADDR, 	/* highaddr */
 				NULL, NULL, 		/* filter, filterarg */
 				TW_CL_MAX_IO_SIZE,	/* maxsize */
@@ -515,7 +515,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
 	if (bus_dma_tag_create(sc->parent_tag,		/* parent */
 				sc->alignment,		/* alignment */
 				0,			/* boundary */
-				BUS_SPACE_MAXADDR,	/* lowaddr */
+				BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
 				BUS_SPACE_MAXADDR, 	/* highaddr */
 				NULL, NULL, 		/* filter, filterarg */
 				dma_mem_size,		/* maxsize */
@@ -562,7 +562,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
 	if (bus_dma_tag_create(sc->parent_tag,		/* parent */
 				sc->alignment,		/* alignment */
 				0,			/* boundary */
-				BUS_SPACE_MAXADDR,	/* lowaddr */
+				BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
 				BUS_SPACE_MAXADDR, 	/* highaddr */
 				NULL, NULL, 		/* filter, filterarg */
 				TW_CL_MAX_IO_SIZE,	/* maxsize */
@@ -588,7 +588,7 @@ tw_osli_alloc_mem(struct twa_softc *sc)
 	if (bus_dma_tag_create(sc->parent_tag,		/* parent */
 				sc->alignment,		/* alignment */
 				0,			/* boundary */
-				BUS_SPACE_MAXADDR,	/* lowaddr */
+				BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
 				BUS_SPACE_MAXADDR, 	/* highaddr */
 				NULL, NULL, 		/* filter, filterarg */
 				TW_CL_MAX_IO_SIZE,	/* maxsize */

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Oct 14 19:48:58 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B03221065696;
	Tue, 14 Oct 2008 19:48:58 +0000 (UTC)
	(envelope-from dwmalone@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D4448FC1E;
	Tue, 14 Oct 2008 19:48:58 +0000 (UTC)
	(envelope-from dwmalone@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9EJmwXp014702;
	Tue, 14 Oct 2008 19:48:58 GMT
	(envelope-from dwmalone@svn.freebsd.org)
Received: (from dwmalone@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9EJmwbo014701;
	Tue, 14 Oct 2008 19:48:58 GMT
	(envelope-from dwmalone@svn.freebsd.org)
Message-Id: <200810141948.m9EJmwbo014701@svn.freebsd.org>
From: David Malone 
Date: Tue, 14 Oct 2008 19:48:58 +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: r183893 - in stable/7/sys: . dev/twa net
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Oct 2008 19:48:58 -0000

Author: dwmalone
Date: Tue Oct 14 19:48:58 2008
New Revision: 183893
URL: http://svn.freebsd.org/changeset/base/183893

Log:
  Some people's 6to4 routers seem to have been blowing up because of
  the unlocked route caching in if_stf. Add a mutex that protects
  access to cached route. Various versions of this patch were tested
  by Pekka Savola, Nick Sayer and Wouter Snels.
  
  Approved by:    re (gnn)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/twa/   (props changed)
  stable/7/sys/net/if_stf.c

Modified: stable/7/sys/net/if_stf.c
==============================================================================
--- stable/7/sys/net/if_stf.c	Tue Oct 14 19:02:47 2008	(r183892)
+++ stable/7/sys/net/if_stf.c	Tue Oct 14 19:48:58 2008	(r183893)
@@ -89,6 +89,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -119,6 +120,13 @@
 
 #include 
 
+SYSCTL_DECL(_net_link);
+SYSCTL_NODE(_net_link, IFT_STF, stf, CTLFLAG_RW, 0, "6to4 Interface");
+
+static int stf_route_cache = 1;
+SYSCTL_INT(_net_link_stf, OID_AUTO, route_cache, CTLFLAG_RW,
+    &stf_route_cache, 0, "Caching of IPv4 routes for 6to4 Output");
+
 #define STFNAME		"stf"
 #define STFUNIT		0
 
@@ -137,15 +145,15 @@ struct stf_softc {
 		struct route_in6 __sc_ro6; /* just for safety */
 	} __sc_ro46;
 #define sc_ro	__sc_ro46.__sc_ro4
+	struct mtx	sc_ro_mtx;
 	u_int	sc_fibnum;
 	const struct encaptab *encap_cookie;
 };
 #define STF2IFP(sc)	((sc)->sc_ifp)
 
 /*
- * XXXRW: Note that mutable fields in the softc are not currently locked:
- * in particular, sc_ro needs to be protected from concurrent entrance
- * of stf_output().
+ * Note that mutable fields in the softc are not currently locked.
+ * We do lock sc_ro in stf_output though.
  */
 static MALLOC_DEFINE(M_STF, STFNAME, "6to4 Tunnel Interface");
 static const int ip_stf_ttl = 40;
@@ -231,6 +239,7 @@ stf_clone_create(struct if_clone *ifc, c
 	ifp->if_dname = ifc->ifc_name;
 	ifp->if_dunit = IF_DUNIT_NONE;
 
+	mtx_init(&(sc)->sc_ro_mtx, "stf ro", NULL, MTX_DEF);
 	sc->encap_cookie = encap_attach_func(AF_INET, IPPROTO_IPV6,
 	    stf_encapcheck, &in_stf_protosw, sc);
 	if (sc->encap_cookie == NULL) {
@@ -257,6 +266,7 @@ stf_clone_destroy(struct if_clone *ifc, 
 
 	err = encap_detach(sc->encap_cookie);
 	KASSERT(err == 0, ("Unexpected error detaching encap_cookie"));
+	mtx_destroy(&(sc)->sc_ro_mtx);
 	bpfdetach(ifp);
 	if_detach(ifp);
 	if_free(ifp);
@@ -398,6 +408,7 @@ stf_output(ifp, m, dst, rt)
 {
 	struct stf_softc *sc;
 	struct sockaddr_in6 *dst6;
+	struct route *cached_route;
 	struct in_addr in4;
 	caddr_t ptr;
 	struct sockaddr_in *dst4;
@@ -406,9 +417,9 @@ stf_output(ifp, m, dst, rt)
 	struct ip6_hdr *ip6;
 	struct in6_ifaddr *ia6;
 	u_int32_t af;
-#ifdef MAC
 	int error;
 
+#ifdef MAC
 	error = mac_check_ifnet_transmit(ifp, m);
 	if (error) {
 		m_freem(m);
@@ -507,9 +518,15 @@ stf_output(ifp, m, dst, rt)
 	else
 		ip_ecn_ingress(ECN_NOCARE, &ip->ip_tos, &tos);
 
+	if (!stf_route_cache) {
+		cached_route = NULL;
+		goto sendit;
+	}
+
 	/*
-	 * XXXRW: Locking of sc_ro required.
+	 * Do we have a cached route?
 	 */
+	mtx_lock(&(sc)->sc_ro_mtx);
 	dst4 = (struct sockaddr_in *)&sc->sc_ro.ro_dst;
 	if (dst4->sin_family != AF_INET ||
 	    bcmp(&dst4->sin_addr, &ip->ip_dst, sizeof(ip->ip_dst)) != 0) {
@@ -527,14 +544,21 @@ stf_output(ifp, m, dst, rt)
 		rtalloc_fib(&sc->sc_ro, sc->sc_fibnum);
 		if (sc->sc_ro.ro_rt == NULL) {
 			m_freem(m);
+			mtx_unlock(&(sc)->sc_ro_mtx);
 			ifp->if_oerrors++;
 			return ENETUNREACH;
 		}
 	}
+	cached_route = &sc->sc_ro;
 
+sendit:
 	M_SETFIB(m, sc->sc_fibnum);
 	ifp->if_opackets++;
-	return ip_output(m, NULL, &sc->sc_ro, 0, NULL, NULL);
+	error = ip_output(m, NULL, cached_route, 0, NULL, NULL);
+
+	if (cached_route != NULL)
+		mtx_unlock(&(sc)->sc_ro_mtx);
+	return error;
 }
 
 static int

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Oct 14 20:17:23 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 489431065686;
	Tue, 14 Oct 2008 20:17:23 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net
	[IPv6:2001:470:1f10:75::2])
	by mx1.freebsd.org (Postfix) with ESMTP id DD16B8FC24;
	Tue, 14 Oct 2008 20:17:22 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1])
	(authenticated bits=0)
	by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m9EKHGND025750;
	Tue, 14 Oct 2008 16:17:16 -0400 (EDT) (envelope-from jhb@freebsd.org)
From: John Baldwin 
To: Xin LI 
Date: Tue, 14 Oct 2008 16:16:27 -0400
User-Agent: KMail/1.9.7
References: <200810141902.m9EJ2lKt013833@svn.freebsd.org>
In-Reply-To: <200810141902.m9EJ2lKt013833@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200810141616.27776.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by
	milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]);
	Tue, 14 Oct 2008 16:17:16 -0400 (EDT)
X-Virus-Scanned: ClamAV 0.93.1/8424/Tue Oct 14 12:10:56 2008 on
	server.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS 
	autolearn=ham version=3.1.3
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r183892 - stable/7/sys/dev/twa
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Oct 2008 20:17:23 -0000

On Tuesday 14 October 2008 03:02:47 pm Xin LI wrote:
> Author: delphij
> Date: Tue Oct 14 19:02:47 2008
> New Revision: 183892
> URL: http://svn.freebsd.org/changeset/base/183892
> 
> Log:
>   MFC r183660: Limit DMA memory to lower addressable 4GB, without
>   this patch, we can reliably provoke data corruption on systems
>   equipped with a plenty of memory during high load.
>   
>   Approved by:	re (kib)
> 
> Modified:
>   stable/7/sys/dev/twa/   (props changed)
>   stable/7/sys/dev/twa/tw_osl_freebsd.c

Need to re-merge this to stable/7/sys to move the merge info up to sys and out 
of sys/dev/twa.

-- 
John Baldwin

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Oct 14 20:47:29 2008
Return-Path: 
Delivered-To: svn-src-stable-7@FreeBSD.ORG
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DE0B1065696;
	Tue, 14 Oct 2008 20:47:29 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net
	[IPv6:2001:470:1f03:2c9::2])
	by mx1.freebsd.org (Postfix) with ESMTP id D50CD8FC14;
	Tue, 14 Oct 2008 20:47:28 +0000 (UTC)
	(envelope-from delphij@delphij.net)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.delphij.net (Postfix) with ESMTPS id 0A84228454;
	Wed, 15 Oct 2008 04:47:28 +0800 (CST)
Received: from localhost (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id 72EF8101DE1A;
	Wed, 15 Oct 2008 04:47:27 +0800 (CST)
X-Virus-Scanned: amavisd-new at geekcn.org
Received: from tarsier.geekcn.org ([211.166.10.233])
	by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new,
	port 10024)
	with ESMTP id ZCM4BKwqHhB4; Wed, 15 Oct 2008 04:47:22 +0800 (CST)
Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net
	[76.237.33.62])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by tarsier.geekcn.org (Postfix) with ESMTPSA id D605A101B2B4;
	Wed, 15 Oct 2008 04:47:18 +0800 (CST)
DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns;
	h=message-id:date:from:reply-to:organization:user-agent:
	mime-version:to:cc:subject:references:in-reply-to:
	x-enigmail-version:openpgp:content-type:content-transfer-encoding;
	b=I2Y31FIEKpWT5XGRXbseiRf6Z+FXmrdkiC14sMrzHQS9sagUvIvlv5FcoUbqWhtXq
	WxRVPaK6fIsye7ykcZaCA==
Message-ID: <48F50552.7070507@delphij.net>
Date: Tue, 14 Oct 2008 13:47:14 -0700
From: Xin LI 
Organization: The FreeBSD Project
User-Agent: Thunderbird 2.0.0.17 (X11/20080928)
MIME-Version: 1.0
To: John Baldwin 
References: <200810141902.m9EJ2lKt013833@svn.freebsd.org>
	<200810141616.27776.jhb@freebsd.org>
In-Reply-To: <200810141616.27776.jhb@freebsd.org>
X-Enigmail-Version: 0.95.7
OpenPGP: id=18EDEBA0;
	url=http://www.delphij.net/delphij.asc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable-7@FreeBSD.ORG, svn-src-stable@FreeBSD.ORG,
	svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG,
	Xin LI 
Subject: Re: svn commit: r183892 - stable/7/sys/dev/twa
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: d@delphij.net
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Oct 2008 20:47:29 -0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John Baldwin wrote:
> On Tuesday 14 October 2008 03:02:47 pm Xin LI wrote:
>> Author: delphij
>> Date: Tue Oct 14 19:02:47 2008
>> New Revision: 183892
>> URL: http://svn.freebsd.org/changeset/base/183892
>>
>> Log:
>>   MFC r183660: Limit DMA memory to lower addressable 4GB, without
>>   this patch, we can reliably provoke data corruption on systems
>>   equipped with a plenty of memory during high load.
>>   
>>   Approved by:	re (kib)
>>
>> Modified:
>>   stable/7/sys/dev/twa/   (props changed)
>>   stable/7/sys/dev/twa/tw_osl_freebsd.c
> 
> Need to re-merge this to stable/7/sys to move the merge info up to sys and out 
> of sys/dev/twa.

Sorry for that.  Seems that David Malone has committed a merge on sys/
which already collapsed the mergeinfo?

Cheers,
- --
Xin LI 	http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkj1BVEACgkQi+vbBBjt66D2QQCcC52AesgNxP0IDgH9LtMPzQ26
xX8An13BAPJax/5/D7LxyN1MowCGL67j
=NF1s
-----END PGP SIGNATURE-----

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Oct 14 22:48:38 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 61AF11065689;
	Tue, 14 Oct 2008 22:48:38 +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 4E9B38FC16;
	Tue, 14 Oct 2008 22:48:38 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9EMmcAc017958;
	Tue, 14 Oct 2008 22:48:38 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9EMmcOG017957;
	Tue, 14 Oct 2008 22:48:38 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200810142248.m9EMmcOG017957@svn.freebsd.org>
From: Robert Watson 
Date: Tue, 14 Oct 2008 22:48:38 +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: r183898 - in stable/7/sys: . kern
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Oct 2008 22:48:38 -0000

Author: rwatson
Date: Tue Oct 14 22:48:38 2008
New Revision: 183898
URL: http://svn.freebsd.org/changeset/base/183898

Log:
  Merge r183675 from head to stable/7:
  
    In soreceive_dgram, when a 0-length buffer is passed into recv(2) and
    no data is ready, return 0 rather than blocking or returning EAGAIN.
    This is consistent with the behavior of soreceive_generic (soreceive)
    in earlier versions of FreeBSD, and restores this behavior for UDP.
  
    Discussed with: jhb, sam
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/kern/uipc_socket.c

Modified: stable/7/sys/kern/uipc_socket.c
==============================================================================
--- stable/7/sys/kern/uipc_socket.c	Tue Oct 14 22:11:18 2008	(r183897)
+++ stable/7/sys/kern/uipc_socket.c	Tue Oct 14 22:48:38 2008	(r183898)
@@ -1900,7 +1900,8 @@ soreceive_dgram(struct socket *so, struc
 			SOCKBUF_UNLOCK(&so->so_rcv);
 			return (error);
 		}
-		if (so->so_rcv.sb_state & SBS_CANTRCVMORE) {
+		if (so->so_rcv.sb_state & SBS_CANTRCVMORE ||
+		    uio->uio_resid == 0) {
 			SOCKBUF_UNLOCK(&so->so_rcv);
 			return (0);
 		}

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Oct 15 11:28:17 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D77441065692;
	Wed, 15 Oct 2008 11:28:17 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A0678FC08;
	Wed, 15 Oct 2008 11:28:17 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua)
	by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256)
	(Exim 4.63 (FreeBSD)) (envelope-from )
	id 1Kq4Y2-000NsT-Pi; Wed, 15 Oct 2008 14:28:15 +0300
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 m9FBSAFp028506
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 15 Oct 2008 14:28:11 +0300 (EEST)
	(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.3/8.14.3) with ESMTP id
	m9FBSAFK000387; Wed, 15 Oct 2008 14:28:10 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id m9FBSAOl000384; 
	Wed, 15 Oct 2008 14:28:10 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 15 Oct 2008 14:28:10 +0300
From: Kostik Belousov 
To: Christoph Mallon 
Message-ID: <20081015112810.GN7782@deviant.kiev.zoral.com.ua>
References: <200810131245.m9DCjIsR076490@svn.freebsd.org>
	<48F48B7F.5030009@gmx.de>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="0f/2aphqXmKkUnNA"
Content-Disposition: inline
In-Reply-To: <48F48B7F.5030009@gmx.de>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: ClamAV version 0.93.3,
	clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00
	autolearn=ham version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
X-Virus-Scanned: mail.terabit.net.ua 1Kq4Y2-000NsT-Pi
	6aaf2619a6dc1d5c8ed4e4fefa4cbaa3
X-Terabit: YES
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r183818 - in stable/7/sys: . i386/include
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Oct 2008 11:28:18 -0000


--0f/2aphqXmKkUnNA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 14, 2008 at 02:07:27PM +0200, Christoph Mallon wrote:
> Hi Konstantin
>=20
> Konstantin Belousov wrote:
> >Author: kib
> >Date: Mon Oct 13 12:45:18 2008
> >New Revision: 183818
> >URL: http://svn.freebsd.org/changeset/base/183818
> >
> >Log:
> >  MFC r180756 (by luoqi):
> >  Unbreak cc -pg support on i386 by changing mcount() to always preserve=
=20
> >  %ecx.
> > =20
> >  Approved by:	re (kensmith)
> >
> >Modified:
> >  stable/7/sys/   (props changed)
> >  stable/7/sys/i386/include/profile.h
> >
> >Modified: stable/7/sys/i386/include/profile.h
> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> >--- stable/7/sys/i386/include/profile.h	Mon Oct 13 12:28:33 2008=20
> >(r183817)
> >+++ stable/7/sys/i386/include/profile.h	Mon Oct 13 12:45:18 2008=20
> >(r183818)
> >@@ -115,7 +115,15 @@ void user(void);
> > void									\
> > mcount()								\
> > {									\
> >-	uintfptr_t selfpc, frompc;					\
> >+	uintfptr_t selfpc, frompc, ecx;					\
> >+	/*								\
> >+	 * In gcc 4.2, ecx might be used in the caller as the arg	\
> >+	 * pointer if the stack realignment option is set (-mstackrealign) \
> >+	 * or if the caller has the force_align_arg_pointer attribute	\
> >+	 * (stack realignment is ALWAYS on for main).  Preserve ecx	\
> >+	 * here.							\
> >+	 */								\
> >+	__asm("" : "=3Dc" (ecx));						\
> > 	/*								\
> > 	 * Find the return address for mcount,				\
> > 	 * and the return address for mcount's caller.			\
> >@@ -132,6 +140,7 @@ mcount()						 \
> > 	__asm("movl (%%ebp),%0" : "=3Dr" (frompc));			\
> > 	frompc =3D ((uintfptr_t *)frompc)[1];				\
> > 	_mcount(frompc, selfpc);					\
> >+	__asm("" : : "c" (ecx));					\
> > }
> > #else /* !__GNUCLIKE_ASM */
> > #define	MCOUNT
>=20
> This fix is conceptually broken and an accident waiting to happen. There=
=20
> is no way to prevent the compiler from shuffling instructions and=20
> clobbering %ecx. Here is a simple example, which demonstrates this proble=
m:
>=20
> unsigned f(unsigned a)
> {
>         unsigned ecx;
>         asm("nop" : "=3Dc" (ecx));
>         a =3D 1 << a;
>         asm("nop" : : "c" (ecx));
>         return a;
> }
>=20
> GCC compiles this to:
> f:
> #APP
>         nop
>         nop
> #NO_APP
>         movl    4(%esp), %ecx
>         movl    $1, %eax
>         sall    %cl, %eax
>         ret
>=20
> As you can see, %ecx gets destroyed (GCC does not emit the #APP marker=20
> for empty asm statements, so I added "nop" for clarity. Even then GCC=20
> merged the two #APP blocks!). In mcount() the compiler could choose to=20
> place selfpc or frompc into %ecx and change the order of statements,=20
> which would destroy the contents of %ecx. In fact, if -mstackrealign is=
=20
> used, the stack realignment in mcount() destroys %ecx before any of the=
=20
> inline assembler statements is executed for sure. The only safe way is=20
> to implement mcount() using a global asm statement:
>=20
> #define _MCOUNT_DECL static __attribute((cdecl,noinline)) void _mcount
>=20
> #define MCOUNT                                         \
> asm(                                                   \
> 	".globl mcount\n\t"                            \
> 	".type	mcount, @function\n"                   \
> 	"mcount:\n\t"                                  \
> 	"pushl %ecx\n\t"                               \
> 	"pushl 4(%esp)\n\t" // my return address       \
> 	"pushl 4(%ebp)\n\t" // caller's return address \
> 	"call  _mcount\n\t"                            \
> 	"addl  $8, %esp\n\t"                           \
> 	"pop   %ecx\n\t"                               \
> 	"ret\n\t"                                      \
> 	".size   mcount, .-mcount");
>=20
> Considering the whole issue, I think this is a bug/misfeature of GCC. It=
=20
> could easily restore %ecx after calling mcount(), which it does for any=
=20
> normal (i.e. non-pg-induced) function call().
I was worried too about suspiciously looking direct asm manipulations of
the registers that could interfere with optimizer, when I have seen the
patch committed to the HEAD. On the other hand, it magically works for
the present version of the gcc and used compiler flags.

We cannot have any other fix for 7.1, I suspect. Feel free to submit
more accurate patch. And, as was stated in the original commit message,
saving of the whole register file may be right thing to do.
>=20
>=20
> On a related note, I have submitted PR i386/127387 with patch=20
> (http://www.freebsd.org/cgi/query-pr.cgi?pr=3Di386/127387) about a simila=
r=20
> problem in _start() in crt1.c for x86.
>=20
> Regards
> 	Christoph

--0f/2aphqXmKkUnNA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkj108kACgkQC3+MBN1Mb4iGYgCgxFKXeArQboGFoV2RS1COGYYx
re8AoPJta5Sl5346jnCxnbHU1TPVFB5s
=no6b
-----END PGP SIGNATURE-----

--0f/2aphqXmKkUnNA--

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Oct 15 12:08:45 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 16DA1106568B
	for ;
	Wed, 15 Oct 2008 12:08:45 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id 6E4C98FC1D
	for ;
	Wed, 15 Oct 2008 12:08:44 +0000 (UTC)
	(envelope-from christoph.mallon@gmx.de)
Received: (qmail invoked by alias); 15 Oct 2008 12:08:42 -0000
Received: from p54A3ECE9.dip.t-dialin.net (EHLO tron.homeunix.org)
	[84.163.236.233]
	by mail.gmx.net (mp002) with SMTP; 15 Oct 2008 14:08:42 +0200
X-Authenticated: #1673122
X-Provags-ID: V01U2FsdGVkX199mHI1MfV92CRgXxkjaP8bQpuo+dAUMi/UN16Yqp
	CAp6jfSx46Siif
Message-ID: <48F5DD49.6040003@gmx.de>
Date: Wed, 15 Oct 2008 14:08:41 +0200
From: Christoph Mallon 
User-Agent: Thunderbird 2.0.0.17 (X11/20080927)
MIME-Version: 1.0
To: Kostik Belousov 
References: <200810131245.m9DCjIsR076490@svn.freebsd.org>
	<48F48B7F.5030009@gmx.de>
	<20081015112810.GN7782@deviant.kiev.zoral.com.ua>
In-Reply-To: <20081015112810.GN7782@deviant.kiev.zoral.com.ua>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.48
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r183818 - in stable/7/sys: . i386/include
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Oct 2008 12:08:45 -0000

Kostik Belousov wrote:
> On Tue, Oct 14, 2008 at 02:07:27PM +0200, Christoph Mallon wrote:
>> Hi Konstantin
>>
>> Konstantin Belousov wrote:
>>> Author: kib
>>> Date: Mon Oct 13 12:45:18 2008
>>> New Revision: 183818
>>> URL: http://svn.freebsd.org/changeset/base/183818
>>>
>>> Log:
>>>  MFC r180756 (by luoqi):
>>>  Unbreak cc -pg support on i386 by changing mcount() to always preserve 
>>>  %ecx.

[...]

>> As you can see, %ecx gets destroyed (GCC does not emit the #APP marker 
>> for empty asm statements, so I added "nop" for clarity. Even then GCC 
>> merged the two #APP blocks!). In mcount() the compiler could choose to 
>> place selfpc or frompc into %ecx and change the order of statements, 
>> which would destroy the contents of %ecx. In fact, if -mstackrealign is 
>> used, the stack realignment in mcount() destroys %ecx before any of the 
>> inline assembler statements is executed for sure. The only safe way is 
>> to implement mcount() using a global asm statement:
>>
>> #define _MCOUNT_DECL static __attribute((cdecl,noinline)) void _mcount
>>
>> #define MCOUNT                                         \
>> asm(                                                   \
>> 	".globl mcount\n\t"                            \
>> 	".type	mcount, @function\n"                   \
>> 	"mcount:\n\t"                                  \
>> 	"pushl %ecx\n\t"                               \
>> 	"pushl 4(%esp)\n\t" // my return address       \
>> 	"pushl 4(%ebp)\n\t" // caller's return address \
>> 	"call  _mcount\n\t"                            \
>> 	"addl  $8, %esp\n\t"                           \
>> 	"pop   %ecx\n\t"                               \
>> 	"ret\n\t"                                      \
>> 	".size   mcount, .-mcount");
>>
>> Considering the whole issue, I think this is a bug/misfeature of GCC. It 
>> could easily restore %ecx after calling mcount(), which it does for any 
>> normal (i.e. non-pg-induced) function call().
> I was worried too about suspiciously looking direct asm manipulations of
> the registers that could interfere with optimizer, when I have seen the
> patch committed to the HEAD. On the other hand, it magically works for
> the present version of the gcc and used compiler flags.

No, it does not work. I exactly described the scenario in which it plain 
breaks: If you use -mstackrealign, then mcount() gets realignment code 
too, which destroys the contents of %ecx *before* any of the inline 
assembler statemets get executed. The first thing the compiler inserts 
into mcount() is this line:

	leal    4(%esp), %ecx

This immediately destroys %ecx. And even if you do not use 
-mstackrealign - as I explained - you have *no* guarantee that you get 
the contents of %ecx from before the function call. It depends on the 
exact switches (which GCC has dozens of) to not explode - have you 
tested *all* combinations?

> We cannot have any other fix for 7.1, I suspect.

We should, for the reasons explained above.

> Feel free to submit more accurate patch.

Um, I *did*. See the code above.

Regards
	Christoph

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Oct 16 08:24:02 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E313F1065694;
	Thu, 16 Oct 2008 08:24:02 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D09978FC1D;
	Thu, 16 Oct 2008 08:24:02 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9G8O2fK055580;
	Thu, 16 Oct 2008 08:24:02 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9G8O2Pq055578;
	Thu, 16 Oct 2008 08:24:02 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200810160824.m9G8O2Pq055578@svn.freebsd.org>
From: Weongyo Jeong 
Date: Thu, 16 Oct 2008 08:24:02 +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: r183930 - in stable/7/sys: . dev/if_ndis dev/twa
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 16 Oct 2008 08:24:03 -0000

Author: weongyo
Date: Thu Oct 16 08:24:02 2008
New Revision: 183930
URL: http://svn.freebsd.org/changeset/base/183930

Log:
  MFC r183587:
  
    sc->ndis_txidx should be cycle between 0 and sc->ndis_maxpkts, not
    NDIS_TXPKTS and don't allocate unused extra spaces for
    sc->ndis_txarray and sc->ndis_txpool.
  
    PR:		kern/127644
    Submitted by:	Antoine Pelisse 
  
  Approved by:	re (gnn)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/if_ndis/if_ndis.c
  stable/7/sys/dev/if_ndis/if_ndisvar.h
  stable/7/sys/dev/twa/   (props changed)

Modified: stable/7/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- stable/7/sys/dev/if_ndis/if_ndis.c	Thu Oct 16 04:17:17 2008	(r183929)
+++ stable/7/sys/dev/if_ndis/if_ndis.c	Thu Oct 16 08:24:02 2008	(r183930)
@@ -660,12 +660,12 @@ ndis_attach(dev)
 		sc->ndis_maxpkts = 10;
 
 	sc->ndis_txarray = malloc(sizeof(ndis_packet *) *
-	    NDIS_TXPKTS, M_DEVBUF, M_NOWAIT|M_ZERO);
+	    sc->ndis_maxpkts, M_DEVBUF, M_NOWAIT|M_ZERO);
 
 	/* Allocate a pool of ndis_packets for TX encapsulation. */
 
 	NdisAllocatePacketPool(&i, &sc->ndis_txpool,
-	   NDIS_TXPKTS, PROTOCOL_RESERVED_SIZE_IN_PACKET);
+	    sc->ndis_maxpkts, PROTOCOL_RESERVED_SIZE_IN_PACKET);
 
 	if (i != NDIS_STATUS_SUCCESS) {
 		sc->ndis_txpool = NULL;

Modified: stable/7/sys/dev/if_ndis/if_ndisvar.h
==============================================================================
--- stable/7/sys/dev/if_ndis/if_ndisvar.h	Thu Oct 16 04:17:17 2008	(r183929)
+++ stable/7/sys/dev/if_ndis/if_ndisvar.h	Thu Oct 16 08:24:02 2008	(r183930)
@@ -87,7 +87,7 @@ TAILQ_HEAD(nch, ndis_cfglist);
 
 #define NDIS_TXPKTS 64
 #define NDIS_INC(x)		\
-	(x)->ndis_txidx = ((x)->ndis_txidx + 1) % NDIS_TXPKTS
+	(x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts
 
 #if __FreeBSD_version < 600007
 #define arpcom ic.ic_ac

From owner-svn-src-stable-7@FreeBSD.ORG  Thu Oct 16 17:11:06 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6B721065687;
	Thu, 16 Oct 2008 17:11:06 +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 AB1508FC19;
	Thu, 16 Oct 2008 17:11:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9GHB62M066396;
	Thu, 16 Oct 2008 17:11:06 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9GHB6ue066395;
	Thu, 16 Oct 2008 17:11:06 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200810161711.m9GHB6ue066395@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 16 Oct 2008 17:11:06 +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: r183956 - in stable/7/sys: . dev/twa
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Thu, 16 Oct 2008 17:11:07 -0000

Author: jhb
Date: Thu Oct 16 17:11:06 2008
New Revision: 183956
URL: http://svn.freebsd.org/changeset/base/183956

Log:
  Move mergeinfo from sys/dev/twa up to sys.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/twa/   (props changed)

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Oct 17 19:52:35 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91644106568C;
	Fri, 17 Oct 2008 19:52:35 +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 7E1D78FC19;
	Fri, 17 Oct 2008 19:52:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9HJqZB5096336;
	Fri, 17 Oct 2008 19:52:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9HJqZ8m096334;
	Fri, 17 Oct 2008 19:52:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200810171952.m9HJqZ8m096334@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 17 Oct 2008 19:52:35 +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: r183984 - in stable/7/sys: . i386/i386 i386/include
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Oct 2008 19:52:35 -0000

Author: jhb
Date: Fri Oct 17 19:52:35 2008
New Revision: 183984
URL: http://svn.freebsd.org/changeset/base/183984

Log:
  MFC: More CPUID feature flags: SSE4, X2APIC, POPCNT, DTES64, and 1GB
  large pages.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/i386/i386/identcpu.c
  stable/7/sys/i386/include/specialreg.h

Modified: stable/7/sys/i386/i386/identcpu.c
==============================================================================
--- stable/7/sys/i386/i386/identcpu.c	Fri Oct 17 18:19:36 2008	(r183983)
+++ stable/7/sys/i386/i386/identcpu.c	Fri Oct 17 19:52:35 2008	(r183984)
@@ -720,7 +720,7 @@ printcpuinfo(void)
 				"\020"
 				"\001SSE3"	/* SSE3 */
 				"\002"
-				"\003RSVD2"	/* "Reserved" bit 2 */
+				"\003DTES64"	/* 64-bit Debug Trace */
 				"\004MON"	/* MONITOR/MWAIT Instructions */
 				"\005DS_CPL"	/* CPL Qualified Debug Store */
 				"\006VMX"	/* Virtual Machine Extensions */
@@ -737,11 +737,11 @@ printcpuinfo(void)
 				"\021"
 				"\022"
 				"\023DCA"	/* Direct Cache Access */
-				"\024"
-				"\025"
-				"\026"
+				"\024SSE4.1"
+				"\025SSE4.2"
+				"\026x2APIC"	/* xAPIC Extensions */
 				"\027"
-				"\030"
+				"\030POPCNT"
 				"\031"
 				"\032"
 				"\033"
@@ -791,7 +791,7 @@ printcpuinfo(void)
 				"\030"	/* Same */
 				"\031"	/* Same */
 				"\032FFXSR"	/* Fast FXSAVE/FXRSTOR */
-				"\033"	/* Undefined */
+				"\033Page1GB"	/* 1-GB large page support */
 				"\034RDTSCP"	/* RDTSCP */
 				"\035"	/* Undefined */
 				"\036LM"	/* 64 bit long mode */

Modified: stable/7/sys/i386/include/specialreg.h
==============================================================================
--- stable/7/sys/i386/include/specialreg.h	Fri Oct 17 18:19:36 2008	(r183983)
+++ stable/7/sys/i386/include/specialreg.h	Fri Oct 17 19:52:35 2008	(r183984)
@@ -110,6 +110,7 @@
 #define	CPUID_PBE	0x80000000
 
 #define	CPUID2_SSE3	0x00000001
+#define	CPUID2_DTES64	0x00000004
 #define	CPUID2_MON	0x00000008
 #define	CPUID2_DS_CPL	0x00000010
 #define	CPUID2_VMX	0x00000020
@@ -122,6 +123,10 @@
 #define	CPUID2_XTPR	0x00004000
 #define	CPUID2_PDCM	0x00008000
 #define	CPUID2_DCA	0x00040000
+#define	CPUID2_SSE41	0x00080000
+#define	CPUID2_SSE42	0x00100000
+#define	CPUID2_X2APIC	0x00200000
+#define	CPUID2_POPCNT	0x00800000
 
 /*
  * Important bits in the AMD extended cpuid flags
@@ -131,6 +136,7 @@
 #define	AMDID_NX	0x00100000
 #define	AMDID_EXT_MMX	0x00400000
 #define	AMDID_FFXSR	0x01000000
+#define	AMDID_PAGE1GB	0x04000000
 #define	AMDID_RDTSCP	0x08000000
 #define	AMDID_LM	0x20000000
 #define	AMDID_EXT_3DNOW	0x40000000

From owner-svn-src-stable-7@FreeBSD.ORG  Sat Oct 18 04:11:25 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9FC5106568D;
	Sat, 18 Oct 2008 04:11:25 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9776D8FC12;
	Sat, 18 Oct 2008 04:11:25 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9I4BPEl006258;
	Sat, 18 Oct 2008 04:11:25 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9I4BPOS006256;
	Sat, 18 Oct 2008 04:11:25 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200810180411.m9I4BPOS006256@svn.freebsd.org>
From: Weongyo Jeong 
Date: Sat, 18 Oct 2008 04:11:25 +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: r184009 - in stable/7/sys: . dev/usb
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 18 Oct 2008 04:11:25 -0000

Author: weongyo
Date: Sat Oct 18 04:11:25 2008
New Revision: 184009
URL: http://svn.freebsd.org/changeset/base/184009

Log:
  MFC r182783:
    Add ZyXEL G-202
  
    Obtained from:	OpenBSD
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/usb/if_zyd.c
  stable/7/sys/dev/usb/usbdevs

Modified: stable/7/sys/dev/usb/if_zyd.c
==============================================================================
--- stable/7/sys/dev/usb/if_zyd.c	Sat Oct 18 03:57:57 2008	(r184008)
+++ stable/7/sys/dev/usb/if_zyd.c	Sat Oct 18 04:11:25 2008	(r184009)
@@ -119,6 +119,7 @@ static const struct zyd_type {
 	ZYD_ZD1211_DEV(ZYXEL,		AG225H),
 	ZYD_ZD1211_DEV(ZYXEL,		ZYAIRG220),
 	ZYD_ZD1211_DEV(ZYXEL,		G200V2),
+	ZYD_ZD1211_DEV(ZYXEL,		G202),
 
 	ZYD_ZD1211B_DEV(ACCTON,		SMCWUSBG),
 	ZYD_ZD1211B_DEV(ACCTON,		ZD1211B),

Modified: stable/7/sys/dev/usb/usbdevs
==============================================================================
--- stable/7/sys/dev/usb/usbdevs	Sat Oct 18 03:57:57 2008	(r184008)
+++ stable/7/sys/dev/usb/usbdevs	Sat Oct 18 04:11:25 2008	(r184009)
@@ -2391,5 +2391,6 @@ product ZYXEL 980N		0x2011	Scorpion-980N
 product ZYXEL ZYAIRG220		0x3401	ZyAIR G-220
 product ZYXEL G200V2		0x3407	G-200 v2
 product ZYXEL AG225H		0x3409	AG-225H
+product ZYXEL G202		0x3410	G-202
 product ZYXEL M202		0x340a	M-202
 product ZYXEL G220V2		0x340f	G-220 v2

From owner-svn-src-stable-7@FreeBSD.ORG  Sat Oct 18 04:13:52 2008
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 01AD41065687;
	Sat, 18 Oct 2008 04:13:52 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E3DFE8FC17;
	Sat, 18 Oct 2008 04:13:51 +0000 (UTC)
	(envelope-from weongyo@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9I4DpsG006349;
	Sat, 18 Oct 2008 04:13:51 GMT (envelope-from weongyo@svn.freebsd.org)
Received: (from weongyo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9I4DpVM006348;
	Sat, 18 Oct 2008 04:13:51 GMT (envelope-from weongyo@svn.freebsd.org)
Message-Id: <200810180413.m9I4DpVM006348@svn.freebsd.org>
From: Weongyo Jeong 
Date: Sat, 18 Oct 2008 04:13:51 +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: r184010 - in stable/7/sys: . dev/usb
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 18 Oct 2008 04:13:52 -0000

Author: weongyo
Date: Sat Oct 18 04:13:51 2008
New Revision: 184010
URL: http://svn.freebsd.org/changeset/base/184010

Log:
  MFC r182799:
    Sort products numerically.
  
  Approved by:	re (gnn)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/dev/usb/usbdevs

Modified: stable/7/sys/dev/usb/usbdevs
==============================================================================
--- stable/7/sys/dev/usb/usbdevs	Sat Oct 18 04:11:25 2008	(r184009)
+++ stable/7/sys/dev/usb/usbdevs	Sat Oct 18 04:13:51 2008	(r184010)
@@ -2391,6 +2391,6 @@ product ZYXEL 980N		0x2011	Scorpion-980N
 product ZYXEL ZYAIRG220		0x3401	ZyAIR G-220
 product ZYXEL G200V2		0x3407	G-200 v2
 product ZYXEL AG225H		0x3409	AG-225H
-product ZYXEL G202		0x3410	G-202
 product ZYXEL M202		0x340a	M-202
 product ZYXEL G220V2		0x340f	G-220 v2
+product ZYXEL G202		0x3410	G-202