From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 10:53:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CC85106566B; Sun, 29 Nov 2009 10:53:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 826048FC13; Sun, 29 Nov 2009 10:53:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATArYxE086241; Sun, 29 Nov 2009 10:53:34 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATArYrV086240; Sun, 29 Nov 2009 10:53:34 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911291053.nATArYrV086240@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 10:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199899 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 10:53:34 -0000 Author: bz Date: Sun Nov 29 10:53:34 2009 New Revision: 199899 URL: http://svn.freebsd.org/changeset/base/199899 Log: Only add the IPcomp header if crypto reported success and we have a lower payload size. Before we had always added the header, no matter if we actually send out compressed data or not. With this, after the opencrypto/deflate changes, IPcomp starts to work apart from edge cases. Leave it disabled by default until those are fixed as well. PR: kern/123587 MFC after: 5 days Modified: head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sat Nov 28 23:50:48 2009 (r199898) +++ head/sys/netipsec/xform_ipcomp.c Sun Nov 29 10:53:34 2009 (r199899) @@ -330,13 +330,10 @@ ipcomp_output( { struct secasvar *sav; struct comp_algo *ipcompx; - int error, ralen, hlen, maxpacketsize, roff; - u_int8_t prot; + int error, ralen, maxpacketsize; struct cryptodesc *crdc; struct cryptop *crp; struct tdb_crypto *tc; - struct mbuf *mo; - struct ipcomp *ipcomp; sav = isr->sav; IPSEC_ASSERT(sav != NULL, ("null SA")); @@ -355,8 +352,6 @@ ipcomp_output( } ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */ - hlen = IPCOMP_HLENGTH; - V_ipcompstat.ipcomps_output++; /* Check for maximum packet size violations. */ @@ -381,13 +376,13 @@ ipcomp_output( error = EPFNOSUPPORT; goto bad; } - if (skip + hlen + ralen > maxpacketsize) { + if (ralen + skip + IPCOMP_HLENGTH > maxpacketsize) { V_ipcompstat.ipcomps_toobig++; DPRINTF(("%s: packet in IPCA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi), - skip + hlen + ralen, maxpacketsize)); + ralen + skip + IPCOMP_HLENGTH, maxpacketsize)); error = EMSGSIZE; goto bad; } @@ -405,40 +400,7 @@ ipcomp_output( goto bad; } - /* Inject IPCOMP header */ - mo = m_makespace(m, skip, hlen, &roff); - if (mo == NULL) { - V_ipcompstat.ipcomps_wrap++; - DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); - error = ENOBUFS; - goto bad; - } - ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff); - - /* Initialize the IPCOMP header */ - /* XXX alignment always correct? */ - switch (sav->sah->saidx.dst.sa.sa_family) { -#ifdef INET - case AF_INET: - ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt; - break; -#endif - } - ipcomp->comp_flags = 0; - ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi)); - - /* Fix Next Protocol in IPv4/IPv6 header */ - prot = IPPROTO_IPCOMP; - m_copyback(m, protoff, sizeof(u_int8_t), (u_char *) &prot); - - /* Ok now, we can pass to the crypto processing */ + /* Ok now, we can pass to the crypto processing. */ /* Get crypto descriptors */ crp = crypto_getreq(1); @@ -451,10 +413,10 @@ ipcomp_output( crdc = crp->crp_desc; /* Compression descriptor */ - crdc->crd_skip = skip + hlen; - crdc->crd_len = m->m_pkthdr.len - (skip + hlen); + crdc->crd_skip = skip; + crdc->crd_len = ralen; crdc->crd_flags = CRD_F_COMP; - crdc->crd_inject = skip + hlen; + crdc->crd_inject = skip; /* Compression operation */ crdc->crd_alg = ipcompx->type; @@ -474,7 +436,8 @@ ipcomp_output( tc->tc_spi = sav->spi; tc->tc_dst = sav->sah->saidx.dst; tc->tc_proto = sav->sah->saidx.proto; - tc->tc_skip = skip + hlen; + tc->tc_protoff = protoff; + tc->tc_skip = skip; /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ @@ -501,13 +464,12 @@ ipcomp_output_cb(struct cryptop *crp) struct ipsecrequest *isr; struct secasvar *sav; struct mbuf *m; - int error, skip, rlen; + int error, skip; tc = (struct tdb_crypto *) crp->crp_opaque; IPSEC_ASSERT(tc != NULL, ("null opaque data area!")); m = (struct mbuf *) crp->crp_buf; skip = tc->tc_skip; - rlen = crp->crp_ilen - skip; isr = tc->tc_isr; IPSECREQUEST_LOCK(isr); @@ -529,8 +491,7 @@ ipcomp_output_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); - error = crypto_dispatch(crp); - return error; + return crypto_dispatch(crp); } V_ipcompstat.ipcomps_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); @@ -546,7 +507,46 @@ ipcomp_output_cb(struct cryptop *crp) } V_ipcompstat.ipcomps_hist[sav->alg_comp]++; - if (rlen > crp->crp_olen) { + if (crp->crp_ilen - skip > crp->crp_olen) { + struct mbuf *mo; + struct ipcomp *ipcomp; + int roff; + uint8_t prot; + + /* Compression helped, inject IPCOMP header. */ + mo = m_makespace(m, skip, IPCOMP_HLENGTH, &roff); + if (mo == NULL) { + V_ipcompstat.ipcomps_wrap++; + DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", + __func__, ipsec_address(&sav->sah->saidx.dst), + (u_long) ntohl(sav->spi))); + error = ENOBUFS; + goto bad; + } + ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff); + + /* Initialize the IPCOMP header */ + /* XXX alignment always correct? */ + switch (sav->sah->saidx.dst.sa.sa_family) { +#ifdef INET + case AF_INET: + ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt; + break; +#endif + } + ipcomp->comp_flags = 0; + ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi)); + + /* Fix Next Protocol in IPv4/IPv6 header */ + prot = IPPROTO_IPCOMP; + m_copyback(m, tc->tc_protoff, sizeof(u_int8_t), + (u_char *)&prot); + /* Adjust the length in the IP header */ switch (sav->sah->saidx.dst.sa.sa_family) { #ifdef INET @@ -573,6 +573,8 @@ ipcomp_output_cb(struct cryptop *crp) } else { /* compression was useless, we have lost time */ /* XXX add statistic */ + /* XXX remember state to not compress the next couple + * of packets, RFC 3173, 2.2. Non-Expansion Policy */ } /* Release the crypto descriptor */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 17:27:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A67F106566C; Sun, 29 Nov 2009 17:27:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 664128FC16; Sun, 29 Nov 2009 17:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATHRxha002338; Sun, 29 Nov 2009 17:27:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATHRwIC002328; Sun, 29 Nov 2009 17:27:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911291727.nATHRwIC002328@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 17:27: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: r199901 - in stable/7: . sys/compat/pecoff sys/conf sys/i386/conf sys/i386/include sys/modules sys/modules/pecoff sys/pc98/conf sys/pc98/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 17:27:59 -0000 Author: bz Date: Sun Nov 29 17:27:58 2009 New Revision: 199901 URL: http://svn.freebsd.org/changeset/base/199901 Log: MFC r179785, r180496: Remove obselete PECOFF image activator support. Discussed with: secteam, kib Approved by: re (kensmith) Deleted: stable/7/sys/compat/pecoff/ stable/7/sys/i386/include/pecoff_machdep.h stable/7/sys/modules/pecoff/ stable/7/sys/pc98/include/pecoff_machdep.h Modified: stable/7/ObsoleteFiles.inc (contents, props changed) stable/7/UPDATING stable/7/sys/conf/files.i386 stable/7/sys/conf/files.pc98 stable/7/sys/conf/options.i386 stable/7/sys/conf/options.pc98 stable/7/sys/i386/conf/NOTES stable/7/sys/modules/Makefile stable/7/sys/pc98/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/ObsoleteFiles.inc ============================================================================== --- stable/7/ObsoleteFiles.inc Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/ObsoleteFiles.inc Sun Nov 29 17:27:58 2009 (r199901) @@ -14,6 +14,10 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20091129: pecoff image activator removed +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/pecoff_machdep.h +.endif # 20090203: adding_user.8 moved to adding_user.7 OLD_FILES+=usr/share/man/man8/adding_user.8.gz # 20080407: pkg_sign has been removed Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/UPDATING Sun Nov 29 17:27:58 2009 (r199901) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20091129: + PECOFF image activator support removed. + 20090831: The newly imported zic(8) produces a new format in the output. Please run tzsetup(8) to install the newly created Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/conf/files.i386 Sun Nov 29 17:27:58 2009 (r199901) @@ -98,7 +98,6 @@ compat/ndis/subr_ntoskrnl.c optional ndi compat/ndis/subr_pe.c optional ndisapi pci compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx32_wrap.S optional ndisapi pci -compat/pecoff/imgact_pecoff.c optional pecoff_support compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 Modified: stable/7/sys/conf/files.pc98 ============================================================================== --- stable/7/sys/conf/files.pc98 Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/conf/files.pc98 Sun Nov 29 17:27:58 2009 (r199901) @@ -60,7 +60,6 @@ compat/linux/linux_sysctl.c optional com compat/linux/linux_time.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux -compat/pecoff/imgact_pecoff.c optional pecoff_support compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 Modified: stable/7/sys/conf/options.i386 ============================================================================== --- stable/7/sys/conf/options.i386 Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/conf/options.i386 Sun Nov 29 17:27:58 2009 (r199901) @@ -27,8 +27,6 @@ DEBUG_SVR4 opt_svr4.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h NDISAPI opt_dontuse.h -PECOFF_DEBUG opt_pecoff.h -PECOFF_SUPPORT opt_dontuse.h # Change KVM size. Changes things all over the kernel. KVA_PAGES opt_global.h Modified: stable/7/sys/conf/options.pc98 ============================================================================== --- stable/7/sys/conf/options.pc98 Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/conf/options.pc98 Sun Nov 29 17:27:58 2009 (r199901) @@ -25,8 +25,6 @@ COMPAT_SVR4 opt_dontuse.h DEBUG_SVR4 opt_svr4.h LINPROCFS opt_dontuse.h LINSYSFS opt_dontuse.h -PECOFF_DEBUG opt_pecoff.h -PECOFF_SUPPORT opt_dontuse.h # Change KVM size. Changes things all over the kernel. KVA_PAGES opt_global.h Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/i386/conf/NOTES Sun Nov 29 17:27:58 2009 (r199901) @@ -1221,10 +1221,6 @@ options KSTACK_PAGES=3 options FB_INSTALL_CDEV # install a CDEV entry in /dev -# PECOFF module (Win32 Execution Format) -options PECOFF_SUPPORT -options PECOFF_DEBUG - options I4B_SMP_WORKAROUND options I586_PMC_GUPROF=0x70000 options KBDIO_DEBUG=2 Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/modules/Makefile Sun Nov 29 17:27:58 2009 (r199901) @@ -215,7 +215,6 @@ SUBDIR= ${_3dfx} \ ${_pccard} \ ${_pcfclock} \ pcn \ - ${_pecoff} \ ${_pf} \ ${_pflog} \ plip \ @@ -433,7 +432,6 @@ _opensolaris= opensolaris .endif _pccard= pccard _pcfclock= pcfclock -_pecoff= pecoff _pst= pst _ray= ray _rdma= rdma @@ -588,7 +586,7 @@ _zfs= zfs .if ${MACHINE_ARCH} == "ia64" # Modules not enabled on ia64 (as compared to i386) include: # aac acpi aout apm atspeaker drm ibcs2 linprocfs linux ncv -# nsp oltr pecoff s3 sbni stg vesa +# nsp oltr s3 sbni stg vesa # acpi is not enabled because it is broken as a module on ia64 _aic= aic #_ar= ar not 64-bit clean Modified: stable/7/sys/pc98/conf/NOTES ============================================================================== --- stable/7/sys/pc98/conf/NOTES Sun Nov 29 17:25:32 2009 (r199900) +++ stable/7/sys/pc98/conf/NOTES Sun Nov 29 17:27:58 2009 (r199901) @@ -749,10 +749,6 @@ options KSTACK_PAGES=3 options FB_INSTALL_CDEV # install a CDEV entry in /dev -# PECOFF module (Win32 Execution Format) -options PECOFF_SUPPORT -options PECOFF_DEBUG - options I4B_SMP_WORKAROUND options I586_PMC_GUPROF=0x70000 options KBDIO_DEBUG=2 From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 17:35:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE71B106568D; Sun, 29 Nov 2009 17:35:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A4658FC08; Sun, 29 Nov 2009 17:35:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATHZVJS002545; Sun, 29 Nov 2009 17:35:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATHZVuk002535; Sun, 29 Nov 2009 17:35:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911291735.nATHZVuk002535@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 17:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199902 - in stable/6: . sys/compat/pecoff sys/conf sys/i386/conf sys/i386/include sys/modules sys/modules/pecoff sys/pc98/conf sys/pc98/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 17:35:31 -0000 Author: bz Date: Sun Nov 29 17:35:31 2009 New Revision: 199902 URL: http://svn.freebsd.org/changeset/base/199902 Log: MFC r179785, r180496: Remove obselete PECOFF image activator support. Discussed with: secteam, kib Approved by: re (kensmith) Deleted: stable/6/sys/compat/pecoff/ stable/6/sys/i386/include/pecoff_machdep.h stable/6/sys/modules/pecoff/ stable/6/sys/pc98/include/pecoff_machdep.h Modified: stable/6/ObsoleteFiles.inc (contents, props changed) stable/6/UPDATING stable/6/sys/conf/files.i386 stable/6/sys/conf/files.pc98 stable/6/sys/conf/options.i386 stable/6/sys/conf/options.pc98 stable/6/sys/i386/conf/NOTES stable/6/sys/modules/Makefile stable/6/sys/pc98/conf/NOTES Directory Properties: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/ObsoleteFiles.inc ============================================================================== --- stable/6/ObsoleteFiles.inc Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/ObsoleteFiles.inc Sun Nov 29 17:35:31 2009 (r199902) @@ -14,6 +14,10 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20091129: pecoff image activator removed +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/pecoff_machdep.h +.endif # 20090203: adding_user.8 moved to adding_user.7 OLD_FILES+=usr/share/man/man8/adding_user.8.gz # 20080407: pkg_sign has been removed Modified: stable/6/UPDATING ============================================================================== --- stable/6/UPDATING Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/UPDATING Sun Nov 29 17:35:31 2009 (r199902) @@ -8,6 +8,9 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20091129: + PECOFF image activator support removed. + 20081128: FreeBSD 6.4-RELEASE Modified: stable/6/sys/conf/files.i386 ============================================================================== --- stable/6/sys/conf/files.i386 Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/conf/files.i386 Sun Nov 29 17:35:31 2009 (r199902) @@ -109,7 +109,6 @@ compat/ndis/subr_ntoskrnl.c optional ndi compat/ndis/subr_pe.c optional ndisapi pci compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx32_wrap.S optional ndisapi pci -compat/pecoff/imgact_pecoff.c optional pecoff_support compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 Modified: stable/6/sys/conf/files.pc98 ============================================================================== --- stable/6/sys/conf/files.pc98 Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/conf/files.pc98 Sun Nov 29 17:35:31 2009 (r199902) @@ -66,7 +66,6 @@ compat/linux/linux_sysctl.c optional com compat/linux/linux_time.c optional compat_linux compat/linux/linux_uid16.c optional compat_linux compat/linux/linux_util.c optional compat_linux -compat/pecoff/imgact_pecoff.c optional pecoff_support compat/svr4/imgact_svr4.c optional compat_svr4 compat/svr4/svr4_fcntl.c optional compat_svr4 compat/svr4/svr4_filio.c optional compat_svr4 Modified: stable/6/sys/conf/options.i386 ============================================================================== --- stable/6/sys/conf/options.i386 Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/conf/options.i386 Sun Nov 29 17:35:31 2009 (r199902) @@ -25,8 +25,6 @@ COMPAT_LINUX opt_dontuse.h COMPAT_SVR4 opt_dontuse.h DEBUG_SVR4 opt_svr4.h NDISAPI opt_dontuse.h -PECOFF_DEBUG opt_pecoff.h -PECOFF_SUPPORT opt_dontuse.h # Change KVM size. Changes things all over the kernel. KVA_PAGES opt_global.h Modified: stable/6/sys/conf/options.pc98 ============================================================================== --- stable/6/sys/conf/options.pc98 Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/conf/options.pc98 Sun Nov 29 17:35:31 2009 (r199902) @@ -23,8 +23,6 @@ IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h COMPAT_SVR4 opt_dontuse.h DEBUG_SVR4 opt_svr4.h -PECOFF_DEBUG opt_pecoff.h -PECOFF_SUPPORT opt_dontuse.h # Change KVM size. Changes things all over the kernel. KVA_PAGES opt_global.h Modified: stable/6/sys/i386/conf/NOTES ============================================================================== --- stable/6/sys/i386/conf/NOTES Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/i386/conf/NOTES Sun Nov 29 17:35:31 2009 (r199902) @@ -1117,10 +1117,6 @@ options KSTACK_PAGES=3 options FB_INSTALL_CDEV # install a CDEV entry in /dev -# PECOFF module (Win32 Execution Format) -options PECOFF_SUPPORT -options PECOFF_DEBUG - options I4B_SMP_WORKAROUND options I586_PMC_GUPROF=0x70000 options KBDIO_DEBUG=2 Modified: stable/6/sys/modules/Makefile ============================================================================== --- stable/6/sys/modules/Makefile Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/modules/Makefile Sun Nov 29 17:35:31 2009 (r199902) @@ -199,7 +199,6 @@ SUBDIR= ${_3dfx} \ ${_pccard} \ ${_pcfclock} \ pcn \ - ${_pecoff} \ ${_pf} \ ${_pflog} \ plip \ @@ -386,7 +385,6 @@ _nwfs= nwfs _oltr= oltr _pccard= pccard _pcfclock= pcfclock -_pecoff= pecoff _pst= pst _puc= puc _ray= ray @@ -510,7 +508,7 @@ _twa= twa .if ${MACHINE_ARCH} == "ia64" # Modules not enabled on ia64 (as compared to i386) include: # aac acpi aout apm atspeaker drm ibcs2 linprocfs linux ncv -# nsp oltr pecoff s3 sbni stg vesa +# nsp oltr s3 sbni stg vesa # acpi is not enabled because it is broken as a module on ia64 _aic= aic #_ar= ar not 64-bit clean Modified: stable/6/sys/pc98/conf/NOTES ============================================================================== --- stable/6/sys/pc98/conf/NOTES Sun Nov 29 17:27:58 2009 (r199901) +++ stable/6/sys/pc98/conf/NOTES Sun Nov 29 17:35:31 2009 (r199902) @@ -709,10 +709,6 @@ options KSTACK_PAGES=3 options FB_INSTALL_CDEV # install a CDEV entry in /dev -# PECOFF module (Win32 Execution Format) -options PECOFF_SUPPORT -options PECOFF_DEBUG - options I4B_SMP_WORKAROUND options I586_PMC_GUPROF=0x70000 options KBDIO_DEBUG=2 From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 17:46:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0401065670; Sun, 29 Nov 2009 17:46:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 893CA8FC1E; Sun, 29 Nov 2009 17:46:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATHkekj002880; Sun, 29 Nov 2009 17:46:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATHkeS1002878; Sun, 29 Nov 2009 17:46:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911291746.nATHkeS1002878@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 17:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199904 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 17:46:42 -0000 Author: bz Date: Sun Nov 29 17:46:40 2009 New Revision: 199904 URL: http://svn.freebsd.org/changeset/base/199904 Log: Add SDT iter probes forgotten in r199885. MFC after: 5 days Modified: head/sys/opencrypto/deflate.c Modified: head/sys/opencrypto/deflate.c ============================================================================== --- head/sys/opencrypto/deflate.c Sun Nov 29 17:44:44 2009 (r199903) +++ head/sys/opencrypto/deflate.c Sun Nov 29 17:46:40 2009 (r199904) @@ -148,6 +148,12 @@ deflate_global(data, size, decomp, out) zbuf.state->dummy, zbuf.total_out); goto bad; } + SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) { /* Done. */ break; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 17:47:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80CD4106568D; Sun, 29 Nov 2009 17:47:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701D18FC12; Sun, 29 Nov 2009 17:47:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATHln2K002934; Sun, 29 Nov 2009 17:47:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATHln5v002932; Sun, 29 Nov 2009 17:47:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911291747.nATHln5v002932@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 17:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199905 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 17:47:49 -0000 Author: bz Date: Sun Nov 29 17:47:49 2009 New Revision: 199905 URL: http://svn.freebsd.org/changeset/base/199905 Log: Assimilate very similar input and output code paths (no real functional change). MFC after: 5 days Modified: head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sun Nov 29 17:46:40 2009 (r199904) +++ head/sys/netipsec/xform_ipcomp.c Sun Nov 29 17:47:49 2009 (r199905) @@ -249,10 +249,8 @@ ipcomp_input_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { KEY_FREESAV(&sav); - error = crypto_dispatch(crp); - return error; + return crypto_dispatch(crp); } - V_ipcompstat.ipcomps_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; @@ -484,7 +482,7 @@ ipcomp_output_cb(struct cryptop *crp) /* Check for crypto errors */ if (crp->crp_etype) { - /* Reset session ID */ + /* Reset the session ID */ if (sav->tdb_cryptoid != 0) sav->tdb_cryptoid = crp->crp_sid; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 17:53:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B103E106566B; Sun, 29 Nov 2009 17:53:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A02758FC16; Sun, 29 Nov 2009 17:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATHrv0v003073; Sun, 29 Nov 2009 17:53:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATHrvcN003071; Sun, 29 Nov 2009 17:53:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911291753.nATHrvcN003071@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 17:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199906 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 17:53:57 -0000 Author: bz Date: Sun Nov 29 17:53:57 2009 New Revision: 199906 URL: http://svn.freebsd.org/changeset/base/199906 Log: In case the compression result is the same size as the orignal version, the compression was useless as well. Make sure to not update the data and return, else we would waste resources when decompressing. This also avoids the copyback() changing data other consumers like xform_ipcomp.c would have ignored because of no win and sent out without noting that compression was used, resulting in invalid packets at the receiver. MFC after: 5 days Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Sun Nov 29 17:47:49 2009 (r199905) +++ head/sys/opencrypto/cryptosoft.c Sun Nov 29 17:53:57 2009 (r199906) @@ -552,7 +552,7 @@ swcr_compdec(struct cryptodesc *crd, str sw->sw_size = result; /* Check the compressed size when doing compression */ if (crd->crd_flags & CRD_F_COMP) { - if (result > crd->crd_len) { + if (result >= crd->crd_len) { /* Compression was useless, we lost time */ free(out, M_CRYPTO_DATA); return 0; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 18:03:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E3C91065694; Sun, 29 Nov 2009 18:03:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CEBE8FC12; Sun, 29 Nov 2009 18:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATI3ngV003335; Sun, 29 Nov 2009 18:03:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATI3nN2003333; Sun, 29 Nov 2009 18:03:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200911291803.nATI3nN2003333@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 29 Nov 2009 18:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199907 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 18:03:50 -0000 Author: kib Date: Sun Nov 29 18:03:49 2009 New Revision: 199907 URL: http://svn.freebsd.org/changeset/base/199907 Log: MFC r199828: Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Sun Nov 29 17:53:57 2009 (r199906) +++ stable/8/libexec/rtld-elf/rtld.c Sun Nov 29 18:03:49 2009 (r199907) @@ -898,7 +898,7 @@ digest_dynamic(Obj_Entry *obj, int early #endif case DT_FLAGS: - if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) + if ((dynp->d_un.d_val & DF_ORIGIN) && trust) obj->z_origin = true; if (dynp->d_un.d_val & DF_SYMBOLIC) obj->symbolic = true; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 18:05:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50913106566B; Sun, 29 Nov 2009 18:05:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2768FC14; Sun, 29 Nov 2009 18:05:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 701E541C74D; Sun, 29 Nov 2009 19:05:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id jbizGoJMzWCy; Sun, 29 Nov 2009 19:05:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id AED2641C70C; Sun, 29 Nov 2009 19:05:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 235134448EC; Sun, 29 Nov 2009 18:00:56 +0000 (UTC) Date: Sun, 29 Nov 2009 18:00:56 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <200911291053.nATArYrV086240@svn.freebsd.org> Message-ID: <20091129175432.K37440@maildrop.int.zabbadoz.net> References: <200911291053.nATArYrV086240@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r199899 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 18:05:07 -0000 On Sun, 29 Nov 2009, Bjoern A. Zeeb wrote: > With this, after the opencrypto/deflate changes, IPcomp starts to work > apart from edge cases. Leave it disabled by default until those are > fixed as well. Note that after r199906 (apart from stats) IPcomp is working as good as net/zlib.? is. There are occational cases where we get a crypto error. An update to the latest zlib.? fixes this. I do have a patch but ideally we would want to just use an unchanged libz (we have 2-3 copies in sys/), a version without the classic PPP changes. For this to happen, ng_deflate will need to be "fixed"; it looks like it could need some zlib improvements for stability anyway from reading the code. Anyone who uses it and can test ng_deflate is welcome to contact me. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 18:29:20 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BFBC106568F; Sun, 29 Nov 2009 18:29:20 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (l95h.icis.pcz.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id 171A58FC16; Sun, 29 Nov 2009 18:29:19 +0000 (UTC) Received: from freebsd.czest.pl (l95h.icis.pcz.pl [212.87.224.105]) by freebsd.czest.pl (8.14.2/8.14.2) with ESMTP id nATII2ls046735; Sun, 29 Nov 2009 19:18:02 +0100 (CET) (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.2/8.14.2/Submit) id nATII2io046734; Sun, 29 Nov 2009 19:18:02 +0100 (CET) (envelope-from wkoszek) Date: Sun, 29 Nov 2009 19:18:02 +0100 From: "Wojciech A. Koszek" To: "Bjoern A. Zeeb" Message-ID: <20091129181802.GC98022@FreeBSD.org> Mail-Followup-To: "Bjoern A. Zeeb" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-7@FreeBSD.org References: <200911291727.nATHRwIC002328@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <200911291727.nATHRwIC002328@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-3.0 (freebsd.czest.pl [212.87.224.105]); Sun, 29 Nov 2009 19:18:02 +0100 (CET) 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: r199901 - in stable/7: . sys/compat/pecoff sys/conf sys/i386/conf sys/i386/include sys/modules sys/modules/pecoff sys/pc98/conf sys/pc98/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 18:29:20 -0000 On Sun, Nov 29, 2009 at 05:27:58PM +0000, Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Nov 29 17:27:58 2009 > New Revision: 199901 > URL: http://svn.freebsd.org/changeset/base/199901 > > Log: > MFC r179785, r180496: > > Remove obselete PECOFF image activator support. > > Discussed with: secteam, kib > Approved by: re (kensmith) > > Deleted: > stable/7/sys/compat/pecoff/ > stable/7/sys/i386/include/pecoff_machdep.h > stable/7/sys/modules/pecoff/ > stable/7/sys/pc98/include/pecoff_machdep.h > Modified: > stable/7/ObsoleteFiles.inc (contents, props changed) > stable/7/UPDATING > stable/7/sys/conf/files.i386 > stable/7/sys/conf/files.pc98 > stable/7/sys/conf/options.i386 > stable/7/sys/conf/options.pc98 > stable/7/sys/i386/conf/NOTES > stable/7/sys/modules/Makefile > stable/7/sys/pc98/conf/NOTES > Directory Properties: > stable/7/sys/ (props changed) > stable/7/sys/contrib/pf/ (props changed) Thank you. -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/~wkoszek/ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 18:51:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B46E81065679; Sun, 29 Nov 2009 18:51:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88C798FC25; Sun, 29 Nov 2009 18:51:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATIpw36004487; Sun, 29 Nov 2009 18:51:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATIpw5U004485; Sun, 29 Nov 2009 18:51:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291851.nATIpw5U004485@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 18:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199908 - stable/8/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 18:51:58 -0000 Author: yongari Date: Sun Nov 29 18:51:58 2009 New Revision: 199908 URL: http://svn.freebsd.org/changeset/base/199908 Log: MFC r197585. Remove unnecessary device reinitialization. Modified: stable/8/sys/dev/jme/if_jme.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Sun Nov 29 18:03:49 2009 (r199907) +++ stable/8/sys/dev/jme/if_jme.c Sun Nov 29 18:51:58 2009 (r199908) @@ -306,6 +306,10 @@ jme_mediastatus(struct ifnet *ifp, struc sc = ifp->if_softc; JME_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + JME_UNLOCK(sc); + return; + } mii = device_get_softc(sc->jme_miibus); mii_pollstat(mii); @@ -1585,8 +1589,10 @@ jme_resume(device_t dev) pmc + PCIR_POWER_STATUS, pmstat, 2); } ifp = sc->jme_ifp; - if ((ifp->if_flags & IFF_UP) != 0) + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); + } JME_UNLOCK(sc); @@ -1861,6 +1867,7 @@ jme_watchdog(struct jme_softc *sc) if ((sc->jme_flags & JME_FLAG_LINK) == 0) { if_printf(sc->jme_ifp, "watchdog timeout (missed link)\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); return; } @@ -1875,6 +1882,7 @@ jme_watchdog(struct jme_softc *sc) if_printf(sc->jme_ifp, "watchdog timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->jme_tq, &sc->jme_tx_task); @@ -1917,8 +1925,10 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, VLAN_CAPABILITIES(ifp); } ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); + } JME_UNLOCK(sc); } break; @@ -2642,6 +2652,8 @@ jme_init_locked(struct jme_softc *sc) ifp = sc->jme_ifp; mii = device_get_softc(sc->jme_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; /* * Cancel any pending I/O. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 18:54:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B0601065670; Sun, 29 Nov 2009 18:54:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 501DE8FC20; Sun, 29 Nov 2009 18:54:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATIsLVq004576; Sun, 29 Nov 2009 18:54:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATIsL46004574; Sun, 29 Nov 2009 18:54:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291854.nATIsL46004574@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 18:54: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: r199909 - stable/7/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 18:54:21 -0000 Author: yongari Date: Sun Nov 29 18:54:21 2009 New Revision: 199909 URL: http://svn.freebsd.org/changeset/base/199909 Log: MFC r197585. Remove unnecessary device reinitialization. Modified: stable/7/sys/dev/jme/if_jme.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Sun Nov 29 18:51:58 2009 (r199908) +++ stable/7/sys/dev/jme/if_jme.c Sun Nov 29 18:54:21 2009 (r199909) @@ -306,6 +306,10 @@ jme_mediastatus(struct ifnet *ifp, struc sc = ifp->if_softc; JME_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + JME_UNLOCK(sc); + return; + } mii = device_get_softc(sc->jme_miibus); mii_pollstat(mii); @@ -1585,8 +1589,10 @@ jme_resume(device_t dev) pmc + PCIR_POWER_STATUS, pmstat, 2); } ifp = sc->jme_ifp; - if ((ifp->if_flags & IFF_UP) != 0) + if ((ifp->if_flags & IFF_UP) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); + } JME_UNLOCK(sc); @@ -1861,6 +1867,7 @@ jme_watchdog(struct jme_softc *sc) if ((sc->jme_flags & JME_FLAG_LINK) == 0) { if_printf(sc->jme_ifp, "watchdog timeout (missed link)\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); return; } @@ -1875,6 +1882,7 @@ jme_watchdog(struct jme_softc *sc) if_printf(sc->jme_ifp, "watchdog timeout\n"); ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->jme_tq, &sc->jme_tx_task); @@ -1917,8 +1925,10 @@ jme_ioctl(struct ifnet *ifp, u_long cmd, VLAN_CAPABILITIES(ifp); } ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; jme_init_locked(sc); + } JME_UNLOCK(sc); } break; @@ -2642,6 +2652,8 @@ jme_init_locked(struct jme_softc *sc) ifp = sc->jme_ifp; mii = device_get_softc(sc->jme_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; /* * Cancel any pending I/O. */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 18:59:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66C2106568F; Sun, 29 Nov 2009 18:59:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A56E88FC20; Sun, 29 Nov 2009 18:59:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATIxh5o004726; Sun, 29 Nov 2009 18:59:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATIxh0d004724; Sun, 29 Nov 2009 18:59:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291859.nATIxh0d004724@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 18:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199910 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 18:59:43 -0000 Author: yongari Date: Sun Nov 29 18:59:43 2009 New Revision: 199910 URL: http://svn.freebsd.org/changeset/base/199910 Log: MFC 197587. Don't encode model id twice. Reported by: Kristof Provost sigsegv dot be> Modified: stable/8/sys/dev/mii/e1000phy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Nov 29 18:54:21 2009 (r199909) +++ stable/8/sys/dev/mii/e1000phy.c Sun Nov 29 18:59:43 2009 (r199910) @@ -248,7 +248,7 @@ e1000phy_reset(struct mii_softc *sc) } } - switch (MII_MODEL(esc->mii_model)) { + switch (esc->mii_model) { case MII_MODEL_MARVELL_E3082: case MII_MODEL_MARVELL_E1112: case MII_MODEL_MARVELL_E1118: From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:01:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90212106566C; Sun, 29 Nov 2009 19:01:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBDC8FC13; Sun, 29 Nov 2009 19:01:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJ1MC6004834; Sun, 29 Nov 2009 19:01:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJ1M4d004832; Sun, 29 Nov 2009 19:01:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291901.nATJ1M4d004832@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:01:22 +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: r199911 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:01:22 -0000 Author: yongari Date: Sun Nov 29 19:01:21 2009 New Revision: 199911 URL: http://svn.freebsd.org/changeset/base/199911 Log: MFC 197587. Don't encode model id twice. Reported by: Kristof Provost sigsegv dot be> Modified: stable/7/sys/dev/mii/e1000phy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Sun Nov 29 18:59:43 2009 (r199910) +++ stable/7/sys/dev/mii/e1000phy.c Sun Nov 29 19:01:21 2009 (r199911) @@ -247,7 +247,7 @@ e1000phy_reset(struct mii_softc *sc) } } - switch (MII_MODEL(esc->mii_model)) { + switch (esc->mii_model) { case MII_MODEL_MARVELL_E3082: case MII_MODEL_MARVELL_E1112: case MII_MODEL_MARVELL_E1118: From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:03:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D82AD106566C; Sun, 29 Nov 2009 19:03:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C76F68FC12; Sun, 29 Nov 2009 19:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJ3KEc004914; Sun, 29 Nov 2009 19:03:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJ3KaG004912; Sun, 29 Nov 2009 19:03:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291903.nATJ3KaG004912@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199912 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:03:21 -0000 Author: yongari Date: Sun Nov 29 19:03:20 2009 New Revision: 199912 URL: http://svn.freebsd.org/changeset/base/199912 Log: MFC 197588. Some fiber PHY(88E1112) does not seem to set resolved speed so always assume we've got IFM_1000_SX. Modified: stable/8/sys/dev/mii/e1000phy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Nov 29 19:01:21 2009 (r199911) +++ stable/8/sys/dev/mii/e1000phy.c Sun Nov 29 19:03:20 2009 (r199912) @@ -485,8 +485,11 @@ e1000phy_status(struct mii_softc *sc) return; } } else { - if (ssr & E1000_SSR_1000MBS) - mii->mii_media_active |= IFM_1000_SX; + /* + * Some fiber PHY(88E1112) does not seem to set resolved + * speed so always assume we've got IFM_1000_SX. + */ + mii->mii_media_active |= IFM_1000_SX; } if (ssr & E1000_SSR_DUPLEX) From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:04:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60A89106566B; Sun, 29 Nov 2009 19:04:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FCF38FC19; Sun, 29 Nov 2009 19:04:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJ4gDh004985; Sun, 29 Nov 2009 19:04:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJ4gXD004983; Sun, 29 Nov 2009 19:04:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291904.nATJ4gXD004983@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:04:42 +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: r199913 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:04:42 -0000 Author: yongari Date: Sun Nov 29 19:04:42 2009 New Revision: 199913 URL: http://svn.freebsd.org/changeset/base/199913 Log: MFC 197588. Some fiber PHY(88E1112) does not seem to set resolved speed so always assume we've got IFM_1000_SX. Modified: stable/7/sys/dev/mii/e1000phy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Sun Nov 29 19:03:20 2009 (r199912) +++ stable/7/sys/dev/mii/e1000phy.c Sun Nov 29 19:04:42 2009 (r199913) @@ -484,8 +484,11 @@ e1000phy_status(struct mii_softc *sc) return; } } else { - if (ssr & E1000_SSR_1000MBS) - mii->mii_media_active |= IFM_1000_SX; + /* + * Some fiber PHY(88E1112) does not seem to set resolved + * speed so always assume we've got IFM_1000_SX. + */ + mii->mii_media_active |= IFM_1000_SX; } if (ssr & E1000_SSR_DUPLEX) From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:06:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA82D1065694; Sun, 29 Nov 2009 19:06:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9B908FC0C; Sun, 29 Nov 2009 19:06:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJ6XiK005064; Sun, 29 Nov 2009 19:06:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJ6XJl005062; Sun, 29 Nov 2009 19:06:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291906.nATJ6XJl005062@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199914 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:06:33 -0000 Author: yongari Date: Sun Nov 29 19:06:33 2009 New Revision: 199914 URL: http://svn.freebsd.org/changeset/base/199914 Log: MFC 197589. Fix MIB statistics clear routine. This should fix alignment errors on sparc64. Reported by: Garrett Damore < gdamore <> opensolaris dot org > Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:04:42 2009 (r199913) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:06:33 2009 (r199914) @@ -4190,7 +4190,7 @@ msk_stats_clear(struct msk_if_softc *sc_ gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); /* Read all MIB Counters with Clear Mode set. */ - for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i++) + for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i += sizeof(uint32_t)) reg = MSK_READ_MIB32(sc_if->msk_port, i); /* Clear MIB Clear Counter Mode. */ gmac &= ~GM_PAR_MIB_CLR; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:07:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22101065672; Sun, 29 Nov 2009 19:07:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D17AB8FC19; Sun, 29 Nov 2009 19:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJ7cCO005145; Sun, 29 Nov 2009 19:07:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJ7cOR005143; Sun, 29 Nov 2009 19:07:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291907.nATJ7cOR005143@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:07: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: r199915 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:07:39 -0000 Author: yongari Date: Sun Nov 29 19:07:38 2009 New Revision: 199915 URL: http://svn.freebsd.org/changeset/base/199915 Log: MFC 197589. Fix MIB statistics clear routine. This should fix alignment errors on sparc64. Reported by: Garrett Damore < gdamore <> opensolaris dot org > Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:06:33 2009 (r199914) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:07:38 2009 (r199915) @@ -4188,7 +4188,7 @@ msk_stats_clear(struct msk_if_softc *sc_ gmac = GMAC_READ_2(sc, sc_if->msk_port, GM_PHY_ADDR); GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); /* Read all MIB Counters with Clear Mode set. */ - for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i++) + for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i += sizeof(uint32_t)) reg = MSK_READ_MIB32(sc_if->msk_port, i); /* Clear MIB Clear Counter Mode. */ gmac &= ~GM_PAR_MIB_CLR; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:11:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB3B0106566B; Sun, 29 Nov 2009 19:11:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 997158FC12; Sun, 29 Nov 2009 19:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJB3J5005265; Sun, 29 Nov 2009 19:11:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJB3k4005260; Sun, 29 Nov 2009 19:11:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291911.nATJB3k4005260@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199916 - in stable/8/sys/dev: mii msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:11:03 -0000 Author: yongari Date: Sun Nov 29 19:11:03 2009 New Revision: 199916 URL: http://svn.freebsd.org/changeset/base/199916 Log: MFC 197590. Add hack to pass controller specific information to phy driver. Unlike most other PHYs there is no easy way to know which media type the PHY supports on Marvell PHYs. MIIF_HAVEFIBER flags is now passed via bus-specific instance variable of a device. While I'm here add 88E1112 specific work around to set SIGDET polarity low. Many thanks "Eugene Perevyazko dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Modified: stable/8/sys/dev/mii/e1000phy.c stable/8/sys/dev/mii/e1000phyreg.h stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/msk/if_mskreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/e1000phy.c ============================================================================== --- stable/8/sys/dev/mii/e1000phy.c Sun Nov 29 19:07:38 2009 (r199915) +++ stable/8/sys/dev/mii/e1000phy.c Sun Nov 29 19:11:03 2009 (r199916) @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include +/* XXX */ +#include +#include #include "miibus_if.h" @@ -68,6 +71,7 @@ static int e1000phy_attach(device_t); struct e1000phy_softc { struct mii_softc mii_sc; int mii_model; + struct msk_mii_data *mmd; }; static device_method_t e1000phy_methods[] = { @@ -130,6 +134,7 @@ e1000phy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; esc = device_get_softc(dev); sc = &esc->mii_sc; @@ -145,6 +150,16 @@ e1000phy_attach(device_t dev) mii->mii_instance++; esc->mii_model = MII_MODEL(ma->mii_id2); + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "msk") == 0) { + /* XXX */ + esc->mmd = device_get_ivars( + device_get_parent(device_get_parent(dev))); + if (esc->mmd != NULL && + (esc->mmd->mii_flags & MIIF_HAVEFIBER) != 0) + sc->mii_flags |= MIIF_HAVEFIBER; + } + switch (esc->mii_model) { case MII_MODEL_MARVELL_E1011: case MII_MODEL_MARVELL_E1112: @@ -199,6 +214,13 @@ e1000phy_reset(struct mii_softc *sc) reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); + if (esc->mmd != NULL && esc->mmd->pmd == 'P') { + /* Set SIGDET polarity low for SFP module. */ + PHY_WRITE(sc, E1000_EADR, 1); + reg = PHY_READ(sc, E1000_SCR); + reg |= E1000_SCR_FIB_SIGDET_POLARITY; + PHY_WRITE(sc, E1000_SCR, reg); + } PHY_WRITE(sc, E1000_EADR, page); } } else { Modified: stable/8/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/8/sys/dev/mii/e1000phyreg.h Sun Nov 29 19:07:38 2009 (r199915) +++ stable/8/sys/dev/mii/e1000phyreg.h Sun Nov 29 19:11:03 2009 (r199916) @@ -248,6 +248,11 @@ #define E1000_SCR_EN_DETECT_MASK 0x0300 +/* 88E1112 page 1 fiber specific control */ +#define E1000_SCR_FIB_TX_DIS 0x0008 +#define E1000_SCR_FIB_SIGDET_POLARITY 0x0200 +#define E1000_SCR_FIB_FORCE_LINK 0x0400 + /* 88E1112 page 2 */ #define E1000_SCR_MODE_MASK 0x0380 #define E1000_SCR_MODE_AUTO 0x0180 Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:07:38 2009 (r199915) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:11:03 2009 (r199916) @@ -1447,6 +1447,7 @@ msk_attach(device_t dev) struct msk_softc *sc; struct msk_if_softc *sc_if; struct ifnet *ifp; + struct msk_mii_data *mmd; int i, port, error; uint8_t eaddr[6]; @@ -1456,7 +1457,8 @@ msk_attach(device_t dev) error = 0; sc_if = device_get_softc(dev); sc = device_get_softc(device_get_parent(dev)); - port = *(int *)device_get_ivars(dev); + mmd = device_get_ivars(dev); + port = mmd->port; sc_if->msk_if_dev = dev; sc_if->msk_port = port; @@ -1602,7 +1604,8 @@ static int mskc_attach(device_t dev) { struct msk_softc *sc; - int error, msic, msir, *port, reg; + struct msk_mii_data *mmd; + int error, msic, msir, reg; sc = device_get_softc(dev); sc->msk_dev = dev; @@ -1671,10 +1674,6 @@ mskc_attach(device_t dev) CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_pmd = CSR_READ_1(sc, B2_PMD_TYP); - if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') - sc->msk_coppertype = 0; - else - sc->msk_coppertype = 1; /* Check number of MACs. */ sc->msk_num_port = 1; if ((CSR_READ_1(sc, B2_Y2_HW_RES) & CFG_DUAL_MAC_MSK) == @@ -1814,15 +1813,18 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - port = malloc(sizeof(int), M_DEVBUF, M_WAITOK); - if (port == NULL) { + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_A\n"); error = ENXIO; goto fail; } - *port = MSK_PORT_A; - device_set_ivars(sc->msk_devs[MSK_PORT_A], port); + mmd->port = MSK_PORT_A; + mmd->pmd = sc->msk_pmd; + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S' || sc->msk_pmd == 'P') + mmd->mii_flags |= MIIF_HAVEFIBER; + device_set_ivars(sc->msk_devs[MSK_PORT_A], mmd); if (sc->msk_num_port > 1) { sc->msk_devs[MSK_PORT_B] = device_add_child(dev, "msk", -1); @@ -1831,15 +1833,18 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - port = malloc(sizeof(int), M_DEVBUF, M_WAITOK); - if (port == NULL) { + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_B\n"); error = ENXIO; goto fail; } - *port = MSK_PORT_B; - device_set_ivars(sc->msk_devs[MSK_PORT_B], port); + mmd->port = MSK_PORT_B; + mmd->pmd = sc->msk_pmd; + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S' || sc->msk_pmd == 'P') + mmd->mii_flags |= MIIF_HAVEFIBER; + device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd); } error = bus_generic_attach(dev); Modified: stable/8/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/8/sys/dev/msk/if_mskreg.h Sun Nov 29 19:07:38 2009 (r199915) +++ stable/8/sys/dev/msk/if_mskreg.h Sun Nov 29 19:11:03 2009 (r199916) @@ -2404,6 +2404,12 @@ struct msk_ring_data { #define MSK_TX_TIMEOUT 5 #define MSK_PUT_WM 10 +struct msk_mii_data { + int port; + uint32_t pmd; + int mii_flags; +}; + /* Forward decl. */ struct msk_if_softc; @@ -2467,7 +2473,6 @@ struct msk_softc { uint8_t msk_num_port; int msk_ramsize; /* amount of SRAM on NIC */ uint32_t msk_pmd; /* physical media type */ - uint32_t msk_coppertype; uint32_t msk_intrmask; uint32_t msk_intrhwemask; uint32_t msk_pflags; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:12:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 056C4106566C; Sun, 29 Nov 2009 19:12:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF4038FC1C; Sun, 29 Nov 2009 19:12:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJCfkx005345; Sun, 29 Nov 2009 19:12:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJCf0n005340; Sun, 29 Nov 2009 19:12:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291912.nATJCf0n005340@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:12:41 +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: r199917 - in stable/7/sys/dev: mii msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:12:42 -0000 Author: yongari Date: Sun Nov 29 19:12:41 2009 New Revision: 199917 URL: http://svn.freebsd.org/changeset/base/199917 Log: MFC 197590. Add hack to pass controller specific information to phy driver. Unlike most other PHYs there is no easy way to know which media type the PHY supports on Marvell PHYs. MIIF_HAVEFIBER flags is now passed via bus-specific instance variable of a device. While I'm here add 88E1112 specific work around to set SIGDET polarity low. Many thanks "Eugene Perevyazko dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Modified: stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/e1000phyreg.h stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Sun Nov 29 19:11:03 2009 (r199916) +++ stable/7/sys/dev/mii/e1000phy.c Sun Nov 29 19:12:41 2009 (r199917) @@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include "miidevs.h" #include +/* XXX */ +#include +#include #include "miibus_if.h" @@ -68,6 +71,7 @@ static int e1000phy_attach(device_t); struct e1000phy_softc { struct mii_softc mii_sc; int mii_model; + struct msk_mii_data *mmd; }; static device_method_t e1000phy_methods[] = { @@ -129,6 +133,7 @@ e1000phy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; esc = device_get_softc(dev); sc = &esc->mii_sc; @@ -144,6 +149,16 @@ e1000phy_attach(device_t dev) mii->mii_instance++; esc->mii_model = MII_MODEL(ma->mii_id2); + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "msk") == 0) { + /* XXX */ + esc->mmd = device_get_ivars( + device_get_parent(device_get_parent(dev))); + if (esc->mmd != NULL && + (esc->mmd->mii_flags & MIIF_HAVEFIBER) != 0) + sc->mii_flags |= MIIF_HAVEFIBER; + } + switch (esc->mii_model) { case MII_MODEL_MARVELL_E1011: case MII_MODEL_MARVELL_E1112: @@ -198,6 +213,13 @@ e1000phy_reset(struct mii_softc *sc) reg &= ~E1000_SCR_MODE_MASK; reg |= E1000_SCR_MODE_1000BX; PHY_WRITE(sc, E1000_SCR, reg); + if (esc->mmd != NULL && esc->mmd->pmd == 'P') { + /* Set SIGDET polarity low for SFP module. */ + PHY_WRITE(sc, E1000_EADR, 1); + reg = PHY_READ(sc, E1000_SCR); + reg |= E1000_SCR_FIB_SIGDET_POLARITY; + PHY_WRITE(sc, E1000_SCR, reg); + } PHY_WRITE(sc, E1000_EADR, page); } } else { Modified: stable/7/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/e1000phyreg.h Sun Nov 29 19:11:03 2009 (r199916) +++ stable/7/sys/dev/mii/e1000phyreg.h Sun Nov 29 19:12:41 2009 (r199917) @@ -248,6 +248,11 @@ #define E1000_SCR_EN_DETECT_MASK 0x0300 +/* 88E1112 page 1 fiber specific control */ +#define E1000_SCR_FIB_TX_DIS 0x0008 +#define E1000_SCR_FIB_SIGDET_POLARITY 0x0200 +#define E1000_SCR_FIB_FORCE_LINK 0x0400 + /* 88E1112 page 2 */ #define E1000_SCR_MODE_MASK 0x0380 #define E1000_SCR_MODE_AUTO 0x0180 Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:11:03 2009 (r199916) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:12:41 2009 (r199917) @@ -1445,6 +1445,7 @@ msk_attach(device_t dev) struct msk_softc *sc; struct msk_if_softc *sc_if; struct ifnet *ifp; + struct msk_mii_data *mmd; int i, port, error; uint8_t eaddr[6]; @@ -1454,7 +1455,8 @@ msk_attach(device_t dev) error = 0; sc_if = device_get_softc(dev); sc = device_get_softc(device_get_parent(dev)); - port = *(int *)device_get_ivars(dev); + mmd = device_get_ivars(dev); + port = mmd->port; sc_if->msk_if_dev = dev; sc_if->msk_port = port; @@ -1600,7 +1602,8 @@ static int mskc_attach(device_t dev) { struct msk_softc *sc; - int error, msic, msir, *port, reg; + struct msk_mii_data *mmd; + int error, msic, msir, reg; sc = device_get_softc(dev); sc->msk_dev = dev; @@ -1669,10 +1672,6 @@ mskc_attach(device_t dev) CSR_WRITE_2(sc, B0_CTST, CS_RST_SET); CSR_WRITE_2(sc, B0_CTST, CS_RST_CLR); sc->msk_pmd = CSR_READ_1(sc, B2_PMD_TYP); - if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') - sc->msk_coppertype = 0; - else - sc->msk_coppertype = 1; /* Check number of MACs. */ sc->msk_num_port = 1; if ((CSR_READ_1(sc, B2_Y2_HW_RES) & CFG_DUAL_MAC_MSK) == @@ -1812,15 +1811,18 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - port = malloc(sizeof(int), M_DEVBUF, M_WAITOK); - if (port == NULL) { + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_A\n"); error = ENXIO; goto fail; } - *port = MSK_PORT_A; - device_set_ivars(sc->msk_devs[MSK_PORT_A], port); + mmd->port = MSK_PORT_A; + mmd->pmd = sc->msk_pmd; + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S' || sc->msk_pmd == 'P') + mmd->mii_flags |= MIIF_HAVEFIBER; + device_set_ivars(sc->msk_devs[MSK_PORT_A], mmd); if (sc->msk_num_port > 1) { sc->msk_devs[MSK_PORT_B] = device_add_child(dev, "msk", -1); @@ -1829,15 +1831,18 @@ mskc_attach(device_t dev) error = ENXIO; goto fail; } - port = malloc(sizeof(int), M_DEVBUF, M_WAITOK); - if (port == NULL) { + mmd = malloc(sizeof(struct msk_mii_data), M_DEVBUF, M_WAITOK | M_ZERO); + if (mmd == NULL) { device_printf(dev, "failed to allocate memory for " "ivars of PORT_B\n"); error = ENXIO; goto fail; } - *port = MSK_PORT_B; - device_set_ivars(sc->msk_devs[MSK_PORT_B], port); + mmd->port = MSK_PORT_B; + mmd->pmd = sc->msk_pmd; + if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S' || sc->msk_pmd == 'P') + mmd->mii_flags |= MIIF_HAVEFIBER; + device_set_ivars(sc->msk_devs[MSK_PORT_B], mmd); } error = bus_generic_attach(dev); Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 19:11:03 2009 (r199916) +++ stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 19:12:41 2009 (r199917) @@ -2403,6 +2403,12 @@ struct msk_ring_data { #define MSK_TX_TIMEOUT 5 #define MSK_PUT_WM 10 +struct msk_mii_data { + int port; + uint32_t pmd; + int mii_flags; +}; + /* Forward decl. */ struct msk_if_softc; @@ -2466,7 +2472,6 @@ struct msk_softc { uint8_t msk_num_port; int msk_ramsize; /* amount of SRAM on NIC */ uint32_t msk_pmd; /* physical media type */ - uint32_t msk_coppertype; uint32_t msk_intrmask; uint32_t msk_intrhwemask; uint32_t msk_pflags; From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:15:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55E8C10656C8; Sun, 29 Nov 2009 19:15:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 455B08FC0A; Sun, 29 Nov 2009 19:15:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJF9UZ005455; Sun, 29 Nov 2009 19:15:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJF9NI005453; Sun, 29 Nov 2009 19:15:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291915.nATJF9NI005453@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199918 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:15:09 -0000 Author: yongari Date: Sun Nov 29 19:15:08 2009 New Revision: 199918 URL: http://svn.freebsd.org/changeset/base/199918 Log: MFC 197591. Add workaround for Yukon XL which has hardware bug that can't flush FIFO. Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:12:41 2009 (r199917) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:15:08 2009 (r199918) @@ -3801,9 +3801,14 @@ msk_init_locked(struct msk_if_softc *sc_ /* Set receive filter. */ msk_rxfilter(sc_if); - /* Flush Rx MAC FIFO on any flow control or error. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), - GMR_FS_ANY_ERR); + if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { + /* Clear flush mask - HW bug. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), 0); + } else { + /* Flush Rx MAC FIFO on any flow control or error. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), + GMR_FS_ANY_ERR); + } /* * Set Rx FIFO flush threshold to 64 bytes + 1 FIFO word From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:16:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6FCF106566C; Sun, 29 Nov 2009 19:16:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 964878FC08; Sun, 29 Nov 2009 19:16:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJGGft005532; Sun, 29 Nov 2009 19:16:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJGGCp005530; Sun, 29 Nov 2009 19:16:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291916.nATJGGCp005530@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:16:16 +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: r199919 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:16:16 -0000 Author: yongari Date: Sun Nov 29 19:16:16 2009 New Revision: 199919 URL: http://svn.freebsd.org/changeset/base/199919 Log: MFC 197591. Add workaround for Yukon XL which has hardware bug that can't flush FIFO. Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:15:08 2009 (r199918) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:16:16 2009 (r199919) @@ -3799,9 +3799,14 @@ msk_init_locked(struct msk_if_softc *sc_ /* Set receive filter. */ msk_rxfilter(sc_if); - /* Flush Rx MAC FIFO on any flow control or error. */ - CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), - GMR_FS_ANY_ERR); + if (sc->msk_hw_id == CHIP_ID_YUKON_XL) { + /* Clear flush mask - HW bug. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), 0); + } else { + /* Flush Rx MAC FIFO on any flow control or error. */ + CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_FL_MSK), + GMR_FS_ANY_ERR); + } /* * Set Rx FIFO flush threshold to 64 bytes + 1 FIFO word From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:18:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 127D4106566C; Sun, 29 Nov 2009 19:18:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01ABE8FC1F; Sun, 29 Nov 2009 19:18:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJIMl8005634; Sun, 29 Nov 2009 19:18:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJIMaH005631; Sun, 29 Nov 2009 19:18:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291918.nATJIMaH005631@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199920 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:18:23 -0000 Author: yongari Date: Sun Nov 29 19:18:22 2009 New Revision: 199920 URL: http://svn.freebsd.org/changeset/base/199920 Log: MFC 197592. Add DGE-560SX(Yukon XL) to the supported device list. Many thanks to "Eugene Perevyazko dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Modified: stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/msk/if_mskreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:16:16 2009 (r199919) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:18:22 2009 (r199920) @@ -225,6 +225,8 @@ static struct msk_product { "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, + { VENDORID_DLINK, DEVICEID_DLINK_DGE560SX, + "D-Link 560SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560T, "D-Link 560T Gigabit Ethernet" } }; Modified: stable/8/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/8/sys/dev/msk/if_mskreg.h Sun Nov 29 19:16:16 2009 (r199919) +++ stable/8/sys/dev/msk/if_mskreg.h Sun Nov 29 19:18:22 2009 (r199920) @@ -149,6 +149,7 @@ * D-Link gigabit ethernet device ID */ #define DEVICEID_DLINK_DGE550SX 0x4001 +#define DEVICEID_DLINK_DGE560SX 0x4002 #define DEVICEID_DLINK_DGE560T 0x4b00 #define BIT_31 (1 << 31) From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:19:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E2DF1065670; Sun, 29 Nov 2009 19:19:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6088FC1D; Sun, 29 Nov 2009 19:19:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJJNDl005700; Sun, 29 Nov 2009 19:19:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJJNmj005697; Sun, 29 Nov 2009 19:19:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291919.nATJJNmj005697@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19: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: r199921 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:19:23 -0000 Author: yongari Date: Sun Nov 29 19:19:23 2009 New Revision: 199921 URL: http://svn.freebsd.org/changeset/base/199921 Log: MFC 197592. Add DGE-560SX(Yukon XL) to the supported device list. Many thanks to "Eugene Perevyazko dnepro dot net>" who kindly gave remote access to system with DGE-560SX. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:18:22 2009 (r199920) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:19:23 2009 (r199921) @@ -223,6 +223,8 @@ static struct msk_product { "Marvell Yukon 88E8072 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, + { VENDORID_DLINK, DEVICEID_DLINK_DGE560SX, + "D-Link 560SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560T, "D-Link 560T Gigabit Ethernet" } }; Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 19:18:22 2009 (r199920) +++ stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 19:19:23 2009 (r199921) @@ -148,6 +148,7 @@ * D-Link gigabit ethernet device ID */ #define DEVICEID_DLINK_DGE550SX 0x4001 +#define DEVICEID_DLINK_DGE560SX 0x4002 #define DEVICEID_DLINK_DGE560T 0x4b00 #define BIT_31 (1 << 31) From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:22:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D5AF1065697; Sun, 29 Nov 2009 19:22:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CA058FC2C; Sun, 29 Nov 2009 19:22:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJMiAa005827; Sun, 29 Nov 2009 19:22:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJMiT4005825; Sun, 29 Nov 2009 19:22:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291922.nATJMiT4005825@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199922 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:22:44 -0000 Author: yongari Date: Sun Nov 29 19:22:44 2009 New Revision: 199922 URL: http://svn.freebsd.org/changeset/base/199922 Log: MFC 197593. DGE-560SX is now supported. Modified: stable/8/share/man/man4/msk.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/msk.4 ============================================================================== --- stable/8/share/man/man4/msk.4 Sun Nov 29 19:19:23 2009 (r199921) +++ stable/8/share/man/man4/msk.4 Sun Nov 29 19:22:44 2009 (r199922) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2009 +.Dd September 28, 2009 .Dt MSK 4 .Os .Sh NAME @@ -158,6 +158,8 @@ Yukon II based Gigabit Ethernet controll .It D-Link 550SX Gigabit Ethernet .It +D-Link 560SX Gigabit Ethernet +.It D-Link 560T Gigabit Ethernet .It Marvell Yukon 88E8021CU Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:23:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 297321065692; Sun, 29 Nov 2009 19:23:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18C1E8FC17; Sun, 29 Nov 2009 19:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJNPl3005891; Sun, 29 Nov 2009 19:23:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJNPBM005889; Sun, 29 Nov 2009 19:23:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291923.nATJNPBM005889@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:23: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: r199923 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:23:26 -0000 Author: yongari Date: Sun Nov 29 19:23:25 2009 New Revision: 199923 URL: http://svn.freebsd.org/changeset/base/199923 Log: MFC 197593. DGE-560SX is now supported. Modified: stable/7/share/man/man4/msk.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Sun Nov 29 19:22:44 2009 (r199922) +++ stable/7/share/man/man4/msk.4 Sun Nov 29 19:23:25 2009 (r199923) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2009 +.Dd September 28, 2009 .Dt MSK 4 .Os .Sh NAME @@ -158,6 +158,8 @@ Yukon II based Gigabit Ethernet controll .It D-Link 550SX Gigabit Ethernet .It +D-Link 560SX Gigabit Ethernet +.It D-Link 560T Gigabit Ethernet .It Marvell Yukon 88E8021CU Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:25:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 897F9106566B; Sun, 29 Nov 2009 19:25:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C068FC17; Sun, 29 Nov 2009 19:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJPFq8005976; Sun, 29 Nov 2009 19:25:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJPF0A005974; Sun, 29 Nov 2009 19:25:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291925.nATJPF0A005974@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199924 - stable/8/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:25:15 -0000 Author: yongari Date: Sun Nov 29 19:25:15 2009 New Revision: 199924 URL: http://svn.freebsd.org/changeset/base/199924 Log: MFC 197600. For AR8132 fast ethernet controller, do not report 1000baseT capability to mii(4). Even though AR8132 uses the same model/ revision number of F1 gigabit PHY, the PHY has no ability to establish 1000baseT link. I have no idea why Atheros use the same device/model id for this PHY. With this change atphy(4) does not report 1000baseT media capability and manual 1000baseT configuration is also disabled which is more desirable behavior for 10/100Mbps PHY. Modified: stable/8/sys/dev/alc/if_alc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Sun Nov 29 19:23:25 2009 (r199923) +++ stable/8/sys/dev/alc/if_alc.c Sun Nov 29 19:25:15 2009 (r199924) @@ -234,6 +234,16 @@ alc_miibus_readreg(device_t dev, int phy if (phy != sc->alc_phyaddr) return (0); + /* + * For AR8132 fast ethernet controller, do not report 1000baseT + * capability to mii(4). Even though AR8132 uses the same + * model/revision number of F1 gigabit PHY, the PHY has no + * ability to establish 1000baseT link. + */ + if ((sc->alc_flags & ALC_FLAG_FASTETHER) != 0 && + reg == MII_EXTSR) + return (0); + CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); for (i = ALC_PHY_TIMEOUT; i > 0; i--) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:26:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CA981065706; Sun, 29 Nov 2009 19:26:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C0DC8FC2B; Sun, 29 Nov 2009 19:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJQWCa006045; Sun, 29 Nov 2009 19:26:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJQWYi006043; Sun, 29 Nov 2009 19:26:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291926.nATJQWYi006043@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:26: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: r199925 - stable/7/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:26:32 -0000 Author: yongari Date: Sun Nov 29 19:26:31 2009 New Revision: 199925 URL: http://svn.freebsd.org/changeset/base/199925 Log: MFC 197600. For AR8132 fast ethernet controller, do not report 1000baseT capability to mii(4). Even though AR8132 uses the same model/ revision number of F1 gigabit PHY, the PHY has no ability to establish 1000baseT link. I have no idea why Atheros use the same device/model id for this PHY. With this change atphy(4) does not report 1000baseT media capability and manual 1000baseT configuration is also disabled which is more desirable behavior for 10/100Mbps PHY. Modified: stable/7/sys/dev/alc/if_alc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Nov 29 19:25:15 2009 (r199924) +++ stable/7/sys/dev/alc/if_alc.c Sun Nov 29 19:26:31 2009 (r199925) @@ -234,6 +234,16 @@ alc_miibus_readreg(device_t dev, int phy if (phy != sc->alc_phyaddr) return (0); + /* + * For AR8132 fast ethernet controller, do not report 1000baseT + * capability to mii(4). Even though AR8132 uses the same + * model/revision number of F1 gigabit PHY, the PHY has no + * ability to establish 1000baseT link. + */ + if ((sc->alc_flags & ALC_FLAG_FASTETHER) != 0 && + reg == MII_EXTSR) + return (0); + CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); for (i = ALC_PHY_TIMEOUT; i > 0; i--) { From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:29:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84733106568D; Sun, 29 Nov 2009 19:29:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3FA8FC1B; Sun, 29 Nov 2009 19:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJTBr8006138; Sun, 29 Nov 2009 19:29:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJTBdb006133; Sun, 29 Nov 2009 19:29:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291929.nATJTBdb006133@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199926 - in stable/8/sys/dev: ae age alc ale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:29:11 -0000 Author: yongari Date: Sun Nov 29 19:29:11 2009 New Revision: 199926 URL: http://svn.freebsd.org/changeset/base/199926 Log: MFC 197627. Fix multicast handling. All Atheros controllers use big-endian form in computing multicast hash. PR: kern/139137 Modified: stable/8/sys/dev/ae/if_ae.c stable/8/sys/dev/age/if_age.c stable/8/sys/dev/alc/if_alc.c stable/8/sys/dev/ale/if_ale.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ae/if_ae.c ============================================================================== --- stable/8/sys/dev/ae/if_ae.c Sun Nov 29 19:26:31 2009 (r199925) +++ stable/8/sys/dev/ae/if_ae.c Sun Nov 29 19:29:11 2009 (r199926) @@ -2077,7 +2077,7 @@ ae_rxfilter(ae_softc_t *sc) TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } Modified: stable/8/sys/dev/age/if_age.c ============================================================================== --- stable/8/sys/dev/age/if_age.c Sun Nov 29 19:26:31 2009 (r199925) +++ stable/8/sys/dev/age/if_age.c Sun Nov 29 19:29:11 2009 (r199926) @@ -3135,7 +3135,7 @@ age_rxfilter(struct age_softc *sc) TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Sun Nov 29 19:26:31 2009 (r199925) +++ stable/8/sys/dev/alc/if_alc.c Sun Nov 29 19:29:11 2009 (r199926) @@ -3476,7 +3476,7 @@ alc_rxfilter(struct alc_softc *sc) TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Sun Nov 29 19:26:31 2009 (r199925) +++ stable/8/sys/dev/ale/if_ale.c Sun Nov 29 19:29:11 2009 (r199926) @@ -3060,7 +3060,7 @@ ale_rxfilter(struct ale_softc *sc) TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:30:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35F291065785; Sun, 29 Nov 2009 19:30:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A7C48FC15; Sun, 29 Nov 2009 19:30:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJUsma006225; Sun, 29 Nov 2009 19:30:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJUsBx006220; Sun, 29 Nov 2009 19:30:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291930.nATJUsBx006220@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:30:54 +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: r199927 - in stable/7/sys/dev: ae age alc ale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:30:55 -0000 Author: yongari Date: Sun Nov 29 19:30:54 2009 New Revision: 199927 URL: http://svn.freebsd.org/changeset/base/199927 Log: MFC 197627. Fix multicast handling. All Atheros controllers use big-endian form in computing multicast hash. PR: kern/139137 Modified: stable/7/sys/dev/ae/if_ae.c stable/7/sys/dev/age/if_age.c stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/ale/if_ale.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ae/if_ae.c ============================================================================== --- stable/7/sys/dev/ae/if_ae.c Sun Nov 29 19:29:11 2009 (r199926) +++ stable/7/sys/dev/ae/if_ae.c Sun Nov 29 19:30:54 2009 (r199927) @@ -2077,7 +2077,7 @@ ae_rxfilter(ae_softc_t *sc) TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } Modified: stable/7/sys/dev/age/if_age.c ============================================================================== --- stable/7/sys/dev/age/if_age.c Sun Nov 29 19:29:11 2009 (r199926) +++ stable/7/sys/dev/age/if_age.c Sun Nov 29 19:30:54 2009 (r199927) @@ -3135,7 +3135,7 @@ age_rxfilter(struct age_softc *sc) TAILQ_FOREACH(ifma, &sc->age_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Nov 29 19:29:11 2009 (r199926) +++ stable/7/sys/dev/alc/if_alc.c Sun Nov 29 19:30:54 2009 (r199927) @@ -3476,7 +3476,7 @@ alc_rxfilter(struct alc_softc *sc) TAILQ_FOREACH(ifma, &sc->alc_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Sun Nov 29 19:29:11 2009 (r199926) +++ stable/7/sys/dev/ale/if_ale.c Sun Nov 29 19:30:54 2009 (r199927) @@ -3060,7 +3060,7 @@ ale_rxfilter(struct ale_softc *sc) TAILQ_FOREACH(ifma, &sc->ale_ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + crc = ether_crc32_be(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN); mchash[crc >> 31] |= 1 << ((crc >> 26) & 0x1f); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:46:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D97E1065672; Sun, 29 Nov 2009 19:46:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CC418FC08; Sun, 29 Nov 2009 19:46:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJkFTr006541; Sun, 29 Nov 2009 19:46:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJkF0H006538; Sun, 29 Nov 2009 19:46:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291946.nATJkF0H006538@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199928 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:46:16 -0000 Author: yongari Date: Sun Nov 29 19:46:15 2009 New Revision: 199928 URL: http://svn.freebsd.org/changeset/base/199928 Log: MFC 198813. Add BCM5761 PHY id. Modified: stable/8/sys/dev/mii/brgphy.c stable/8/sys/dev/mii/miidevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Sun Nov 29 19:30:54 2009 (r199927) +++ stable/8/sys/dev/mii/brgphy.c Sun Nov 29 19:46:15 2009 (r199928) @@ -134,6 +134,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; Modified: stable/8/sys/dev/mii/miidevs ============================================================================== --- stable/8/sys/dev/mii/miidevs Sun Nov 29 19:30:54 2009 (r199927) +++ stable/8/sys/dev/mii/miidevs Sun Nov 29 19:46:15 2009 (r199928) @@ -154,6 +154,7 @@ model xxBROADCOM_ALT1 BCM5708S 0x0015 BC model xxBROADCOM_ALT1 BCM5709CAX 0x002c BCM5709C(AX) 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5722 0x002d BCM5722 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:47:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04C0106568B; Sun, 29 Nov 2009 19:47:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFA698FC18; Sun, 29 Nov 2009 19:47:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJlVqM006611; Sun, 29 Nov 2009 19:47:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJlVKV006608; Sun, 29 Nov 2009 19:47:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291947.nATJlVKV006608@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:47:31 +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: r199929 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:47:32 -0000 Author: yongari Date: Sun Nov 29 19:47:31 2009 New Revision: 199929 URL: http://svn.freebsd.org/changeset/base/199929 Log: MFC 198813. Add BCM5761 PHY id. Modified: stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/miidevs Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Sun Nov 29 19:46:15 2009 (r199928) +++ stable/7/sys/dev/mii/brgphy.c Sun Nov 29 19:47:31 2009 (r199929) @@ -134,6 +134,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709CAX), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5722), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5709C), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5906), MII_PHY_END }; Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Sun Nov 29 19:46:15 2009 (r199928) +++ stable/7/sys/dev/mii/miidevs Sun Nov 29 19:47:31 2009 (r199929) @@ -149,6 +149,7 @@ model xxBROADCOM_ALT1 BCM5708S 0x0015 BC model xxBROADCOM_ALT1 BCM5709CAX 0x002c BCM5709C(AX) 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5722 0x002d BCM5722 10/100/1000baseTX PHY model xxBROADCOM_ALT1 BCM5709C 0x003c BCM5709C 10/100/1000baseTX PHY +model xxBROADCOM_ALT1 BCM5761 0x003d BCM5761 10/100/1000baseTX PHY model BROADCOM2 BCM5906 0x0004 BCM5906 10/100baseTX PHY /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:49:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBC4E1065676; Sun, 29 Nov 2009 19:49:21 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB57B8FC16; Sun, 29 Nov 2009 19:49:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJnL9A006691; Sun, 29 Nov 2009 19:49:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJnLk3006689; Sun, 29 Nov 2009 19:49:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291949.nATJnLk3006689@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199930 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:49:21 -0000 Author: yongari Date: Sun Nov 29 19:49:21 2009 New Revision: 199930 URL: http://svn.freebsd.org/changeset/base/199930 Log: MFC 198814. Add a check to know whether driver is still running after reacquiring driver lock in Rx handler. re(4) drops a driver lock before passing received frame to upper stack and reacquire the lock. During the time window ioctl calls could be executed and if the ioctl was interface down request, driver will stop the controller and free allocated mbufs. After that when driver comes back to Rx handler again it does not know what was happend so it could access free mbufs which in turn cause panic. Reported by: Norbert Papke < npapk <> acm dot org > Tested by: Norbert Papke < npapk <> acm dot org > Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Sun Nov 29 19:47:31 2009 (r199929) +++ stable/8/sys/dev/re/if_re.c Sun Nov 29 19:49:21 2009 (r199930) @@ -1817,6 +1817,8 @@ re_rxeof(struct rl_softc *sc, int *rx_np for (i = sc->rl_ldata.rl_rx_prodidx; maxpkt > 0; i = RL_RX_DESC_NXT(sc, i)) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; cur_rx = &sc->rl_ldata.rl_rx_list[i]; rxstat = le32toh(cur_rx->rl_cmdstat); if ((rxstat & RL_RDESC_STAT_OWN) != 0) From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:50:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 743FC1065679; Sun, 29 Nov 2009 19:50:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63D8D8FC0C; Sun, 29 Nov 2009 19:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJod1a006766; Sun, 29 Nov 2009 19:50:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJodsM006764; Sun, 29 Nov 2009 19:50:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291950.nATJodsM006764@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:50:39 +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: r199931 - stable/7/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:50:39 -0000 Author: yongari Date: Sun Nov 29 19:50:39 2009 New Revision: 199931 URL: http://svn.freebsd.org/changeset/base/199931 Log: MFC 198814. Add a check to know whether driver is still running after reacquiring driver lock in Rx handler. re(4) drops a driver lock before passing received frame to upper stack and reacquire the lock. During the time window ioctl calls could be executed and if the ioctl was interface down request, driver will stop the controller and free allocated mbufs. After that when driver comes back to Rx handler again it does not know what was happend so it could access free mbufs which in turn cause panic. Reported by: Norbert Papke < npapk <> acm dot org > Tested by: Norbert Papke < npapk <> acm dot org > Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sun Nov 29 19:49:21 2009 (r199930) +++ stable/7/sys/dev/re/if_re.c Sun Nov 29 19:50:39 2009 (r199931) @@ -1814,6 +1814,8 @@ re_rxeof(struct rl_softc *sc) for (i = sc->rl_ldata.rl_rx_prodidx; maxpkt > 0; i = RL_RX_DESC_NXT(sc, i)) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; cur_rx = &sc->rl_ldata.rl_rx_list[i]; rxstat = le32toh(cur_rx->rl_cmdstat); if ((rxstat & RL_RDESC_STAT_OWN) != 0) From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:54:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78595106566C; Sun, 29 Nov 2009 19:54:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67ADC8FC16; Sun, 29 Nov 2009 19:54:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJsWZx006888; Sun, 29 Nov 2009 19:54:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJsW68006886; Sun, 29 Nov 2009 19:54:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291954.nATJsW68006886@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:54:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199932 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:54:32 -0000 Author: yongari Date: Sun Nov 29 19:54:32 2009 New Revision: 199932 URL: http://svn.freebsd.org/changeset/base/199932 Log: MFC 198996-198997. r198996: Remove unnecessary header file. r198997: It's normal to see Rx FIFO overruns under high network load and showing the message creates other side-effects. Remove the Rx FIFO overrun message in interrupt handler. msk(4) should recover from the FIFO overruns without any user intervention. Users can still check the Rx FIFO overrun counter from MAC MIB statistics maintained in driver(dev.msk.0.stats.rx.overflows). Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:50:39 2009 (r199931) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:54:32 2009 (r199932) @@ -137,7 +137,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -3218,11 +3217,9 @@ msk_intr_gmac(struct msk_if_softc *sc_if status = CSR_READ_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_SRC)); /* GMAC Rx FIFO overrun. */ - if ((status & GM_IS_RX_FF_OR) != 0) { + if ((status & GM_IS_RX_FF_OR) != 0) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); - device_printf(sc_if->msk_if_dev, "Rx FIFO overrun!\n"); - } /* GMAC Tx FIFO underrun. */ if ((status & GM_IS_TX_FF_UR) != 0) { CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:56:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0292106566C; Sun, 29 Nov 2009 19:56:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF8DE8FC1A; Sun, 29 Nov 2009 19:56:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJunSc007005; Sun, 29 Nov 2009 19:56:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJunu6007003; Sun, 29 Nov 2009 19:56:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291956.nATJunu6007003@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:56:49 +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: r199933 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:56:50 -0000 Author: yongari Date: Sun Nov 29 19:56:49 2009 New Revision: 199933 URL: http://svn.freebsd.org/changeset/base/199933 Log: MFC 198996-198997. r198996: Remove unnecessary header file. r198997: It's normal to see Rx FIFO overruns under high network load and showing the message creates other side-effects. Remove the Rx FIFO overrun message in interrupt handler. msk(4) should recover from the FIFO overruns without any user intervention. Users can still check the Rx FIFO overrun counter from MAC MIB statistics maintained in driver(dev.msk.0.stats.rx.overflows). Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:54:32 2009 (r199932) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:56:49 2009 (r199933) @@ -137,7 +137,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -3216,11 +3215,9 @@ msk_intr_gmac(struct msk_if_softc *sc_if status = CSR_READ_1(sc, MR_ADDR(sc_if->msk_port, GMAC_IRQ_SRC)); /* GMAC Rx FIFO overrun. */ - if ((status & GM_IS_RX_FF_OR) != 0) { + if ((status & GM_IS_RX_FF_OR) != 0) CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); - device_printf(sc_if->msk_if_dev, "Rx FIFO overrun!\n"); - } /* GMAC Tx FIFO underrun. */ if ((status & GM_IS_TX_FF_UR) != 0) { CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, TX_GMF_CTRL_T), From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:58:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1E1A1065670; Sun, 29 Nov 2009 19:58:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B11648FC13; Sun, 29 Nov 2009 19:58:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJwZQR007111; Sun, 29 Nov 2009 19:58:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJwZN4007108; Sun, 29 Nov 2009 19:58:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291958.nATJwZN4007108@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199934 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:58:36 -0000 Author: yongari Date: Sun Nov 29 19:58:35 2009 New Revision: 199934 URL: http://svn.freebsd.org/changeset/base/199934 Log: MFC r199012: Add preliminary Yukon Ultra 2 support(88E8057). The controller looks very similar to Yukon EC Ultra. Tested by: kalin m ( kalin <> el dot net ) Modified: stable/8/sys/dev/msk/if_msk.c stable/8/sys/dev/msk/if_mskreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:56:49 2009 (r199933) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 19:58:35 2009 (r199934) @@ -222,6 +222,8 @@ static struct msk_product { "Marvell Yukon 88E8071 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436C, "Marvell Yukon 88E8072 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4380, + "Marvell Yukon 88E8057 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560SX, @@ -236,7 +238,9 @@ static const char *model_name[] = { "Yukon EX", "Yukon EC", "Yukon FE", - "Yukon FE+" + "Yukon FE+", + "Yukon Supreme", + "Yukon Ultra 2" }; static int mskc_probe(device_t); @@ -1143,6 +1147,7 @@ msk_phy_power(struct msk_softc *sc, int case CHIP_ID_YUKON_EC_U: case CHIP_ID_YUKON_EX: case CHIP_ID_YUKON_FE_P: + case CHIP_ID_YUKON_UL_2: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); /* Enable all clocks. */ @@ -1646,7 +1651,8 @@ mskc_attach(device_t dev) sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || - sc->msk_hw_id > CHIP_ID_YUKON_FE_P) { + sc->msk_hw_id > CHIP_ID_YUKON_UL_2 || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); mtx_destroy(&sc->msk_mtx); @@ -1745,6 +1751,10 @@ mskc_attach(device_t dev) sc->msk_clock = 156; /* 156 Mhz */ sc->msk_pflags |= MSK_FLAG_JUMBO; break; + case CHIP_ID_YUKON_UL_2: + sc->msk_clock = 156; /* 156 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO; + break; default: sc->msk_clock = 156; /* 156 Mhz */ break; Modified: stable/8/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/8/sys/dev/msk/if_mskreg.h Sun Nov 29 19:56:49 2009 (r199933) +++ stable/8/sys/dev/msk/if_mskreg.h Sun Nov 29 19:58:35 2009 (r199934) @@ -144,6 +144,7 @@ #define DEVICEID_MRVL_436A 0x436A #define DEVICEID_MRVL_436B 0x436B #define DEVICEID_MRVL_436C 0x436C +#define DEVICEID_MRVL_4380 0x4380 /* * D-Link gigabit ethernet device ID @@ -891,6 +892,8 @@ #define CHIP_ID_YUKON_EC 0xb6 /* Chip ID for YUKON-2 EC */ #define CHIP_ID_YUKON_FE 0xb7 /* Chip ID for YUKON-2 FE */ #define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ +#define CHIP_ID_YUKON_SUPR 0xb9 /* Chip ID for YUKON-2 Supreme */ +#define CHIP_ID_YUKON_UL_2 0xba /* Chip ID for YUKON-2 Ultra 2 */ #define CHIP_REV_YU_XL_A0 0 /* Chip Rev. for Yukon-2 A0 */ #define CHIP_REV_YU_XL_A1 1 /* Chip Rev. for Yukon-2 A1 */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 19:59:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D4BC10656A4; Sun, 29 Nov 2009 19:59:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 839F28FC14; Sun, 29 Nov 2009 19:59:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATJxeMi007186; Sun, 29 Nov 2009 19:59:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATJxeRl007183; Sun, 29 Nov 2009 19:59:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911291959.nATJxeRl007183@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 19:59:40 +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: r199935 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 19:59:40 -0000 Author: yongari Date: Sun Nov 29 19:59:40 2009 New Revision: 199935 URL: http://svn.freebsd.org/changeset/base/199935 Log: MFC r199012: Add preliminary Yukon Ultra 2 support(88E8057). The controller looks very similar to Yukon EC Ultra. Tested by: kalin m ( kalin <> el dot net ) Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:58:35 2009 (r199934) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 19:59:40 2009 (r199935) @@ -220,6 +220,8 @@ static struct msk_product { "Marvell Yukon 88E8071 Gigabit Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_436C, "Marvell Yukon 88E8072 Gigabit Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_4380, + "Marvell Yukon 88E8057 Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE550SX, "D-Link 550SX Gigabit Ethernet" }, { VENDORID_DLINK, DEVICEID_DLINK_DGE560SX, @@ -234,7 +236,9 @@ static const char *model_name[] = { "Yukon EX", "Yukon EC", "Yukon FE", - "Yukon FE+" + "Yukon FE+", + "Yukon Supreme", + "Yukon Ultra 2" }; static int mskc_probe(device_t); @@ -1141,6 +1145,7 @@ msk_phy_power(struct msk_softc *sc, int case CHIP_ID_YUKON_EC_U: case CHIP_ID_YUKON_EX: case CHIP_ID_YUKON_FE_P: + case CHIP_ID_YUKON_UL_2: CSR_WRITE_2(sc, B0_CTST, Y2_HW_WOL_OFF); /* Enable all clocks. */ @@ -1644,7 +1649,8 @@ mskc_attach(device_t dev) sc->msk_hw_rev = (CSR_READ_1(sc, B2_MAC_CFG) >> 4) & 0x0f; /* Bail out if chip is not recognized. */ if (sc->msk_hw_id < CHIP_ID_YUKON_XL || - sc->msk_hw_id > CHIP_ID_YUKON_FE_P) { + sc->msk_hw_id > CHIP_ID_YUKON_UL_2 || + sc->msk_hw_id == CHIP_ID_YUKON_SUPR) { device_printf(dev, "unknown device: id=0x%02x, rev=0x%02x\n", sc->msk_hw_id, sc->msk_hw_rev); mtx_destroy(&sc->msk_mtx); @@ -1743,6 +1749,10 @@ mskc_attach(device_t dev) sc->msk_clock = 156; /* 156 Mhz */ sc->msk_pflags |= MSK_FLAG_JUMBO; break; + case CHIP_ID_YUKON_UL_2: + sc->msk_clock = 156; /* 156 Mhz */ + sc->msk_pflags |= MSK_FLAG_JUMBO; + break; default: sc->msk_clock = 156; /* 156 Mhz */ break; Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 19:58:35 2009 (r199934) +++ stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 19:59:40 2009 (r199935) @@ -143,6 +143,7 @@ #define DEVICEID_MRVL_436A 0x436A #define DEVICEID_MRVL_436B 0x436B #define DEVICEID_MRVL_436C 0x436C +#define DEVICEID_MRVL_4380 0x4380 /* * D-Link gigabit ethernet device ID @@ -890,6 +891,8 @@ #define CHIP_ID_YUKON_EC 0xb6 /* Chip ID for YUKON-2 EC */ #define CHIP_ID_YUKON_FE 0xb7 /* Chip ID for YUKON-2 FE */ #define CHIP_ID_YUKON_FE_P 0xb8 /* Chip ID for YUKON-2 FE+ */ +#define CHIP_ID_YUKON_SUPR 0xb9 /* Chip ID for YUKON-2 Supreme */ +#define CHIP_ID_YUKON_UL_2 0xba /* Chip ID for YUKON-2 Ultra 2 */ #define CHIP_REV_YU_XL_A0 0 /* Chip Rev. for Yukon-2 A0 */ #define CHIP_REV_YU_XL_A1 1 /* Chip Rev. for Yukon-2 A1 */ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:06:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEB74106568B; Sun, 29 Nov 2009 20:06:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE1268FC1D; Sun, 29 Nov 2009 20:06:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATK6vUw007440; Sun, 29 Nov 2009 20:06:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATK6vPF007438; Sun, 29 Nov 2009 20:06:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292006.nATK6vPF007438@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199936 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:06:57 -0000 Author: yongari Date: Sun Nov 29 20:06:57 2009 New Revision: 199936 URL: http://svn.freebsd.org/changeset/base/199936 Log: MFC r198475: - Add support for Marvell Yukon 88E8042 device. Modified: stable/8/share/man/man4/msk.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/msk.4 ============================================================================== --- stable/8/share/man/man4/msk.4 Sun Nov 29 19:59:40 2009 (r199935) +++ stable/8/share/man/man4/msk.4 Sun Nov 29 20:06:57 2009 (r199936) @@ -190,6 +190,8 @@ Marvell Yukon 88E8040 Fast Ethernet .It Marvell Yukon 88E8040T Fast Ethernet .It +Marvell Yukon 88E8042 Fast Ethernet +.It Marvell Yukon 88E8048 Fast Ethernet .It Marvell Yukon 88E8050 Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:09:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FD06106566C; Sun, 29 Nov 2009 20:09:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2148FC12; Sun, 29 Nov 2009 20:09:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATK9aDG007528; Sun, 29 Nov 2009 20:09:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATK9aV8007525; Sun, 29 Nov 2009 20:09:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292009.nATK9aV8007525@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:09:36 +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: r199937 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:09:36 -0000 Author: yongari Date: Sun Nov 29 20:09:35 2009 New Revision: 199937 URL: http://svn.freebsd.org/changeset/base/199937 Log: MFC r198475: - Add support for Marvell Yukon 88E8042 device. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/msk/if_mskreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 20:06:57 2009 (r199936) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 20:09:35 2009 (r199937) @@ -200,6 +200,8 @@ static struct msk_product { "Marvell Yukon 88E8040 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8040T, "Marvell Yukon 88E8040T Fast Ethernet" }, + { VENDORID_MARVELL, DEVICEID_MRVL_8042, + "Marvell Yukon 88E8042 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_8048, "Marvell Yukon 88E8048 Fast Ethernet" }, { VENDORID_MARVELL, DEVICEID_MRVL_4361, Modified: stable/7/sys/dev/msk/if_mskreg.h ============================================================================== --- stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 20:06:57 2009 (r199936) +++ stable/7/sys/dev/msk/if_mskreg.h Sun Nov 29 20:09:35 2009 (r199937) @@ -133,6 +133,7 @@ #define DEVICEID_MRVL_8039 0x4353 #define DEVICEID_MRVL_8040 0x4354 #define DEVICEID_MRVL_8040T 0x4355 +#define DEVICEID_MRVL_8042 0x4357 #define DEVICEID_MRVL_8048 0x435A #define DEVICEID_MRVL_4360 0x4360 #define DEVICEID_MRVL_4361 0x4361 From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:10:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EAD5106566B; Sun, 29 Nov 2009 20:10:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E4048FC0C; Sun, 29 Nov 2009 20:10:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKAZp7007601; Sun, 29 Nov 2009 20:10:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKAZqY007599; Sun, 29 Nov 2009 20:10:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292010.nATKAZqY007599@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:10: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: r199938 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:10:35 -0000 Author: yongari Date: Sun Nov 29 20:10:35 2009 New Revision: 199938 URL: http://svn.freebsd.org/changeset/base/199938 Log: MFC r198475: - Add support for Marvell Yukon 88E8042 device. Modified: stable/7/share/man/man4/msk.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Sun Nov 29 20:09:35 2009 (r199937) +++ stable/7/share/man/man4/msk.4 Sun Nov 29 20:10:35 2009 (r199938) @@ -190,6 +190,8 @@ Marvell Yukon 88E8040 Fast Ethernet .It Marvell Yukon 88E8040T Fast Ethernet .It +Marvell Yukon 88E8042 Fast Ethernet +.It Marvell Yukon 88E8048 Fast Ethernet .It Marvell Yukon 88E8050 Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:11:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 831B01065670; Sun, 29 Nov 2009 20:11:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 729298FC12; Sun, 29 Nov 2009 20:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKBcJu007680; Sun, 29 Nov 2009 20:11:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKBcHK007678; Sun, 29 Nov 2009 20:11:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292011.nATKBcHK007678@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199939 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:11:38 -0000 Author: yongari Date: Sun Nov 29 20:11:38 2009 New Revision: 199939 URL: http://svn.freebsd.org/changeset/base/199939 Log: MFC r199013: 88E8057(Ultra 2) is now supported. Modified: stable/8/share/man/man4/msk.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/msk.4 ============================================================================== --- stable/8/share/man/man4/msk.4 Sun Nov 29 20:10:35 2009 (r199938) +++ stable/8/share/man/man4/msk.4 Sun Nov 29 20:11:38 2009 (r199939) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2009 +.Dd November 6, 2009 .Dt MSK 4 .Os .Sh NAME @@ -204,6 +204,8 @@ Marvell Yukon 88E8055 Gigabit Ethernet .It Marvell Yukon 88E8056 Gigabit Ethernet .It +Marvell Yukon 88E8057 Gigabit Ethernet +.It Marvell Yukon 88E8058 Gigabit Ethernet .It Marvell Yukon 88E8070 Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:12:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1F581065679; Sun, 29 Nov 2009 20:12:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918F48FC14; Sun, 29 Nov 2009 20:12:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKC7V0007738; Sun, 29 Nov 2009 20:12:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKC7IK007736; Sun, 29 Nov 2009 20:12:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292012.nATKC7IK007736@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:12: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: r199940 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:12:07 -0000 Author: yongari Date: Sun Nov 29 20:12:07 2009 New Revision: 199940 URL: http://svn.freebsd.org/changeset/base/199940 Log: MFC r199013: 88E8057(Ultra 2) is now supported. Modified: stable/7/share/man/man4/msk.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Sun Nov 29 20:11:38 2009 (r199939) +++ stable/7/share/man/man4/msk.4 Sun Nov 29 20:12:07 2009 (r199940) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2009 +.Dd November 6, 2009 .Dt MSK 4 .Os .Sh NAME @@ -204,6 +204,8 @@ Marvell Yukon 88E8055 Gigabit Ethernet .It Marvell Yukon 88E8056 Gigabit Ethernet .It +Marvell Yukon 88E8057 Gigabit Ethernet +.It Marvell Yukon 88E8058 Gigabit Ethernet .It Marvell Yukon 88E8070 Gigabit Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:17:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2412106566C; Sun, 29 Nov 2009 20:17:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D27B28FC12; Sun, 29 Nov 2009 20:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKHogo007883; Sun, 29 Nov 2009 20:17:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKHoIe007881; Sun, 29 Nov 2009 20:17:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200911292017.nATKHoIe007881@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 29 Nov 2009 20:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199941 - head/sys/ia64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:17:51 -0000 Author: marcel Date: Sun Nov 29 20:17:50 2009 New Revision: 199941 URL: http://svn.freebsd.org/changeset/base/199941 Log: Move the sysctl related fields to the end of the structure and make them conditional upon _KERNEL. libkvm includes and does not expose the structure definitions to userland. Modified: head/sys/ia64/include/pcpu.h Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Sun Nov 29 20:12:07 2009 (r199940) +++ head/sys/ia64/include/pcpu.h Sun Nov 29 20:17:50 2009 (r199941) @@ -34,9 +34,6 @@ #include struct pcpu_stats { - struct sysctl_ctx_list pcs_sysctl_ctx; - struct sysctl_oid *pcs_sysctl_tree; - u_long pcs_nasts; /* IPI_AST counter. */ u_long pcs_nclks; /* Clock interrupt counter. */ u_long pcs_nextints; /* ExtINT counter. */ @@ -46,6 +43,11 @@ struct pcpu_stats { u_long pcs_nrdvs; /* IPI_RENDEZVOUS counter. */ u_long pcs_nstops; /* IPI_STOP counter. */ u_long pcs_nstrays; /* Stray interrupt counter. */ + +#ifdef _KERNEL + struct sysctl_ctx_list pcs_sysctl_ctx; + struct sysctl_oid *pcs_sysctl_tree; +#endif }; #define PCPU_MD_FIELDS \ From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:19:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A9C01065676; Sun, 29 Nov 2009 20:19:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3CA8FC16; Sun, 29 Nov 2009 20:19:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKJOHs007963; Sun, 29 Nov 2009 20:19:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKJOTj007961; Sun, 29 Nov 2009 20:19:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292019.nATKJOTj007961@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:19:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199942 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:19:24 -0000 Author: yongari Date: Sun Nov 29 20:19:24 2009 New Revision: 199942 URL: http://svn.freebsd.org/changeset/base/199942 Log: MFC r199413: It seems generation of link state change of e1000phy(4) is not reliable on some Marvell PHYs. If msk(4) know it still does not have established link check whether msk(4) missed the link state change by looking into polled link state. Reported by: Mel Flynn < mel.flynn+fbsd.current <> mailing.thruhere dot net >, Gleb Kurtsou gmail dot com > Tested by: Gleb Kurtsou gmail dot com > Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Sun Nov 29 20:17:50 2009 (r199941) +++ stable/8/sys/dev/msk/if_msk.c Sun Nov 29 20:19:24 2009 (r199942) @@ -3200,6 +3200,8 @@ msk_tick(void *xsc_if) mii = device_get_softc(sc_if->msk_miibus); mii_tick(mii); + if ((sc_if->msk_flags & MSK_FLAG_LINK) == 0) + msk_miibus_statchg(sc_if->msk_if_dev); msk_watchdog(sc_if); callout_reset(&sc_if->msk_tick_ch, hz, msk_tick, sc_if); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:20:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D292C1065676; Sun, 29 Nov 2009 20:20:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C23098FC16; Sun, 29 Nov 2009 20:20:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKKYjd008039; Sun, 29 Nov 2009 20:20:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKKYD1008037; Sun, 29 Nov 2009 20:20:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292020.nATKKYD1008037@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:20:34 +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: r199943 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:20:34 -0000 Author: yongari Date: Sun Nov 29 20:20:34 2009 New Revision: 199943 URL: http://svn.freebsd.org/changeset/base/199943 Log: MFC r199413: It seems generation of link state change of e1000phy(4) is not reliable on some Marvell PHYs. If msk(4) know it still does not have established link check whether msk(4) missed the link state change by looking into polled link state. Reported by: Mel Flynn < mel.flynn+fbsd.current <> mailing.thruhere dot net >, Gleb Kurtsou gmail dot com > Tested by: Gleb Kurtsou gmail dot com > Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Sun Nov 29 20:19:24 2009 (r199942) +++ stable/7/sys/dev/msk/if_msk.c Sun Nov 29 20:20:34 2009 (r199943) @@ -3200,6 +3200,8 @@ msk_tick(void *xsc_if) mii = device_get_softc(sc_if->msk_miibus); mii_tick(mii); + if ((sc_if->msk_flags & MSK_FLAG_LINK) == 0) + msk_miibus_statchg(sc_if->msk_if_dev); msk_watchdog(sc_if); callout_reset(&sc_if->msk_tick_ch, hz, msk_tick, sc_if); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:31:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A00621065692; Sun, 29 Nov 2009 20:31:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F2538FC1F; Sun, 29 Nov 2009 20:31:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKV9uX008270; Sun, 29 Nov 2009 20:31:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKV9RV008267; Sun, 29 Nov 2009 20:31:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292031.nATKV9RV008267@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:31:09 +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: r199944 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:31:09 -0000 Author: yongari Date: Sun Nov 29 20:31:09 2009 New Revision: 199944 URL: http://svn.freebsd.org/changeset/base/199944 Log: MFC r195675: Adding hardware ID for RTL810x PCIe found on HP Pavilion DV2-1022AX. Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sun Nov 29 20:20:34 2009 (r199943) +++ stable/7/sys/dev/re/if_re.c Sun Nov 29 20:31:09 2009 (r199944) @@ -211,6 +211,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8101E, RL_8169, "8101E"}, { RL_HWREV_8102E, RL_8169, "8102E"}, { RL_HWREV_8102EL, RL_8169, "8102EL"}, + { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL"}, { RL_HWREV_8168_SPIN2, RL_8169, "8168"}, { RL_HWREV_8168_SPIN3, RL_8169, "8168"}, { RL_HWREV_8168C, RL_8169, "8168C/8111C"}, @@ -1261,6 +1262,7 @@ re_attach(device_t dev) break; case RL_HWREV_8102E: case RL_HWREV_8102EL: + case RL_HWREV_8102EL_SPIN1: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Sun Nov 29 20:20:34 2009 (r199943) +++ stable/7/sys/pci/if_rlreg.h Sun Nov 29 20:31:09 2009 (r199944) @@ -159,6 +159,7 @@ #define RL_HWREV_8169_8110SB 0x10000000 #define RL_HWREV_8169_8110SC 0x18000000 #define RL_HWREV_8102EL 0x24800000 +#define RL_HWREV_8102EL_SPIN1 0x24c00000 #define RL_HWREV_8168D 0x28000000 #define RL_HWREV_8168DP 0x28800000 #define RL_HWREV_8168_SPIN1 0x30000000 From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:34:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F73106568D; Sun, 29 Nov 2009 20:34:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2188FC16; Sun, 29 Nov 2009 20:34:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKYf2F008399; Sun, 29 Nov 2009 20:34:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKYfOE008396; Sun, 29 Nov 2009 20:34:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200911292034.nATKYfOE008396@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 29 Nov 2009 20:34:41 +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: r199945 - in stable/7/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:34:42 -0000 Author: yongari Date: Sun Nov 29 20:34:41 2009 New Revision: 199945 URL: http://svn.freebsd.org/changeset/base/199945 Log: MFC r191301: For RTL8139C+ controllers, have controller handle padding short checksum offload frames. Software workaround used for broken controllers(RTL8169, RTL8168, RTL8168B) seem to cause watchdog timeouts on RTL8139C+. Introduce a new flag RL_FLAG_AUTOPAD to mark automatic padding feature of controller and set it for RTL8139C+ and controllers that use new descriptor format. This fixes watchdog timeouts seen on RTL8139C+. Reported by: Dimitri Rodis < DimitriR <> integritasystems dot com > Tested by: Dimitri Rodis < DimitriR <> integritasystems dot com > Modified: stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Sun Nov 29 20:31:09 2009 (r199944) +++ stable/7/sys/dev/re/if_re.c Sun Nov 29 20:34:41 2009 (r199945) @@ -1253,7 +1253,8 @@ re_attach(device_t dev) switch (hw_rev->rl_rev) { case RL_HWREV_8139CPLUS: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER | + RL_FLAG_AUTOPAD; break; case RL_HWREV_8100E: case RL_HWREV_8101E: @@ -1265,7 +1266,7 @@ re_attach(device_t dev) case RL_HWREV_8102EL_SPIN1: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: @@ -1285,7 +1286,8 @@ re_attach(device_t dev) case RL_HWREV_8168D: case RL_HWREV_8168DP: sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | - RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP; + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP | + RL_FLAG_AUTOPAD; /* * These controllers support jumbo frame but it seems * that enabling it requires touching additional magic @@ -2257,7 +2259,7 @@ re_encap(struct rl_softc *sc, struct mbu * offload is enabled, we always manually pad short frames out * to the minimum ethernet frame size. */ - if ((sc->rl_flags & RL_FLAG_DESCV2) == 0 && + if ((sc->rl_flags & RL_FLAG_AUTOPAD) == 0 && (*m_head)->m_pkthdr.len < RL_IP4CSUMTX_PADLEN && ((*m_head)->m_pkthdr.csum_flags & CSUM_IP) != 0) { padlen = RL_MIN_FRAMELEN - (*m_head)->m_pkthdr.len; Modified: stable/7/sys/pci/if_rlreg.h ============================================================================== --- stable/7/sys/pci/if_rlreg.h Sun Nov 29 20:31:09 2009 (r199944) +++ stable/7/sys/pci/if_rlreg.h Sun Nov 29 20:34:41 2009 (r199945) @@ -855,6 +855,7 @@ struct rl_softc { int rl_txstart; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 +#define RL_FLAG_AUTOPAD 0x0002 #define RL_FLAG_PHYWAKE 0x0008 #define RL_FLAG_NOJUMBO 0x0010 #define RL_FLAG_PAR 0x0020 From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:37:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01CC31065679; Sun, 29 Nov 2009 20:37:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E56B18FC15; Sun, 29 Nov 2009 20:37:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKbUw3008492; Sun, 29 Nov 2009 20:37:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKbUxY008488; Sun, 29 Nov 2009 20:37:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911292037.nATKbUxY008488@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 20:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199946 - in head: sys/netipsec usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:37:31 -0000 Author: bz Date: Sun Nov 29 20:37:30 2009 New Revision: 199946 URL: http://svn.freebsd.org/changeset/base/199946 Log: Add more statistics variables for IPcomp. Try to version the struct in a backward compatible way. People asked for the versioning of the stats structs in general before. MFC after: 5 days Modified: head/sys/netipsec/ipcomp_var.h head/sys/netipsec/xform_ipcomp.c head/usr.bin/netstat/ipsec.c Modified: head/sys/netipsec/ipcomp_var.h ============================================================================== --- head/sys/netipsec/ipcomp_var.h Sun Nov 29 20:34:41 2009 (r199945) +++ head/sys/netipsec/ipcomp_var.h Sun Nov 29 20:37:30 2009 (r199946) @@ -41,6 +41,7 @@ */ #define IPCOMP_ALG_MAX 8 +#define IPCOMPSTAT_VERSION 1 struct ipcompstat { u_int32_t ipcomps_hdrops; /* Packet shorter than header shows */ u_int32_t ipcomps_nopf; /* Protocol family not supported */ @@ -58,6 +59,9 @@ struct ipcompstat { u_int32_t ipcomps_pdrops; /* Packet blocked due to policy */ u_int32_t ipcomps_crypto; /* "Crypto" processing failure */ u_int32_t ipcomps_hist[IPCOMP_ALG_MAX];/* Per-algorithm op count */ + u_int32_t version; /* Version of this structure. */ + u_int32_t ipcomps_threshold; /* Packet < comp. algo. threshold. */ + u_int32_t ipcomps_uncompr; /* Compression was useles. */ }; #ifdef _KERNEL Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sun Nov 29 20:34:41 2009 (r199945) +++ head/sys/netipsec/xform_ipcomp.c Sun Nov 29 20:37:30 2009 (r199946) @@ -345,7 +345,7 @@ ipcomp_output( * See RFC 3173, 2.2. Non-Expansion Policy. */ if (m->m_pkthdr.len <= ipcompx->minlen) { - /* XXX-BZ V_ipcompstat.threshold++; */ + V_ipcompstat.ipcomps_threshold++; return ipsec_process_done(m, isr); } @@ -569,8 +569,10 @@ ipcomp_output_cb(struct cryptop *crp) goto bad; } } else { - /* compression was useless, we have lost time */ - /* XXX add statistic */ + /* Compression was useless, we have lost time. */ + V_ipcompstat.ipcomps_uncompr++; + DPRINTF(("%s: compressions was useless %d - %d <= %d\n", + __func__, crp->crp_ilen, skip, crp->crp_olen)); /* XXX remember state to not compress the next couple * of packets, RFC 3173, 2.2. Non-Expansion Policy */ } @@ -609,3 +611,13 @@ ipcomp_attach(void) } SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL); + +static void +vnet_ipcomp_attach(const void *unused __unused) +{ + + V_ipcompstat.version = IPCOMPSTAT_VERSION; +} + +VNET_SYSINIT(vnet_ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, + vnet_ipcomp_attach, NULL); Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Sun Nov 29 20:34:41 2009 (r199945) +++ head/usr.bin/netstat/ipsec.c Sun Nov 29 20:37:30 2009 (r199946) @@ -418,6 +418,7 @@ esp_stats(u_long off, const char *name, static void print_ipcompstats(const struct ipcompstat *ipcompstat) { + uint32_t version; #define p32(f, m) if (ipcompstat->f || sflag <= 1) \ printf("\t%u" m, (unsigned int)ipcompstat->f, plural(ipcompstat->f)) #define p64(f, m) if (ipcompstat->f || sflag <= 1) \ @@ -425,6 +426,11 @@ print_ipcompstats(const struct ipcompsta #define hist(f, n, t) \ ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t)); +#ifndef IPCOMPSTAT_VERSION + version = 0; +#else + version = ipcompstat->version; +#endif p32(ipcomps_hdrops, " packet%s shorter than header shows\n"); p32(ipcomps_nopf, " packet%s dropped; protocol family not supported\n"); p32(ipcomps_notdb, " packet%s dropped; no TDB\n"); @@ -441,6 +447,10 @@ print_ipcompstats(const struct ipcompsta p32(ipcomps_pdrops, " packet%s blocked due to policy\n"); p32(ipcomps_crypto, " crypto processing failure%s\n"); hist(ipcompstat->ipcomps_hist, ipsec_compnames, "COMP output"); + if (version >= 1) { + p32(ipcomps_threshold, " packet%s sent uncompressed; size < compr. algo. threshold\n"); + p32(ipcomps_uncompr, " packet%s sent uncompressed; compression was useless\n"); + } #undef p32 #undef p64 From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:47:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345AD106566C; Sun, 29 Nov 2009 20:47:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AA838FC15; Sun, 29 Nov 2009 20:47:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKlh1U008714; Sun, 29 Nov 2009 20:47:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKlh66008711; Sun, 29 Nov 2009 20:47:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911292047.nATKlh66008711@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 20:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199947 - in head: share/man/man4 sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:47:44 -0000 Author: bz Date: Sun Nov 29 20:47:43 2009 New Revision: 199947 URL: http://svn.freebsd.org/changeset/base/199947 Log: Enable IPcomp by default. PR: kern/123587 MFC after: 5 days Modified: head/share/man/man4/ipsec.4 head/sys/netipsec/xform_ipcomp.c Modified: head/share/man/man4/ipsec.4 ============================================================================== --- head/share/man/man4/ipsec.4 Sun Nov 29 20:37:30 2009 (r199946) +++ head/share/man/man4/ipsec.4 Sun Nov 29 20:47:43 2009 (r199947) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2009 +.Dd November 29, 2009 .Dt IPSEC 4 .Os .Sh NAME @@ -215,7 +215,7 @@ To selectively enable/disable protocols, .It Sy "Name Default" .It "net.inet.esp.esp_enable On" .It "net.inet.ah.ah_enable On" -.It "net.inet.ipcomp.ipcomp_enable Off" +.It "net.inet.ipcomp.ipcomp_enable On" .El .Pp In addition the following variables are accessible via @@ -408,6 +408,8 @@ size may alleviate this problem. .Pp The .Tn IPcomp -protocol support is currently broken. +protocol may occationally error because of +.Xr zlib 3 +problems. .Pp This documentation needs more review. Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sun Nov 29 20:37:30 2009 (r199946) +++ head/sys/netipsec/xform_ipcomp.c Sun Nov 29 20:47:43 2009 (r199947) @@ -68,7 +68,7 @@ #include #include -VNET_DEFINE(int, ipcomp_enable) = 0; +VNET_DEFINE(int, ipcomp_enable) = 1; VNET_DEFINE(struct ipcompstat, ipcompstat); SYSCTL_DECL(_net_inet_ipcomp); From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:48:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EEAE106566C; Sun, 29 Nov 2009 20:48:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EEEF8FC1B; Sun, 29 Nov 2009 20:48:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKmKZ6008769; Sun, 29 Nov 2009 20:48:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKmKVc008767; Sun, 29 Nov 2009 20:48:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911292048.nATKmKVc008767@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 29 Nov 2009 20:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199948 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:48:20 -0000 Author: nwhitehorn Date: Sun Nov 29 20:48:19 2009 New Revision: 199948 URL: http://svn.freebsd.org/changeset/base/199948 Log: Early-generation touchpads do not send periodic calibration frames for baseline subtraction, and are very temperature sensitive, so would slowly drift out of a calibrated state when under load. Escape this by taking the last frame before we decide that the pad is idle as a finger-free baseline. Tested on: iBook G4 Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Sun Nov 29 20:47:43 2009 (r199947) +++ head/sys/dev/usb/input/atp.c Sun Nov 29 20:48:19 2009 (r199948) @@ -1850,6 +1850,21 @@ atp_intr(struct usb_xfer *xfer, usb_erro sc->sc_idlecount++; if (sc->sc_idlecount >= ATP_IDLENESS_THRESHOLD) { DPRINTFN(ATP_LLEVEL_INFO, "idle\n"); + + /* + * Use the last frame before we go idle for + * calibration on pads which do not send + * calibration frames. + */ + if (sc->sc_params->prot < ATP_PROT_GEYSER3) { + memcpy(sc->base_x, sc->cur_x, + sc->sc_params->n_xsensors * + sizeof(*(sc->base_x))); + memcpy(sc->base_y, sc->cur_y, + sc->sc_params->n_ysensors * + sizeof(*(sc->base_y))); + } + sc->sc_idlecount = 0; usbd_transfer_start(sc->sc_xfer[ATP_RESET]); } From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:51:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95764106568D; Sun, 29 Nov 2009 20:51:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856F08FC1D; Sun, 29 Nov 2009 20:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATKpNEU008870; Sun, 29 Nov 2009 20:51:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATKpNxc008868; Sun, 29 Nov 2009 20:51:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200911292051.nATKpNxc008868@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 29 Nov 2009 20:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199949 - head/sys/powerpc/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:51:23 -0000 Author: nwhitehorn Date: Sun Nov 29 20:51:23 2009 New Revision: 199949 URL: http://svn.freebsd.org/changeset/base/199949 Log: Add atp(4) to powerpc GENERIC. Most late-generation Apple PowerPC laptops have trackpads that do not work at all without this driver. Modified: head/sys/powerpc/conf/GENERIC Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Nov 29 20:48:19 2009 (r199948) +++ head/sys/powerpc/conf/GENERIC Sun Nov 29 20:51:23 2009 (r199949) @@ -155,6 +155,7 @@ options KBD_INSTALL_CDEV # install a CD device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da0 device ums # Mouse +device atp # Apple USB touchpad device urio # Diamond Rio 500 MP3 player # USB Ethernet device aue # ADMtek USB Ethernet From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 20:55:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363E31065672; Sun, 29 Nov 2009 20:55:45 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id D269D8FC13; Sun, 29 Nov 2009 20:55:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id D8C0414D9D9B; Sun, 29 Nov 2009 21:55:41 +0100 (CET) X-Virus-Scanned: amavisd-new at example.com Received: from server.mypc.hu ([127.0.0.1]) by localhost (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AzIFvKg1W1NA; Sun, 29 Nov 2009 21:55:39 +0100 (CET) Received: from [192.168.1.105] (catv-89-132-179-104.catv.broadband.hu [89.132.179.104]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.mypc.hu (Postfix) with ESMTPSA id 0925614D9D47; Sun, 29 Nov 2009 21:55:38 +0100 (CET) Message-ID: <4B12DFC6.3050108@FreeBSD.org> Date: Sun, 29 Nov 2009 21:55:34 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <200911292047.nATKlh66008711@svn.freebsd.org> In-Reply-To: <200911292047.nATKlh66008711@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199947 - in head: share/man/man4 sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 20:55:45 -0000 Bjoern A. Zeeb escribió: > -protocol support is currently broken. > +protocol may occationally error because of > +.Xr zlib 3 > +problems. > There's a typo here, should be occasionally. -- Gabor Kovesdan FreeBSD Volunteer EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 21:03:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290F2106568B; Sun, 29 Nov 2009 21:03:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 192668FC12; Sun, 29 Nov 2009 21:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATL3sTI009147; Sun, 29 Nov 2009 21:03:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATL3sPG009145; Sun, 29 Nov 2009 21:03:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200911292103.nATL3sPG009145@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 29 Nov 2009 21:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199950 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 21:03:55 -0000 Author: bz Date: Sun Nov 29 21:03:54 2009 New Revision: 199950 URL: http://svn.freebsd.org/changeset/base/199950 Log: Correct typo. Reported by: gabor MFC after: 5 days Modified: head/share/man/man4/ipsec.4 Modified: head/share/man/man4/ipsec.4 ============================================================================== --- head/share/man/man4/ipsec.4 Sun Nov 29 20:51:23 2009 (r199949) +++ head/share/man/man4/ipsec.4 Sun Nov 29 21:03:54 2009 (r199950) @@ -408,7 +408,7 @@ size may alleviate this problem. .Pp The .Tn IPcomp -protocol may occationally error because of +protocol may occasionally error because of .Xr zlib 3 problems. .Pp From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 21:05:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1791065670; Sun, 29 Nov 2009 21:05:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 19CEF8FC08; Sun, 29 Nov 2009 21:05:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 7918D41C677; Sun, 29 Nov 2009 22:05:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id 6Ro5Zir0hGti; Sun, 29 Nov 2009 22:05:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id CC2E441C67E; Sun, 29 Nov 2009 22:05:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 85CFF4448EC; Sun, 29 Nov 2009 21:04:09 +0000 (UTC) Date: Sun, 29 Nov 2009 21:04:09 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Gabor Kovesdan In-Reply-To: <4B12DFC6.3050108@FreeBSD.org> Message-ID: <20091129210357.Y37440@maildrop.int.zabbadoz.net> References: <200911292047.nATKlh66008711@svn.freebsd.org> <4B12DFC6.3050108@FreeBSD.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-10082989-1259528649=:37440" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199947 - in head: share/man/man4 sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 21:05:07 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-10082989-1259528649=:37440 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 29 Nov 2009, Gabor Kovesdan wrote: > Bjoern A. Zeeb escribi=F3: >> -protocol support is currently broken. >> +protocol may occationally error because of >> +.Xr zlib 3 >> +problems. >>=20 > There's a typo here, should be occasionally. Fixed, thanks! --=20 Bjoern A. Zeeb It will not break if you know what you are doing. --0-10082989-1259528649=:37440-- From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 22:33:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 696251065672; Sun, 29 Nov 2009 22:33:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5713A8FC08; Sun, 29 Nov 2009 22:33:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATMXxPk011548; Sun, 29 Nov 2009 22:33:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATMXxIn011543; Sun, 29 Nov 2009 22:33:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200911292233.nATMXxIn011543@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 29 Nov 2009 22:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199953 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 22:33:59 -0000 Author: jilles Date: Sun Nov 29 22:33:59 2009 New Revision: 199953 URL: http://svn.freebsd.org/changeset/base/199953 Log: Fix some cases where file descriptors from redirections leak to programs. - Redirecting fds that were not open before kept two copies of the redirected file. sh -c '{ :; } 7>/dev/null; fstat -p $$; true' (both fd 7 and 10 remained open) - File descriptors used to restore things after redirection were not set close-on-exec, instead they were explicitly closed before executing a program normally and before executing a shell procedure. The latter must remain but the former is replaced by close-on-exec. sh -c 'exec 7/dev/null; true' (fd 10 remained open) The examples above are simpler than the testsuite because I do not want to use fstat or procstat in the testsuite. Added: head/tools/regression/bin/sh/execution/redir1.0 (contents, props changed) head/tools/regression/bin/sh/execution/redir2.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/redir.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Nov 29 21:34:52 2009 (r199952) +++ head/bin/sh/eval.c Sun Nov 29 22:33:59 2009 (r199953) @@ -883,7 +883,6 @@ cmddone: #ifdef DEBUG trputs("normal command: "); trargs(argv); #endif - clearredir(); redirect(cmd->ncmd.redirect, 0); for (sp = varlist.list ; sp ; sp = sp->next) setvareq(sp->text, VEXPORT|VSTACK); Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Sun Nov 29 21:34:52 2009 (r199952) +++ head/bin/sh/redir.c Sun Nov 29 22:33:59 2009 (r199953) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #define EMPTY -2 /* marks an unused slot in redirtab */ +#define CLOSED -1 /* fd was not open before redir */ #define PIPESIZE 4096 /* amount of buffering in a pipe */ @@ -101,7 +102,6 @@ redirect(union node *redir, int flags) struct redirtab *sv = NULL; int i; int fd; - int try; char memory[10]; /* file descriptors to write to memory */ for (i = 10 ; --i >= 0 ; ) @@ -116,38 +116,30 @@ redirect(union node *redir, int flags) } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; - try = 0; if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) && n->ndup.dupfd == fd) continue; /* redirect from/to same file descriptor */ if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { INTOFF; -again: if ((i = fcntl(fd, F_DUPFD, 10)) == -1) { switch (errno) { case EBADF: - if (!try) { - openredirect(n, memory); - try++; - goto again; - } - /* FALLTHROUGH*/ + i = CLOSED; + break; default: INTON; error("%d: %s", fd, strerror(errno)); break; } - } - if (!try) { - sv->renamed[fd] = i; - } + } else + (void)fcntl(i, F_SETFD, FD_CLOEXEC); + sv->renamed[fd] = i; INTON; } if (fd == 0) fd0_redirected++; - if (!try) - openredirect(n, memory); + openredirect(n, memory); } if (memory[1]) out1 = &memout; Added: head/tools/regression/bin/sh/execution/redir1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/redir1.0 Sun Nov 29 22:33:59 2009 (r199953) @@ -0,0 +1,27 @@ +# $FreeBSD$ +trap ': $((brokenpipe+=1))' pipe + +P=${TMPDIR:-/tmp} +cd $P +T=$(mktemp -d sh-test.XXXXXX) +cd $T + +brokenpipe=0 +mkfifo fifo1 fifo2 +read dummy >fifo2 fifo2 +} 3fifo1 +if [ $brokenpipe -ne 0 ]; then + rc=3 +fi +wait +echo dummy >&4 +if [ $brokenpipe -eq 1 ]; then + : ${rc:=0} +fi + +rm fifo1 fifo2 +rmdir ${P}/${T} +exit ${rc:-3} Added: head/tools/regression/bin/sh/execution/redir2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/redir2.0 Sun Nov 29 22:33:59 2009 (r199953) @@ -0,0 +1,29 @@ +# $FreeBSD$ +trap ': $((brokenpipe+=1))' pipe + +P=${TMPDIR:-/tmp} +cd $P +T=$(mktemp -d sh-test.XXXXXX) +cd $T + +brokenpipe=0 +mkfifo fifo1 fifo2 +{ + { + exec sh -c 'exec fifo2 +exec 3>fifo1 +echo dummy >&4 +if [ $brokenpipe -eq 1 ]; then + : ${rc:=0} +fi +echo dummy >&3 +wait + +rm fifo1 fifo2 +rmdir ${P}/${T} +exit ${rc:-3} From owner-svn-src-all@FreeBSD.ORG Sun Nov 29 22:58:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C15571065741; Sun, 29 Nov 2009 22:58:10 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEC3E8FC14; Sun, 29 Nov 2009 22:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nATMwA6I012088; Sun, 29 Nov 2009 22:58:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nATMwArp012085; Sun, 29 Nov 2009 22:58:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200911292258.nATMwArp012085@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 29 Nov 2009 22:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199955 - in head/tools/regression/bin/sh: builtins errors X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Nov 2009 22:58:10 -0000 Author: jilles Date: Sun Nov 29 22:58:10 2009 New Revision: 199955 URL: http://svn.freebsd.org/changeset/base/199955 Log: Disable job control when running 'sh -i' in the testsuite. Job control tty manipulations sometimes cause the tests to stop (SIGTTOU and the like) when run from the 'prove' tool. Modified: head/tools/regression/bin/sh/builtins/fc1.0 head/tools/regression/bin/sh/errors/backquote-error1.0 Modified: head/tools/regression/bin/sh/builtins/fc1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/fc1.0 Sun Nov 29 22:43:51 2009 (r199954) +++ head/tools/regression/bin/sh/builtins/fc1.0 Sun Nov 29 22:58:10 2009 (r199955) @@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX) cd $T mkfifo input output error -HISTFILE=/dev/null sh -i output 2>error & +HISTFILE=/dev/null sh +m -i output 2>error & { # Syntax error echo ')' >&3 Modified: head/tools/regression/bin/sh/errors/backquote-error1.0 ============================================================================== --- head/tools/regression/bin/sh/errors/backquote-error1.0 Sun Nov 29 22:43:51 2009 (r199954) +++ head/tools/regression/bin/sh/errors/backquote-error1.0 Sun Nov 29 22:58:10 2009 (r199955) @@ -1,4 +1,4 @@ # $FreeBSD$ -echo 'echo `for` echo ".BAD"CODE.' | sh -i 2>&1 | grep -q BADCODE && exit 1 +echo 'echo `for` echo ".BAD"CODE.' | sh +m -i 2>&1 | grep -q BADCODE && exit 1 exit 0 From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 02:59:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03AD6106566C; Mon, 30 Nov 2009 02:59:31 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D35D78FC08; Mon, 30 Nov 2009 02:59:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU2xUcM016387; Mon, 30 Nov 2009 02:59:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU2xUp4016377; Mon, 30 Nov 2009 02:59:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200911300259.nAU2xUp4016377@svn.freebsd.org> From: Doug Barton Date: Mon, 30 Nov 2009 02:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199956 - in vendor/bind9/dist: . bin/named lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 02:59:31 -0000 Author: dougb Date: Mon Nov 30 02:59:30 2009 New Revision: 199956 URL: http://svn.freebsd.org/changeset/base/199956 Log: Vendor import of BIND 9.6.1-P2 Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/bin/named/query.c vendor/bind9/dist/lib/dns/api vendor/bind9/dist/lib/dns/include/dns/types.h vendor/bind9/dist/lib/dns/masterdump.c vendor/bind9/dist/lib/dns/rbtdb.c vendor/bind9/dist/lib/dns/resolver.c vendor/bind9/dist/lib/dns/validator.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/CHANGES Mon Nov 30 02:59:30 2009 (r199956) @@ -1,3 +1,9 @@ + --- 9.6.1-P2 released --- + +2772. [security] When validating, track whether pending data was from + the additional section or not and only return it if + validates as secure. [RT #20438] + --- 9.6.1-P1 released --- 2640. [security] A specially crafted update packet will cause named Modified: vendor/bind9/dist/bin/named/query.c ============================================================================== --- vendor/bind9/dist/bin/named/query.c Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/bin/named/query.c Mon Nov 30 02:59:30 2009 (r199956) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.7 2009/03/13 01:38:51 marka Exp $ */ +/* $Id: query.c,v 1.313.20.7.12.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -116,6 +116,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + typedef struct client_additionalctx { ns_client_t *client; dns_rdataset_t *rdataset; @@ -1761,8 +1763,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -1801,8 +1803,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -2601,14 +2603,14 @@ query_addbestns(ns_client_t *client) { /* * Attempt to validate RRsets that are pending or that are glue. */ - if ((rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending)) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && - (client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0) + !PENDINGOK(client->query.dboptions)) goto cleanup; - if ((rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue)) && + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && SECURE(client) && WANTDNSSEC(client)) goto cleanup; @@ -3716,6 +3718,8 @@ query_find(ns_client_t *client, dns_fetc dns_rdataset_t *noqname; isc_boolean_t resuming; int line = -1; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -3933,9 +3937,49 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (validate(client, db, fname, rdataset, sigrdataset)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: vendor/bind9/dist/lib/dns/api ============================================================================== --- vendor/bind9/dist/lib/dns/api Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/lib/dns/api Mon Nov 30 02:59:30 2009 (r199956) @@ -1,3 +1,3 @@ -LIBINTERFACE = 52 +LIBINTERFACE = 53 LIBREVISION = 0 -LIBAGE = 2 +LIBAGE = 0 Modified: vendor/bind9/dist/lib/dns/include/dns/types.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/types.h Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/lib/dns/include/dns/types.h Mon Nov 30 02:59:30 2009 (r199956) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.130.50.3 2009/01/29 22:40:35 jinmei Exp $ */ +/* $Id: types.h,v 1.130.50.3.12.1 2009/11/18 23:58:04 marka Exp $ */ #ifndef DNS_TYPES_H #define DNS_TYPES_H 1 @@ -258,40 +258,52 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /*% Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) + + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) /*% Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) /* Received in a referral response. */ - dns_trust_glue = 3, + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) /* Answer from a non-authoritative server */ - dns_trust_answer = 4, + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) /* Answer from an authoritative server */ - dns_trust_authanswer = 6, + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + + /*% * Name checking severities. */ Modified: vendor/bind9/dist/lib/dns/masterdump.c ============================================================================== --- vendor/bind9/dist/lib/dns/masterdump.c Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/lib/dns/masterdump.c Mon Nov 30 02:59:30 2009 (r199956) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.94.50.2 2009/01/18 23:47:40 tbox Exp $ */ +/* $Id: masterdump.c,v 1.94.50.2.12.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -775,7 +775,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: vendor/bind9/dist/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist/lib/dns/rbtdb.c Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/lib/dns/rbtdb.c Mon Nov 30 02:59:30 2009 (r199956) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.6 2009/05/06 23:34:30 jinmei Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.6.10.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -4005,7 +4005,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -4548,7 +4548,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: vendor/bind9/dist/lib/dns/resolver.c ============================================================================== --- vendor/bind9/dist/lib/dns/resolver.c Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/lib/dns/resolver.c Mon Nov 30 02:59:30 2009 (r199956) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.384.14.14 2009/06/02 23:47:13 tbox Exp $ */ +/* $Id: resolver.c,v 1.384.14.14.8.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -4293,6 +4293,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -4329,12 +4330,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation || !ANSWER(rdataset)) { addedrdataset = ardataset; result = dns_db_addrdataset(fctx->cache, node, @@ -4682,7 +4705,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: vendor/bind9/dist/lib/dns/validator.c ============================================================================== --- vendor/bind9/dist/lib/dns/validator.c Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/lib/dns/validator.c Mon Nov 30 02:59:30 2009 (r199956) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.164.12.9 2009/05/07 23:47:12 tbox Exp $ */ +/* $Id: validator.c,v 1.164.12.9.8.1 2009/11/18 23:58:04 marka Exp $ */ #include @@ -1607,7 +1607,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1622,7 +1622,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -2243,7 +2243,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -2256,7 +2256,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -3337,7 +3337,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: vendor/bind9/dist/version ============================================================================== --- vendor/bind9/dist/version Sun Nov 29 22:58:10 2009 (r199955) +++ vendor/bind9/dist/version Mon Nov 30 02:59:30 2009 (r199956) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.5.8.1 2009/07/28 14:18:08 marka Exp $ +# $Id: version,v 1.43.12.5.8.2 2009/11/18 23:58:04 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER=1 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 03:00:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCF371065692; Mon, 30 Nov 2009 03:00:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0578FC1C; Mon, 30 Nov 2009 03:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU30fmI016477; Mon, 30 Nov 2009 03:00:41 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU30fIr016476; Mon, 30 Nov 2009 03:00:41 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200911300300.nAU30fIr016476@svn.freebsd.org> From: Doug Barton Date: Mon, 30 Nov 2009 03:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199957 - vendor/bind9/9.6.1-P2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 03:00:41 -0000 Author: dougb Date: Mon Nov 30 03:00:41 2009 New Revision: 199957 URL: http://svn.freebsd.org/changeset/base/199957 Log: Tag the 9.6.1-P2 release Added: vendor/bind9/9.6.1-P2/ - copied from r199956, vendor/bind9/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 03:38:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B89C7106568D; Mon, 30 Nov 2009 03:38:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A55DC8FC26; Mon, 30 Nov 2009 03:38:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU3cYef017487; Mon, 30 Nov 2009 03:38:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU3cYou017476; Mon, 30 Nov 2009 03:38:34 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200911300338.nAU3cYou017476@svn.freebsd.org> From: Doug Barton Date: Mon, 30 Nov 2009 03:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199958 - in head: contrib/bind9 contrib/bind9/bin/named contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns lib/bind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 03:38:34 -0000 Author: dougb Date: Mon Nov 30 03:38:34 2009 New Revision: 199958 URL: http://svn.freebsd.org/changeset/base/199958 Log: Update to BIND 9.6.1-P2. The vulnerability this is designed to fix is related to DNSSEC validation on a resolving name server that allows access to untrusted users. If your system does not fall into all 3 of these categories you do not need to update immediately. Modified: head/contrib/bind9/CHANGES head/contrib/bind9/bin/named/query.c head/contrib/bind9/lib/dns/api head/contrib/bind9/lib/dns/include/dns/types.h head/contrib/bind9/lib/dns/masterdump.c head/contrib/bind9/lib/dns/rbtdb.c head/contrib/bind9/lib/dns/resolver.c head/contrib/bind9/lib/dns/validator.c head/contrib/bind9/version head/lib/bind/config.h Directory Properties: head/contrib/bind9/ (props changed) Modified: head/contrib/bind9/CHANGES ============================================================================== --- head/contrib/bind9/CHANGES Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/CHANGES Mon Nov 30 03:38:34 2009 (r199958) @@ -1,3 +1,9 @@ + --- 9.6.1-P2 released --- + +2772. [security] When validating, track whether pending data was from + the additional section or not and only return it if + validates as secure. [RT #20438] + --- 9.6.1-P1 released --- 2640. [security] A specially crafted update packet will cause named Modified: head/contrib/bind9/bin/named/query.c ============================================================================== --- head/contrib/bind9/bin/named/query.c Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/bin/named/query.c Mon Nov 30 03:38:34 2009 (r199958) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.7 2009/03/13 01:38:51 marka Exp $ */ +/* $Id: query.c,v 1.313.20.7.12.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -116,6 +116,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + typedef struct client_additionalctx { ns_client_t *client; dns_rdataset_t *rdataset; @@ -1761,8 +1763,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -1801,8 +1803,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -2601,14 +2603,14 @@ query_addbestns(ns_client_t *client) { /* * Attempt to validate RRsets that are pending or that are glue. */ - if ((rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending)) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && - (client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0) + !PENDINGOK(client->query.dboptions)) goto cleanup; - if ((rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue)) && + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && SECURE(client) && WANTDNSSEC(client)) goto cleanup; @@ -3716,6 +3718,8 @@ query_find(ns_client_t *client, dns_fetc dns_rdataset_t *noqname; isc_boolean_t resuming; int line = -1; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -3933,9 +3937,49 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (validate(client, db, fname, rdataset, sigrdataset)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: head/contrib/bind9/lib/dns/api ============================================================================== --- head/contrib/bind9/lib/dns/api Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/lib/dns/api Mon Nov 30 03:38:34 2009 (r199958) @@ -1,3 +1,3 @@ -LIBINTERFACE = 52 +LIBINTERFACE = 53 LIBREVISION = 0 -LIBAGE = 2 +LIBAGE = 0 Modified: head/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- head/contrib/bind9/lib/dns/include/dns/types.h Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/lib/dns/include/dns/types.h Mon Nov 30 03:38:34 2009 (r199958) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.130.50.3 2009/01/29 22:40:35 jinmei Exp $ */ +/* $Id: types.h,v 1.130.50.3.12.1 2009/11/18 23:58:04 marka Exp $ */ #ifndef DNS_TYPES_H #define DNS_TYPES_H 1 @@ -258,40 +258,52 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /*% Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) + + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) /*% Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) /* Received in a referral response. */ - dns_trust_glue = 3, + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) /* Answer from a non-authoritative server */ - dns_trust_answer = 4, + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) /* Answer from an authoritative server */ - dns_trust_authanswer = 6, + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + + /*% * Name checking severities. */ Modified: head/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- head/contrib/bind9/lib/dns/masterdump.c Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/lib/dns/masterdump.c Mon Nov 30 03:38:34 2009 (r199958) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.94.50.2 2009/01/18 23:47:40 tbox Exp $ */ +/* $Id: masterdump.c,v 1.94.50.2.12.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -775,7 +775,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: head/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- head/contrib/bind9/lib/dns/rbtdb.c Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/lib/dns/rbtdb.c Mon Nov 30 03:38:34 2009 (r199958) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.6 2009/05/06 23:34:30 jinmei Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.6.10.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -4005,7 +4005,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -4548,7 +4548,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: head/contrib/bind9/lib/dns/resolver.c ============================================================================== --- head/contrib/bind9/lib/dns/resolver.c Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/lib/dns/resolver.c Mon Nov 30 03:38:34 2009 (r199958) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.384.14.14 2009/06/02 23:47:13 tbox Exp $ */ +/* $Id: resolver.c,v 1.384.14.14.8.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -4293,6 +4293,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -4329,12 +4330,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation || !ANSWER(rdataset)) { addedrdataset = ardataset; result = dns_db_addrdataset(fctx->cache, node, @@ -4682,7 +4705,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: head/contrib/bind9/lib/dns/validator.c ============================================================================== --- head/contrib/bind9/lib/dns/validator.c Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/lib/dns/validator.c Mon Nov 30 03:38:34 2009 (r199958) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.164.12.9 2009/05/07 23:47:12 tbox Exp $ */ +/* $Id: validator.c,v 1.164.12.9.8.1 2009/11/18 23:58:04 marka Exp $ */ #include @@ -1607,7 +1607,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1622,7 +1622,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -2243,7 +2243,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -2256,7 +2256,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -3337,7 +3337,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: head/contrib/bind9/version ============================================================================== --- head/contrib/bind9/version Mon Nov 30 03:00:41 2009 (r199957) +++ head/contrib/bind9/version Mon Nov 30 03:38:34 2009 (r199958) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.5.8.1 2009/07/28 14:18:08 marka Exp $ +# $Id: version,v 1.43.12.5.8.2 2009/11/18 23:58:04 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER=1 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 Modified: head/lib/bind/config.h ============================================================================== --- head/lib/bind/config.h Mon Nov 30 03:00:41 2009 (r199957) +++ head/lib/bind/config.h Mon Nov 30 03:38:34 2009 (r199958) @@ -277,6 +277,10 @@ int sigwait(const unsigned int *set, int /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + /* Defined if extern char *optarg is not declared. */ /* #undef NEED_OPTARG */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 04:20:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0DCD106566B; Mon, 30 Nov 2009 04:20:43 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF6A78FC14; Mon, 30 Nov 2009 04:20:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU4Khnu018287; Mon, 30 Nov 2009 04:20:43 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU4KhQQ018284; Mon, 30 Nov 2009 04:20:43 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911300420.nAU4KhQQ018284@svn.freebsd.org> From: Kip Macy Date: Mon, 30 Nov 2009 04:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199959 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 04:20:44 -0000 Author: kmacy Date: Mon Nov 30 04:20:43 2009 New Revision: 199959 URL: http://svn.freebsd.org/changeset/base/199959 Log: Update license to reflect terms in xen 2.0 as of the time when the driver was ported to FreeBSD Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Nov 30 03:38:34 2009 (r199958) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Nov 30 04:20:43 2009 (r199959) @@ -1,24 +1,29 @@ -/*- - * All rights reserved. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - /* * XenBSD block device driver * * Copyright (c) 2009 Frank Suchomel, Citrix + * Copyright (c) 2009 Doug F. Rabson, Citrix + * Copyright (c) 2005 Kip Macy + * Copyright (c) 2003-2004, Keir Fraser & Steve Hand + * Modifications by Mark A. Williamson are (c) Intel Research Cambridge + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ #include Modified: head/sys/dev/xen/blkfront/block.h ============================================================================== --- head/sys/dev/xen/blkfront/block.h Mon Nov 30 03:38:34 2009 (r199958) +++ head/sys/dev/xen/blkfront/block.h Mon Nov 30 04:20:43 2009 (r199959) @@ -1,5 +1,23 @@ /* * + * XenBSD block device driver + * + * Copyright (c) 2009 Frank Suchomel, Citrix + * Copyright (c) 2009 Doug F. Rabson, Citrix + * Copyright (c) 2005 Kip Macy + * Copyright (c) 2003-2004, Keir Fraser & Steve Hand + * Modifications by Mark A. Williamson are (c) Intel Research Cambridge + * + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 04:32:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F921065670; Mon, 30 Nov 2009 04:32:35 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 36CBE8FC13; Mon, 30 Nov 2009 04:32:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU4WYti018516; Mon, 30 Nov 2009 04:32:34 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU4WYeA018513; Mon, 30 Nov 2009 04:32:34 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911300432.nAU4WYeA018513@svn.freebsd.org> From: Kip Macy Date: Mon, 30 Nov 2009 04:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199960 - head/sys/dev/xen/blkfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 04:32:35 -0000 Author: kmacy Date: Mon Nov 30 04:32:34 2009 New Revision: 199960 URL: http://svn.freebsd.org/changeset/base/199960 Log: Merge Scott Long's latest blkfront now that the licensing issues are resolved Modified: head/sys/dev/xen/blkfront/blkfront.c head/sys/dev/xen/blkfront/block.h Modified: head/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- head/sys/dev/xen/blkfront/blkfront.c Mon Nov 30 04:20:43 2009 (r199959) +++ head/sys/dev/xen/blkfront/blkfront.c Mon Nov 30 04:32:34 2009 (r199960) @@ -1,6 +1,7 @@ /* * XenBSD block device driver * + * Copyright (c) 2009 Scott Long, Yahoo! * Copyright (c) 2009 Frank Suchomel, Citrix * Copyright (c) 2009 Doug F. Rabson, Citrix * Copyright (c) 2005 Kip Macy @@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -63,27 +65,21 @@ __FBSDID("$FreeBSD$"); #include "xenbus_if.h" -#define ASSERT(S) KASSERT(S, (#S)) /* prototypes */ -struct xb_softc; +static void xb_free_command(struct xb_command *cm); static void xb_startio(struct xb_softc *sc); -static void connect(device_t, struct blkfront_info *); +static void connect(struct xb_softc *); static void blkfront_closing(device_t); static int blkfront_detach(device_t); -static int talk_to_backend(device_t, struct blkfront_info *); -static int setup_blkring(device_t, struct blkfront_info *); +static int talk_to_backend(struct xb_softc *); +static int setup_blkring(struct xb_softc *); static void blkif_int(void *); -#if 0 -static void blkif_restart_queue(void *arg); -#endif -static void blkif_recover(struct blkfront_info *); -static void blkif_completion(struct blk_shadow *); -static void blkif_free(struct blkfront_info *, int); +static void blkif_recover(struct xb_softc *); +static void blkif_completion(struct xb_command *); +static void blkif_free(struct xb_softc *, int); +static void blkif_queue_cb(void *, bus_dma_segment_t *, int, int); #define GRANT_INVALID_REF 0 -#define BLK_RING_SIZE __RING_SIZE((blkif_sring_t *)0, PAGE_SIZE) - -LIST_HEAD(xb_softc_list_head, xb_softc) xbsl_head; /* Control whether runtime update of vbds is enabled. */ #define ENABLE_VBD_UPDATE 0 @@ -92,7 +88,6 @@ LIST_HEAD(xb_softc_list_head, xb_softc) static void vbd_update(void); #endif - #define BLKIF_STATE_DISCONNECTED 0 #define BLKIF_STATE_CONNECTED 1 #define BLKIF_STATE_SUSPENDED 2 @@ -111,44 +106,34 @@ static char * blkif_status_name[] = { [BLKIF_INTERFACE_STATUS_CHANGED] = "changed", }; #endif -#define WPRINTK(fmt, args...) printf("[XEN] " fmt, ##args) + #if 0 #define DPRINTK(fmt, args...) printf("[XEN] %s:%d: " fmt ".\n", __func__, __LINE__, ##args) #else #define DPRINTK(fmt, args...) #endif -static grant_ref_t gref_head; #define MAXIMUM_OUTSTANDING_BLOCK_REQS \ (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLK_RING_SIZE) -static void kick_pending_request_queues(struct blkfront_info *); +#define BLKIF_MAXIO (32 * 1024) + static int blkif_open(struct disk *dp); static int blkif_close(struct disk *dp); static int blkif_ioctl(struct disk *dp, u_long cmd, void *addr, int flag, struct thread *td); -static int blkif_queue_request(struct bio *bp); +static int blkif_queue_request(struct xb_softc *sc, struct xb_command *cm); static void xb_strategy(struct bio *bp); // In order to quiesce the device during kernel dumps, outstanding requests to // DOM0 for disk reads/writes need to be accounted for. -static int blkif_queued_requests; static int xb_dump(void *, void *, vm_offset_t, off_t, size_t); - /* XXX move to xb_vbd.c when VBD update support is added */ #define MAX_VBDS 64 #define XBD_SECTOR_SIZE 512 /* XXX: assume for now */ #define XBD_SECTOR_SHFT 9 -static struct mtx blkif_io_lock; - -static vm_paddr_t -pfn_to_mfn(vm_paddr_t pfn) -{ - return (phystomach(pfn << PAGE_SHIFT) >> PAGE_SHIFT); -} - /* * Translate Linux major/minor to an appropriate name and unit * number. For HVM guests, this allows us to use the same drive names @@ -217,23 +202,18 @@ blkfront_vdevice_to_unit(int vdevice, in } int -xlvbd_add(device_t dev, blkif_sector_t capacity, - int vdevice, uint16_t vdisk_info, uint16_t sector_size, - struct blkfront_info *info) +xlvbd_add(struct xb_softc *sc, blkif_sector_t capacity, + int vdevice, uint16_t vdisk_info, uint16_t sector_size) { - struct xb_softc *sc; int unit, error = 0; const char *name; blkfront_vdevice_to_unit(vdevice, &unit, &name); - sc = (struct xb_softc *)malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); sc->xb_unit = unit; - sc->xb_info = info; - info->sc = sc; if (strcmp(name, "xbd")) - device_printf(dev, "attaching as %s%d\n", name, unit); + device_printf(sc->xb_dev, "attaching as %s%d\n", name, unit); memset(&sc->xb_disk, 0, sizeof(sc->xb_disk)); sc->xb_disk = disk_alloc(); @@ -247,31 +227,18 @@ xlvbd_add(device_t dev, blkif_sector_t c sc->xb_disk->d_drv1 = sc; sc->xb_disk->d_sectorsize = sector_size; - /* XXX */ sc->xb_disk->d_mediasize = capacity << XBD_SECTOR_SHFT; -#if 0 - sc->xb_disk->d_maxsize = DFLTPHYS; -#else /* XXX: xen can't handle large single i/o requests */ - sc->xb_disk->d_maxsize = 4096; -#endif -#ifdef notyet - XENPRINTF("attaching device 0x%x unit %d capacity %llu\n", - xb_diskinfo[sc->xb_unit].device, sc->xb_unit, - sc->xb_disk->d_mediasize); -#endif + sc->xb_disk->d_maxsize = BLKIF_MAXIO; sc->xb_disk->d_flags = 0; disk_create(sc->xb_disk, DISK_VERSION_00); - bioq_init(&sc->xb_bioq); return error; } void -xlvbd_del(struct blkfront_info *info) +xlvbd_del(struct xb_softc *sc) { - struct xb_softc *sc; - sc = info->sc; disk_destroy(sc->xb_disk); } /************************ end VBD support *****************/ @@ -289,102 +256,147 @@ xb_strategy(struct bio *bp) if (sc == NULL) { bp->bio_error = EINVAL; bp->bio_flags |= BIO_ERROR; - goto bad; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + return; } - DPRINTK(""); - /* * Place it in the queue of disk activities for this disk */ - mtx_lock(&blkif_io_lock); + mtx_lock(&sc->xb_io_lock); - bioq_disksort(&sc->xb_bioq, bp); + xb_enqueue_bio(sc, bp); xb_startio(sc); - mtx_unlock(&blkif_io_lock); + mtx_unlock(&sc->xb_io_lock); return; +} - bad: - /* - * Correctly set the bio to indicate a failed tranfer. - */ - bp->bio_resid = bp->bio_bcount; +static void +xb_bio_complete(struct xb_softc *sc, struct xb_command *cm) +{ + struct bio *bp; + + bp = cm->bp; + + if ( unlikely(cm->status != BLKIF_RSP_OKAY) ) { + disk_err(bp, "disk error" , -1, 0); + printf(" status: %x\n", cm->status); + bp->bio_flags |= BIO_ERROR; + } + + if (bp->bio_flags & BIO_ERROR) + bp->bio_error = EIO; + else + bp->bio_resid = 0; + + xb_free_command(cm); biodone(bp); - return; } -static void xb_quiesce(struct blkfront_info *info); // Quiesce the disk writes for a dump file before allowing the next buffer. static void -xb_quiesce(struct blkfront_info *info) +xb_quiesce(struct xb_softc *sc) { int mtd; // While there are outstanding requests - while (blkif_queued_requests) { - RING_FINAL_CHECK_FOR_RESPONSES(&info->ring, mtd); + while (!TAILQ_EMPTY(&sc->cm_busy)) { + RING_FINAL_CHECK_FOR_RESPONSES(&sc->ring, mtd); if (mtd) { - // Recieved request completions, update queue. - blkif_int(info); + /* Recieved request completions, update queue. */ + blkif_int(sc); } - if (blkif_queued_requests) { - // Still pending requests, wait for the disk i/o to complete + if (!TAILQ_EMPTY(&sc->cm_busy)) { + /* + * Still pending requests, wait for the disk i/o + * to complete. + */ HYPERVISOR_yield(); } } } -// Some bio structures for dumping core -#define DUMP_BIO_NO 16 // 16 * 4KB = 64KB dump block -static struct bio xb_dump_bp[DUMP_BIO_NO]; +/* Kernel dump function for a paravirtualized disk device */ +static void +xb_dump_complete(struct xb_command *cm) +{ + + xb_enqueue_complete(cm); +} -// Kernel dump function for a paravirtualized disk device static int xb_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length) { - int sbp; - int mbp; - size_t chunk; - struct disk *dp = arg; - struct xb_softc *sc = (struct xb_softc *) dp->d_drv1; - int rc = 0; - - xb_quiesce(sc->xb_info); // All quiet on the western front. - if (length > 0) { - // If this lock is held, then this module is failing, and a successful - // kernel dump is highly unlikely anyway. - mtx_lock(&blkif_io_lock); - // Split the 64KB block into 16 4KB blocks - for (sbp=0; length>0 && sbp PAGE_SIZE ? PAGE_SIZE : length; - xb_dump_bp[sbp].bio_disk = dp; - xb_dump_bp[sbp].bio_pblkno = offset / dp->d_sectorsize; - xb_dump_bp[sbp].bio_bcount = chunk; - xb_dump_bp[sbp].bio_resid = chunk; - xb_dump_bp[sbp].bio_data = virtual; - xb_dump_bp[sbp].bio_cmd = BIO_WRITE; - xb_dump_bp[sbp].bio_done = NULL; - - bioq_disksort(&sc->xb_bioq, &xb_dump_bp[sbp]); - - length -= chunk; - offset += chunk; - virtual = (char *) virtual + chunk; + struct disk *dp = arg; + struct xb_softc *sc = (struct xb_softc *) dp->d_drv1; + struct xb_command *cm; + size_t chunk; + int sbp; + int rc = 0; + + if (length <= 0) + return (rc); + + xb_quiesce(sc); /* All quiet on the western front. */ + + /* + * If this lock is held, then this module is failing, and a + * successful kernel dump is highly unlikely anyway. + */ + mtx_lock(&sc->xb_io_lock); + + /* Split the 64KB block as needed */ + for (sbp=0; length > 0; sbp++) { + cm = xb_dequeue_free(sc); + if (cm == NULL) { + mtx_unlock(&sc->xb_io_lock); + device_printf(sc->xb_dev, "dump: no more commands?\n"); + return (EBUSY); } - // Tell DOM0 to do the I/O - xb_startio(sc); - mtx_unlock(&blkif_io_lock); - - // Must wait for the completion: the dump routine reuses the same - // 16 x 4KB buffer space. - xb_quiesce(sc->xb_info); // All quite on the eastern front - // If there were any errors, bail out... - for (mbp=0; mbpgref_head) < 0) { + xb_free_command(cm); + mtx_unlock(&sc->xb_io_lock); + device_printf(sc->xb_dev, "no more grant allocs?\n"); + return (EBUSY); } + + chunk = length > BLKIF_MAXIO ? BLKIF_MAXIO : length; + cm->data = virtual; + cm->datalen = chunk; + cm->operation = BLKIF_OP_WRITE; + cm->sector_number = offset / dp->d_sectorsize; + cm->cm_complete = xb_dump_complete; + + xb_enqueue_ready(cm); + + length -= chunk; + offset += chunk; + virtual = (char *) virtual + chunk; } + + /* Tell DOM0 to do the I/O */ + xb_startio(sc); + mtx_unlock(&sc->xb_io_lock); + + /* Poll for the completion. */ + xb_quiesce(sc); /* All quite on the eastern front */ + + /* If there were any errors, bail out... */ + while ((cm = xb_dequeue_complete(sc)) != NULL) { + if (cm->status != BLKIF_RSP_OKAY) { + device_printf(sc->xb_dev, + "Dump I/O failed at sector %jd\n", + cm->sector_number); + rc = EIO; + } + xb_free_command(cm); + } + return (rc); } @@ -410,9 +422,10 @@ blkfront_probe(device_t dev) static int blkfront_attach(device_t dev) { - int error, vdevice, i, unit; - struct blkfront_info *info; + struct xb_softc *sc; + struct xb_command *cm; const char *name; + int error, vdevice, i, unit; /* FIXME: Use dynamic device id if this is not set. */ error = xenbus_scanf(XBT_NIL, xenbus_get_node(dev), @@ -427,29 +440,56 @@ blkfront_attach(device_t dev) if (!strcmp(name, "xbd")) device_set_unit(dev, unit); - info = device_get_softc(dev); - - /* - * XXX debug only - */ - for (i = 0; i < sizeof(*info); i++) - if (((uint8_t *)info)[i] != 0) - panic("non-null memory"); - - info->shadow_free = 0; - info->xbdev = dev; - info->vdevice = vdevice; - info->connected = BLKIF_STATE_DISCONNECTED; + sc = device_get_softc(dev); + mtx_init(&sc->xb_io_lock, "blkfront i/o lock", NULL, MTX_DEF); + xb_initq_free(sc); + xb_initq_busy(sc); + xb_initq_ready(sc); + xb_initq_complete(sc); + xb_initq_bio(sc); + + /* Allocate parent DMA tag */ + if (bus_dma_tag_create( NULL, /* parent */ + 4096, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BLKIF_MAXIO, /* maxsize */ + BLKIF_MAX_SEGMENTS_PER_REQUEST, /* nsegments */ + PAGE_SIZE, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + busdma_lock_mutex, /* lockfunc */ + &sc->xb_io_lock, /* lockarg */ + &sc->xb_io_dmat)) { + device_printf(dev, "Cannot allocate parent DMA tag\n"); + return (ENOMEM); + } +#ifdef notyet + if (bus_dma_tag_set(sc->xb_io_dmat, BUS_DMA_SET_MINSEGSZ, + XBD_SECTOR_SIZE)) { + device_printf(dev, "Cannot set sector size\n"); + return (EINVAL); + } +#endif + + sc->xb_dev = dev; + sc->vdevice = vdevice; + sc->connected = BLKIF_STATE_DISCONNECTED; /* work queue needed ? */ - for (i = 0; i < BLK_RING_SIZE; i++) - info->shadow[i].req.id = i+1; - info->shadow[BLK_RING_SIZE-1].req.id = 0x0fffffff; + for (i = 0; i < BLK_RING_SIZE; i++) { + cm = &sc->shadow[i]; + cm->req.id = i; + cm->cm_sc = sc; + if (bus_dmamap_create(sc->xb_io_dmat, 0, &cm->map) != 0) + break; + xb_free_command(cm); + } /* Front end dir is a number, which is used as the id. */ - info->handle = strtoul(strrchr(xenbus_get_node(dev),'/')+1, NULL, 0); + sc->handle = strtoul(strrchr(xenbus_get_node(dev),'/')+1, NULL, 0); - error = talk_to_backend(dev, info); + error = talk_to_backend(sc); if (error) return (error); @@ -459,12 +499,12 @@ blkfront_attach(device_t dev) static int blkfront_suspend(device_t dev) { - struct blkfront_info *info = device_get_softc(dev); + struct xb_softc *sc = device_get_softc(dev); /* Prevent new requests being issued until we fix things up. */ - mtx_lock(&blkif_io_lock); - info->connected = BLKIF_STATE_SUSPENDED; - mtx_unlock(&blkif_io_lock); + mtx_lock(&sc->xb_io_lock); + sc->connected = BLKIF_STATE_SUSPENDED; + mtx_unlock(&sc->xb_io_lock); return (0); } @@ -472,29 +512,31 @@ blkfront_suspend(device_t dev) static int blkfront_resume(device_t dev) { - struct blkfront_info *info = device_get_softc(dev); + struct xb_softc *sc = device_get_softc(dev); int err; DPRINTK("blkfront_resume: %s\n", xenbus_get_node(dev)); - blkif_free(info, 1); - err = talk_to_backend(dev, info); - if (info->connected == BLKIF_STATE_SUSPENDED && !err) - blkif_recover(info); + blkif_free(sc, 1); + err = talk_to_backend(sc); + if (sc->connected == BLKIF_STATE_SUSPENDED && !err) + blkif_recover(sc); return (err); } /* Common code used when first setting up, and when resuming. */ static int -talk_to_backend(device_t dev, struct blkfront_info *info) +talk_to_backend(struct xb_softc *sc) { - const char *message = NULL; + device_t dev; struct xenbus_transaction xbt; + const char *message = NULL; int err; /* Create shared ring, alloc event channel. */ - err = setup_blkring(dev, info); + dev = sc->xb_dev; + err = setup_blkring(sc); if (err) goto out; @@ -506,13 +548,13 @@ talk_to_backend(device_t dev, struct blk } err = xenbus_printf(xbt, xenbus_get_node(dev), - "ring-ref","%u", info->ring_ref); + "ring-ref","%u", sc->ring_ref); if (err) { message = "writing ring-ref"; goto abort_transaction; } err = xenbus_printf(xbt, xenbus_get_node(dev), - "event-channel", "%u", irq_to_evtchn_port(info->irq)); + "event-channel", "%u", irq_to_evtchn_port(sc->irq)); if (err) { message = "writing event-channel"; goto abort_transaction; @@ -540,47 +582,47 @@ talk_to_backend(device_t dev, struct blk if (message) xenbus_dev_fatal(dev, err, "%s", message); destroy_blkring: - blkif_free(info, 0); + blkif_free(sc, 0); out: return err; } static int -setup_blkring(device_t dev, struct blkfront_info *info) +setup_blkring(struct xb_softc *sc) { blkif_sring_t *sring; int error; - info->ring_ref = GRANT_INVALID_REF; + sc->ring_ref = GRANT_INVALID_REF; sring = (blkif_sring_t *)malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT|M_ZERO); if (sring == NULL) { - xenbus_dev_fatal(dev, ENOMEM, "allocating shared ring"); + xenbus_dev_fatal(sc->xb_dev, ENOMEM, "allocating shared ring"); return ENOMEM; } SHARED_RING_INIT(sring); - FRONT_RING_INIT(&info->ring, sring, PAGE_SIZE); + FRONT_RING_INIT(&sc->ring, sring, PAGE_SIZE); - error = xenbus_grant_ring(dev, - (vtomach(info->ring.sring) >> PAGE_SHIFT), &info->ring_ref); + error = xenbus_grant_ring(sc->xb_dev, + (vtomach(sc->ring.sring) >> PAGE_SHIFT), &sc->ring_ref); if (error) { free(sring, M_DEVBUF); - info->ring.sring = NULL; + sc->ring.sring = NULL; goto fail; } - error = bind_listening_port_to_irqhandler(xenbus_get_otherend_id(dev), - "xbd", (driver_intr_t *)blkif_int, info, - INTR_TYPE_BIO | INTR_MPSAFE, &info->irq); + error = bind_listening_port_to_irqhandler(xenbus_get_otherend_id(sc->xb_dev), + "xbd", (driver_intr_t *)blkif_int, sc, + INTR_TYPE_BIO | INTR_MPSAFE, &sc->irq); if (error) { - xenbus_dev_fatal(dev, error, + xenbus_dev_fatal(sc->xb_dev, error, "bind_evtchn_to_irqhandler failed"); goto fail; } return (0); fail: - blkif_free(info, 0); + blkif_free(sc, 0); return (error); } @@ -591,7 +633,7 @@ setup_blkring(device_t dev, struct blkfr static int blkfront_backend_changed(device_t dev, XenbusState backend_state) { - struct blkfront_info *info = device_get_softc(dev); + struct xb_softc *sc = device_get_softc(dev); DPRINTK("backend_state=%d\n", backend_state); @@ -606,22 +648,22 @@ blkfront_backend_changed(device_t dev, X break; case XenbusStateConnected: - connect(dev, info); + connect(sc); break; case XenbusStateClosing: - if (info->users > 0) + if (sc->users > 0) xenbus_dev_error(dev, -EBUSY, "Device in use; refusing to close"); else blkfront_closing(dev); #ifdef notyet - bd = bdget(info->dev); + bd = bdget(sc->dev); if (bd == NULL) xenbus_dev_fatal(dev, -ENODEV, "bdget failed"); down(&bd->bd_sem); - if (info->users > 0) + if (sc->users > 0) xenbus_dev_error(dev, -EBUSY, "Device in use; refusing to close"); else @@ -639,14 +681,15 @@ blkfront_backend_changed(device_t dev, X ** the details about the physical device - #sectors, size, etc). */ static void -connect(device_t dev, struct blkfront_info *info) +connect(struct xb_softc *sc) { + device_t dev = sc->xb_dev; unsigned long sectors, sector_size; unsigned int binfo; - int err; + int err, feature_barrier; - if( (info->connected == BLKIF_STATE_CONNECTED) || - (info->connected == BLKIF_STATE_SUSPENDED) ) + if( (sc->connected == BLKIF_STATE_CONNECTED) || + (sc->connected == BLKIF_STATE_SUSPENDED) ) return; DPRINTK("blkfront.c:connect:%s.\n", xenbus_get_otherend_path(dev)); @@ -663,10 +706,10 @@ connect(device_t dev, struct blkfront_in return; } err = xenbus_gather(XBT_NIL, xenbus_get_otherend_path(dev), - "feature-barrier", "%lu", &info->feature_barrier, + "feature-barrier", "%lu", &feature_barrier, NULL); - if (err) - info->feature_barrier = 0; + if (!err || feature_barrier) + sc->xb_flags |= XB_BARRIER; device_printf(dev, "%juMB <%s> at %s", (uintmax_t) sectors / (1048576 / sector_size), @@ -674,20 +717,17 @@ connect(device_t dev, struct blkfront_in xenbus_get_node(dev)); bus_print_child_footer(device_get_parent(dev), dev); - xlvbd_add(dev, sectors, info->vdevice, binfo, sector_size, info); + xlvbd_add(sc, sectors, sc->vdevice, binfo, sector_size); (void)xenbus_set_state(dev, XenbusStateConnected); /* Kick pending requests. */ - mtx_lock(&blkif_io_lock); - info->connected = BLKIF_STATE_CONNECTED; - kick_pending_request_queues(info); - mtx_unlock(&blkif_io_lock); - info->is_ready = 1; + mtx_lock(&sc->xb_io_lock); + sc->connected = BLKIF_STATE_CONNECTED; + xb_startio(sc); + sc->xb_flags |= XB_READY; + mtx_unlock(&sc->xb_io_lock); -#if 0 - add_disk(info->gd); -#endif } /** @@ -699,14 +739,14 @@ connect(device_t dev, struct blkfront_in static void blkfront_closing(device_t dev) { - struct blkfront_info *info = device_get_softc(dev); + struct xb_softc *sc = device_get_softc(dev); DPRINTK("blkfront_closing: %s removed\n", xenbus_get_node(dev)); - if (info->mi) { + if (sc->mi) { DPRINTK("Calling xlvbd_del\n"); - xlvbd_del(info); - info->mi = NULL; + xlvbd_del(sc); + sc->mi = NULL; } xenbus_set_state(dev, XenbusStateClosed); @@ -716,92 +756,33 @@ blkfront_closing(device_t dev) static int blkfront_detach(device_t dev) { - struct blkfront_info *info = device_get_softc(dev); + struct xb_softc *sc = device_get_softc(dev); DPRINTK("blkfront_remove: %s removed\n", xenbus_get_node(dev)); - blkif_free(info, 0); + blkif_free(sc, 0); + mtx_destroy(&sc->xb_io_lock); return 0; } -static inline int -GET_ID_FROM_FREELIST(struct blkfront_info *info) -{ - unsigned long nfree = info->shadow_free; - - KASSERT(nfree <= BLK_RING_SIZE, ("free %lu > RING_SIZE", nfree)); - info->shadow_free = info->shadow[nfree].req.id; - info->shadow[nfree].req.id = 0x0fffffee; /* debug */ - atomic_add_int(&blkif_queued_requests, 1); - return nfree; -} - static inline void -ADD_ID_TO_FREELIST(struct blkfront_info *info, unsigned long id) -{ - info->shadow[id].req.id = info->shadow_free; - info->shadow[id].request = 0; - info->shadow_free = id; - atomic_subtract_int(&blkif_queued_requests, 1); -} - -static inline void -flush_requests(struct blkfront_info *info) +flush_requests(struct xb_softc *sc) { int notify; - RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&info->ring, notify); + RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&sc->ring, notify); if (notify) - notify_remote_via_irq(info->irq); -} - -static void -kick_pending_request_queues(struct blkfront_info *info) -{ - /* XXX check if we can't simplify */ -#if 0 - if (!RING_FULL(&info->ring)) { - /* Re-enable calldowns. */ - blk_start_queue(info->rq); - /* Kick things off immediately. */ - do_blkif_request(info->rq); - } -#endif - if (!RING_FULL(&info->ring)) { -#if 0 - sc = LIST_FIRST(&xbsl_head); - LIST_REMOVE(sc, entry); - /* Re-enable calldowns. */ - blk_start_queue(di->rq); -#endif - /* Kick things off immediately. */ - xb_startio(info->sc); - } -} - -#if 0 -/* XXX */ -static void blkif_restart_queue(void *arg) -{ - struct blkfront_info *info = (struct blkfront_info *)arg; - - mtx_lock(&blkif_io_lock); - kick_pending_request_queues(info); - mtx_unlock(&blkif_io_lock); + notify_remote_via_irq(sc->irq); } -#endif static void blkif_restart_queue_callback(void *arg) { -#if 0 - struct blkfront_info *info = (struct blkfront_info *)arg; - /* XXX BSD equiv ? */ + struct xb_softc *sc = arg; - schedule_work(&info->work); -#endif + xb_startio(sc); } static int @@ -815,7 +796,7 @@ blkif_open(struct disk *dp) } sc->xb_flags |= XB_OPEN; - sc->xb_info->users++; + sc->users++; return (0); } @@ -827,11 +808,11 @@ blkif_close(struct disk *dp) if (sc == NULL) return (ENXIO); sc->xb_flags &= ~XB_OPEN; - if (--(sc->xb_info->users) == 0) { + if (--(sc->users) == 0) { /* Check whether we have been instructed to close. We will have ignored this request initially, as the device was still mounted. */ - device_t dev = sc->xb_info->xbdev; + device_t dev = sc->xb_dev; XenbusState state = xenbus_read_driver_state(xenbus_get_otherend_path(dev)); @@ -852,6 +833,18 @@ blkif_ioctl(struct disk *dp, u_long cmd, return (ENOTTY); } +static void +xb_free_command(struct xb_command *cm) +{ + + KASSERT((cm->cm_flags & XB_ON_XBQ_MASK) == 0, + ("Freeing command that is still on a queue\n")); + + cm->cm_flags = 0; + cm->bp = NULL; + cm->cm_complete = NULL; + xb_enqueue_free(cm); +} /* * blkif_queue_request @@ -863,106 +856,152 @@ blkif_ioctl(struct disk *dp, u_long cmd, * buffer: buffer to read/write into. this should be a * virtual address in the guest os. */ -static int blkif_queue_request(struct bio *bp) +static struct xb_command * +xb_bio_command(struct xb_softc *sc) +{ + struct xb_command *cm; + struct bio *bp; + + if (unlikely(sc->connected != BLKIF_STATE_CONNECTED)) + return (NULL); + + bp = xb_dequeue_bio(sc); + if (bp == NULL) + return (NULL); + + if ((cm = xb_dequeue_free(sc)) == NULL) { + xb_requeue_bio(sc, bp); + return (NULL); + } + + if (gnttab_alloc_grant_references(BLKIF_MAX_SEGMENTS_PER_REQUEST, + &cm->gref_head) < 0) { + gnttab_request_free_callback(&sc->callback, + blkif_restart_queue_callback, sc, + BLKIF_MAX_SEGMENTS_PER_REQUEST); + xb_requeue_bio(sc, bp); + xb_enqueue_free(cm); + sc->xb_flags |= XB_FROZEN; + return (NULL); + } + + /* XXX Can we grab refs before doing the load so that the ref can + * be filled out here? + */ + cm->bp = bp; + cm->data = bp->bio_data; + cm->datalen = bp->bio_bcount; + cm->operation = (bp->bio_cmd == BIO_READ) ? BLKIF_OP_READ : + BLKIF_OP_WRITE; + cm->sector_number = (blkif_sector_t)bp->bio_pblkno; + + return (cm); +} + +static int +blkif_queue_request(struct xb_softc *sc, struct xb_command *cm) { - caddr_t alignbuf; + int error; + + error = bus_dmamap_load(sc->xb_io_dmat, cm->map, cm->data, cm->datalen, + blkif_queue_cb, cm, 0); + if (error == EINPROGRESS) { + printf("EINPROGRESS\n"); + sc->xb_flags |= XB_FROZEN; + cm->cm_flags |= XB_CMD_FROZEN; + return (0); + } + + return (error); +} + +static void +blkif_queue_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct xb_softc *sc; + struct xb_command *cm; + blkif_request_t *ring_req; vm_paddr_t buffer_ma; - blkif_request_t *ring_req; - unsigned long id; uint64_t fsect, lsect; - struct xb_softc *sc = (struct xb_softc *)bp->bio_disk->d_drv1; - struct blkfront_info *info = sc->xb_info; - int ref; - - if (unlikely(sc->xb_info->connected != BLKIF_STATE_CONNECTED)) - return 1; - - if (gnttab_alloc_grant_references( - BLKIF_MAX_SEGMENTS_PER_REQUEST, &gref_head) < 0) { - gnttab_request_free_callback( - &info->callback, - blkif_restart_queue_callback, - info, - BLKIF_MAX_SEGMENTS_PER_REQUEST); - return 1; + int ref, i, op; + + cm = arg; + sc = cm->cm_sc; + + if (error) { + printf("error %d in blkif_queue_cb\n", error); + cm->bp->bio_error = EIO; + biodone(cm->bp); + xb_free_command(cm); + return; } - /* Check if the buffer is properly aligned */ - if ((vm_offset_t)bp->bio_data & PAGE_MASK) { - int align = (bp->bio_bcount < PAGE_SIZE/2) ? XBD_SECTOR_SIZE : - PAGE_SIZE; - caddr_t newbuf = malloc(bp->bio_bcount + align, M_DEVBUF, - M_NOWAIT); - - alignbuf = (char *)roundup2((u_long)newbuf, align); - - /* save a copy of the current buffer */ - bp->bio_driver1 = newbuf; - bp->bio_driver2 = alignbuf; - - /* Copy the data for a write */ - if (bp->bio_cmd == BIO_WRITE) - bcopy(bp->bio_data, alignbuf, bp->bio_bcount); - } else - alignbuf = bp->bio_data; - /* Fill out a communications ring structure. */ - ring_req = RING_GET_REQUEST(&info->ring, - info->ring.req_prod_pvt); - id = GET_ID_FROM_FREELIST(info); - info->shadow[id].request = (unsigned long)bp; - - ring_req->id = id; - ring_req->operation = (bp->bio_cmd == BIO_READ) ? BLKIF_OP_READ : - BLKIF_OP_WRITE; - - ring_req->sector_number= (blkif_sector_t)bp->bio_pblkno; - ring_req->handle = (blkif_vdev_t)(uintptr_t)sc->xb_disk; - - ring_req->nr_segments = 0; /* XXX not doing scatter/gather since buffer - * chaining is not supported. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 07:51:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF5911065670; Mon, 30 Nov 2009 07:51:37 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3E1F8FC12; Mon, 30 Nov 2009 07:51:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU7pbLH022505; Mon, 30 Nov 2009 07:51:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU7pbME022503; Mon, 30 Nov 2009 07:51:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911300751.nAU7pbME022503@svn.freebsd.org> From: Christian Brueffer Date: Mon, 30 Nov 2009 07:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199965 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 07:51:37 -0000 Author: brueffer Date: Mon Nov 30 07:51:37 2009 New Revision: 199965 URL: http://svn.freebsd.org/changeset/base/199965 Log: MFC: r199748 Grammar and mdoc improvements. Modified: stable/8/share/man/man4/ada.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ada.4 ============================================================================== --- stable/8/share/man/man4/ada.4 Mon Nov 30 07:23:27 2009 (r199964) +++ stable/8/share/man/man4/ada.4 Mon Nov 30 07:51:37 2009 (r199965) @@ -36,12 +36,12 @@ .Sh DESCRIPTION The .Nm -driver provides support for direct access devices, implementing +driver provides support for direct access devices, implementing the .Tn ATA command protocol, that are attached to the system through a host adapter -supported by CAM subsystem. +supported by the CAM subsystem. .Pp -Host adapter must also be separately configured into the system before a +The host adapter must also be separately configured into the system before an .Tn ATA direct access device can be configured. .Sh COMMAND QUEUING @@ -52,12 +52,12 @@ seeks. defines two types of queueing: .Tn TCQ (Tagged Command Queueing, PATA legacy) and -.Tn NCQ (Native Command Queueing, SATA). +.Tn NCQ (Native Command Queueing, SATA) . The .Nm -device driver takes full advantage of the NCQ, when supported. -To ensure that transactions to distant portions of the media, -which may be deferred indefinitely by servicing requests nearer the current +device driver takes full advantage of NCQ, when supported. +To ensure that transactions to distant parts of the media, +which may be deferred indefinitely by servicing requests closer to the current head position, are completed in a timely fashion, an ordered transaction is sent every 7 seconds during continuous device operation. .Sh CACHE EFFECTS @@ -84,8 +84,8 @@ writes will be lost. The effect of a loss of write transactions on a file system is non-deterministic and can cause corruption. Most -devices age write transactions to limit vulnerability to a few transactions -recently reported as complete, but it is none-the-less recommended that +devices age write transactions to limit the vulnerability to a few transactions +recently reported as complete, but it is nonetheless recommended that systems with write cache enabled devices reside on an Uninterruptible Power Supply (UPS). The @@ -125,14 +125,14 @@ seconds. ATA device nodes .El .Sh SEE ALSO +.Xr ad 4 , .Xr ahci 4 , -.Xr siis 4 , -.Xr ad 4 -.Xr da 4 +.Xr da 4 , +.Xr siis 4 .Sh HISTORY The .Nm driver first appeared in .Fx 8.0 . .Sh AUTHORS -.An Alexander Motin Aq mav@FreeBSD.org . +.An Alexander Motin Aq mav@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 07:54:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01DD31065670; Mon, 30 Nov 2009 07:54:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8B578FC19; Mon, 30 Nov 2009 07:54:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU7sMLK022612; Mon, 30 Nov 2009 07:54:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU7sMcX022610; Mon, 30 Nov 2009 07:54:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911300754.nAU7sMcX022610@svn.freebsd.org> From: Christian Brueffer Date: Mon, 30 Nov 2009 07:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199966 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 07:54:23 -0000 Author: brueffer Date: Mon Nov 30 07:54:22 2009 New Revision: 199966 URL: http://svn.freebsd.org/changeset/base/199966 Log: MFC: r199739, r199825 - LSI MegaRAID 9260 works, sort the hardware list while here. - Add IBM ServeRAID-MR10i to the hardware list. Modified: stable/8/share/man/man4/mfi.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/mfi.4 ============================================================================== --- stable/8/share/man/man4/mfi.4 Mon Nov 30 07:51:37 2009 (r199965) +++ stable/8/share/man/man4/mfi.4 Mon Nov 30 07:54:22 2009 (r199966) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2009 +.Dd November 26, 2009 .Dt MFI 4 .Os .Sh NAME @@ -79,15 +79,19 @@ driver supports the following hardware: .Pp .Bl -bullet -compact .It +LSI MegaRAID SAS 1078 +.It LSI MegaRAID SAS 8408E .It LSI MegaRAID SAS 8480E .It -LSI MegaRAID SAS 1078 +LSI MegaRAID SAS 9260 .It Dell PERC5 .It Dell PERC6 +.It +IBM ServeRAID-MR10i .El .Sh FILES .Bl -tag -width ".Pa /dev/mfid?" -compact From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 08:01:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AFCB1065670; Mon, 30 Nov 2009 08:01:19 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED1898FC12; Mon, 30 Nov 2009 08:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAU81I2G022838; Mon, 30 Nov 2009 08:01:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAU81I6W022836; Mon, 30 Nov 2009 08:01:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200911300801.nAU81I6W022836@svn.freebsd.org> From: Christian Brueffer Date: Mon, 30 Nov 2009 08:01: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: r199967 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 08:01:19 -0000 Author: brueffer Date: Mon Nov 30 08:01:18 2009 New Revision: 199967 URL: http://svn.freebsd.org/changeset/base/199967 Log: MFC: r199739, r199825 - LSI MegaRAID 9260 works, sort the hardware list while here. - Add IBM ServeRAID-MR10i to the hardware list. Modified: stable/7/share/man/man4/mfi.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/mfi.4 ============================================================================== --- stable/7/share/man/man4/mfi.4 Mon Nov 30 07:54:22 2009 (r199966) +++ stable/7/share/man/man4/mfi.4 Mon Nov 30 08:01:18 2009 (r199967) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2008 +.Dd November 26, 2009 .Dt MFI 4 .Os .Sh NAME @@ -79,15 +79,19 @@ driver supports the following hardware: .Pp .Bl -bullet -compact .It +LSI MegaRAID SAS 1078 +.It LSI MegaRAID SAS 8408E .It LSI MegaRAID SAS 8480E .It -LSI MegaRAID SAS 1078 +LSI MegaRAID SAS 9260 .It Dell PERC5 .It Dell PERC6 +.It +IBM ServeRAID-MR10i .El .Sh FILES .Bl -tag -width ".Pa /dev/mfid?" -compact From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 08:01:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13B411065692; Mon, 30 Nov 2009 08:01:54 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id AA3668FC08; Mon, 30 Nov 2009 08:01:53 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 9C3BE1CE67; Mon, 30 Nov 2009 09:01:52 +0100 (CET) Date: Mon, 30 Nov 2009 09:01:52 +0100 From: Ed Schouten To: Gabor Kovesdan Message-ID: <20091130080152.GZ64905@hoeg.nl> References: <200911292047.nATKlh66008711@svn.freebsd.org> <4B12DFC6.3050108@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xNMMsVvlV1B6vaKr" Content-Disposition: inline In-Reply-To: <4B12DFC6.3050108@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r199947 - in head: share/man/man4 sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 08:01:54 -0000 --xNMMsVvlV1B6vaKr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Gabor Kovesdan wrote: > Bjoern A. Zeeb escribi=F3: > >-protocol support is currently broken. > >+protocol may occationally error because of > >+.Xr zlib 3 > >+problems. > There's a typo here, should be occasionally. Because we're nitpicking anyway. Do we consider `error' to be a proper verb? Can't we use the word `fail' here? --=20 Ed Schouten WWW: http://80386.nl/ --xNMMsVvlV1B6vaKr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksTe/AACgkQ52SDGA2eCwU0RQCfdFBmHeZjGdXyQmSwOj5dtveo etAAniKC8d44MDWH1qb1j2qB2amDHZjX =2wRT -----END PGP SIGNATURE----- --xNMMsVvlV1B6vaKr-- From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 11:11:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9F0D1065679; Mon, 30 Nov 2009 11:11:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADE218FC08; Mon, 30 Nov 2009 11:11:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAUBB8qK028432; Mon, 30 Nov 2009 11:11:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAUBB8qe028431; Mon, 30 Nov 2009 11:11:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200911301111.nAUBB8qe028431@svn.freebsd.org> From: Andriy Gapon Date: Mon, 30 Nov 2009 11:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199968 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 11:11:09 -0000 Author: avg Date: Mon Nov 30 11:11:08 2009 New Revision: 199968 URL: http://svn.freebsd.org/changeset/base/199968 Log: x86 cpu features: add MOVBE reporting and flag The check is glimpsed from Linux and OpenSolaris. MOVBE instruction is found in Intel Atom processors. Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/include/specialreg.h head/sys/i386/i386/identcpu.c head/sys/i386/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Mon Nov 30 08:01:18 2009 (r199967) +++ head/sys/amd64/amd64/identcpu.c Mon Nov 30 11:11:08 2009 (r199968) @@ -259,7 +259,7 @@ printcpuinfo(void) "\024SSE4.1" "\025SSE4.2" "\026x2APIC" /* xAPIC Extensions */ - "\027" + "\027MOVBE" "\030POPCNT" "\031" "\032" Modified: head/sys/amd64/include/specialreg.h ============================================================================== --- head/sys/amd64/include/specialreg.h Mon Nov 30 08:01:18 2009 (r199967) +++ head/sys/amd64/include/specialreg.h Mon Nov 30 11:11:08 2009 (r199968) @@ -129,6 +129,7 @@ #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 #define CPUID2_X2APIC 0x00200000 +#define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 /* Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Mon Nov 30 08:01:18 2009 (r199967) +++ head/sys/i386/i386/identcpu.c Mon Nov 30 11:11:08 2009 (r199968) @@ -746,7 +746,7 @@ printcpuinfo(void) "\024SSE4.1" "\025SSE4.2" "\026x2APIC" /* xAPIC Extensions */ - "\027" + "\027MOVBE" "\030POPCNT" "\031" "\032" Modified: head/sys/i386/include/specialreg.h ============================================================================== --- head/sys/i386/include/specialreg.h Mon Nov 30 08:01:18 2009 (r199967) +++ head/sys/i386/include/specialreg.h Mon Nov 30 11:11:08 2009 (r199968) @@ -126,6 +126,7 @@ #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 #define CPUID2_X2APIC 0x00200000 +#define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 /* From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 11:44:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D25551065670; Mon, 30 Nov 2009 11:44:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCDB28FC18; Mon, 30 Nov 2009 11:44:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAUBi3Uw029502; Mon, 30 Nov 2009 11:44:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAUBi3if029492; Mon, 30 Nov 2009 11:44:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200911301144.nAUBi3if029492@svn.freebsd.org> From: Andriy Gapon Date: Mon, 30 Nov 2009 11:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199969 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/amdsbwd sys/i386/conf sys/modules sys/modules/amdsbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 11:44:04 -0000 Author: avg Date: Mon Nov 30 11:44:03 2009 New Revision: 199969 URL: http://svn.freebsd.org/changeset/base/199969 Log: amdsbwd: new driver for AMD SB600/SB7xx watchdog timer The hardware is compliant with WDRT specification, so I originally considered including generic WDRT watchdog support, but decided against it, because I couldn't find anyone to the code for me. WDRT seems to be not very popular. Besides, generic WDRT porbably requires a slightly different driver approach. Reviewed by: des, gavin, rpaulo MFC after: 3 weeks Added: head/share/man/man4/amdsbwd.4 (contents, props changed) head/sys/dev/amdsbwd/ head/sys/dev/amdsbwd/amdsbwd.c (contents, props changed) head/sys/modules/amdsbwd/ head/sys/modules/amdsbwd/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Nov 30 11:11:08 2009 (r199968) +++ head/share/man/man4/Makefile Mon Nov 30 11:44:03 2009 (r199969) @@ -31,6 +31,7 @@ MAN= aac.4 \ ale.4 \ altq.4 \ amd.4 \ + ${_amdsbwd.4} \ ${_amdsmb.4} \ ${_amdtemp.4} \ amr.4 \ @@ -610,6 +611,7 @@ _acpi_panasonic.4=acpi_panasonic.4 _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 +_amdsbwd.4= amdsbwd.4 _amdsmb.4= amdsmb.4 _amdtemp.4= amdtemp.4 _asmc.4= asmc.4 Added: head/share/man/man4/amdsbwd.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/amdsbwd.4 Mon Nov 30 11:44:03 2009 (r199969) @@ -0,0 +1,72 @@ +.\"- +.\" Copyright (c) 2009 Andriy Gapon +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 30, 2009 +.Dt AMDSBWD 4 +.Os +.Sh NAME +.Nm amdsbwd +.Nd device driver for the AMD SB600/SB700/SB710/SB750 watchdog timer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device amdsbwd" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +amdsbwd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog timers present on +AMD SB600 and SB7xx south bridge chips. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 9.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Andiry Gapon Aq avg@FreeBSD.org . +This manual page was written by +.An Andiry Gapon Aq avg@FreeBSD.org . Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Mon Nov 30 11:11:08 2009 (r199968) +++ head/sys/amd64/conf/NOTES Mon Nov 30 11:44:03 2009 (r199969) @@ -399,8 +399,10 @@ device asmc # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer +# amdsbwd: AMD SB7xx watchdog timer # device ichwd +device amdsbwd # # Temperature sensors: Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Nov 30 11:11:08 2009 (r199968) +++ head/sys/conf/files.amd64 Mon Nov 30 11:44:03 2009 (r199969) @@ -151,6 +151,7 @@ dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_intel.c optional agp dev/agp/agp_via.c optional agp +dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Nov 30 11:11:08 2009 (r199968) +++ head/sys/conf/files.i386 Mon Nov 30 11:44:03 2009 (r199969) @@ -127,6 +127,7 @@ dev/agp/agp_nvidia.c optional agp dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp dev/aic/aic_isa.c optional aic isa +dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Added: head/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/amdsbwd/amdsbwd.c Mon Nov 30 11:44:03 2009 (r199969) @@ -0,0 +1,431 @@ +/*- + * Copyright (c) 2009 Andriy Gapon + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This is a driver for watchdog timer present in AMD SB600/SB7xx + * south bridges and other watchdog timers advertised via WDRT ACPI table. + * Please see the following specifications for the descriptions of the + * registers and flags: + * - AMD SB600 Register Reference Guide, Public Version, Rev. 3.03 (SB600 RRG) + * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/46155_sb600_rrg_pub_3.03.pdf + * - AMD SB700/710/750 Register Reference Guide (RRG) + * http://developer.amd.com/assets/43009_sb7xx_rrg_pub_1.00.pdf + * - AMD SB700/710/750 Register Programming Requirements (RPR) + * http://developer.amd.com/assets/42413_sb7xx_rpr_pub_1.00.pdf + * Please see the following for Watchdog Resource Table specification: + * - Watchdog Timer Hardware Requirements for Windows Server 2003 (WDRT) + * http://www.microsoft.com/whdc/system/sysinternals/watchdog.mspx + * AMD SB600/SB7xx watchdog hardware seems to conform to the above, + * but my system doesn't provide the table. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* RRG 2.3.3.1.1, page 161. */ +#define AMDSB_PMIO_INDEX 0xcd6 +#define AMDSB_PMIO_DATA (PMIO_INDEX + 1) +#define AMDSB_PMIO_WIDTH 2 +/* RRG 2.3.3.2, page 181. */ +#define AMDSB_PM_RESET_STATUS0 0x44 +#define AMDSB_PM_RESET_STATUS1 0x45 +#define AMDSB_WD_RST_STS 0x02 +/* RRG 2.3.3.2, page 188; RPR 2.36, page 30. */ +#define AMDSB_PM_WDT_CTRL 0x69 +#define AMDSB_WDT_DISABLE 0x01 +#define AMDSB_WDT_RES_MASK (0x02 | 0x04) +#define AMDSB_WDT_RES_32US 0x00 +#define AMDSB_WDT_RES_10MS 0x02 +#define AMDSB_WDT_RES_100MS 0x04 +#define AMDSB_WDT_RES_1S 0x06 +#define AMDSB_PM_WDT_BASE_LSB 0x6c +#define AMDSB_PM_WDT_BASE_MSB 0x6f +/* RRG 2.3.4, page 223, WDRT. */ +#define AMDSB_WD_CTRL 0x00 +#define AMDSB_WD_RUN 0x01 +#define AMDSB_WD_FIRED 0x02 +#define AMDSB_WD_SHUTDOWN 0x04 +#define AMDSB_WD_DISABLE 0x08 +#define AMDSB_WD_RESERVED 0x70 +#define AMDSB_WD_RELOAD 0x80 +#define AMDSB_WD_COUNT 0x04 +#define AMDSB_WD_COUNT_MASK 0xffff +#define AMDSB_WDIO_REG_WIDTH 4 +/* WDRT */ +#define MAXCOUNT_MIN_VALUE 511 +/* RRG 2.3.1.1, page 122; SB600 RRG 2.3.1.1, page 97. */ +#define AMDSB7xx_SMBUS_DEVID 0x43851002 + +#define amdsbwd_verbose_printf(dev, ...) \ + do { \ + if (bootverbose) \ + device_printf(dev, __VA_ARGS__);\ + } while (0) + +struct amdsbwd_softc { + device_t dev; + eventhandler_tag ev_tag; + struct resource *res_ctrl; + struct resource *res_count; + int rid_ctrl; + int rid_count; + int ms_per_tick; + int max_ticks; + int active; + unsigned int timeout; +}; + +static void amdsbwd_identify(driver_t *driver, device_t parent); +static int amdsbwd_probe(device_t dev); +static int amdsbwd_attach(device_t dev); +static int amdsbwd_detach(device_t dev); + +static device_method_t amdsbwd_methods[] = { + DEVMETHOD(device_identify, amdsbwd_identify), + DEVMETHOD(device_probe, amdsbwd_probe), + DEVMETHOD(device_attach, amdsbwd_attach), + DEVMETHOD(device_detach, amdsbwd_detach), +#if 0 + DEVMETHOD(device_shutdown, amdsbwd_detach), +#endif + {0, 0} +}; + +static devclass_t amdsbwd_devclass; +static driver_t amdsbwd_driver = { + "amdsbwd", + amdsbwd_methods, + sizeof(struct amdsbwd_softc) +}; + +DRIVER_MODULE(amdsbwd, isa, amdsbwd_driver, amdsbwd_devclass, NULL, NULL); + + +static uint8_t +pmio_read(struct resource *res, uint8_t reg) +{ + bus_write_1(res, 0, reg); /* Index */ + return (bus_read_1(res, 1)); /* Data */ +} + +static void +pmio_write(struct resource *res, uint8_t reg, uint8_t val) +{ + bus_write_1(res, 0, reg); /* Index */ + bus_write_1(res, 1, val); /* Data */ +} + +static uint32_t +wdctrl_read(struct amdsbwd_softc *sc) +{ + return (bus_read_4(sc->res_ctrl, 0)); +} + +static void +wdctrl_write(struct amdsbwd_softc *sc, uint32_t val) +{ + bus_write_4(sc->res_ctrl, 0, val); +} + +static __unused uint32_t +wdcount_read(struct amdsbwd_softc *sc) +{ + return (bus_read_4(sc->res_count, 0)); +} + +static void +wdcount_write(struct amdsbwd_softc *sc, uint32_t val) +{ + bus_write_4(sc->res_count, 0, val); +} + +static void +amdsbwd_tmr_enable(struct amdsbwd_softc *sc) +{ + uint32_t val; + + val = wdctrl_read(sc); + val |= AMDSB_WD_RUN; + wdctrl_write(sc, val); + sc->active = 1; + amdsbwd_verbose_printf(sc->dev, "timer enabled\n"); +} + +static void +amdsbwd_tmr_disable(struct amdsbwd_softc *sc) +{ + uint32_t val; + + val = wdctrl_read(sc); + val &= ~AMDSB_WD_RUN; + wdctrl_write(sc, val); + sc->active = 0; + amdsbwd_verbose_printf(sc->dev, "timer disabled\n"); +} + +static void +amdsbwd_tmr_reload(struct amdsbwd_softc *sc) +{ + uint32_t val; + + val = wdctrl_read(sc); + val |= AMDSB_WD_RELOAD; + wdctrl_write(sc, val); +} + +static void +amdsbwd_tmr_set(struct amdsbwd_softc *sc, uint16_t timeout) +{ + + timeout &= AMDSB_WD_COUNT_MASK; + wdcount_write(sc, timeout); + sc->timeout = timeout; + amdsbwd_verbose_printf(sc->dev, "timeout set to %u ticks\n", timeout); +} + +static void +amdsbwd_event(void *arg, unsigned int cmd, int *error) +{ + struct amdsbwd_softc *sc = arg; + unsigned int timeout; + + /* convert from power-of-two-ns to WDT ticks */ + cmd &= WD_INTERVAL; + if (cmd < WD_TO_1SEC) + cmd = 0; + timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (timeout > sc->max_ticks) + timeout = sc->max_ticks; + if (cmd) { + if (timeout != sc->timeout) { + amdsbwd_tmr_set(sc, timeout); + if (!sc->active) + amdsbwd_tmr_enable(sc); + } + amdsbwd_tmr_reload(sc); + *error = 0; + } else { + if (sc->active) + amdsbwd_tmr_disable(sc); + } +} + +static void +amdsbwd_identify(driver_t *driver, device_t parent) +{ + device_t child; + device_t smb_dev; + + if (resource_disabled("amdsbwd", 0)) + return; + if (device_find_child(parent, "amdsbwd", -1) != NULL) + return; + + /* + * Try to identify SB600/SB7xx by PCI Device ID of SMBus device + * that should be present at bus 0, device 20, function 0. + */ + smb_dev = pci_find_bsf(0, 20, 0); + if (smb_dev == NULL) + return; + if (pci_get_devid(smb_dev) != AMDSB7xx_SMBUS_DEVID) + return; + + child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); + if (child == NULL) + device_printf(parent, "add amdsbwd child failed\n"); +} + +static int +amdsbwd_probe(device_t dev) +{ + struct resource *res; + uint32_t addr; + uint32_t val; + int rid; + int rc; + int i; + + /* Do not claim some ISA PnP device by accident. */ + if (isa_get_logicalid(dev) != 0) + return (ENXIO); + + rc = bus_set_resource(dev, SYS_RES_IOPORT, 0, AMDSB_PMIO_INDEX, + AMDSB_PMIO_WIDTH); + if (rc != 0) { + device_printf(dev, "bus_set_resource for IO failed\n"); + return (ENXIO); + } + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, + AMDSB_PMIO_WIDTH, RF_ACTIVE | RF_SHAREABLE); + if (res == NULL) { + device_printf(dev, "bus_alloc_resource for IO failed\n"); + return (ENXIO); + } + + /* Report cause of previous reset for user's convenience. */ + val = pmio_read(res, AMDSB_PM_RESET_STATUS0); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); + val = pmio_read(res, AMDSB_PM_RESET_STATUS1); + if (val != 0) + amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + if ((val & AMDSB_WD_RST_STS) != 0) + device_printf(dev, "Previous Reset was caused by Watchdog\n"); + + /* Find base address of memory mapped WDT registers. */ + for (addr = 0, i = 0; i < 4; i++) { + addr <<= 8; + addr |= pmio_read(res, AMDSB_PM_WDT_BASE_MSB - i); + } + amdsbwd_verbose_printf(dev, "memory base address = %#010x\n", addr); + rc = bus_set_resource(dev, SYS_RES_MEMORY, 0, addr + AMDSB_WD_CTRL, + AMDSB_WDIO_REG_WIDTH); + if (rc != 0) { + device_printf(dev, "bus_set_resource for control failed\n"); + return (ENXIO); + } + rc = bus_set_resource(dev, SYS_RES_MEMORY, 1, addr + AMDSB_WD_COUNT, + AMDSB_WDIO_REG_WIDTH); + if (rc != 0) { + device_printf(dev, "bus_set_resource for count failed\n"); + return (ENXIO); + } + + /* Set watchdog timer tick to 10ms. */ + val = pmio_read(res, AMDSB_PM_WDT_CTRL); + val &= ~AMDSB_WDT_RES_MASK; + val |= AMDSB_WDT_RES_10MS; + pmio_write(res, AMDSB_PM_WDT_CTRL, val); + + /* Enable watchdog device (in stopped state). */ + val = pmio_read(res, AMDSB_PM_WDT_CTRL); + val &= ~AMDSB_WDT_DISABLE; + pmio_write(res, AMDSB_PM_WDT_CTRL, val); + + /* + * XXX TODO: Ensure that watchdog decode is enabled + * (register 0x41, bit 3). + */ + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + bus_delete_resource(dev, SYS_RES_IOPORT, rid); + + device_set_desc(dev, "AMD SB600/SB7xx Watchdog Timer"); + return (0); +} + +static int +amdsbwd_attach_sb(device_t dev, struct amdsbwd_softc *sc) +{ + sc->max_ticks = UINT16_MAX; + sc->ms_per_tick = 10; + sc->rid_ctrl = 0; + sc->rid_count = 1; + + sc->res_ctrl = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->rid_ctrl, RF_ACTIVE); + if (sc->res_ctrl == NULL) { + device_printf(dev, "bus_alloc_resource for ctrl failed\n"); + return (ENXIO); + } + sc->res_count = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->rid_count, RF_ACTIVE); + if (sc->res_count == NULL) { + device_printf(dev, "bus_alloc_resource for count failed\n"); + return (ENXIO); + } + return (0); +} + +static int +amdsbwd_attach(device_t dev) +{ + struct amdsbwd_softc *sc; + int rc; + + sc = device_get_softc(dev); + sc->dev = dev; + + rc = amdsbwd_attach_sb(dev, sc); + if (rc != 0) + goto fail; + + /* Setup initial state of Watchdog Control. */ + wdctrl_write(sc, AMDSB_WD_FIRED); + + if (wdctrl_read(sc) & AMDSB_WD_DISABLE) { + device_printf(dev, "watchdog hardware is disabled\n"); + goto fail; + } + + sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, amdsbwd_event, sc, + EVENTHANDLER_PRI_ANY); + + return (0); + +fail: + amdsbwd_detach(dev); + return (ENXIO); +} + +static int +amdsbwd_detach(device_t dev) +{ + struct amdsbwd_softc *sc; + + sc = device_get_softc(dev); + if (sc->ev_tag != NULL) + EVENTHANDLER_DEREGISTER(watchdog_list, sc->ev_tag); + + if (sc->active) + amdsbwd_tmr_disable(sc); + + if (sc->res_ctrl != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_ctrl, + sc->res_ctrl); + + if (sc->res_count != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid_count, + sc->res_count); + + return (0); +} + Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Mon Nov 30 11:11:08 2009 (r199968) +++ head/sys/i386/conf/NOTES Mon Nov 30 11:44:03 2009 (r199969) @@ -785,8 +785,10 @@ hint.pcf.0.irq="5" # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer +# amdsbwd: AMD SB7xx watchdog timer # device ichwd +device amdsbwd # # Temperature sensors: Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Nov 30 11:11:08 2009 (r199968) +++ head/sys/modules/Makefile Mon Nov 30 11:44:03 2009 (r199969) @@ -21,6 +21,7 @@ SUBDIR= ${_3dfx} \ alc \ ale \ ${_amd} \ + ${_amdsbwd} \ ${_amdtemp} \ amr \ ${_an} \ @@ -416,6 +417,7 @@ _zfs= zfs _aac= aac _acpi= acpi _ahb= ahb +_amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc @@ -472,6 +474,7 @@ _aac= aac _acpi= acpi _agp= agp _an= an +_amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc Added: head/sys/modules/amdsbwd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/amdsbwd/Makefile Mon Nov 30 11:44:03 2009 (r199969) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/amdsbwd +KMOD = amdsbwd +SRCS = amdsbwd.c +SRCS += device_if.h bus_if.h pci_if.h isa_if.h + +.include From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 18:08:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39C161065670; Mon, 30 Nov 2009 18:08:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D854F8FC17; Mon, 30 Nov 2009 18:08:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nAUHwhuq055000; Mon, 30 Nov 2009 10:58:43 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 30 Nov 2009 10:58:59 -0700 (MST) Message-Id: <20091130.105859.-1417605724.imp@bsdimp.com> To: trasz@freebsd.org From: "M. Warner Losh" In-Reply-To: <200911251636.nAPGa7YX055796@svn.freebsd.org> References: <200911251636.nAPGa7YX055796@svn.freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199806 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 18:08:33 -0000 In message: <200911251636.nAPGa7YX055796@svn.freebsd.org> Edward Tomasz Napierala writes: : Author: trasz : Date: Wed Nov 25 16:36:07 2009 : New Revision: 199806 : URL: http://svn.freebsd.org/changeset/base/199806 : : Log: : Be nice, don't use the f-word. Too bad the boot code doesn't grok EDOOFUS :) Warner From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 18:26:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B86C106568F; Mon, 30 Nov 2009 18:26:47 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8EB8FC18; Mon, 30 Nov 2009 18:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAUIQkj0037223; Mon, 30 Nov 2009 18:26:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAUIQk41037222; Mon, 30 Nov 2009 18:26:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200911301826.nAUIQk41037222@svn.freebsd.org> From: Ed Maste Date: Mon, 30 Nov 2009 18:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199970 - head/sys/dev/hatm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 18:26:47 -0000 Author: emaste Date: Mon Nov 30 18:26:46 2009 New Revision: 199970 URL: http://svn.freebsd.org/changeset/base/199970 Log: Free pointer from getenv() when done with it. Submitted by: Phil Longstaff Modified: head/sys/dev/hatm/if_hatm.c Modified: head/sys/dev/hatm/if_hatm.c ============================================================================== --- head/sys/dev/hatm/if_hatm.c Mon Nov 30 11:44:03 2009 (r199969) +++ head/sys/dev/hatm/if_hatm.c Mon Nov 30 18:26:46 2009 (r199970) @@ -1325,6 +1325,7 @@ kenv_getuint(struct hatm_softc *sc, cons freeenv(val); return (EINVAL); } + freeenv(val); if (bootverbose) if_printf(sc->ifp, "%s=%u\n", full, u); *ptr = u; From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 19:29:52 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C8CC106566B; Mon, 30 Nov 2009 19:29:52 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id D09AD8FC14; Mon, 30 Nov 2009 19:29:51 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nAUJTmi0089693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2009 11:29:49 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B141D2E.1000203@FreeBSD.org> Date: Mon, 30 Nov 2009 11:29:50 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Stanislav Sedov References: <200911151143.nAFBhTSD036619@svn.freebsd.org> In-Reply-To: <200911151143.nAFBhTSD036619@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 19:29:52 -0000 Is the option related to Jumbo Frames in any way? If not, IMHO the name should be changed to avoid any confusion. -Maxim Stanislav Sedov wrote: > Author: stas > Date: Sun Nov 15 11:43:28 2009 > New Revision: 199289 > URL: http://svn.freebsd.org/changeset/base/199289 > > Log: > - MFC r198320: > Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable header > in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not > into if_bce.c anyway. It is disabled by default. > > PR: If a GNATS PR is affected by the change. > > Submitted by: If someone else sent in the change. > > Reviewed by: If someone else reviewed your modification. > > Approved by: If you needed approval for this commit. > > Obtained from: If the change is from a third party. > > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > > Security: Vulnerability reference (one per line) or description. > > Empty fields above will be automatically removed. > > _M 7/sys > M 7/sys/conf/NOTES > M 7/sys/conf/options > M 7/sys/dev/bce/if_bce.c > M 7/sys/dev/bce/if_bcereg.h > _M 7/sys/contrib/pf > > Modified: > stable/7/sys/conf/NOTES > stable/7/sys/conf/options > stable/7/sys/dev/bce/if_bce.c > stable/7/sys/dev/bce/if_bcereg.h > Directory Properties: > stable/7/sys/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > > Modified: stable/7/sys/conf/NOTES > ============================================================================== > --- stable/7/sys/conf/NOTES Sun Nov 15 11:30:59 2009 (r199288) > +++ stable/7/sys/conf/NOTES Sun Nov 15 11:43:28 2009 (r199289) > @@ -1929,6 +1929,12 @@ device lmc > # only works for Tigon II chips, and has no effect for Tigon I chips. > options TI_JUMBO_HDRSPLIT > > +# > +# Use header splitting feature on bce(4) adapters. > +# This may help to reduce the amount of jumbo-sized memory buffers used. > +# > +options BCE_JUMBO_HDRSPLIT > + > # These two options allow manipulating the mbuf cluster size and mbuf size, > # respectively. Be very careful with NIC driver modules when changing > # these from their default values, because that can potentially cause a > > Modified: stable/7/sys/conf/options > ============================================================================== > --- stable/7/sys/conf/options Sun Nov 15 11:30:59 2009 (r199288) > +++ stable/7/sys/conf/options Sun Nov 15 11:43:28 2009 (r199289) > @@ -493,6 +493,7 @@ DRM_DEBUG opt_drm.h > ZERO_COPY_SOCKETS opt_zero.h > TI_PRIVATE_JUMBOS opt_ti.h > TI_JUMBO_HDRSPLIT opt_ti.h > +BCE_JUMBO_HDRSPLIT opt_bce.h > > # XXX Conflict: # of devices vs network protocol (Native ATM). > # This makes "atm.h" unusable. > > Modified: stable/7/sys/dev/bce/if_bce.c > ============================================================================== > --- stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:30:59 2009 (r199288) > +++ stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:43:28 2009 (r199289) > @@ -293,12 +293,12 @@ static void bce_dump_enet (str > static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); > static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); > static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); > #endif > static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *); > static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); > #endif > static void bce_dump_l2fhdr (struct bce_softc *, int, struct l2_fhdr *); > @@ -306,7 +306,7 @@ static void bce_dump_ctx (struct bce_s > static void bce_dump_ftqs (struct bce_softc *); > static void bce_dump_tx_chain (struct bce_softc *, u16, int); > static void bce_dump_rx_chain (struct bce_softc *, u16, int); > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > static void bce_dump_pg_chain (struct bce_softc *, u16, int); > #endif > static void bce_dump_status_block (struct bce_softc *); > @@ -391,7 +391,7 @@ static int bce_init_rx_chain (struct b > static void bce_fill_rx_chain (struct bce_softc *); > static void bce_free_rx_chain (struct bce_softc *); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); > static int bce_init_pg_chain (struct bce_softc *); > static void bce_fill_pg_chain (struct bce_softc *); > @@ -597,7 +597,7 @@ bce_print_adapter_info(struct bce_softc > > /* Firmware version and device features. */ > printf("B/C (0x%08X); Flags( ", sc->bce_bc_ver); > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > printf("SPLT "); > #endif > if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) > @@ -1013,7 +1013,7 @@ bce_attach(device_t dev) > * This may change later if the MTU size is set to > * something other than 1500. > */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > sc->rx_bd_mbuf_alloc_size = MHLEN; > /* Make sure offset is 16 byte aligned for hardware. */ > sc->rx_bd_mbuf_align_pad = roundup2((MSIZE - MHLEN), 16) - > @@ -2753,7 +2753,7 @@ bce_dma_free(struct bce_softc *sc) > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* Free, unmap and destroy all page buffer descriptor chain pages. */ > for (i = 0; i < PG_PAGES; i++ ) { > if (sc->pg_bd_chain[i] != NULL) { > @@ -2817,7 +2817,7 @@ bce_dma_free(struct bce_softc *sc) > sc->rx_mbuf_tag = NULL; > } > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* Unload and destroy the page mbuf maps. */ > for (i = 0; i < TOTAL_PG_BD; i++) { > if (sc->pg_mbuf_map[i] != NULL) { > @@ -3263,7 +3263,7 @@ bce_dma_alloc(device_t dev) > /* > * Create a DMA tag for RX mbufs. > */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? > MCLBYTES : sc->rx_bd_mbuf_alloc_size); > #else > @@ -3304,7 +3304,7 @@ bce_dma_alloc(device_t dev) > } > } > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* > * Create a DMA tag for the page buffer descriptor chain, > * allocate and clear the memory, and fetch the physical > @@ -4393,7 +4393,7 @@ bce_stop(struct bce_softc *sc) > bce_disable_intr(sc); > > /* Free RX buffers. */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > bce_free_pg_chain(sc); > #endif > bce_free_rx_chain(sc); > @@ -4831,7 +4831,7 @@ bce_get_rx_buf(struct bce_softc *sc, str > goto bce_get_rx_buf_exit); > > /* This is a new mbuf allocation. */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > MGETHDR(m_new, M_DONTWAIT, MT_DATA); > #else > if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) > @@ -4912,7 +4912,7 @@ bce_get_rx_buf_exit: > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /****************************************************************************/ > /* Encapsulate an mbuf cluster into the page chain. */ > /* */ > @@ -5021,7 +5021,7 @@ bce_get_pg_buf_exit: > > return(rc); > } > -#endif /* ZERO_COPY_SOCKETS */ > +#endif /* BCE_JUMBO_HDRSPLIT */ > > /****************************************************************************/ > /* Initialize the TX context memory. */ > @@ -5377,7 +5377,7 @@ bce_free_rx_chain(struct bce_softc *sc) > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /****************************************************************************/ > /* Allocate memory and initialize the page data structures. */ > /* Assumes that bce_init_rx_chain() has not already been called. */ > @@ -5541,7 +5541,7 @@ bce_free_pg_chain(struct bce_softc *sc) > > DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_RECV | BCE_VERBOSE_UNLOAD); > } > -#endif /* ZERO_COPY_SOCKETS */ > +#endif /* BCE_JUMBO_HDRSPLIT */ > > > /****************************************************************************/ > @@ -5714,7 +5714,7 @@ bce_rx_intr(struct bce_softc *sc) > unsigned int pkt_len; > u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons; > u32 status; > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > unsigned int rem_len; > u16 sw_pg_cons, sw_pg_cons_idx; > #endif > @@ -5730,7 +5730,7 @@ bce_rx_intr(struct bce_softc *sc) > bus_dmamap_sync(sc->rx_bd_chain_tag, > sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTREAD); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* Prepare the page chain pages to be accessed by the host CPU. */ > for (int i = 0; i < PG_PAGES; i++) > bus_dmamap_sync(sc->pg_bd_chain_tag, > @@ -5742,7 +5742,7 @@ bce_rx_intr(struct bce_softc *sc) > > /* Get working copies of the driver's view of the consumer indices. */ > sw_rx_cons = sc->rx_cons; > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > sw_pg_cons = sc->pg_cons; > #endif > > @@ -5803,7 +5803,7 @@ bce_rx_intr(struct bce_softc *sc) > */ > m_adj(m0, sizeof(struct l2_fhdr) + ETHER_ALIGN); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* > * Check whether the received frame fits in a single > * mbuf or not (i.e. packet data + FCS <= > @@ -5977,7 +5977,7 @@ bce_rx_int_next_rx: > if (m0) { > /* Make sure we don't lose our place when we release the lock. */ > sc->rx_cons = sw_rx_cons; > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > sc->pg_cons = sw_pg_cons; > #endif > > @@ -5987,7 +5987,7 @@ bce_rx_int_next_rx: > > /* Recover our place. */ > sw_rx_cons = sc->rx_cons; > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > sw_pg_cons = sc->pg_cons; > #endif > } > @@ -5998,7 +5998,7 @@ bce_rx_int_next_rx: > } > > /* No new packets to process. Refill the RX and page chains and exit. */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > sc->pg_cons = sw_pg_cons; > bce_fill_pg_chain(sc); > #endif > @@ -6011,7 +6011,7 @@ bce_rx_int_next_rx: > bus_dmamap_sync(sc->rx_bd_chain_tag, > sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > for (int i = 0; i < PG_PAGES; i++) > bus_dmamap_sync(sc->pg_bd_chain_tag, > sc->pg_bd_chain_map[i], BUS_DMASYNC_PREWRITE); > @@ -6257,7 +6257,7 @@ bce_init_locked(struct bce_softc *sc) > * Calculate and program the hardware Ethernet MTU > * size. Be generous on the receive if we have room. > */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size)) > ether_mtu = sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size; > #else > @@ -6289,7 +6289,7 @@ bce_init_locked(struct bce_softc *sc) > /* Program appropriate promiscuous/multicast filtering. */ > bce_set_rx_mode(sc); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n", > __FUNCTION__, sc->pg_bd_mbuf_alloc_size); > > @@ -6802,7 +6802,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm > BCE_LOCK(sc); > ifp->if_mtu = ifr->ifr_mtu; > ifp->if_drv_flags &= ~IFF_DRV_RUNNING; > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* No buffer allocation size changes are necessary. */ > #else > /* Recalculate our buffer allocation sizes. */ > @@ -7505,7 +7505,7 @@ bce_tick(void *xsc) > bce_stats_update(sc); > > /* Top off the receive and page chains. */ > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > bce_fill_pg_chain(sc); > #endif > bce_fill_rx_chain(sc); > @@ -7685,7 +7685,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_ > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /****************************************************************************/ > /* Provides a sysctl interface to allow dumping the page chain. */ > /* */ > @@ -8313,7 +8313,7 @@ bce_add_sysctls(struct bce_softc *sc) > (void *)sc, 0, > bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain"); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > SYSCTL_ADD_PROC(ctx, children, OID_AUTO, > "dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW, > (void *)sc, 0, > @@ -8608,7 +8608,7 @@ bce_dump_rx_mbuf_chain(struct bce_softc > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /****************************************************************************/ > /* Prints out the mbufs in the mbuf page chain. */ > /* */ > @@ -8732,7 +8732,7 @@ bce_dump_rxbd(struct bce_softc *sc, int > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /****************************************************************************/ > /* Prints out a rx_bd structure in the page chain. */ > /* */ > @@ -9219,7 +9219,7 @@ bce_dump_rx_chain(struct bce_softc *sc, > } > > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /****************************************************************************/ > /* Prints out the page chain. */ > /* */ > @@ -9700,7 +9700,7 @@ bce_dump_driver_state(struct bce_softc * > "0x%08X:%08X - (sc->rx_bd_chain) rx_bd chain virtual address\n", > val_hi, val_lo); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > val_hi = BCE_ADDR_HI(sc->pg_bd_chain); > val_lo = BCE_ADDR_LO(sc->pg_bd_chain); > BCE_PRINTF( > @@ -9720,7 +9720,7 @@ bce_dump_driver_state(struct bce_softc * > "0x%08X:%08X - (sc->rx_mbuf_ptr) rx mbuf chain virtual address\n", > val_hi, val_lo); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > val_hi = BCE_ADDR_HI(sc->pg_mbuf_ptr); > val_lo = BCE_ADDR_LO(sc->pg_mbuf_ptr); > BCE_PRINTF( > @@ -9773,7 +9773,7 @@ bce_dump_driver_state(struct bce_softc * > BCE_PRINTF(" 0x%08X - (sc->free_rx_bd) free rx_bd's\n", > sc->free_rx_bd); > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > BCE_PRINTF(" 0x%04X(0x%04X) - (sc->pg_prod) page producer index\n", > sc->pg_prod, (u16) PG_CHAIN_IDX(sc->pg_prod)); > > @@ -10279,7 +10279,7 @@ bce_breakpoint(struct bce_softc *sc) > bce_dump_tpat_state(sc, 0); > bce_dump_cp_state(sc, 0); > bce_dump_com_state(sc, 0); > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > bce_dump_pgbd(sc, 0, NULL); > bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD); > bce_dump_pg_chain(sc, 0, USABLE_PG_BD); > > Modified: stable/7/sys/dev/bce/if_bcereg.h > ============================================================================== > --- stable/7/sys/dev/bce/if_bcereg.h Sun Nov 15 11:30:59 2009 (r199288) > +++ stable/7/sys/dev/bce/if_bcereg.h Sun Nov 15 11:43:28 2009 (r199289) > @@ -6205,7 +6205,7 @@ struct l2_fhdr { > #define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4)) > #define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE) > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* > * To accomodate jumbo frames, the page chain should > * be 4 times larger than the receive chain. > @@ -6227,7 +6227,7 @@ struct l2_fhdr { > #define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS - 4)) > #define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE) > > -#endif /* ZERO_COPY_SOCKETS */ > +#endif /* BCE_JUMBO_HDRSPLIT */ > > #define CTX_INIT_RETRY_COUNT 10 > > @@ -6505,7 +6505,7 @@ struct bce_softc > u16 tx_cons; > u32 tx_prod_bseq; /* Counts the bytes used. */ > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > u16 pg_prod; > u16 pg_cons; > #endif > @@ -6522,7 +6522,7 @@ struct bce_softc > int rx_bd_mbuf_data_len; > int rx_bd_mbuf_align_pad; > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > int pg_bd_mbuf_alloc_size; > #endif > > @@ -6544,7 +6544,7 @@ struct bce_softc > struct rx_bd *rx_bd_chain[RX_PAGES]; > bus_addr_t rx_bd_chain_paddr[RX_PAGES]; > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* H/W maintained page buffer descriptor chain structure. */ > bus_dma_tag_t pg_bd_chain_tag; > bus_dmamap_t pg_bd_chain_map[PG_PAGES]; > @@ -6581,7 +6581,7 @@ struct bce_softc > bus_dma_tag_t rx_mbuf_tag; > bus_dma_tag_t tx_mbuf_tag; > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > bus_dma_tag_t pg_mbuf_tag; > #endif > > @@ -6593,7 +6593,7 @@ struct bce_softc > bus_dmamap_t rx_mbuf_map[TOTAL_RX_BD]; > struct mbuf *rx_mbuf_ptr[TOTAL_RX_BD]; > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > /* S/W maintained mbuf page chain structure. */ > bus_dmamap_t pg_mbuf_map[TOTAL_PG_BD]; > struct mbuf *pg_mbuf_ptr[TOTAL_PG_BD]; > @@ -6605,7 +6605,7 @@ struct bce_softc > u16 used_tx_bd; > u16 max_tx_bd; > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > u16 free_pg_bd; > u16 max_pg_bd; > #endif > @@ -6693,7 +6693,7 @@ struct bce_softc > int debug_tx_mbuf_alloc; > int debug_rx_mbuf_alloc; > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > int debug_pg_mbuf_alloc; > #endif > > @@ -6710,7 +6710,7 @@ struct bce_softc > u32 rx_low_watermark; /* Lowest number of rx_bd's free. */ > u32 rx_empty_count; /* Number of times the RX chain was empty. */ > > -#ifdef ZERO_COPY_SOCKETS > +#ifdef BCE_JUMBO_HDRSPLIT > u32 pg_low_watermark; /* Lowest number of pages free. */ > u32 pg_empty_count; /* Number of times the page chain was empty. */ > #endif > From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 20:10:22 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0520510656C1; Mon, 30 Nov 2009 20:10:22 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id 67CD08FC18; Mon, 30 Nov 2009 20:10:21 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 5855448AFE; Mon, 30 Nov 2009 20:10:20 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UIb1RPinCttJ; Mon, 30 Nov 2009 20:10:13 +0000 (GMT) Received: from rita.nodomain (unknown [192.168.205.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id D0CC948AFA; Mon, 30 Nov 2009 20:10:11 +0000 (GMT) Message-ID: <4B142655.6030703@tomjudge.com> Date: Mon, 30 Nov 2009 20:08:53 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Maxim Sobolev References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> In-Reply-To: <4B141D2E.1000203@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 20:10:22 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maxim Sobolev wrote: > Is the option related to Jumbo Frames in any way? If not, IMHO the name > should be changed to avoid any confusion. The bug is easier to reproduce when jumbo frames are turned on however we have seen it with normal frames also. Tom > > -Maxim > > Stanislav Sedov wrote: >> Author: stas >> Date: Sun Nov 15 11:43:28 2009 >> New Revision: 199289 >> URL: http://svn.freebsd.org/changeset/base/199289 >> >> Log: >> - MFC r198320: >> Introduce new option BCE_JUMBO_HDRSPLIT that allows user to enable >> header >> in bce(4) instead of (ab)using ZERO_COPY_SOCKETS that was not >> into if_bce.c anyway. It is disabled by default. >> > PR: If a GNATS PR is affected by the change. >> > Submitted by: If someone else sent in the change. >> > Reviewed by: If someone else reviewed your modification. >> > Approved by: If you needed approval for this commit. >> > Obtained from: If the change is from a third party. >> > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder >> email. >> > Security: Vulnerability reference (one per line) or description. >> > Empty fields above will be automatically removed. >> _M 7/sys >> M 7/sys/conf/NOTES >> M 7/sys/conf/options >> M 7/sys/dev/bce/if_bce.c >> M 7/sys/dev/bce/if_bcereg.h >> _M 7/sys/contrib/pf >> >> Modified: >> stable/7/sys/conf/NOTES >> stable/7/sys/conf/options >> stable/7/sys/dev/bce/if_bce.c >> stable/7/sys/dev/bce/if_bcereg.h >> Directory Properties: >> stable/7/sys/ (props changed) >> stable/7/sys/contrib/pf/ (props changed) >> >> Modified: stable/7/sys/conf/NOTES >> ============================================================================== >> >> --- stable/7/sys/conf/NOTES Sun Nov 15 11:30:59 2009 (r199288) >> +++ stable/7/sys/conf/NOTES Sun Nov 15 11:43:28 2009 (r199289) >> @@ -1929,6 +1929,12 @@ device lmc >> # only works for Tigon II chips, and has no effect for Tigon I chips. >> options TI_JUMBO_HDRSPLIT >> >> +# >> +# Use header splitting feature on bce(4) adapters. >> +# This may help to reduce the amount of jumbo-sized memory buffers used. >> +# >> +options BCE_JUMBO_HDRSPLIT >> + >> # These two options allow manipulating the mbuf cluster size and mbuf >> size, >> # respectively. Be very careful with NIC driver modules when changing >> # these from their default values, because that can potentially cause a >> >> Modified: stable/7/sys/conf/options >> ============================================================================== >> >> --- stable/7/sys/conf/options Sun Nov 15 11:30:59 2009 (r199288) >> +++ stable/7/sys/conf/options Sun Nov 15 11:43:28 2009 (r199289) >> @@ -493,6 +493,7 @@ DRM_DEBUG opt_drm.h >> ZERO_COPY_SOCKETS opt_zero.h >> TI_PRIVATE_JUMBOS opt_ti.h >> TI_JUMBO_HDRSPLIT opt_ti.h >> +BCE_JUMBO_HDRSPLIT opt_bce.h >> >> # XXX Conflict: # of devices vs network protocol (Native ATM). >> # This makes "atm.h" unusable. >> >> Modified: stable/7/sys/dev/bce/if_bce.c >> ============================================================================== >> >> --- stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:30:59 2009 >> (r199288) >> +++ stable/7/sys/dev/bce/if_bce.c Sun Nov 15 11:43:28 2009 >> (r199289) >> @@ -293,12 +293,12 @@ static void bce_dump_enet (str >> static void bce_dump_mbuf (struct bce_softc *, struct >> mbuf *); >> static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); >> static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); >> #endif >> static void bce_dump_txbd (struct bce_softc *, int, struct >> tx_bd *); >> static void bce_dump_rxbd (struct bce_softc *, int, struct >> rx_bd *); >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> static void bce_dump_pgbd (struct bce_softc *, int, struct >> rx_bd *); >> #endif >> static void bce_dump_l2fhdr (struct bce_softc *, int, >> struct l2_fhdr *); >> @@ -306,7 +306,7 @@ static void bce_dump_ctx (struct bce_s >> static void bce_dump_ftqs (struct bce_softc *); >> static void bce_dump_tx_chain (struct bce_softc *, u16, int); >> static void bce_dump_rx_chain (struct bce_softc *, u16, int); >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> static void bce_dump_pg_chain (struct bce_softc *, u16, int); >> #endif >> static void bce_dump_status_block (struct bce_softc *); >> @@ -391,7 +391,7 @@ static int bce_init_rx_chain (struct b >> static void bce_fill_rx_chain (struct bce_softc *); >> static void bce_free_rx_chain (struct bce_softc *); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> static int bce_get_pg_buf (struct bce_softc *, struct >> mbuf *, u16 *, u16 *); >> static int bce_init_pg_chain (struct bce_softc *); >> static void bce_fill_pg_chain (struct bce_softc *); >> @@ -597,7 +597,7 @@ bce_print_adapter_info(struct bce_softc >> /* Firmware version and device features. */ >> printf("B/C (0x%08X); Flags( ", sc->bce_bc_ver); >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> printf("SPLT "); >> #endif >> if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) >> @@ -1013,7 +1013,7 @@ bce_attach(device_t dev) >> * This may change later if the MTU size is set to >> * something other than 1500. >> */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> sc->rx_bd_mbuf_alloc_size = MHLEN; >> /* Make sure offset is 16 byte aligned for hardware. */ >> sc->rx_bd_mbuf_align_pad = roundup2((MSIZE - MHLEN), 16) - >> @@ -2753,7 +2753,7 @@ bce_dma_free(struct bce_softc *sc) >> } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* Free, unmap and destroy all page buffer descriptor chain >> pages. */ >> for (i = 0; i < PG_PAGES; i++ ) { >> if (sc->pg_bd_chain[i] != NULL) { >> @@ -2817,7 +2817,7 @@ bce_dma_free(struct bce_softc *sc) >> sc->rx_mbuf_tag = NULL; >> } >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* Unload and destroy the page mbuf maps. */ >> for (i = 0; i < TOTAL_PG_BD; i++) { >> if (sc->pg_mbuf_map[i] != NULL) { >> @@ -3263,7 +3263,7 @@ bce_dma_alloc(device_t dev) >> /* >> * Create a DMA tag for RX mbufs. >> */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? >> MCLBYTES : sc->rx_bd_mbuf_alloc_size); >> #else >> @@ -3304,7 +3304,7 @@ bce_dma_alloc(device_t dev) >> } >> } >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* >> * Create a DMA tag for the page buffer descriptor chain, >> * allocate and clear the memory, and fetch the physical >> @@ -4393,7 +4393,7 @@ bce_stop(struct bce_softc *sc) >> bce_disable_intr(sc); >> >> /* Free RX buffers. */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> bce_free_pg_chain(sc); >> #endif >> bce_free_rx_chain(sc); >> @@ -4831,7 +4831,7 @@ bce_get_rx_buf(struct bce_softc *sc, str >> goto bce_get_rx_buf_exit); >> >> /* This is a new mbuf allocation. */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> MGETHDR(m_new, M_DONTWAIT, MT_DATA); >> #else >> if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) >> @@ -4912,7 +4912,7 @@ bce_get_rx_buf_exit: >> } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /****************************************************************************/ >> >> /* Encapsulate an mbuf cluster into the page >> chain. */ >> /* >> */ >> @@ -5021,7 +5021,7 @@ bce_get_pg_buf_exit: >> >> return(rc); >> } >> -#endif /* ZERO_COPY_SOCKETS */ >> +#endif /* BCE_JUMBO_HDRSPLIT */ >> >> /****************************************************************************/ >> >> /* Initialize the TX context >> memory. */ >> @@ -5377,7 +5377,7 @@ bce_free_rx_chain(struct bce_softc *sc) >> } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /****************************************************************************/ >> >> /* Allocate memory and initialize the page data >> structures. */ >> /* Assumes that bce_init_rx_chain() has not already been >> called. */ >> @@ -5541,7 +5541,7 @@ bce_free_pg_chain(struct bce_softc *sc) >> >> DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_RECV | BCE_VERBOSE_UNLOAD); >> } >> -#endif /* ZERO_COPY_SOCKETS */ >> +#endif /* BCE_JUMBO_HDRSPLIT */ >> >> >> /****************************************************************************/ >> >> @@ -5714,7 +5714,7 @@ bce_rx_intr(struct bce_softc *sc) >> unsigned int pkt_len; >> u16 sw_rx_cons, sw_rx_cons_idx, hw_rx_cons; >> u32 status; >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> unsigned int rem_len; >> u16 sw_pg_cons, sw_pg_cons_idx; >> #endif >> @@ -5730,7 +5730,7 @@ bce_rx_intr(struct bce_softc *sc) >> bus_dmamap_sync(sc->rx_bd_chain_tag, >> sc->rx_bd_chain_map[i], BUS_DMASYNC_POSTREAD); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* Prepare the page chain pages to be accessed by the host CPU. */ >> for (int i = 0; i < PG_PAGES; i++) >> bus_dmamap_sync(sc->pg_bd_chain_tag, >> @@ -5742,7 +5742,7 @@ bce_rx_intr(struct bce_softc *sc) >> >> /* Get working copies of the driver's view of the consumer >> indices. */ >> sw_rx_cons = sc->rx_cons; >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> sw_pg_cons = sc->pg_cons; >> #endif >> >> @@ -5803,7 +5803,7 @@ bce_rx_intr(struct bce_softc *sc) >> */ >> m_adj(m0, sizeof(struct l2_fhdr) + ETHER_ALIGN); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* >> * Check whether the received frame fits in a single >> * mbuf or not (i.e. packet data + FCS <= >> @@ -5977,7 +5977,7 @@ bce_rx_int_next_rx: >> if (m0) { >> /* Make sure we don't lose our place when we release the >> lock. */ >> sc->rx_cons = sw_rx_cons; >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> sc->pg_cons = sw_pg_cons; >> #endif >> >> @@ -5987,7 +5987,7 @@ bce_rx_int_next_rx: >> >> /* Recover our place. */ >> sw_rx_cons = sc->rx_cons; >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> sw_pg_cons = sc->pg_cons; >> #endif >> } >> @@ -5998,7 +5998,7 @@ bce_rx_int_next_rx: >> } >> >> /* No new packets to process. Refill the RX and page chains and >> exit. */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> sc->pg_cons = sw_pg_cons; >> bce_fill_pg_chain(sc); >> #endif >> @@ -6011,7 +6011,7 @@ bce_rx_int_next_rx: >> bus_dmamap_sync(sc->rx_bd_chain_tag, >> sc->rx_bd_chain_map[i], BUS_DMASYNC_PREWRITE); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> for (int i = 0; i < PG_PAGES; i++) >> bus_dmamap_sync(sc->pg_bd_chain_tag, >> sc->pg_bd_chain_map[i], BUS_DMASYNC_PREWRITE); >> @@ -6257,7 +6257,7 @@ bce_init_locked(struct bce_softc *sc) >> * Calculate and program the hardware Ethernet MTU >> * size. Be generous on the receive if we have room. >> */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> if (ifp->if_mtu <= (sc->rx_bd_mbuf_data_len + >> sc->pg_bd_mbuf_alloc_size)) >> ether_mtu = sc->rx_bd_mbuf_data_len + sc->pg_bd_mbuf_alloc_size; >> #else >> @@ -6289,7 +6289,7 @@ bce_init_locked(struct bce_softc *sc) >> /* Program appropriate promiscuous/multicast filtering. */ >> bce_set_rx_mode(sc); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_mbuf_alloc_size = %d\n", >> __FUNCTION__, sc->pg_bd_mbuf_alloc_size); >> >> @@ -6802,7 +6802,7 @@ bce_ioctl(struct ifnet *ifp, u_long comm >> BCE_LOCK(sc); >> ifp->if_mtu = ifr->ifr_mtu; >> ifp->if_drv_flags &= ~IFF_DRV_RUNNING; >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* No buffer allocation size changes are necessary. */ >> #else >> /* Recalculate our buffer allocation sizes. */ >> @@ -7505,7 +7505,7 @@ bce_tick(void *xsc) >> bce_stats_update(sc); >> >> /* Top off the receive and page chains. */ >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> bce_fill_pg_chain(sc); >> #endif >> bce_fill_rx_chain(sc); >> @@ -7685,7 +7685,7 @@ bce_sysctl_dump_tx_chain(SYSCTL_HANDLER_ >> } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /****************************************************************************/ >> >> /* Provides a sysctl interface to allow dumping the page >> chain. */ >> /* >> */ >> @@ -8313,7 +8313,7 @@ bce_add_sysctls(struct bce_softc *sc) >> (void *)sc, 0, >> bce_sysctl_dump_tx_chain, "I", "Dump tx_bd chain"); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> SYSCTL_ADD_PROC(ctx, children, OID_AUTO, >> "dump_pg_chain", CTLTYPE_INT | CTLFLAG_RW, >> (void *)sc, 0, >> @@ -8608,7 +8608,7 @@ bce_dump_rx_mbuf_chain(struct bce_softc } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /****************************************************************************/ >> >> /* Prints out the mbufs in the mbuf page >> chain. */ >> /* >> */ >> @@ -8732,7 +8732,7 @@ bce_dump_rxbd(struct bce_softc *sc, int } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /****************************************************************************/ >> >> /* Prints out a rx_bd structure in the page >> chain. */ >> /* >> */ >> @@ -9219,7 +9219,7 @@ bce_dump_rx_chain(struct bce_softc *sc, } >> >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /****************************************************************************/ >> >> /* Prints out the page >> chain. */ >> /* >> */ >> @@ -9700,7 +9700,7 @@ bce_dump_driver_state(struct bce_softc * >> "0x%08X:%08X - (sc->rx_bd_chain) rx_bd chain virtual address\n", >> val_hi, val_lo); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> val_hi = BCE_ADDR_HI(sc->pg_bd_chain); >> val_lo = BCE_ADDR_LO(sc->pg_bd_chain); >> BCE_PRINTF( >> @@ -9720,7 +9720,7 @@ bce_dump_driver_state(struct bce_softc * >> "0x%08X:%08X - (sc->rx_mbuf_ptr) rx mbuf chain virtual >> address\n", >> val_hi, val_lo); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> val_hi = BCE_ADDR_HI(sc->pg_mbuf_ptr); >> val_lo = BCE_ADDR_LO(sc->pg_mbuf_ptr); >> BCE_PRINTF( >> @@ -9773,7 +9773,7 @@ bce_dump_driver_state(struct bce_softc * >> BCE_PRINTF(" 0x%08X - (sc->free_rx_bd) free rx_bd's\n", >> sc->free_rx_bd); >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> BCE_PRINTF(" 0x%04X(0x%04X) - (sc->pg_prod) page producer >> index\n", >> sc->pg_prod, (u16) PG_CHAIN_IDX(sc->pg_prod)); >> >> @@ -10279,7 +10279,7 @@ bce_breakpoint(struct bce_softc *sc) >> bce_dump_tpat_state(sc, 0); >> bce_dump_cp_state(sc, 0); >> bce_dump_com_state(sc, 0); >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> bce_dump_pgbd(sc, 0, NULL); >> bce_dump_pg_mbuf_chain(sc, 0, USABLE_PG_BD); >> bce_dump_pg_chain(sc, 0, USABLE_PG_BD); >> >> Modified: stable/7/sys/dev/bce/if_bcereg.h >> ============================================================================== >> >> --- stable/7/sys/dev/bce/if_bcereg.h Sun Nov 15 11:30:59 2009 >> (r199288) >> +++ stable/7/sys/dev/bce/if_bcereg.h Sun Nov 15 11:43:28 2009 >> (r199289) >> @@ -6205,7 +6205,7 @@ struct l2_fhdr { >> #define RX_PAGE(x) (((x) & ~USABLE_RX_BD_PER_PAGE) >> (BCM_PAGE_BITS >> - 4)) >> #define RX_IDX(x) ((x) & USABLE_RX_BD_PER_PAGE) >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* >> * To accomodate jumbo frames, the page chain should >> * be 4 times larger than the receive chain. >> @@ -6227,7 +6227,7 @@ struct l2_fhdr { >> #define PG_PAGE(x) (((x) & ~USABLE_PG_BD_PER_PAGE) >> (BCM_PAGE_BITS >> - 4)) >> #define PG_IDX(x) ((x) & USABLE_PG_BD_PER_PAGE) >> >> -#endif /* ZERO_COPY_SOCKETS */ >> +#endif /* BCE_JUMBO_HDRSPLIT */ >> >> #define CTX_INIT_RETRY_COUNT 10 >> >> @@ -6505,7 +6505,7 @@ struct bce_softc >> u16 tx_cons; >> u32 tx_prod_bseq; /* Counts the bytes >> used. */ >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> u16 pg_prod; >> u16 pg_cons; >> #endif >> @@ -6522,7 +6522,7 @@ struct bce_softc >> int rx_bd_mbuf_data_len; >> int rx_bd_mbuf_align_pad; >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> int pg_bd_mbuf_alloc_size; >> #endif >> >> @@ -6544,7 +6544,7 @@ struct bce_softc >> struct rx_bd *rx_bd_chain[RX_PAGES]; >> bus_addr_t rx_bd_chain_paddr[RX_PAGES]; >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* H/W maintained page buffer descriptor chain structure. */ >> bus_dma_tag_t pg_bd_chain_tag; >> bus_dmamap_t pg_bd_chain_map[PG_PAGES]; >> @@ -6581,7 +6581,7 @@ struct bce_softc >> bus_dma_tag_t rx_mbuf_tag; >> bus_dma_tag_t tx_mbuf_tag; >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> bus_dma_tag_t pg_mbuf_tag; >> #endif >> >> @@ -6593,7 +6593,7 @@ struct bce_softc >> bus_dmamap_t rx_mbuf_map[TOTAL_RX_BD]; >> struct mbuf *rx_mbuf_ptr[TOTAL_RX_BD]; >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> /* S/W maintained mbuf page chain structure. */ >> bus_dmamap_t pg_mbuf_map[TOTAL_PG_BD]; >> struct mbuf *pg_mbuf_ptr[TOTAL_PG_BD]; >> @@ -6605,7 +6605,7 @@ struct bce_softc >> u16 used_tx_bd; >> u16 max_tx_bd; >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> u16 free_pg_bd; >> u16 max_pg_bd; >> #endif >> @@ -6693,7 +6693,7 @@ struct bce_softc >> int debug_tx_mbuf_alloc; >> int debug_rx_mbuf_alloc; >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> int debug_pg_mbuf_alloc; >> #endif >> >> @@ -6710,7 +6710,7 @@ struct bce_softc >> u32 rx_low_watermark; /* Lowest number of rx_bd's >> free. */ >> u32 rx_empty_count; /* Number of times the RX >> chain was empty. */ >> >> -#ifdef ZERO_COPY_SOCKETS >> +#ifdef BCE_JUMBO_HDRSPLIT >> u32 pg_low_watermark; /* Lowest number of pages >> free. */ >> u32 pg_empty_count; /* Number of times the page chain >> was empty. */ >> #endif >> > > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" - -- TJU13-ARIN -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJLFCZVAAoJEMSwVS7lr0OdMLgIAKzeXBKtLHvx6BmAMn97ky+K mc0qempP/6gnydQkzJCCosoL/78mLzelqId7ff6jAayOriNkh4iQkSl3cZUtewD2 pJXrN1vhWWR0TxNuXLg77g3VXTtBNwxZ/9y02KWaf2xOGVVMkAOILdfhwHmCPNiV btUjtZpcr9Fe5N4IM0Mpgr8SNAPDbigAWs/58Nn8jpoo6Dy3qYf1Pl7P7kvQDZIj XLC91Vun1gY6B1YSXfZQWeHaOm/6YJwLFjEJs8G4MHF4rjy9Yfb27HX9AzJr3DvS Tm7tgZG+CU0PGrzgojxhqSDOND3MoDhPVSSqQ19oQHlTWSEOZQaq+qrtPvYfPRk= =hEox -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 20:41:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D18B0106566B; Mon, 30 Nov 2009 20:41:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2EB88FC0C; Mon, 30 Nov 2009 20:41:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAUKfUDN042095; Mon, 30 Nov 2009 20:41:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAUKfUJ7042093; Mon, 30 Nov 2009 20:41:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200911302041.nAUKfUJ7042093@svn.freebsd.org> From: Ed Maste Date: Mon, 30 Nov 2009 20:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199972 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 20:41:30 -0000 Author: emaste Date: Mon Nov 30 20:41:30 2009 New Revision: 199972 URL: http://svn.freebsd.org/changeset/base/199972 Log: Use switch out (SWO) instead of switch in (SWI) debug log mask in csw_out. Modified: head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Mon Nov 30 18:48:07 2009 (r199971) +++ head/sys/dev/hwpmc/hwpmc_mod.c Mon Nov 30 20:41:30 2009 (r199972) @@ -1401,7 +1401,7 @@ pmc_process_csw_out(struct thread *td) tmp = newvalue - PMC_PCPU_SAVED(cpu,ri); - PMCDBG(CSW,SWI,1,"cpu=%d ri=%d tmp=%jd", cpu, ri, + PMCDBG(CSW,SWO,1,"cpu=%d ri=%d tmp=%jd", cpu, ri, tmp); if (mode == PMC_MODE_TS) { From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 21:00:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CA191065670; Mon, 30 Nov 2009 21:00:42 +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 632E48FC2D; Mon, 30 Nov 2009 21:00:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAUL0gX7042578; Mon, 30 Nov 2009 21:00:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAUL0gqE042577; Mon, 30 Nov 2009 21:00:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911302100.nAUL0gqE042577@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Nov 2009 21:00:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199973 - in stable/6/sys: . conf contrib/pf dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 21:00:42 -0000 Author: jhb Date: Mon Nov 30 21:00:42 2009 New Revision: 199973 URL: http://svn.freebsd.org/changeset/base/199973 Log: Fixup mergeinfo and move sys/conf mergeinfo up to sys/. Modified: Directory Properties: stable/6/sys/ (props changed) stable/6/sys/conf/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 21:03:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F56A1065697; Mon, 30 Nov 2009 21:03:45 +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 4088F8FC13; Mon, 30 Nov 2009 21:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAUL3j7k042674; Mon, 30 Nov 2009 21:03:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAUL3jZp042672; Mon, 30 Nov 2009 21:03:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911302103.nAUL3jZp042672@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Nov 2009 21:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199974 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 21:03:45 -0000 Author: jhb Date: Mon Nov 30 21:03:44 2009 New Revision: 199974 URL: http://svn.freebsd.org/changeset/base/199974 Log: Remove extra parantheses from usb_ethernet.c and usb_serial.c lines. config(8) doesn't parse parantheses and instead treated them as being part of the device driver name (e.g. '(u3g' vs 'u3g'). While here, fix the style of these long lines to match the wrapping used for other long lines in this file. Submitted by: Brett Glass MFC after: 1 week Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 30 21:00:42 2009 (r199973) +++ head/sys/conf/files Mon Nov 30 21:03:44 2009 (r199974) @@ -1656,8 +1656,8 @@ dev/usb/net/if_cue.c optional cue dev/usb/net/if_kue.c optional kue dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav -dev/usb/net/usb_ethernet.c \ - optional (aue | axe | cdce | cue | kue | rue | udav) +dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | rue | \ + udav # # USB WLAN drivers # @@ -1688,8 +1688,11 @@ dev/usb/serial/uplcom.c optional uplcom dev/usb/serial/uslcom.c optional uslcom dev/usb/serial/uvisor.c optional uvisor dev/usb/serial/uvscom.c optional uvscom -dev/usb/serial/usb_serial.c optional ucom | \ - (u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) +dev/usb/serial/usb_serial.c optional ucom | u3g | uark | ubsa | ubser | \ + uchcom | ucycom | ufoma | uftdi | \ + ugensa | uipaq | ulpt | umct | \ + umodem | umoscom | uplcom | uslcom | \ + uvisor | uvscom # # USB misc drivers # From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 21:25:03 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE96A10656A5; Mon, 30 Nov 2009 21:25:03 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 8D8308FC19; Mon, 30 Nov 2009 21:25:03 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nAULP1GS090380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2009 13:25:02 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B14382F.5080000@FreeBSD.org> Date: Mon, 30 Nov 2009 13:25:03 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tom Judge References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> In-Reply-To: <4B142655.6030703@tomjudge.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 21:25:03 -0000 Tom Judge wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Maxim Sobolev wrote: >> Is the option related to Jumbo Frames in any way? If not, IMHO the name >> should be changed to avoid any confusion. > > The bug is easier to reproduce when jumbo frames are turned on however > we have seen it with normal frames also. Can we change the name then? We've seen the similar issue without the jumbo frames, which made me wonder. Also, perhaps we should make it a default and/or tunable. Having user to recompile kernel just to save 20 bytes of text segment is not very practical these days. -Maxim From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 21:25:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B6AB106568F; Mon, 30 Nov 2009 21:25:58 +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 1B6FB8FC08; Mon, 30 Nov 2009 21:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAULPvEs043113; Mon, 30 Nov 2009 21:25:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAULPvRO043110; Mon, 30 Nov 2009 21:25:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200911302125.nAULPvRO043110@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Nov 2009 21:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 21:25:58 -0000 Author: jhb Date: Mon Nov 30 21:25:57 2009 New Revision: 199975 URL: http://svn.freebsd.org/changeset/base/199975 Log: Remove if_timer/if_watchdog now that they are no longer used. The space used by if_timer is reserved for expanding if_index to an int in the future. Reviewed by: rwatson, brooks Modified: head/sys/net/if.c head/sys/net/if_dead.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Nov 30 21:03:44 2009 (r199974) +++ head/sys/net/if.c Mon Nov 30 21:25:57 2009 (r199975) @@ -96,8 +96,6 @@ struct ifindex_entry { struct ifnet *ife_ifnet; }; -static int slowtimo_started; - SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -125,10 +123,8 @@ static int ifconf(u_long, caddr_t); static void if_freemulti(struct ifmultiaddr *); static void if_init(void *); static void if_grow(void); -static void if_check(void *); static void if_route(struct ifnet *, int flag, int fam); static int if_setflag(struct ifnet *, int, int, int *, int); -static void if_slowtimo(void *); static int if_transmit(struct ifnet *ifp, struct mbuf *m); static void if_unroute(struct ifnet *, int flag, int fam); static void link_rtrequest(int, struct rtentry *, struct rt_addrinfo *); @@ -185,11 +181,6 @@ struct sx ifnet_sxlock; static if_com_alloc_t *if_com_alloc[256]; static if_com_free_t *if_com_free[256]; -/* - * System initialization - */ -SYSINIT(interface_check, SI_SUB_PROTO_IF, SI_ORDER_FIRST, if_check, NULL); - MALLOC_DEFINE(M_IFNET, "ifnet", "interface internals"); MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); @@ -375,18 +366,6 @@ if_grow(void) V_ifindex_table = e; } -static void -if_check(void *dummy __unused) -{ - - /* - * If at least one interface added during boot uses - * if_watchdog then start the timer. - */ - if (slowtimo_started) - if_slowtimo(0); -} - /* * Allocate a struct ifnet and an index for an interface. A layer 2 * common structure will also be allocated if an allocation routine is @@ -670,18 +649,6 @@ if_attach_internal(struct ifnet *ifp, in /* Announce the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); - - if (!vmove && ifp->if_watchdog != NULL) { - if_printf(ifp, - "WARNING: using obsoleted if_watchdog interface\n"); - - /* - * Note that we need if_slowtimo(). If this happens after - * boot, then call if_slowtimo() directly. - */ - if (atomic_cmpset_int(&slowtimo_started, 0, 1) && !cold) - if_slowtimo(0); - } } static void @@ -1973,39 +1940,6 @@ if_qflush(struct ifnet *ifp) } /* - * Handle interface watchdog timer routines. Called - * from softclock, we decrement timers (if set) and - * call the appropriate interface routine on expiration. - * - * XXXRW: Note that because timeouts run with Giant, if_watchdog() is called - * holding Giant. - */ -static void -if_slowtimo(void *arg) -{ - VNET_ITERATOR_DECL(vnet_iter); - struct ifnet *ifp; - int s = splimp(); - - VNET_LIST_RLOCK_NOSLEEP(); - IFNET_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - TAILQ_FOREACH(ifp, &V_ifnet, if_link) { - if (ifp->if_timer == 0 || --ifp->if_timer) - continue; - if (ifp->if_watchdog) - (*ifp->if_watchdog)(ifp); - } - CURVNET_RESTORE(); - } - IFNET_RUNLOCK_NOSLEEP(); - VNET_LIST_RUNLOCK_NOSLEEP(); - splx(s); - timeout(if_slowtimo, (void *)0, hz / IFNET_SLOWHZ); -} - -/* * Map interface name to interface structure pointer, with or without * returning a reference. */ Modified: head/sys/net/if_dead.c ============================================================================== --- head/sys/net/if_dead.c Mon Nov 30 21:03:44 2009 (r199974) +++ head/sys/net/if_dead.c Mon Nov 30 21:25:57 2009 (r199975) @@ -70,12 +70,6 @@ ifdead_ioctl(struct ifnet *ifp, u_long c return (ENXIO); } -static void -ifdead_watchdog(struct ifnet *ifp) -{ - -} - static int ifdead_resolvemulti(struct ifnet *ifp, struct sockaddr **llsa, struct sockaddr *sa) @@ -107,7 +101,6 @@ if_dead(struct ifnet *ifp) ifp->if_input = ifdead_input; ifp->if_start = ifdead_start; ifp->if_ioctl = ifdead_ioctl; - ifp->if_watchdog = ifdead_watchdog; ifp->if_resolvemulti = ifdead_resolvemulti; ifp->if_qflush = ifdead_qflush; ifp->if_transmit = ifdead_transmit; Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Nov 30 21:03:44 2009 (r199974) +++ head/sys/net/if_var.h Mon Nov 30 21:25:57 2009 (r199975) @@ -141,7 +141,7 @@ struct ifnet { struct carp_if *if_carp; /* carp interface structure */ struct bpf_if *if_bpf; /* packet filter structure */ u_short if_index; /* numeric abbreviation for this if */ - short if_timer; /* time 'til if_watchdog called */ + short if_index_reserved; /* spare space to grow if_index */ struct ifvlantrunk *if_vlantrunk; /* pointer to 802.1q data */ int if_flags; /* up/down, broadcast, etc. */ int if_capabilities; /* interface features & capabilities */ @@ -161,8 +161,6 @@ struct ifnet { (struct ifnet *); int (*if_ioctl) /* ioctl routine */ (struct ifnet *, u_long, caddr_t); - void (*if_watchdog) /* timer routine */ - (struct ifnet *); void (*if_init) /* Init routine */ (void *); int (*if_resolvemulti) /* validate/resolve multicast */ From owner-svn-src-all@FreeBSD.ORG Mon Nov 30 23:35:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6990106566B; Mon, 30 Nov 2009 23:35:54 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 9DACF8FC1E; Mon, 30 Nov 2009 23:35:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 411DE7BA13; Tue, 1 Dec 2009 12:35:53 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hCAmkr0uMrbU; Tue, 1 Dec 2009 12:35:48 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Tue, 1 Dec 2009 12:35:48 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id 0483B11475; Tue, 1 Dec 2009 12:35:47 +1300 (NZDT) Date: Tue, 1 Dec 2009 12:35:47 +1300 From: Andrew Thompson To: John Baldwin Message-ID: <20091130233547.GA68836@citylink.fud.org.nz> References: <200911302125.nAULPvRO043110@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200911302125.nAULPvRO043110@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2009 23:35:55 -0000 On Mon, Nov 30, 2009 at 09:25:57PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Nov 30 21:25:57 2009 > New Revision: 199975 > URL: http://svn.freebsd.org/changeset/base/199975 > > Log: > Remove if_timer/if_watchdog now that they are no longer used. The space > used by if_timer is reserved for expanding if_index to an int in the > future. > > Reviewed by: rwatson, brooks > I am getting, ===> usr.bin/netstat (all) cc -O2 -pipe -fno-strict-aliasing -DIPSEC -DSCTP -DINET6 -DNETGRAPH -DIPX -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c: In function 'intpr': /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c:291: error: 'struct ifnet' has no member named 'if_timer' *** Error code 1 Stop in /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat. *** Error code 1 From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 00:32:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C08D106566B; Tue, 1 Dec 2009 00:32:41 +0000 (UTC) (envelope-from lynx.ripe@gmail.com) Received: from mail-fx0-f218.google.com (mail-fx0-f218.google.com [209.85.220.218]) by mx1.freebsd.org (Postfix) with ESMTP id 4D27B8FC1B; Tue, 1 Dec 2009 00:32:39 +0000 (UTC) Received: by fxm10 with SMTP id 10so3647638fxm.14 for ; Mon, 30 Nov 2009 16:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=lxkgGsdTXtz9qnm+rb3GJQ9Ge8bLQY5aoedkBw05y2g=; b=H+kxDtqFm9Wyb03F1FTnVhNJYz5TH52xwoIoDgFh+BS0O3LTP6JW4mi2cO2oLMvaOY LUTnCteCnLxwdYSfvKcntH44q55LC+2WojHUidneYV352nxUG8st2arBrMKs6tv0zhLN nkekqhdukTulNVGj+evHpPwfOVNDK0fVzpa8A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=ssuwhZNKRoNT7gFMEbdzQS18ysJJgedzObJWodMrrwbpcoFsCZ3TIFO4+6zGS21Pjn MOXwtmd5IlGHjNxS2xRaCUdsETGACWP8/K17YaxzUKuGE3ckQPDqXTK2Q7j+kES69Z11 6VDkpggdv/03zAjDnxz+YRaDL9oIrjC6Gt+6E= Received: by 10.86.161.1 with SMTP id j1mr4808623fge.7.1259627558093; Mon, 30 Nov 2009 16:32:38 -0800 (PST) Received: from lynx.homenet (135-4-132-95.pool.ukrtel.net [95.132.4.135]) by mx.google.com with ESMTPS id 12sm12190742fgg.2.2009.11.30.16.32.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 30 Nov 2009 16:32:37 -0800 (PST) Message-ID: <4B146423.2090703@gmail.com> Date: Tue, 01 Dec 2009 02:32:35 +0200 From: Dmitry Pryanishnikov User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.23) Gecko/20090906 SeaMonkey/1.1.18 MIME-Version: 1.0 To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r195843 - in head: lib/libkvm sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 00:32:41 -0000 Hello! > Author: brooks > Date: Fri Jul 24 15:03:10 2009 > New Revision: 195843 > URL: http://svn.freebsd.org/changeset/base/195843 > > Log: > Revert the changes to struct kinfo_proc in r194498. Instead, fill > in up to 16 (KI_NGROUPS) values and steal a bit from ki_cr_flags > (all bits currently unused) to indicate overflow with the new flag > KI_CRF_GRP_OVERFLOW. > > This fixes procstat -s. > > Approved by: re (kib) > > Modified: > head/lib/libkvm/kvm_proc.c > head/sys/kern/kern_proc.c > head/sys/sys/user.h > > Modified: head/lib/libkvm/kvm_proc.c > ============================================================================== > --- head/lib/libkvm/kvm_proc.c Fri Jul 24 14:57:02 2009 (r195842) > +++ head/lib/libkvm/kvm_proc.c Fri Jul 24 15:03:10 2009 (r195843) > @@ -145,8 +145,14 @@ kvm_proclist(kd, what, arg, p, bp, maxcn > kp->ki_svuid = ucred.cr_svuid; > kp->ki_rgid = ucred.cr_rgid; > kp->ki_svgid = ucred.cr_svgid; > - kp->ki_ngroups = ucred.cr_ngroups; > - kp->ki_groups = ucred.cr_groups; > + kp->ki_cr_flags = ucred.cr_flags; > + if (ucred.cr_ngroups > KI_NGROUPS) { > + kp->ki_ngroups = KI_NGROUPS; > + kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; > + } > + kp->ki_ngroups = ucred.cr_ngroups; It seems that 'else' is missing after closing brace of this 'if'? With the code as is, 'kp->ki_ngroups = KI_NGROUPS;' is effectively NO-OP... Sincerely, Dmitry -- nic-hdl: LYNX-RIPE From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 02:57:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EC0C1065672; Tue, 1 Dec 2009 02:57:07 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6A78FC1C; Tue, 1 Dec 2009 02:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB12v7UR049987; Tue, 1 Dec 2009 02:57:07 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB12v7Qe049986; Tue, 1 Dec 2009 02:57:07 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912010257.nB12v7Qe049986@svn.freebsd.org> From: Colin Percival Date: Tue, 1 Dec 2009 02:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199979 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 02:57:07 -0000 Author: cperciva Date: Tue Dec 1 02:57:06 2009 New Revision: 199979 URL: http://svn.freebsd.org/changeset/base/199979 Log: Fix local root vulnerability. Security: Advisory will be coming soon. X-MFC-After: 30 seconds Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Dec 1 00:42:17 2009 (r199978) +++ head/libexec/rtld-elf/rtld.c Tue Dec 1 02:57:06 2009 (r199979) @@ -366,12 +366,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * future processes to honor the potentially un-safe variables. */ if (!trust) { - unsetenv(LD_ "PRELOAD"); - unsetenv(LD_ "LIBMAP"); - unsetenv(LD_ "LIBRARY_PATH"); - unsetenv(LD_ "LIBMAP_DISABLE"); - unsetenv(LD_ "DEBUG"); - unsetenv(LD_ "ELF_HINTS_PATH"); + if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || + unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || + unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH")) { + _rtld_error("environment corrupt; aborting"); + die(); + } } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 02:59:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A816E106566C; Tue, 1 Dec 2009 02:59:22 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 960F38FC14; Tue, 1 Dec 2009 02:59:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB12xMaQ050213; Tue, 1 Dec 2009 02:59:22 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB12xMPR050211; Tue, 1 Dec 2009 02:59:22 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912010259.nB12xMPR050211@svn.freebsd.org> From: Colin Percival Date: Tue, 1 Dec 2009 02:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199980 - stable/8/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 02:59:22 -0000 Author: cperciva Date: Tue Dec 1 02:59:22 2009 New Revision: 199980 URL: http://svn.freebsd.org/changeset/base/199980 Log: MFC r199979: Fix local root vulnerability. Modified: stable/8/libexec/rtld-elf/rtld.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/rtld.c ============================================================================== --- stable/8/libexec/rtld-elf/rtld.c Tue Dec 1 02:57:06 2009 (r199979) +++ stable/8/libexec/rtld-elf/rtld.c Tue Dec 1 02:59:22 2009 (r199980) @@ -366,12 +366,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * future processes to honor the potentially un-safe variables. */ if (!trust) { - unsetenv(LD_ "PRELOAD"); - unsetenv(LD_ "LIBMAP"); - unsetenv(LD_ "LIBRARY_PATH"); - unsetenv(LD_ "LIBMAP_DISABLE"); - unsetenv(LD_ "DEBUG"); - unsetenv(LD_ "ELF_HINTS_PATH"); + if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || + unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || + unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH")) { + _rtld_error("environment corrupt; aborting"); + die(); + } } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 03:00:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4DF9106566B; Tue, 1 Dec 2009 03:00:16 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B30758FC12; Tue, 1 Dec 2009 03:00:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB130Gto050374; Tue, 1 Dec 2009 03:00:16 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB130Gbk050372; Tue, 1 Dec 2009 03:00:16 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912010300.nB130Gbk050372@svn.freebsd.org> From: Colin Percival Date: Tue, 1 Dec 2009 03:00:16 +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: r199981 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 03:00:16 -0000 Author: cperciva Date: Tue Dec 1 03:00:16 2009 New Revision: 199981 URL: http://svn.freebsd.org/changeset/base/199981 Log: MFC r199979: Fix local root vulnerability. Modified: stable/7/libexec/rtld-elf/rtld.c Directory Properties: stable/7/libexec/rtld-elf/ (props changed) Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Tue Dec 1 02:59:22 2009 (r199980) +++ stable/7/libexec/rtld-elf/rtld.c Tue Dec 1 03:00:16 2009 (r199981) @@ -361,12 +361,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * future processes to honor the potentially un-safe variables. */ if (!trust) { - unsetenv(LD_ "PRELOAD"); - unsetenv(LD_ "LIBMAP"); - unsetenv(LD_ "LIBRARY_PATH"); - unsetenv(LD_ "LIBMAP_DISABLE"); - unsetenv(LD_ "DEBUG"); - unsetenv(LD_ "ELF_HINTS_PATH"); + if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || + unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || + unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH")) { + _rtld_error("environment corrupt; aborting"); + die(); + } } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 04:30:56 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 097E9106566B; Tue, 1 Dec 2009 04:30:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id B9FB08FC08; Tue, 1 Dec 2009 04:30:55 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nB14UqO6092427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2009 20:30:53 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B149BFF.50700@FreeBSD.org> Date: Mon, 30 Nov 2009 20:30:55 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Maxim Sobolev References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> In-Reply-To: <4B14382F.5080000@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-stable-7@FreeBSD.org, Tom Judge Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 04:30:56 -0000 Maxim Sobolev wrote: > Tom Judge wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Maxim Sobolev wrote: >>> Is the option related to Jumbo Frames in any way? If not, IMHO the name >>> should be changed to avoid any confusion. >> >> The bug is easier to reproduce when jumbo frames are turned on however >> we have seen it with normal frames also. > > Can we change the name then? We've seen the similar issue without the > jumbo frames, which made me wonder. Also, perhaps we should make it a > default and/or tunable. Having user to recompile kernel just to save 20 > bytes of text segment is not very practical these days. Here is the patch: http://sobomax.sippysoft.com/~sobomax/bce.diff Please let me know if you have any objection to it, otherwise I will check it in. -Maxim From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 04:48:59 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04D93106566B; Tue, 1 Dec 2009 04:48:59 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 9F76C8FC17; Tue, 1 Dec 2009 04:48:58 +0000 (UTC) Received: from orion.SpringDaemons.com (adsl-99-48-191-9.dsl.snfc21.sbcglobal.net [99.48.191.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 3523A8FC4E; Tue, 1 Dec 2009 07:48:56 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 3AD3639858; Mon, 30 Nov 2009 20:48:51 -0800 (PST) Date: Mon, 30 Nov 2009 20:48:44 -0800 From: Stanislav Sedov To: Maxim Sobolev Message-Id: <20091130204844.9bec6460.stas@FreeBSD.org> In-Reply-To: <4B149BFF.50700@FreeBSD.org> References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <4B149BFF.50700@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Mon__30_Nov_2009_20_48_44_-0800_TBpGg.ujfEwuWyU8" Cc: Tom Judge , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 04:48:59 -0000 --Signature=_Mon__30_Nov_2009_20_48_44_-0800_TBpGg.ujfEwuWyU8 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, 30 Nov 2009 20:30:55 -0800 Maxim Sobolev mentioned: > Maxim Sobolev wrote: > > Tom Judge wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA1 > >> > >> Maxim Sobolev wrote: > >>> Is the option related to Jumbo Frames in any way? If not, IMHO the na= me > >>> should be changed to avoid any confusion. > >> > >> The bug is easier to reproduce when jumbo frames are turned on however > >> we have seen it with normal frames also. > >=20 > > Can we change the name then? We've seen the similar issue without the=20 > > jumbo frames, which made me wonder. Also, perhaps we should make it a=20 > > default and/or tunable. Having user to recompile kernel just to save 20= =20 > > bytes of text segment is not very practical these days. >=20 > Here is the patch: >=20 > http://sobomax.sippysoft.com/~sobomax/bce.diff >=20 > Please let me know if you have any objection to it, otherwise I will=20 > check it in. >=20 Thanks, it looks great! But better pass this through davidch@, as he might have objections regarding this modification. My first intention was to enable the header splitting by default, but he seemed to have some concerns, so the compile-time option was a kind of consensus. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Mon__30_Nov_2009_20_48_44_-0800_TBpGg.ujfEwuWyU8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJLFKAyAAoJEL8lojEJL9nwWkkP/j8yU8VJUPjIBMzYSCM8UIxg u8QjIyGgA8ahmaqHQk7LuxuyA2jNrZSImcHk3HForpXualrfglNk1pIpadA1KF7O W+7uCt9xRhxK6Frgce511MW4Gvf7SOn+7EpsMvCrO7lcXPQbhP36qiPZeo++kdi1 2yHou1lPZ2EZc4gr08EQ+bUTcfKXwl1E+Ko0X4/eBR7toQqycZPzaAjFwrdxptCR PMsEkeMvK4XPd9nYR7izagQbeMCIyqMg9Jmj87ssqRBrEIJ870GEvi61tVYIIVg2 ddH7UjDbK95JpFJGcRElVMio898G4e5Pp7As470QA9Ubl08fGR/d7DK1aTnLl65C Dx1m+atUibkKn56mXawZwO1mxPWXc0QOyKaRKNN2FlbvbE80Paz+G8tUQcGjyWAS 1S6+O2s+zkKMTXYjs1b+FWiArjG7VTBwVxtBxrXk0Fo4AxXqrelu7kckCkJC9J8j MZmr6eB2d+3H4ThhG2p6+Ddtf+5T17CcVrggdbpip5xhhPwjFbH4G+uOPJ0mZG2i K9eilmJF2JyLmDuCiJdAcLe3qVDcGYrA689uNyWYQu8P1n3TzN+eJucW9hEhBKN1 BtORc68M5daFsFrFthGeYPuv8+Sz6WSm1KC3kpp8WNd+4CSnmkqWTvM/oIQ56hzC Jzpcr1ITsgrZe5Kl/O7Z =0Gwv -----END PGP SIGNATURE----- --Signature=_Mon__30_Nov_2009_20_48_44_-0800_TBpGg.ujfEwuWyU8-- From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 04:51:47 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2094106566B; Tue, 1 Dec 2009 04:51:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 8949E8FC1B; Tue, 1 Dec 2009 04:51:47 +0000 (UTC) Received: from orion.SpringDaemons.com (adsl-99-48-191-9.dsl.snfc21.sbcglobal.net [99.48.191.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 1E1138FC4E; Tue, 1 Dec 2009 07:51:45 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id A959739858; Mon, 30 Nov 2009 20:51:41 -0800 (PST) Date: Mon, 30 Nov 2009 20:51:41 -0800 From: Stanislav Sedov To: Maxim Sobolev Message-Id: <20091130205141.2911011e.stas@FreeBSD.org> In-Reply-To: <4B14382F.5080000@FreeBSD.org> References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Mon__30_Nov_2009_20_51_41_-0800_l1wet+8p93ROUrOG" Cc: Tom Judge , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 04:51:48 -0000 --Signature=_Mon__30_Nov_2009_20_51_41_-0800_l1wet+8p93ROUrOG Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, 30 Nov 2009 13:25:03 -0800 Maxim Sobolev mentioned: > Can we change the name then? We've seen the similar issue without the=20 > jumbo frames, which made me wonder. It's strange, because 'normal' frames are less than a page size in length, so the issue I was experiencing should not be reproducable with jumbo frames disabled. Can you describe a bit more what kind of problem you're experien= cing? --=20 Stanislav Sedov ST4096-RIPE --Signature=_Mon__30_Nov_2009_20_51_41_-0800_l1wet+8p93ROUrOG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJLFKDdAAoJEL8lojEJL9nwpA0QAMVhGvaW/28mpViCus7FE23y FXzWKCtfyM0cbDnju6Y6BIWR9VkWdErxPIJCrZZkXywnAVh2W/xcX3KZjLWXkI1v UH/G10f/nvLQLSZRqjP2WpClbjHCHCac9qt8i5v3mVl2AX0JBbcKhFlfXJiBreK9 dB/cAoqz5g6de6DlgkIv/3ucMgJQ2dtjClCMDPkKMCioAuxf6QkJ62okdWw93+jH tuAHlgdj6tYJW1OpEG5LWcGQZg+sfRP5pWj63ed9lWSO0BLoN4OkOZwJPTZOcgHi HOr/+blfFOzZd/bK5rowYkBZSvUc0PvfzZKhJuJnUUb7HroS2zqAIxPgDbX+Xi2U M4jrnNXbPyx2KMecONXKUlVlutk7ttbu+LleqzuaAMZ9QrtMxaXVfYpVnyoBabhL 5t0pDTDJhsc3AKn+Poi3KCeOGCA9cp/d56TaSlpVtFhRNXlFFFVMBoYbdx7/3bFp eBrBsAe1qcYV4vGrRzMw3JkC8ieiE3M9cf6S1xveaPhdtzG/IG4zSf/uJKf1dbzQ fmtw1O9Honm58LPz2X54hsn9o/4Jrq9ZgqnwGTsMHYruOmwme7yDGExhTffNBWwV cvJzPPIA9z5K1ZU62455/XhWSrWaZ9rhDYftE6bpwWgO0dwNuwNjMiMfRcf02ZlD J7+8eSV5m68da3ZjJXqs =iD16 -----END PGP SIGNATURE----- --Signature=_Mon__30_Nov_2009_20_51_41_-0800_l1wet+8p93ROUrOG-- From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 05:04:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0650810662F1; Tue, 1 Dec 2009 05:04:32 +0000 (UTC) (envelope-from green@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E932C8FC13; Tue, 1 Dec 2009 05:04:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB154Vxm053172; Tue, 1 Dec 2009 05:04:31 GMT (envelope-from green@svn.freebsd.org) Received: (from green@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB154VnS053167; Tue, 1 Dec 2009 05:04:31 GMT (envelope-from green@svn.freebsd.org) Message-Id: <200912010504.nB154VnS053167@svn.freebsd.org> From: Brian Feldman Date: Tue, 1 Dec 2009 05:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 05:04:43 -0000 Author: green Date: Tue Dec 1 05:04:31 2009 New Revision: 199983 URL: http://svn.freebsd.org/changeset/base/199983 Log: Do not gratuitously fail *env(3) operations due to corrupt ('='-less) **environ entries. This puts non-getenv(3) operations in line with getenv(3) in that bad environ entries do not cause all operations to fail. There is still some inconsistency in that getenv(3) in the absence of any environment-modifying operation does not emit corrupt environ entry warnings. I also fixed another inconsistency in getenv(3) where updating the global environ pointer would not be reflected in the return values. It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) in order to see the change. Modified: head/lib/libc/stdlib/getenv.c head/tools/regression/environ/Makefile.envctl head/tools/regression/environ/envctl.c head/tools/regression/environ/envtest.t Modified: head/lib/libc/stdlib/getenv.c ============================================================================== --- head/lib/libc/stdlib/getenv.c Tue Dec 1 03:52:50 2009 (r199982) +++ head/lib/libc/stdlib/getenv.c Tue Dec 1 05:04:31 2009 (r199983) @@ -96,6 +96,8 @@ static int envVarsTotal = 0; /* Deinitialization of new environment. */ static void __attribute__ ((destructor)) __clean_env_destructor(void); +/* Resetting the environ pointer will affect the env functions. */ +static int __merge_environ(void); /* @@ -190,6 +192,9 @@ __findenv_environ(const char *name, size { int envNdx; + if (environ == NULL) + return (NULL); + /* Find variable within environ. */ for (envNdx = 0; environ[envNdx] != NULL; envNdx++) if (strncmpeq(environ[envNdx], name, nameLen)) @@ -328,6 +333,7 @@ __build_env(void) { char **env; int activeNdx; + int checking; int envNdx; int savedErrno; size_t nameLen; @@ -339,6 +345,23 @@ __build_env(void) /* Count environment variables. */ for (env = environ, envVarsTotal = 0; *env != NULL; env++) envVarsTotal++; + /* Remove any corrupt variable entries, but do not error out. */ + checking = 0; + while (checking < envVarsTotal) { + if (strchr(environ[checking], '=') != NULL) { + checking++; + } else { + __env_warnx(CorruptEnvValueMsg, + environ[checking], strlen(environ[checking])); + /* + * Pull back all remaining entries from checking + 1 + * through envVarsTotal, including the NULL at the end. + */ + memmove(&environ[checking], &environ[checking + 1], + sizeof(char *) * (envVarsTotal - checking)); + envVarsTotal--; + } + } envVarsSize = envVarsTotal * 2; /* Create new environment. */ @@ -353,18 +376,8 @@ __build_env(void) strdup(environ[envVarsTotal - envNdx - 1]); if (envVars[envNdx].name == NULL) goto Failure; - envVars[envNdx].value = strchr(envVars[envNdx].name, '='); - if (envVars[envNdx].value != NULL) { - envVars[envNdx].value++; - envVars[envNdx].valueSize = - strlen(envVars[envNdx].value); - } else { - __env_warnx(CorruptEnvValueMsg, envVars[envNdx].name, - strlen(envVars[envNdx].name)); - errno = EFAULT; - goto Failure; - } - + envVars[envNdx].value = strchr(envVars[envNdx].name, '=') + 1; + envVars[envNdx].valueSize = strlen(envVars[envNdx].value); /* * Find most current version of variable to make active. This * will prevent multiple active variables from being created @@ -426,22 +439,18 @@ getenv(const char *name) } /* - * An empty environment (environ or its first value) regardless if - * environ has been copied before will return a NULL. - * - * If the environment is not empty, find an environment variable via - * environ if environ has not been copied via an *env() call or been - * replaced by a running program, otherwise, use the rebuilt - * environment. + * If we have not already allocated memory by performing + * write operations on the environment, avoid doing so now. */ - if (environ == NULL || environ[0] == NULL) - return (NULL); - else if (envVars == NULL || environ != intEnviron) + if (envVars == NULL) return (__findenv_environ(name, nameLen)); - else { - envNdx = envVarsTotal - 1; - return (__findenv(name, nameLen, &envNdx, true)); - } + + /* Synchronize environment. */ + if (__merge_environ() == -1) + return (NULL); + + envNdx = envVarsTotal - 1; + return (__findenv(name, nameLen, &envNdx, true)); } @@ -559,8 +568,7 @@ __merge_environ(void) if ((equals = strchr(*env, '=')) == NULL) { __env_warnx(CorruptEnvValueMsg, *env, strlen(*env)); - errno = EFAULT; - return (-1); + continue; } if (__setenv(*env, equals - *env, equals + 1, 1) == -1) Modified: head/tools/regression/environ/Makefile.envctl ============================================================================== --- head/tools/regression/environ/Makefile.envctl Tue Dec 1 03:52:50 2009 (r199982) +++ head/tools/regression/environ/Makefile.envctl Tue Dec 1 05:04:31 2009 (r199983) @@ -13,4 +13,4 @@ NO_MAN= yes .include test: ${PROG} - @sh envtest.t + @env -i sh envtest.t Modified: head/tools/regression/environ/envctl.c ============================================================================== --- head/tools/regression/environ/envctl.c Tue Dec 1 03:52:50 2009 (r199982) +++ head/tools/regression/environ/envctl.c Tue Dec 1 05:04:31 2009 (r199983) @@ -60,7 +60,7 @@ dump_environ(void) static void usage(const char *program) { - fprintf(stderr, "Usage: %s [-DGUchrt] [-c 1|2|3|4] [-gu name] " + fprintf(stderr, "Usage: %s [-DGUchrt] [-c 1|2|3|4] [-bgu name] " "[-p name=value]\n" "\t[(-S|-s name) value overwrite]\n\n" "Options:\n" @@ -68,6 +68,7 @@ usage(const char *program) " -G name\t\t\tgetenv(NULL)\n" " -S value overwrite\t\tsetenv(NULL, value, overwrite)\n" " -U\t\t\t\tunsetenv(NULL)\n" + " -b name\t\t\tblank the 'name=$name' entry, corrupting it\n" " -c 1|2|3|4\t\t\tClear environ variable using method:\n" "\t\t\t\t1 - set environ to NULL pointer\n" "\t\t\t\t2 - set environ[0] to NULL pointer\n" @@ -98,6 +99,28 @@ print_rtrn_errno(int rtrnVal, const char return; } +static void +blank_env(const char *var) +{ + char **newenviron; + int n, varlen; + + if (environ == NULL) + return; + + for (n = 0; environ[n] != NULL; n++) + ; + newenviron = malloc(sizeof(char *) * (n + 1)); + varlen = strlen(var); + for (; n >= 0; n--) { + newenviron[n] = environ[n]; + if (newenviron[n] != NULL && + strncmp(newenviron[n], var, varlen) == 0 && + newenviron[n][varlen] == '=') + newenviron[n] += strlen(newenviron[n]); + } + environ = newenviron; +} int main(int argc, char **argv) @@ -114,8 +137,12 @@ main(int argc, char **argv) } /* The entire program is basically executed from this loop. */ - while ((arg = getopt(argc, argv, "DGS:Uc:g:hp:rs:tu:")) != -1) { + while ((arg = getopt(argc, argv, "DGS:Ub:c:g:hp:rs:tu:")) != -1) { switch (arg) { + case 'b': + blank_env(optarg); + break; + case 'c': switch (atoi(optarg)) { case 1: Modified: head/tools/regression/environ/envtest.t ============================================================================== --- head/tools/regression/environ/envtest.t Tue Dec 1 03:52:50 2009 (r199982) +++ head/tools/regression/environ/envtest.t Tue Dec 1 05:04:31 2009 (r199983) @@ -232,3 +232,18 @@ check_result "${BAR} 0 0 ${BAR} 0 0 ${NU run_test -r -g FOO -u FOO -g FOO -s FOO ${BAR} 1 -g FOO check_result "${BAR} 0 0 ${NULL} 0 0 ${BAR}" + + +# corruption (blanking) of environ members. +export BLANK_ME= +export AFTER_BLANK=blanked +run_test -b BLANK_ME -p MORE=vars -g FOO -g BLANK_ME -g AFTER_BLANK +check_result "0 0 ${FOO} ${NULL} ${AFTER_BLANK}" + +run_test -b BLANK_ME -u FOO -g FOO -g AFTER_BLANK +check_result "0 0 ${NULL} ${AFTER_BLANK}" + +export BLANK_ME2= +export AFTER_BLANKS=blankD +run_test -b BLANK_ME -b AFTER_BLANK -b BLANK_ME2 -g FOO -g AFTER_BLANKS +check_result "${FOO} ${AFTER_BLANKS}" From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 06:09:49 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C21011065676 for ; Tue, 1 Dec 2009 06:09:49 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id 2929F14DC14 for ; Tue, 1 Dec 2009 06:09:48 +0000 (UTC) Received: (qmail 82538 invoked from network); 1 Dec 2009 06:09:48 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 1 Dec 2009 06:09:48 -0000 Message-ID: <4B14B32C.3060409@freebsd.org> Date: Mon, 30 Nov 2009 22:09:48 -0800 From: Colin Percival User-Agent: Thunderbird 2.0.0.23 (X11/20090919) MIME-Version: 1.0 To: Brian Feldman References: <200912010504.nB154VnS053167@svn.freebsd.org> In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 06:09:49 -0000 Brian Feldman wrote: > Do not gratuitously fail *env(3) operations due to corrupt ('='-less) > **environ entries. This puts non-getenv(3) operations in line with > getenv(3) in that bad environ entries do not cause all operations to > fail. There is still some inconsistency in that getenv(3) in the > absence of any environment-modifying operation does not emit corrupt > environ entry warnings. > > I also fixed another inconsistency in getenv(3) where updating the > global environ pointer would not be reflected in the return values. > It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) > in order to see the change. The FreeBSD Security Team is currently dealing with a security issue relating to this code. Please back out your change (at least to getenv.c; I don't particularly care about the regression tests) until we've finished, and then submit the patch to us for review along with a detailed explanation of what it does. We've already had two major security issues arising out of getenv.c in the past year, and I'd like to make sure we don't have a third. -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 06:11:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A1C5106566B; Tue, 1 Dec 2009 06:11:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5942E8FC12; Tue, 1 Dec 2009 06:11:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB16BgEC054479; Tue, 1 Dec 2009 06:11:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB16BgJ9054475; Tue, 1 Dec 2009 06:11:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912010611.nB16BgJ9054475@svn.freebsd.org> From: Andriy Gapon Date: Tue, 1 Dec 2009 06:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199984 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 06:11:42 -0000 Author: avg Date: Tue Dec 1 06:11:42 2009 New Revision: 199984 URL: http://svn.freebsd.org/changeset/base/199984 Log: MFC r199016: acpi: remove 'magic' ivar Note that the ivar itself is kept in the stable branches, only its use is dropped. Modified: stable/8/sys/dev/acpica/acpi_cpu.c stable/8/sys/dev/acpica/acpi_ec.c stable/8/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Tue Dec 1 05:04:31 2009 (r199983) +++ stable/8/sys/dev/acpica/acpi_cpu.c Tue Dec 1 06:11:42 2009 (r199984) @@ -255,7 +255,7 @@ acpi_cpu_probe(device_t dev) /* Mark this processor as in-use and save our derived id for attach. */ cpu_softc[cpu_id] = (void *)1; - acpi_set_magic(dev, cpu_id); + acpi_set_private(dev, (void*)(intptr_t)cpu_id); device_set_desc(dev, "ACPI CPU"); return (0); @@ -286,7 +286,7 @@ acpi_cpu_attach(device_t dev) sc = device_get_softc(dev); sc->cpu_dev = dev; sc->cpu_handle = acpi_get_handle(dev); - cpu_id = acpi_get_magic(dev); + cpu_id = (int)(intptr_t)acpi_get_private(dev); cpu_softc[cpu_id] = sc; pcpu_data = pcpu_find(cpu_id); pcpu_data->pc_device = dev; Modified: stable/8/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_ec.c Tue Dec 1 05:04:31 2009 (r199983) +++ stable/8/sys/dev/acpica/acpi_ec.c Tue Dec 1 06:11:42 2009 (r199984) @@ -129,9 +129,6 @@ struct acpi_ec_params { int uid; }; -/* Indicate that this device has already been probed via ECDT. */ -#define DEV_ECDT(x) (acpi_get_magic(x) == (uintptr_t)&acpi_ec_devclass) - /* * Driver softc. */ @@ -332,7 +329,6 @@ acpi_ec_ecdt_probe(device_t parent) params->uid = ecdt->Uid; acpi_GetInteger(h, "_GLK", ¶ms->glk); acpi_set_private(child, params); - acpi_set_magic(child, (uintptr_t)&acpi_ec_devclass); /* Finish the attach process. */ if (device_probe_and_attach(child) != 0) @@ -348,6 +344,7 @@ acpi_ec_probe(device_t dev) ACPI_STATUS status; device_t peer; char desc[64]; + int ecdt; int ret; struct acpi_ec_params *params; static char *ec_ids[] = { "PNP0C09", NULL }; @@ -362,11 +359,12 @@ acpi_ec_probe(device_t dev) * duplicate probe. */ ret = ENXIO; - params = NULL; + ecdt = 0; buf.Pointer = NULL; buf.Length = ACPI_ALLOCATE_BUFFER; - if (DEV_ECDT(dev)) { - params = acpi_get_private(dev); + params = acpi_get_private(dev); + if (params != NULL) { + ecdt = 1; ret = 0; } else if (!acpi_disabled("ec") && ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)) { @@ -439,7 +437,7 @@ out: if (ret == 0) { snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", params->gpe_bit, (params->glk) ? ", GLK" : "", - DEV_ECDT(dev) ? ", ECDT" : ""); + ecdt ? ", ECDT" : ""); device_set_desc_copy(dev, desc); } Modified: stable/8/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_hpet.c Tue Dec 1 05:04:31 2009 (r199983) +++ stable/8/sys/dev/acpica/acpi_hpet.c Tue Dec 1 06:11:42 2009 (r199984) @@ -61,8 +61,6 @@ static void acpi_hpet_test(struct acpi_h static char *hpet_ids[] = { "PNP0103", NULL }; -#define DEV_HPET(x) (acpi_get_magic(x) == (uintptr_t)&acpi_hpet_devclass) - struct timecounter hpet_timecounter = { .tc_get_timecount = hpet_get_timecount, .tc_counter_mask = ~0u, @@ -133,8 +131,6 @@ acpi_hpet_identify(driver_t *driver, dev return; } - /* Record a magic value so we can detect this device later. */ - acpi_set_magic(child, (uintptr_t)&acpi_hpet_devclass); bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, HPET_MEM_WIDTH); } @@ -146,7 +142,7 @@ acpi_hpet_probe(device_t dev) if (acpi_disabled("hpet")) return (ENXIO); - if (!DEV_HPET(dev) && + if (acpi_get_handle(dev) != NULL && (ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL || device_get_unit(dev) != 0)) return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 06:12:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A79AE1065670; Tue, 1 Dec 2009 06:12:31 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 978BD8FC1E; Tue, 1 Dec 2009 06:12:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB16CVQL054548; Tue, 1 Dec 2009 06:12:31 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB16CVre054546; Tue, 1 Dec 2009 06:12:31 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <200912010612.nB16CVre054546@svn.freebsd.org> From: Giorgos Keramidas Date: Tue, 1 Dec 2009 06:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199985 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 06:12:31 -0000 Author: keramida (doc committer) Date: Tue Dec 1 06:12:31 2009 New Revision: 199985 URL: http://svn.freebsd.org/changeset/base/199985 Log: Describe what setpgid(2) does when pgid=0. The text has been copied from NetBSD's manpage, and it also matches the behavior described by the Open Group's online copy of setpgid.2 at http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html Obtained from: NetBSD Submitted by: Petros Barbayiannis MFC after: 1 week Modified: head/lib/libc/sys/setpgid.2 Modified: head/lib/libc/sys/setpgid.2 ============================================================================== --- head/lib/libc/sys/setpgid.2 Tue Dec 1 06:11:42 2009 (r199984) +++ head/lib/libc/sys/setpgid.2 Tue Dec 1 06:12:31 2009 (r199985) @@ -54,6 +54,11 @@ to the specified If .Fa pid is zero, then the call applies to the current process. +If +.Fa pgrp +is zero, then the process id of the process specified by +.Fa pid +is used instead. .Pp If the affected process is not the invoking process, then it must be a child of the invoking process, it must not have performed an From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 06:15:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F11BC106566B; Tue, 1 Dec 2009 06:15:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E08678FC0C; Tue, 1 Dec 2009 06:15:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB16FJjB054664; Tue, 1 Dec 2009 06:15:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB16FJAc054660; Tue, 1 Dec 2009 06:15:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912010615.nB16FJAc054660@svn.freebsd.org> From: Andriy Gapon Date: Tue, 1 Dec 2009 06:15: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: r199986 - stable/7/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 06:15:20 -0000 Author: avg Date: Tue Dec 1 06:15:19 2009 New Revision: 199986 URL: http://svn.freebsd.org/changeset/base/199986 Log: MFC r199016: acpi: remove 'magic' ivar Note that the ivar itself is kept in the stable branches, only its use is dropped. Modified: stable/7/sys/dev/acpica/acpi_cpu.c stable/7/sys/dev/acpica/acpi_ec.c stable/7/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_cpu.c Tue Dec 1 06:12:31 2009 (r199985) +++ stable/7/sys/dev/acpica/acpi_cpu.c Tue Dec 1 06:15:19 2009 (r199986) @@ -252,7 +252,7 @@ acpi_cpu_probe(device_t dev) /* Mark this processor as in-use and save our derived id for attach. */ cpu_softc[cpu_id] = (void *)1; - acpi_set_magic(dev, cpu_id); + acpi_set_private(dev, (void*)(intptr_t)cpu_id); device_set_desc(dev, "ACPI CPU"); return (0); @@ -283,7 +283,7 @@ acpi_cpu_attach(device_t dev) sc = device_get_softc(dev); sc->cpu_dev = dev; sc->cpu_handle = acpi_get_handle(dev); - cpu_id = acpi_get_magic(dev); + cpu_id = (int)(intptr_t)acpi_get_private(dev); cpu_softc[cpu_id] = sc; pcpu_data = pcpu_find(cpu_id); pcpu_data->pc_device = dev; Modified: stable/7/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_ec.c Tue Dec 1 06:12:31 2009 (r199985) +++ stable/7/sys/dev/acpica/acpi_ec.c Tue Dec 1 06:15:19 2009 (r199986) @@ -127,9 +127,6 @@ struct acpi_ec_params { int uid; }; -/* Indicate that this device has already been probed via ECDT. */ -#define DEV_ECDT(x) (acpi_get_magic(x) == (uintptr_t)&acpi_ec_devclass) - /* * Driver softc. */ @@ -330,7 +327,6 @@ acpi_ec_ecdt_probe(device_t parent) params->uid = ecdt->Uid; acpi_GetInteger(h, "_GLK", ¶ms->glk); acpi_set_private(child, params); - acpi_set_magic(child, (uintptr_t)&acpi_ec_devclass); /* Finish the attach process. */ if (device_probe_and_attach(child) != 0) @@ -346,6 +342,7 @@ acpi_ec_probe(device_t dev) ACPI_STATUS status; device_t peer; char desc[64]; + int ecdt; int ret; struct acpi_ec_params *params; static char *ec_ids[] = { "PNP0C09", NULL }; @@ -360,11 +357,12 @@ acpi_ec_probe(device_t dev) * duplicate probe. */ ret = ENXIO; - params = NULL; + ecdt = 0; buf.Pointer = NULL; buf.Length = ACPI_ALLOCATE_BUFFER; - if (DEV_ECDT(dev)) { - params = acpi_get_private(dev); + params = acpi_get_private(dev); + if (params != NULL) { + ecdt = 1; ret = 0; } else if (!acpi_disabled("ec") && ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)) { @@ -437,7 +435,7 @@ out: if (ret == 0) { snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", params->gpe_bit, (params->glk) ? ", GLK" : "", - DEV_ECDT(dev) ? ", ECDT" : ""); + ecdt ? ", ECDT" : ""); device_set_desc_copy(dev, desc); } Modified: stable/7/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/7/sys/dev/acpica/acpi_hpet.c Tue Dec 1 06:12:31 2009 (r199985) +++ stable/7/sys/dev/acpica/acpi_hpet.c Tue Dec 1 06:15:19 2009 (r199986) @@ -59,8 +59,6 @@ static void acpi_hpet_test(struct acpi_h static char *hpet_ids[] = { "PNP0103", NULL }; -#define DEV_HPET(x) (acpi_get_magic(x) == (uintptr_t)&acpi_hpet_devclass) - struct timecounter hpet_timecounter = { .tc_get_timecount = hpet_get_timecount, .tc_counter_mask = ~0u, @@ -131,8 +129,6 @@ acpi_hpet_identify(driver_t *driver, dev return; } - /* Record a magic value so we can detect this device later. */ - acpi_set_magic(child, (uintptr_t)&acpi_hpet_devclass); bus_set_resource(child, SYS_RES_MEMORY, 0, hpet->Address.Address, HPET_MEM_WIDTH); } @@ -144,7 +140,7 @@ acpi_hpet_probe(device_t dev) if (acpi_disabled("hpet")) return (ENXIO); - if (!DEV_HPET(dev) && + if (acpi_get_handle(dev) != NULL && (ACPI_ID_PROBE(device_get_parent(dev), dev, hpet_ids) == NULL || device_get_unit(dev) != 0)) return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 06:42:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 964A7106568F; Tue, 1 Dec 2009 06:42:48 +0000 (UTC) (envelope-from green@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85F028FC17; Tue, 1 Dec 2009 06:42:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB16gmtn055296; Tue, 1 Dec 2009 06:42:48 GMT (envelope-from green@svn.freebsd.org) Received: (from green@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB16glnH055295; Tue, 1 Dec 2009 06:42:47 GMT (envelope-from green@svn.freebsd.org) Message-Id: <200912010642.nB16glnH055295@svn.freebsd.org> From: Brian Feldman Date: Tue, 1 Dec 2009 06:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199987 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 06:42:48 -0000 Author: green Date: Tue Dec 1 06:42:47 2009 New Revision: 199987 URL: http://svn.freebsd.org/changeset/base/199987 Log: Temporarily revert the previous change because the linker has been modified so that it will abort when the environment is bad. Modified: head/lib/libc/stdlib/getenv.c Modified: head/lib/libc/stdlib/getenv.c ============================================================================== --- head/lib/libc/stdlib/getenv.c Tue Dec 1 06:15:19 2009 (r199986) +++ head/lib/libc/stdlib/getenv.c Tue Dec 1 06:42:47 2009 (r199987) @@ -96,8 +96,6 @@ static int envVarsTotal = 0; /* Deinitialization of new environment. */ static void __attribute__ ((destructor)) __clean_env_destructor(void); -/* Resetting the environ pointer will affect the env functions. */ -static int __merge_environ(void); /* @@ -192,9 +190,6 @@ __findenv_environ(const char *name, size { int envNdx; - if (environ == NULL) - return (NULL); - /* Find variable within environ. */ for (envNdx = 0; environ[envNdx] != NULL; envNdx++) if (strncmpeq(environ[envNdx], name, nameLen)) @@ -333,7 +328,6 @@ __build_env(void) { char **env; int activeNdx; - int checking; int envNdx; int savedErrno; size_t nameLen; @@ -345,23 +339,6 @@ __build_env(void) /* Count environment variables. */ for (env = environ, envVarsTotal = 0; *env != NULL; env++) envVarsTotal++; - /* Remove any corrupt variable entries, but do not error out. */ - checking = 0; - while (checking < envVarsTotal) { - if (strchr(environ[checking], '=') != NULL) { - checking++; - } else { - __env_warnx(CorruptEnvValueMsg, - environ[checking], strlen(environ[checking])); - /* - * Pull back all remaining entries from checking + 1 - * through envVarsTotal, including the NULL at the end. - */ - memmove(&environ[checking], &environ[checking + 1], - sizeof(char *) * (envVarsTotal - checking)); - envVarsTotal--; - } - } envVarsSize = envVarsTotal * 2; /* Create new environment. */ @@ -376,8 +353,18 @@ __build_env(void) strdup(environ[envVarsTotal - envNdx - 1]); if (envVars[envNdx].name == NULL) goto Failure; - envVars[envNdx].value = strchr(envVars[envNdx].name, '=') + 1; - envVars[envNdx].valueSize = strlen(envVars[envNdx].value); + envVars[envNdx].value = strchr(envVars[envNdx].name, '='); + if (envVars[envNdx].value != NULL) { + envVars[envNdx].value++; + envVars[envNdx].valueSize = + strlen(envVars[envNdx].value); + } else { + __env_warnx(CorruptEnvValueMsg, envVars[envNdx].name, + strlen(envVars[envNdx].name)); + errno = EFAULT; + goto Failure; + } + /* * Find most current version of variable to make active. This * will prevent multiple active variables from being created @@ -439,18 +426,22 @@ getenv(const char *name) } /* - * If we have not already allocated memory by performing - * write operations on the environment, avoid doing so now. + * An empty environment (environ or its first value) regardless if + * environ has been copied before will return a NULL. + * + * If the environment is not empty, find an environment variable via + * environ if environ has not been copied via an *env() call or been + * replaced by a running program, otherwise, use the rebuilt + * environment. */ - if (envVars == NULL) - return (__findenv_environ(name, nameLen)); - - /* Synchronize environment. */ - if (__merge_environ() == -1) + if (environ == NULL || environ[0] == NULL) return (NULL); - - envNdx = envVarsTotal - 1; - return (__findenv(name, nameLen, &envNdx, true)); + else if (envVars == NULL || environ != intEnviron) + return (__findenv_environ(name, nameLen)); + else { + envNdx = envVarsTotal - 1; + return (__findenv(name, nameLen, &envNdx, true)); + } } @@ -568,7 +559,8 @@ __merge_environ(void) if ((equals = strchr(*env, '=')) == NULL) { __env_warnx(CorruptEnvValueMsg, *env, strlen(*env)); - continue; + errno = EFAULT; + return (-1); } if (__setenv(*env, equals - *env, equals + 1, 1) == -1) From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 06:48:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 378DB106568D; Tue, 1 Dec 2009 06:48:14 +0000 (UTC) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green.homeunix.org [66.92.150.152]) by mx1.freebsd.org (Postfix) with ESMTP id DB1C58FC22; Tue, 1 Dec 2009 06:48:13 +0000 (UTC) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.14.3/8.14.1) with ESMTP id nB16VHk1040284; Tue, 1 Dec 2009 01:31:17 -0500 (EST) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.14.3/8.14.3/Submit) id nB16VGcn040283; Tue, 1 Dec 2009 01:31:16 -0500 (EST) (envelope-from green) Date: Tue, 1 Dec 2009 01:31:16 -0500 From: Brian Fundakowski Feldman To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20091201063116.GA35660@green.homeunix.org> References: <200912010504.nB154VnS053167@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 06:48:14 -0000 On Tue, Dec 01, 2009 at 05:04:31AM +0000, Brian Feldman wrote: > Author: green > Date: Tue Dec 1 05:04:31 2009 > New Revision: 199983 > URL: http://svn.freebsd.org/changeset/base/199983 > > Log: > Do not gratuitously fail *env(3) operations due to corrupt ('='-less) > **environ entries. This puts non-getenv(3) operations in line with > getenv(3) in that bad environ entries do not cause all operations to > fail. There is still some inconsistency in that getenv(3) in the > absence of any environment-modifying operation does not emit corrupt > environ entry warnings. > > I also fixed another inconsistency in getenv(3) where updating the > global environ pointer would not be reflected in the return values. > It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) > in order to see the change. ^^^ I'm apparently pretty sleepy, because I had forgotten what the second half of the change was for :P It makes getenv(3) capable of emitting the corrupted environ warnings. However, this is still avoided in the no-memory-allocation scenario. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 07:00:59 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42DE2106566B; Tue, 1 Dec 2009 07:00:59 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id F403F8FC13; Tue, 1 Dec 2009 07:00:58 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nB170sAF093309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Nov 2009 23:00:56 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B14BF23.1030303@FreeBSD.org> Date: Mon, 30 Nov 2009 23:00:51 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Stanislav Sedov References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> In-Reply-To: <20091130205141.2911011e.stas@FreeBSD.org> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: Tom Judge , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 07:00:59 -0000 Stanislav Sedov wrote: > On Mon, 30 Nov 2009 13:25:03 -0800 > Maxim Sobolev mentioned: > >> Can we change the name then? We've seen the similar issue without the >> jumbo frames, which made me wonder. > > It's strange, because 'normal' frames are less than a page size in length, > so the issue I was experiencing should not be reproducable with jumbo frames > disabled. Can you describe a bit more what kind of problem you're experiencing? The traffic through interface abruptly halts randomly when under a load, without any signs of a problem. What is interesting is that the communication through unix domain sockets appears to be down too, since some scripts that connect to database not able to complete as well, so whatever this problem is it affect the whole network subsystem. We tried to replace hardware and it did not help. Only after we replaced bce(4) with IntelPro card (em) the problem has went away. -Maxim From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 07:28:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BBAB1065672; Tue, 1 Dec 2009 07:28:57 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0C48FC15; Tue, 1 Dec 2009 07:28:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB17SuSr056412; Tue, 1 Dec 2009 07:28:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB17Suoo056411; Tue, 1 Dec 2009 07:28:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912010728.nB17Suoo056411@svn.freebsd.org> From: Christian Brueffer Date: Tue, 1 Dec 2009 07:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199988 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 07:28:57 -0000 Author: brueffer Date: Tue Dec 1 07:28:56 2009 New Revision: 199988 URL: http://svn.freebsd.org/changeset/base/199988 Log: Add an .Nm for strncat. PR: 141037 Submitted by: Jeremy Huddleston MFC after: 3 days Modified: head/lib/libc/string/strcat.3 Modified: head/lib/libc/string/strcat.3 ============================================================================== --- head/lib/libc/string/strcat.3 Tue Dec 1 06:42:47 2009 (r199987) +++ head/lib/libc/string/strcat.3 Tue Dec 1 07:28:56 2009 (r199988) @@ -32,11 +32,12 @@ .\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 1, 2009 .Dt STRCAT 3 .Os .Sh NAME -.Nm strcat +.Nm strcat , +.Nm strncat .Nd concatenate strings .Sh LIBRARY .Lb libc From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 10:06:06 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 924311065670; Tue, 1 Dec 2009 10:06:06 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 039688FC12; Tue, 1 Dec 2009 10:06:05 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id nB1A646x078275; Tue, 1 Dec 2009 13:06:04 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1259661964; bh=oPCWw2UKGV+LahIkYmaE+IdqrKgNMIFcMsjP0vdTcMc=; l=656; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=tYb4zvlNdFbjyO6CCMiXFZwB8NWYjUwIZgjJO/XIpFQDzGrDxUT7EFtfA//WgI7Yy +ahREP2ivvSO4nLpjA7Rc6Ss1rVCV/cFB9E8ZMETc0TKnmFqb8Z2JtwSj5ElCB8Dc/ mpDGxwVd75UqPOCVDSW90WJxu48oden80oeIfCg0= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id nB1A63or078274; Tue, 1 Dec 2009 13:06:04 +0300 (MSK) (envelope-from ache) Date: Tue, 1 Dec 2009 13:06:03 +0300 From: Andrey Chernov To: Brian Feldman Message-ID: <20091201100602.GA77706@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Brian Feldman , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <200912010504.nB154VnS053167@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 10:06:06 -0000 On Tue, Dec 01, 2009 at 05:04:31AM +0000, Brian Feldman wrote: > - if (environ == NULL || environ[0] == NULL) > - return (NULL); > - else if (envVars == NULL || environ != intEnviron) > + if (envVars == NULL) > return (__findenv_environ(name, nameLen)); > - else { > - envNdx = envVarsTotal - 1; > - return (__findenv(name, nameLen, &envNdx, true)); > - } > + > + /* Synchronize environment. */ > + if (__merge_environ() == -1) > + return (NULL); > + > + envNdx = envVarsTotal - 1; > + return (__findenv(name, nameLen, &envNdx, true)); > } __merge_environ() should be avoided here for speed reasons. -- http://ache.pp.ru/ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 10:25:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0141065676; Tue, 1 Dec 2009 10:25:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 8F0828FC12; Tue, 1 Dec 2009 10:25:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id C51F641C751; Tue, 1 Dec 2009 11:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id v4LzqpTGGWYz; Tue, 1 Dec 2009 11:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 1016F41C758; Tue, 1 Dec 2009 11:25:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id AE9814448EC; Tue, 1 Dec 2009 10:23:11 +0000 (UTC) Date: Tue, 1 Dec 2009 10:23:09 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: John Baldwin In-Reply-To: <200911302125.nAULPvRO043110@svn.freebsd.org> Message-ID: <20091201102112.N83957@maildrop.int.zabbadoz.net> References: <200911302125.nAULPvRO043110@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 10:25:09 -0000 On Mon, 30 Nov 2009, John Baldwin wrote: > Author: jhb > Date: Mon Nov 30 21:25:57 2009 > New Revision: 199975 > URL: http://svn.freebsd.org/changeset/base/199975 > > Log: > Remove if_timer/if_watchdog now that they are no longer used. The space > used by if_timer is reserved for expanding if_index to an int in the > future. > > Reviewed by: rwatson, brooks I have no idea yet if it builds or if the output of netstat still looks sane but this is about what was missed (in userland, apart from the traditional docs in share/doc/smm/18.net/6.t ): http://people.freebsd.org/~bz/20091201-01-no-if_timer.diff > Modified: > head/sys/net/if.c > head/sys/net/if_dead.c > head/sys/net/if_var.h -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 11:07:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABFF106566B; Tue, 1 Dec 2009 11:07:06 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D40098FC1B; Tue, 1 Dec 2009 11:07:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1B763q062416; Tue, 1 Dec 2009 11:07:06 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1B765K062407; Tue, 1 Dec 2009 11:07:06 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200912011107.nB1B765K062407@svn.freebsd.org> From: Roman Divacky Date: Tue, 1 Dec 2009 11:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199989 - in vendor/llvm/dist: . autoconf cmake/modules docs docs/CommandGuide docs/tutorial examples/Fibonacci include/llvm include/llvm-c include/llvm/ADT include/llvm/Analysis includ... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 11:07:07 -0000 Author: rdivacky Date: Tue Dec 1 11:07:05 2009 New Revision: 199989 URL: http://svn.freebsd.org/changeset/base/199989 Log: Update LLVM to r90226. Added: vendor/llvm/dist/include/llvm/Config/Disassemblers.def.in vendor/llvm/dist/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h vendor/llvm/dist/lib/CodeGen/TailDuplication.cpp vendor/llvm/dist/lib/Target/X86/Disassembler/ vendor/llvm/dist/lib/Target/X86/Disassembler/CMakeLists.txt vendor/llvm/dist/lib/Target/X86/Disassembler/Makefile vendor/llvm/dist/lib/Target/X86/Disassembler/X86Disassembler.cpp vendor/llvm/dist/test/Analysis/BasicAA/gep-alias.ll vendor/llvm/dist/test/CodeGen/ARM/2009-11-30-LiveVariablesBug.ll vendor/llvm/dist/test/CodeGen/ARM/movt-movw-global.ll vendor/llvm/dist/test/CodeGen/ARM/remat-2.ll vendor/llvm/dist/test/CodeGen/ARM/select-imm.ll vendor/llvm/dist/test/CodeGen/MSP430/2009-11-20-NewNode.ll vendor/llvm/dist/test/CodeGen/PIC16/2009-11-20-NewNode.ll vendor/llvm/dist/test/CodeGen/PowerPC/2009-11-25-ImpDefBug.ll vendor/llvm/dist/test/CodeGen/PowerPC/rlwimi-keep-rsh.ll vendor/llvm/dist/test/CodeGen/PowerPC/vec_buildvector_loadstore.ll vendor/llvm/dist/test/CodeGen/Thumb2/ifcvt-neon.ll vendor/llvm/dist/test/CodeGen/X86/2009-11-25-ImpDefBug.ll vendor/llvm/dist/test/CodeGen/X86/scalar_widen_div.ll vendor/llvm/dist/test/CodeGen/X86/tailcall-fastisel.ll vendor/llvm/dist/test/FrontendC++/m64-ptr.cpp vendor/llvm/dist/test/FrontendC/cstring-align.c vendor/llvm/dist/test/FrontendObjC/2009-11-30-Objc-ID.m vendor/llvm/dist/test/TableGen/UnsetBitInit.td vendor/llvm/dist/test/Transforms/GVN/crash.ll vendor/llvm/dist/test/Transforms/GVN/nonescaping-malloc.ll vendor/llvm/dist/test/Transforms/GVN/pre-load.ll vendor/llvm/dist/test/Transforms/GlobalOpt/constantfold-initializers.ll vendor/llvm/dist/test/Transforms/IPConstantProp/dangling-block-address.ll vendor/llvm/dist/test/Transforms/IPConstantProp/user-with-multiple-uses.ll vendor/llvm/dist/test/Transforms/LoopRotate/indirectbr.ll vendor/llvm/dist/test/Transforms/LoopUnroll/shifted-tripcount.ll vendor/llvm/dist/utils/TableGen/DisassemblerEmitter.cpp vendor/llvm/dist/utils/TableGen/DisassemblerEmitter.h Deleted: vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuild.h vendor/llvm/dist/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll vendor/llvm/dist/test/Assembler/msasm.ll vendor/llvm/dist/test/CodeGen/ARM/load-global.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-mov2.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-mov3.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-mov4.ll vendor/llvm/dist/test/CodeGen/X86/cmp1.ll vendor/llvm/dist/test/Feature/md_on_instruction2.ll vendor/llvm/dist/test/Feature/testswitch.ll vendor/llvm/dist/test/FrontendC++/2009-08-03-Varargs.cpp vendor/llvm/dist/test/FrontendC++/msasm.cpp vendor/llvm/dist/test/FrontendC/memcpy_chk.c vendor/llvm/dist/test/FrontendC/memset_chk.c vendor/llvm/dist/test/FrontendC/msasm.c vendor/llvm/dist/test/FrontendC/object_size.c vendor/llvm/dist/test/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll vendor/llvm/dist/test/Transforms/CondProp/2006-11-01-PhiNodeCrash.ll vendor/llvm/dist/test/Transforms/CondProp/2007-08-01-InvalidRead.ll vendor/llvm/dist/test/Transforms/CondProp/2009-01-25-SingleEntryPHI.ll vendor/llvm/dist/test/Transforms/CondProp/basictest-dbg.ll vendor/llvm/dist/test/Transforms/CondProp/basictest.ll vendor/llvm/dist/test/Transforms/CondProp/dg.exp vendor/llvm/dist/test/Transforms/CondProp/phisimplify.ll vendor/llvm/dist/test/Transforms/CondProp/phisimplify2.ll vendor/llvm/dist/test/Transforms/CondProp/phisimplify3.ll vendor/llvm/dist/test/Transforms/ConstProp/2009-09-19-ConstFold-i1-ConstExpr.ll vendor/llvm/dist/test/Transforms/GVN/lpre-basic.ll vendor/llvm/dist/test/Transforms/IndMemRem/ vendor/llvm/dist/test/Transforms/InstCombine/cast-malloc.ll vendor/llvm/dist/test/Transforms/InstCombine/or2.ll vendor/llvm/dist/test/Transforms/InstCombine/phi-merge.ll vendor/llvm/dist/test/Transforms/InstCombine/store-merge.ll vendor/llvm/dist/test/Transforms/JumpThreading/2008-11-28-InfLoop.ll vendor/llvm/dist/test/Transforms/JumpThreading/2009-01-08-DeadLoopRepl.ll vendor/llvm/dist/test/Transforms/JumpThreading/2009-01-19-InfSwitchLoop.ll vendor/llvm/dist/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll vendor/llvm/dist/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll vendor/llvm/dist/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll vendor/llvm/dist/test/Transforms/RaiseAllocations/dg.exp vendor/llvm/dist/test/Transforms/SCCP/2008-03-10-sret.ll vendor/llvm/dist/test/Transforms/SCCP/basictest.ll vendor/llvm/dist/test/Transforms/SCCP/empty-struct.ll vendor/llvm/dist/test/Transforms/SCCP/ipsccp-conditional.ll vendor/llvm/dist/test/Transforms/SCCP/ipsccp-gvar.ll Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/Makefile vendor/llvm/dist/Makefile.rules vendor/llvm/dist/autoconf/configure.ac vendor/llvm/dist/cmake/modules/AddLLVM.cmake vendor/llvm/dist/cmake/modules/LLVMConfig.cmake vendor/llvm/dist/cmake/modules/LLVMLibDeps.cmake vendor/llvm/dist/configure vendor/llvm/dist/docs/AliasAnalysis.html vendor/llvm/dist/docs/CMake.html vendor/llvm/dist/docs/CommandGuide/FileCheck.pod vendor/llvm/dist/docs/CommandGuide/llvmc.pod vendor/llvm/dist/docs/LangRef.html vendor/llvm/dist/docs/SourceLevelDebugging.html vendor/llvm/dist/docs/tutorial/index.html vendor/llvm/dist/examples/Fibonacci/fibonacci.cpp vendor/llvm/dist/include/llvm-c/Core.h vendor/llvm/dist/include/llvm/ADT/STLExtras.h vendor/llvm/dist/include/llvm/ADT/SmallString.h vendor/llvm/dist/include/llvm/ADT/StringRef.h vendor/llvm/dist/include/llvm/ADT/Trie.h vendor/llvm/dist/include/llvm/ADT/Triple.h vendor/llvm/dist/include/llvm/Analysis/AliasAnalysis.h vendor/llvm/dist/include/llvm/Analysis/CFGPrinter.h vendor/llvm/dist/include/llvm/Analysis/CaptureTracking.h vendor/llvm/dist/include/llvm/Analysis/DebugInfo.h vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h vendor/llvm/dist/include/llvm/Analysis/LibCallAliasAnalysis.h vendor/llvm/dist/include/llvm/Analysis/LoopInfo.h vendor/llvm/dist/include/llvm/Analysis/MemoryDependenceAnalysis.h vendor/llvm/dist/include/llvm/Analysis/PostDominators.h vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/CodeGen/AsmPrinter.h vendor/llvm/dist/include/llvm/CodeGen/JITCodeEmitter.h vendor/llvm/dist/include/llvm/CodeGen/LatencyPriorityQueue.h vendor/llvm/dist/include/llvm/CodeGen/LiveVariables.h vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h vendor/llvm/dist/include/llvm/CodeGen/MachineCodeEmitter.h vendor/llvm/dist/include/llvm/CodeGen/MachineModuleInfo.h vendor/llvm/dist/include/llvm/CodeGen/MachineOperand.h vendor/llvm/dist/include/llvm/CodeGen/Passes.h vendor/llvm/dist/include/llvm/CodeGen/ScheduleDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGISel.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/Intrinsics.td vendor/llvm/dist/include/llvm/IntrinsicsX86.td vendor/llvm/dist/include/llvm/Metadata.h vendor/llvm/dist/include/llvm/Support/DOTGraphTraits.h vendor/llvm/dist/include/llvm/Support/GraphWriter.h vendor/llvm/dist/include/llvm/Support/NoFolder.h vendor/llvm/dist/include/llvm/Support/SourceMgr.h vendor/llvm/dist/include/llvm/System/Path.h vendor/llvm/dist/include/llvm/Target/TargetInstrInfo.h vendor/llvm/dist/include/llvm/Target/TargetJITInfo.h vendor/llvm/dist/include/llvm/Target/TargetRegisterInfo.h vendor/llvm/dist/include/llvm/Target/TargetSelect.h vendor/llvm/dist/include/llvm/Target/TargetSelectionDAG.td vendor/llvm/dist/include/llvm/Transforms/Utils/PromoteMemToReg.h vendor/llvm/dist/lib/Analysis/AliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/AliasDebugger.cpp vendor/llvm/dist/lib/Analysis/AliasSetTracker.cpp vendor/llvm/dist/lib/Analysis/BasicAliasAnalysis.cpp vendor/llvm/dist/lib/Analysis/CaptureTracking.cpp vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/DebugInfo.cpp vendor/llvm/dist/lib/Analysis/DomPrinter.cpp vendor/llvm/dist/lib/Analysis/IPA/Andersens.cpp vendor/llvm/dist/lib/Analysis/IPA/GlobalsModRef.cpp vendor/llvm/dist/lib/Analysis/IVUsers.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LoopInfo.cpp vendor/llvm/dist/lib/Analysis/MemoryDependenceAnalysis.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/AsmParser/LLParser.cpp vendor/llvm/dist/lib/CodeGen/AggressiveAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/AggressiveAntiDepBreaker.h vendor/llvm/dist/lib/CodeGen/AntiDepBreaker.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIE.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DIE.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfDebug.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfException.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfWriter.cpp vendor/llvm/dist/lib/CodeGen/BranchFolding.cpp vendor/llvm/dist/lib/CodeGen/BranchFolding.h vendor/llvm/dist/lib/CodeGen/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/CriticalAntiDepBreaker.cpp vendor/llvm/dist/lib/CodeGen/CriticalAntiDepBreaker.h vendor/llvm/dist/lib/CodeGen/DwarfEHPrepare.cpp vendor/llvm/dist/lib/CodeGen/IfConversion.cpp vendor/llvm/dist/lib/CodeGen/LLVMTargetMachine.cpp vendor/llvm/dist/lib/CodeGen/LatencyPriorityQueue.cpp vendor/llvm/dist/lib/CodeGen/LiveIntervalAnalysis.cpp vendor/llvm/dist/lib/CodeGen/LiveVariables.cpp vendor/llvm/dist/lib/CodeGen/MachineBasicBlock.cpp vendor/llvm/dist/lib/CodeGen/MachineFunction.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/MachineLICM.cpp vendor/llvm/dist/lib/CodeGen/MachineModuleInfo.cpp vendor/llvm/dist/lib/CodeGen/MachineVerifier.cpp vendor/llvm/dist/lib/CodeGen/PHIElimination.cpp vendor/llvm/dist/lib/CodeGen/PHIElimination.h vendor/llvm/dist/lib/CodeGen/PostRASchedulerList.cpp vendor/llvm/dist/lib/CodeGen/ProcessImplicitDefs.cpp vendor/llvm/dist/lib/CodeGen/RegAllocLinearScan.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAG.cpp vendor/llvm/dist/lib/CodeGen/ScheduleDAGPrinter.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/SelectionDAG/FastISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/InstrEmitter.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/SimpleRegisterCoalescing.cpp vendor/llvm/dist/lib/CodeGen/Spiller.cpp vendor/llvm/dist/lib/CodeGen/Spiller.h vendor/llvm/dist/lib/CodeGen/VirtRegRewriter.cpp vendor/llvm/dist/lib/CompilerDriver/CompilationGraph.cpp vendor/llvm/dist/lib/ExecutionEngine/JIT/JITEmitter.cpp vendor/llvm/dist/lib/Support/CommandLine.cpp vendor/llvm/dist/lib/Support/SourceMgr.cpp vendor/llvm/dist/lib/Support/StringRef.cpp vendor/llvm/dist/lib/Support/Triple.cpp vendor/llvm/dist/lib/System/CMakeLists.txt vendor/llvm/dist/lib/System/Host.cpp vendor/llvm/dist/lib/System/Unix/Path.inc vendor/llvm/dist/lib/System/Win32/Path.inc vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseInstrInfo.h vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMBaseRegisterInfo.h vendor/llvm/dist/lib/Target/ARM/ARMCodeEmitter.cpp vendor/llvm/dist/lib/Target/ARM/ARMConstantIslandPass.cpp vendor/llvm/dist/lib/Target/ARM/ARMExpandPseudoInsts.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrFormats.td vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrNEON.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/ARM/ARMInstrVFP.td vendor/llvm/dist/lib/Target/ARM/ARMJITInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARMJITInfo.h vendor/llvm/dist/lib/Target/ARM/ARMScheduleV7.td vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.cpp vendor/llvm/dist/lib/Target/ARM/ARMSubtarget.h vendor/llvm/dist/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp vendor/llvm/dist/lib/Target/ARM/NEONMoveFix.cpp vendor/llvm/dist/lib/Target/ARM/Thumb2SizeReduction.cpp vendor/llvm/dist/lib/Target/Alpha/AlphaISelLowering.cpp vendor/llvm/dist/lib/Target/Alpha/AlphaJITInfo.cpp vendor/llvm/dist/lib/Target/Alpha/AlphaJITInfo.h vendor/llvm/dist/lib/Target/Blackfin/BlackfinISelLowering.cpp vendor/llvm/dist/lib/Target/Blackfin/BlackfinRegisterInfo.td vendor/llvm/dist/lib/Target/CellSPU/SPUISelLowering.cpp vendor/llvm/dist/lib/Target/CellSPU/SPUInstrInfo.td vendor/llvm/dist/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430ISelLowering.cpp vendor/llvm/dist/lib/Target/MSP430/MSP430InstrInfo.td vendor/llvm/dist/lib/Target/MSP430/MSP430MCAsmInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsInstrInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsRegisterInfo.cpp vendor/llvm/dist/lib/Target/PIC16/PIC16DebugInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCFrameInfo.h vendor/llvm/dist/lib/Target/PowerPC/PPCISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCInstrInfo.td vendor/llvm/dist/lib/Target/PowerPC/PPCJITInfo.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCJITInfo.h vendor/llvm/dist/lib/Target/PowerPC/PPCRegisterInfo.cpp vendor/llvm/dist/lib/Target/README.txt vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.cpp vendor/llvm/dist/lib/Target/TargetLoweringObjectFile.cpp vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp vendor/llvm/dist/lib/Target/X86/AsmPrinter/X86MCInstLower.h vendor/llvm/dist/lib/Target/X86/Makefile vendor/llvm/dist/lib/Target/X86/X86CodeEmitter.cpp vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86Instr64bit.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Target/X86/X86JITInfo.cpp vendor/llvm/dist/lib/Target/X86/X86JITInfo.h vendor/llvm/dist/lib/Target/X86/X86RegisterInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/XCore/XCoreISelLowering.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionAttrs.cpp vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/IPO/IPConstantPropagation.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/SCCP.cpp vendor/llvm/dist/lib/Transforms/Scalar/ScalarReplAggregates.cpp vendor/llvm/dist/lib/Transforms/Scalar/SimplifyCFGPass.cpp vendor/llvm/dist/lib/Transforms/Scalar/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopSimplify.cpp vendor/llvm/dist/lib/Transforms/Utils/Mem2Reg.cpp vendor/llvm/dist/lib/Transforms/Utils/PromoteMemoryToRegister.cpp vendor/llvm/dist/lib/VMCore/Core.cpp vendor/llvm/dist/lib/VMCore/Metadata.cpp vendor/llvm/dist/lib/VMCore/PassManager.cpp vendor/llvm/dist/lib/VMCore/Verifier.cpp vendor/llvm/dist/test/Analysis/BasicAA/modref.ll vendor/llvm/dist/test/Analysis/ScalarEvolution/scev-aa.ll vendor/llvm/dist/test/CodeGen/ARM/2009-11-07-SubRegAsmPrinting.ll vendor/llvm/dist/test/CodeGen/ARM/bic.ll vendor/llvm/dist/test/CodeGen/ARM/fabss.ll vendor/llvm/dist/test/CodeGen/ARM/fadds.ll vendor/llvm/dist/test/CodeGen/ARM/fdivs.ll vendor/llvm/dist/test/CodeGen/ARM/fmacs.ll vendor/llvm/dist/test/CodeGen/ARM/fmscs.ll vendor/llvm/dist/test/CodeGen/ARM/fmuls.ll vendor/llvm/dist/test/CodeGen/ARM/fnegs.ll vendor/llvm/dist/test/CodeGen/ARM/fpconsts.ll vendor/llvm/dist/test/CodeGen/ARM/fptoint.ll vendor/llvm/dist/test/CodeGen/ARM/fsubs.ll vendor/llvm/dist/test/CodeGen/ARM/mls.ll vendor/llvm/dist/test/CodeGen/ARM/remat.ll vendor/llvm/dist/test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.ll vendor/llvm/dist/test/CodeGen/Mips/2009-11-16-CstPoolLoad.ll vendor/llvm/dist/test/CodeGen/PIC16/2009-07-17-PR4566-pic16.ll vendor/llvm/dist/test/CodeGen/PowerPC/Frames-alloca.ll vendor/llvm/dist/test/CodeGen/PowerPC/Frames-large.ll vendor/llvm/dist/test/CodeGen/PowerPC/Frames-small.ll vendor/llvm/dist/test/CodeGen/PowerPC/bswap-load-store.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc-prologue.ll vendor/llvm/dist/test/CodeGen/Thumb2/cross-rc-coalescing-2.ll vendor/llvm/dist/test/CodeGen/Thumb2/ldr-str-imm12.ll vendor/llvm/dist/test/CodeGen/Thumb2/machine-licm.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-add3.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-and2.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-cmn.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-mla.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-mls.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-orn.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-orn2.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-orr2.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-ror.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-rsb.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-rsb2.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-select_xform.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-sub2.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-teq.ll vendor/llvm/dist/test/CodeGen/Thumb2/thumb2-tst.ll vendor/llvm/dist/test/CodeGen/X86/2008-08-05-SpillerBug.ll vendor/llvm/dist/test/CodeGen/X86/2009-03-13-PHIElimBug.ll vendor/llvm/dist/test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll vendor/llvm/dist/test/CodeGen/X86/2009-09-19-SchedCustomLoweringBug.ll vendor/llvm/dist/test/CodeGen/X86/2009-10-08-MachineLICMBug.ll vendor/llvm/dist/test/CodeGen/X86/fp_constant_op.ll vendor/llvm/dist/test/CodeGen/X86/palignr-2.ll vendor/llvm/dist/test/CodeGen/X86/pic-load-remat.ll vendor/llvm/dist/test/CodeGen/X86/tailcall-stackalign.ll vendor/llvm/dist/test/CodeGen/X86/trunc-to-bool.ll vendor/llvm/dist/test/FrontendC++/2006-11-30-Pubnames.cpp vendor/llvm/dist/test/FrontendC/2009-02-17-BitField-dbg.c vendor/llvm/dist/test/FrontendC/pr4349.c vendor/llvm/dist/test/Transforms/DeadStoreElimination/crash.ll vendor/llvm/dist/test/Transforms/DeadStoreElimination/lifetime.ll vendor/llvm/dist/test/Transforms/GVN/rle-must-alias.ll vendor/llvm/dist/test/Transforms/GVN/rle-no-phi-translate.ll vendor/llvm/dist/test/Transforms/GVN/rle-phi-translate.ll vendor/llvm/dist/test/Transforms/InstCombine/cast.ll vendor/llvm/dist/test/Transforms/InstCombine/compare-signs.ll vendor/llvm/dist/test/Transforms/InstCombine/crash.ll vendor/llvm/dist/test/Transforms/InstCombine/getelementptr.ll vendor/llvm/dist/test/Transforms/InstCombine/intrinsics.ll vendor/llvm/dist/test/Transforms/InstCombine/or.ll vendor/llvm/dist/test/Transforms/InstCombine/shufflevec-constant.ll vendor/llvm/dist/test/Transforms/InstCombine/store.ll vendor/llvm/dist/test/Transforms/JumpThreading/crash.ll vendor/llvm/dist/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll vendor/llvm/dist/test/Transforms/LoopSimplify/indirectbr.ll vendor/llvm/dist/test/Transforms/ScalarRepl/badarray.ll vendor/llvm/dist/tools/llvm-config/llvm-config.in.in vendor/llvm/dist/tools/llvmc/doc/LLVMC-Reference.rst vendor/llvm/dist/tools/llvmc/example/Hello/Hello.cpp vendor/llvm/dist/tools/llvmc/plugins/Base/Base.td.in vendor/llvm/dist/tools/lto/LTOCodeGenerator.cpp vendor/llvm/dist/tools/opt/GraphPrinters.cpp vendor/llvm/dist/unittests/ADT/StringRefTest.cpp vendor/llvm/dist/unittests/ADT/ValueMapTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/JIT/JITTest.cpp vendor/llvm/dist/utils/FileCheck/FileCheck.cpp vendor/llvm/dist/utils/TableGen/CMakeLists.txt vendor/llvm/dist/utils/TableGen/DAGISelEmitter.cpp vendor/llvm/dist/utils/TableGen/LLVMCConfigurationEmitter.cpp vendor/llvm/dist/utils/TableGen/OptParserEmitter.cpp vendor/llvm/dist/utils/TableGen/Record.cpp vendor/llvm/dist/utils/TableGen/Record.h vendor/llvm/dist/utils/TableGen/TGParser.cpp vendor/llvm/dist/utils/TableGen/TableGen.cpp vendor/llvm/dist/utils/buildit/build_llvm Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/CMakeLists.txt Tue Dec 1 11:07:05 2009 (r199989) @@ -191,6 +191,10 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LL add_llvm_definitions( -D__STDC_LIMIT_MACROS ) add_llvm_definitions( -D__STDC_CONSTANT_MACROS ) +option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON) +option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) +option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) + if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 ) # TODO: support other platforms and toolchains. option(LLVM_BUILD_32_BITS "Build 32 bits executables and libraries." OFF) @@ -226,6 +230,27 @@ if( MSVC ) add_llvm_definitions("/${LLVM_USE_CRT}") message(STATUS "Using VC++ CRT: ${LLVM_USE_CRT}") endif (NOT ${LLVM_USE_CRT} STREQUAL "") + + # Enable warnings + if (LLVM_ENABLE_WARNINGS) + add_llvm_definitions( /W4 /Wall ) + if (LLVM_ENABLE_PEDANTIC) + # No MSVC equivalent available + endif (LLVM_ENABLE_PEDANTIC) + endif (LLVM_ENABLE_WARNINGS) + if (LLVM_ENABLE_WERROR) + add_llvm_definitions( /WX ) + endif (LLVM_ENABLE_WERROR) +elseif( CMAKE_COMPILER_IS_GNUCXX ) + if (LLVM_ENABLE_WARNINGS) + add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings ) + if (LLVM_ENABLE_PEDANTIC) + add_llvm_definitions( -pedantic -Wno-long-long ) + endif (LLVM_ENABLE_PEDANTIC) + endif (LLVM_ENABLE_WARNINGS) + if (LLVM_ENABLE_WERROR) + add_llvm_definitions( -Werror ) + endif (LLVM_ENABLE_WERROR) endif( MSVC ) include_directories( ${LLVM_BINARY_DIR}/include ${LLVM_MAIN_INCLUDE_DIR}) @@ -280,6 +305,7 @@ add_subdirectory(utils/not) set(LLVM_ENUM_ASM_PRINTERS "") set(LLVM_ENUM_ASM_PARSERS "") +set(LLVM_ENUM_DISASSEMBLERS "") foreach(t ${LLVM_TARGETS_TO_BUILD}) message(STATUS "Targeting ${t}") add_subdirectory(lib/Target/${t}) @@ -294,6 +320,11 @@ foreach(t ${LLVM_TARGETS_TO_BUILD}) set(LLVM_ENUM_ASM_PARSERS "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n") endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmParser/CMakeLists.txt ) + if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/Disassembler/CMakeLists.txt ) + add_subdirectory(lib/Target/${t}/Disassembler) + set(LLVM_ENUM_DISASSEMBLERS + "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n") + endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/Disassembler/CMakeLists.txt ) set(CURRENT_LLVM_TARGET) endforeach(t) @@ -309,6 +340,12 @@ configure_file( ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def ) +# Produce llvm/Config/Disassemblers.def +configure_file( + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in + ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def + ) + add_subdirectory(lib/ExecutionEngine) add_subdirectory(lib/ExecutionEngine/Interpreter) add_subdirectory(lib/ExecutionEngine/JIT) @@ -319,14 +356,10 @@ add_subdirectory(lib/Archive) add_subdirectory(projects) option(LLVM_BUILD_TOOLS "Build LLVM tool programs." ON) -if(LLVM_BUILD_TOOLS) - add_subdirectory(tools) -endif() +add_subdirectory(tools) option(LLVM_BUILD_EXAMPLES "Build LLVM example programs." OFF) -if(LLVM_BUILD_EXAMPLES) - add_subdirectory(examples) -endif () +add_subdirectory(examples) install(DIRECTORY include/ DESTINATION include Modified: vendor/llvm/dist/Makefile ============================================================================== --- vendor/llvm/dist/Makefile Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/Makefile Tue Dec 1 11:07:05 2009 (r199989) @@ -155,9 +155,11 @@ install-libs: install FilesToConfig := \ include/llvm/Config/config.h \ include/llvm/Config/Targets.def \ - include/llvm/Config/AsmPrinters.def \ + include/llvm/Config/AsmPrinters.def \ + include/llvm/Config/AsmParsers.def \ + include/llvm/Config/Disassemblers.def \ include/llvm/System/DataTypes.h \ - tools/llvmc/plugins/Base/Base.td + tools/llvmc/plugins/Base/Base.td FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig)) all-local:: $(FilesToConfigPATH) Modified: vendor/llvm/dist/Makefile.rules ============================================================================== --- vendor/llvm/dist/Makefile.rules Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/Makefile.rules Tue Dec 1 11:07:05 2009 (r199989) @@ -1565,6 +1565,11 @@ $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(O $(Echo) "Building $( conftest.$ac_ext < conftest.$ac_ext + echo '#line 13267 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -14976,11 +14982,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14979: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14985: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14983: \$? = $ac_status" >&5 + echo "$as_me:14989: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15244,11 +15250,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15247: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15253: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15251: \$? = $ac_status" >&5 + echo "$as_me:15257: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15348,11 +15354,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15351: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15357: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15355: \$? = $ac_status" >&5 + echo "$as_me:15361: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17800,7 +17806,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:20277: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20275: \$? = $ac_status" >&5 + echo "$as_me:20281: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -20372,11 +20378,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20375: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20381: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:20379: \$? = $ac_status" >&5 + echo "$as_me:20385: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -21942,11 +21948,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21945: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21951: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21949: \$? = $ac_status" >&5 + echo "$as_me:21955: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -22046,11 +22052,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:22049: $lt_compile\"" >&5) + (eval echo "\"\$as_me:22055: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:22053: \$? = $ac_status" >&5 + echo "$as_me:22059: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -24281,11 +24287,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24284: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24290: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:24288: \$? = $ac_status" >&5 + echo "$as_me:24294: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -24549,11 +24555,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24552: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24558: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:24556: \$? = $ac_status" >&5 + echo "$as_me:24562: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -24653,11 +24659,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:24656: $lt_compile\"" >&5) + (eval echo "\"\$as_me:24662: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:24660: \$? = $ac_status" >&5 + echo "$as_me:24666: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -35375,6 +35381,8 @@ ac_config_files="$ac_config_files includ ac_config_files="$ac_config_files include/llvm/Config/AsmParsers.def" +ac_config_files="$ac_config_files include/llvm/Config/Disassemblers.def" + ac_config_headers="$ac_config_headers include/llvm/System/DataTypes.h" @@ -36002,6 +36010,7 @@ do "include/llvm/Config/Targets.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/Targets.def" ;; "include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;; "include/llvm/Config/AsmParsers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmParsers.def" ;; + "include/llvm/Config/Disassemblers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/Disassemblers.def" ;; "include/llvm/System/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/System/DataTypes.h" ;; "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; "llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;; @@ -36175,12 +36184,12 @@ TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_de LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim LLVM_ENUM_ASM_PARSERS!$LLVM_ENUM_ASM_PARSERS$ac_delim +LLVM_ENUM_DISASSEMBLERS!$LLVM_ENUM_DISASSEMBLERS$ac_delim ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim OPTIMIZE_OPTION!$OPTIMIZE_OPTION$ac_delim EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim -ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -36222,6 +36231,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim @@ -36319,7 +36329,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -36338,7 +36348,7 @@ fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g @@ -36351,8 +36361,6 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!! ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g CEOF$ac_eof _ACEOF @@ -36600,7 +36608,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && Modified: vendor/llvm/dist/docs/AliasAnalysis.html ============================================================================== --- vendor/llvm/dist/docs/AliasAnalysis.html Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/docs/AliasAnalysis.html Tue Dec 1 11:07:05 2009 (r199989) @@ -225,12 +225,7 @@ method for testing dependencies between call sites (CS1 & CS2), returns NoModRef if the two calls refer to disjoint memory locations, Ref if CS1 reads memory written by CS2, Mod if CS1 writes to memory read or written by CS2, or ModRef if CS1 might read or write memory -accessed by CS2. Note that this relation is not commutative. Clients that use -this method should be predicated on the hasNoModRefInfoForCalls() -method, which indicates whether or not an analysis can provide mod/ref -information for function call pairs (most can not). If this predicate is false, -the client shouldn't waste analysis time querying the getModRefInfo -method many times.

+accessed by CS2. Note that this relation is not commutative.

@@ -251,21 +246,6 @@ analysis implementations and can be put
- The getMustAliases method -
- -
- -

The getMustAliases method returns all values that are known to -always must alias a pointer. This information can be provided in some cases for -important objects like the null pointer and global values. Knowing that a -pointer always points to a particular function allows indirect calls to be -turned into direct calls, for example.

- -
- - -
The pointsToConstantMemory method
@@ -969,7 +949,7 @@ analysis directly.

Chris Lattner
LLVM Compiler Infrastructure
- Last modified: $Date: 2009-04-25 23:11:37 +0200 (Sat, 25 Apr 2009) $ + Last modified: $Date: 2009-11-22 17:01:44 +0100 (Sun, 22 Nov 2009) $ Modified: vendor/llvm/dist/docs/CMake.html ============================================================================== --- vendor/llvm/dist/docs/CMake.html Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/docs/CMake.html Tue Dec 1 11:07:05 2009 (r199989) @@ -251,10 +251,16 @@ -DLLVM_TARGETS_TO_BUILD="X86;PowerPC;Alpha".
LLVM_BUILD_TOOLS:BOOL
-
Build LLVM tools. Defaults to ON.
+
Build LLVM tools. Defaults to ON. Targets for building each tool + are generated in any case. You can build an tool separately by + invoking its target. For example, you can build llvm-as + with a makefile-based system executing make llvm-as on the + root of your build directory.
LLVM_BUILD_EXAMPLES:BOOL
-
Build LLVM examples. Defaults to ON.
+
Build LLVM examples. Defaults to OFF. Targets for building each + example are generated in any case. See documentation + for LLVM_BUILD_TOOLS above for more details.
LLVM_ENABLE_THREADS:BOOL
Build with threads support, if available. Defaults to ON.
@@ -268,10 +274,21 @@ compiler supports this flag. Some systems, like Windows, do not need this flag. Defaults to ON. +
LLVM_ENABLE_WARNINGS:BOOL
+
Enable all compiler warnings. Defaults to ON.
+ +
LLVM_ENABLE_PEDANTIC:BOOL
+
Enable pedantic mode. This disable compiler specific extensions, is + possible. Defaults to ON.
+ +
LLVM_ENABLE_WERROR:BOOL
+
Stop and fail build, if a compiler warning is + triggered. Defaults to OFF.
+
LLVM_BUILD_32_BITS:BOOL
Build 32-bits executables and libraries on 64-bits systems. This - option is available only on some 64-bits unix systems. Defaults to - OFF.
+ option is available only on some 64-bits unix systems. Defaults to + OFF.
LLVM_TARGET_ARCH:STRING
LLVM target to use for native code generation. This is required Modified: vendor/llvm/dist/docs/CommandGuide/FileCheck.pod ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/FileCheck.pod Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/docs/CommandGuide/FileCheck.pod Tue Dec 1 11:07:05 2009 (r199989) @@ -224,7 +224,7 @@ The first check line matches a regex ([[ ]] pairs, are named, and their names can be -formed with the regex "[a-zA-Z][a-zA-Z0-9]*". If a colon follows the +formed with the regex "[a-zA-Z_][a-zA-Z0-9_]*". If a colon follows the name, then it is a definition of the variable, if not, it is a use. FileCheck variables can be defined multiple times, and uses always get the Modified: vendor/llvm/dist/docs/CommandGuide/llvmc.pod ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/llvmc.pod Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/docs/CommandGuide/llvmc.pod Tue Dec 1 11:07:05 2009 (r199989) @@ -126,24 +126,31 @@ use the B<-Wo,> option. =item B<-I> I -Add a directory to the header file search path. This option can be -repeated. +Add a directory to the header file search path. =item B<-L> I -Add I to the library search path. This option can be -repeated. +Add I to the library search path. + +=item B<-F> I + +Add I to the framework search path. =item B<-l>I Link in the library libI.[bc | a | so]. This library should be a bitcode library. +=item B<-framework> I + +Link in the library libI.[bc | a | so]. This library should +be a bitcode library. + =item B<-emit-llvm> -Make the output be LLVM bitcode (with B<-c>) or assembly (with B<-S>) instead -of native object (or assembly). If B<-emit-llvm> is given without either B<-c> -or B<-S> it has no effect. +Output LLVM bitcode (with B<-c>) or assembly (with B<-S>) instead of native +object (or assembly). If B<-emit-llvm> is given without either B<-c> or B<-S> +it has no effect. =item B<-Wa> @@ -157,6 +164,10 @@ Pass options to linker. Pass options to opt. +=item B<-Wllc> + +Pass options to llc (code generator). + =back =head1 EXIT STATUS Modified: vendor/llvm/dist/docs/LangRef.html ============================================================================== --- vendor/llvm/dist/docs/LangRef.html Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/docs/LangRef.html Tue Dec 1 11:07:05 2009 (r199989) @@ -291,6 +291,8 @@ 'llvm.trap' Intrinsic
  • 'llvm.stackprotector' Intrinsic
  • +
  • + 'llvm.objectsize' Intrinsic
  • @@ -1440,11 +1442,6 @@ Classifications -

    Note that the code generator does not yet support large integer types to be - used as function return types. The specific limit on how large a return type - the code generator can currently handle is target-dependent; currently it's - often 64 bits for 32-bit targets and 128 bits for 64-bit targets.

    - @@ -1583,11 +1580,6 @@ Classifications length array type. An implementation of 'pascal style arrays' in LLVM could use the type "{ i32, [0 x float]}", for example.

    -

    Note that the code generator does not yet support large aggregate types to be - used as function return types. The specific limit on how large an aggregate - return type the code generator can currently handle is target-dependent, and - also dependent on the aggregate element types.

    - @@ -1680,11 +1672,6 @@ Classifications -

    Note that the code generator does not yet support large aggregate types to be - used as function return types. The specific limit on how large an aggregate - return type the code generator can currently handle is target-dependent, and - also dependent on the aggregate element types.

    - @@ -1775,8 +1762,7 @@ Classifications

    A vector type is a simple derived type that represents a vector of elements. Vector types are used when multiple primitive data are operated in parallel using a single instruction (SIMD). A vector type requires a size (number of - elements) and an underlying primitive data type. Vectors must have a power - of two length (1, 2, 4, 8, 16 ...). Vector types are considered + elements) and an underlying primitive data type. Vector types are considered first class.

    Syntax:
    @@ -1803,11 +1789,6 @@ Classifications -

    Note that the code generator does not yet support large vector types to be - used as function return types. The specific limit on how large a vector - return type codegen can currently handle is target-dependent; currently it's - often a few times longer than a hardware vector register.

    - @@ -2600,14 +2581,6 @@ Instruction ret { i32, i8 } { i32 4, i8 2 } ; Return a struct of values 4 and 2 -

    Note that the code generator does not yet fully support large - return values. The specific sizes that are currently supported are - dependent on the target. For integers, on 32-bit targets the limit - is often 64 bits, and on 64-bit targets the limit is often 128 bits. - For aggregate types, the current limits are dependent on the element - types; for example targets are often limited to 2 total integer - elements and 2 total floating-point elements.

    - @@ -7275,6 +7248,41 @@ LLVM.

    + + + +
    + +
    Syntax:
    +
    +  declare i32 @llvm.objectsize.i32( i8* <ptr>, i32 <type> )
    +  declare i64 @llvm.objectsize.i64( i8* <ptr>, i32 <type> )
    +
    + +
    Overview:
    +

    The llvm.objectsize intrinsic returns the constant number of bytes + from ptr to the end of the object ptr points to if it + can deduce this at compile time. If there are any side-effects in evaluating + the argument or it cannot deduce which objects ptr points to at compile + time the intrinsic returns (size_t) -1 for type 0 + or 1 and (size_t) 0 for type 2 or 3.

    + +
    Arguments:
    +

    The llvm.objectsize intrinsic takes two arguments. The first + argument is a pointer to the object ptr and an integer type. + type is an integer ranging from 0 to 3. The lsb corresponds to + a return value based on whole objects, the second bit whether or not we + return the maximum or minimum remaining bytes computed.

    + +
    Semantics:
    +

    The llvm.objectsize intrinsic is lowered to either a constant + representing the size of the object concerned or (size_t) -1 if + it cannot be determined at compile time.

    + +
    +
    @@ -7285,7 +7293,7 @@ LLVM.

    Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2009-11-09 20:01:53 +0100 (Mon, 09 Nov 2009) $ + Last modified: $Date: 2009-11-30 09:03:53 +0100 (Mon, 30 Nov 2009) $
    Modified: vendor/llvm/dist/docs/SourceLevelDebugging.html ============================================================================== --- vendor/llvm/dist/docs/SourceLevelDebugging.html Tue Dec 1 07:28:56 2009 (r199988) +++ vendor/llvm/dist/docs/SourceLevelDebugging.html Tue Dec 1 11:07:05 2009 (r199989) @@ -37,15 +37,10 @@
  • Debugger intrinsic functions
  • -
  • Representing stopping points in the - source program
  • +
  • Object lifetimes and scoping
  • C/C++ front-end specific debug information
    1. C/C++ source file information
    2. @@ -763,272 +758,182 @@ DW_TAG_return_variable = 258
      -  void %llvm.dbg.stoppoint( uint, uint, metadata)
      +  void %llvm.dbg.declare( { } *, metadata )
       
      -

      This intrinsic is used to provide correspondence between the source file and - the generated code. The first argument is the line number (base 1), second - argument is the column number (0 if unknown) and the third argument the - source %llvm.dbg.compile_unit. - Code following a call to this intrinsic will - have been defined in close proximity of the line, column and file. This - information holds until the next call - to %lvm.dbg.stoppoint.

      +

      This intrinsic provides information about a local element (ex. variable.) The + first argument is the alloca for the variable, cast to a { }*. The + second argument is + the %llvm.dbg.variable containing + the description of the variable.

      -
      - llvm.dbg.func.start +
      -
      -  void %llvm.dbg.func.start( metadata )
      -
      +

      In many languages, the local variables in functions can have their lifetimes + or scopes limited to a subset of a function. In the C family of languages, + for example, variables are only live (readable and writable) within the + source block that they are defined in. In functional languages, values are + only readable after they have been defined. Though this is a very obvious + concept, it is non-trivial to model in LLVM, because it has no notion of + scoping in this sense, and does not want to be tied to a language's scoping + rules.

      -

      This intrinsic is used to link the debug information - in %llvm.dbg.subprogram to the - function. It defines the beginning of the function's declarative region - (scope). It also implies a call to - %llvm.dbg.stoppoint which - defines a source line "stop point". The intrinsic should be called early in - the function after the all the alloca instructions. It should be paired off - with a closing - %llvm.dbg.region.end. - The function's single argument is - the %llvm.dbg.subprogram.type.

      +

      In order to handle this, the LLVM debug format uses the metadata attached to + llvm instructions to encode line nuber and scoping information. Consider the + following C fragment, for example:

      +
      +
      +1.  void foo() {
      +2.    int X = 21;
      +3.    int Y = 22;
      +4.    {
      +5.      int Z = 23;
      +6.      Z = X;
      +7.    }
      +8.    X = Y;
      +9.  }
      +
      - - +

      Compiled to LLVM, this function would be represented like this:

      -
      +
      -  void %llvm.dbg.region.start( metadata )
      -
      - -

      This intrinsic is used to define the beginning of a declarative scope (ex. - block) for local language elements. It should be paired off with a closing - %llvm.dbg.region.end. The - function's single argument is - the %llvm.dbg.block which is - starting.

      +define void @foo() nounwind ssp { +entry: + %X = alloca i32, align 4 ; <i32*> [#uses=4] + %Y = alloca i32, align 4 ; <i32*> [#uses=4] + %Z = alloca i32, align 4 ; <i32*> [#uses=3] + %0 = bitcast i32* %X to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %0, metadata !0), !dbg !7 + store i32 21, i32* %X, !dbg !8 + %1 = bitcast i32* %Y to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %1, metadata !9), !dbg !10 + store i32 22, i32* %Y, !dbg !11 + %2 = bitcast i32* %Z to { }* ; <{ }*> [#uses=1] + call void @llvm.dbg.declare({ }* %2, metadata !12), !dbg !14 + store i32 23, i32* %Z, !dbg !15 + %tmp = load i32* %X, !dbg !16 ; <i32> [#uses=1] + %tmp1 = load i32* %Y, !dbg !16 ; <i32> [#uses=1] + %add = add nsw i32 %tmp, %tmp1, !dbg !16 ; <i32> [#uses=1] + store i32 %add, i32* %Z, !dbg !16 + %tmp2 = load i32* %Y, !dbg !17 ; <i32> [#uses=1] + store i32 %tmp2, i32* %X, !dbg !17 + ret void, !dbg !18 +} +declare void @llvm.dbg.declare({ }*, metadata) nounwind readnone +!0 = metadata !{i32 459008, metadata !1, metadata !"X", + metadata !3, i32 2, metadata !6}; [ DW_TAG_auto_variable ] +!1 = metadata !{i32 458763, metadata !2}; [DW_TAG_lexical_block ] +!2 = metadata !{i32 458798, i32 0, metadata !3, metadata !"foo", metadata !"foo", + metadata !"foo", metadata !3, i32 1, metadata !4, + i1 false, i1 true}; [DW_TAG_subprogram ] +!3 = metadata !{i32 458769, i32 0, i32 12, metadata !"foo.c", + metadata !"/private/tmp", metadata !"clang 1.1", i1 true, + i1 false, metadata !"", i32 0}; [DW_TAG_compile_unit ] +!4 = metadata !{i32 458773, metadata !3, metadata !"", null, i32 0, i64 0, i64 0, + i64 0, i32 0, null, metadata !5, i32 0}; [DW_TAG_subroutine_type ] +!5 = metadata !{null} +!6 = metadata !{i32 458788, metadata !3, metadata !"int", metadata !3, i32 0, + i64 32, i64 32, i64 0, i32 0, i32 5}; [DW_TAG_base_type ] +!7 = metadata !{i32 2, i32 7, metadata !1, null} +!8 = metadata !{i32 2, i32 3, metadata !1, null} +!9 = metadata !{i32 459008, metadata !1, metadata !"Y", metadata !3, i32 3, + metadata !6}; [ DW_TAG_auto_variable ] +!10 = metadata !{i32 3, i32 7, metadata !1, null} +!11 = metadata !{i32 3, i32 3, metadata !1, null} +!12 = metadata !{i32 459008, metadata !13, metadata !"Z", metadata !3, i32 5, + metadata !6}; [ DW_TAG_auto_variable ] +!13 = metadata !{i32 458763, metadata !1}; [DW_TAG_lexical_block ] +!14 = metadata !{i32 5, i32 9, metadata !13, null} +!15 = metadata !{i32 5, i32 5, metadata !13, null} +!16 = metadata !{i32 6, i32 5, metadata !13, null} +!17 = metadata !{i32 8, i32 3, metadata !1, null} +!18 = metadata !{i32 9, i32 1, metadata !2, null} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 11:08:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E55BC106566B; Tue, 1 Dec 2009 11:08:04 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF4FF8FC15; Tue, 1 Dec 2009 11:08:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1B84Pr062487; Tue, 1 Dec 2009 11:08:04 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1B84TS062474; Tue, 1 Dec 2009 11:08:04 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200912011108.nB1B84TS062474@svn.freebsd.org> From: Roman Divacky Date: Tue, 1 Dec 2009 11:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199990 - in vendor/clang/dist: . clang.xcodeproj include/clang/AST include/clang/Analysis include/clang/Analysis/Analyses include/clang/Analysis/PathSensitive include/clang/Analysis/Pa... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 11:08:05 -0000 Author: rdivacky Date: Tue Dec 1 11:08:04 2009 New Revision: 199990 URL: http://svn.freebsd.org/changeset/base/199990 Log: Update clang to r90226. Added: vendor/clang/dist/include/clang/Frontend/LangStandard.h vendor/clang/dist/include/clang/Frontend/LangStandards.def vendor/clang/dist/lib/Analysis/CallAndMessageChecker.cpp vendor/clang/dist/lib/Analysis/Checker.cpp vendor/clang/dist/lib/Analysis/UndefBranchChecker.cpp vendor/clang/dist/lib/Analysis/UndefResultChecker.cpp vendor/clang/dist/lib/CodeGen/CGClass.cpp vendor/clang/dist/lib/CodeGen/CGExprCXX.cpp vendor/clang/dist/lib/CodeGen/CGTemporaries.cpp vendor/clang/dist/lib/Frontend/LangStandards.cpp vendor/clang/dist/test/CXX/basic/basic.link/p9.cpp vendor/clang/dist/test/CXX/temp/temp.param/p9.cpp vendor/clang/dist/test/CodeGenCXX/condition.cpp vendor/clang/dist/test/CodeGenCXX/conditional-temporaries.cpp vendor/clang/dist/test/CodeGenCXX/const-global-linkage.cpp vendor/clang/dist/test/CodeGenCXX/copy-assign-synthesis-2.cpp vendor/clang/dist/test/CodeGenCXX/eh.cpp vendor/clang/dist/test/CodeGenCXX/mangle-template.cpp vendor/clang/dist/test/CodeGenCXX/member-pointer-cast.cpp vendor/clang/dist/test/CodeGenCXX/member-templates.cpp vendor/clang/dist/test/CodeGenCXX/new-with-default-arg.cpp vendor/clang/dist/test/CodeGenCXX/temp-order.cpp vendor/clang/dist/test/CodeGenCXX/virt-dtor-key.cpp vendor/clang/dist/test/CodeGenCXX/virtual-base-destructor-call.cpp vendor/clang/dist/test/CodeGenCXX/virtual-bases.cpp vendor/clang/dist/test/CodeGenCXX/virtual-functions-incomplete-types.cpp vendor/clang/dist/test/CodeGenObjC/sel-as-builtin-type.m vendor/clang/dist/test/CodeGenObjC/undefined-protocol.m vendor/clang/dist/test/FixIt/fixit-cxx0x.cpp vendor/clang/dist/test/Frontend/output-failures.c vendor/clang/dist/test/Index/c-index-api-fn-scan.m vendor/clang/dist/test/Lexer/constants-ms.c vendor/clang/dist/test/Parser/cxx-attributes.cpp vendor/clang/dist/test/Parser/cxx0x-attributes.cpp vendor/clang/dist/test/Parser/cxx0x-literal-operators.cpp vendor/clang/dist/test/SemaCXX/alignof-sizeof-reference.cpp vendor/clang/dist/test/SemaCXX/attr-cxx0x.cpp vendor/clang/dist/test/SemaCXX/attr-sentinel.cpp vendor/clang/dist/test/SemaCXX/member-pointers-2.cpp vendor/clang/dist/test/SemaCXX/switch-0x.cpp vendor/clang/dist/test/SemaTemplate/default-arguments-cxx0x.cpp vendor/clang/dist/test/SemaTemplate/dependent-sized_array.cpp vendor/clang/dist/test/SemaTemplate/overload-uneval.cpp vendor/clang/dist/tools/scan-build/ vendor/clang/dist/tools/scan-build/ccc-analyzer (contents, props changed) vendor/clang/dist/tools/scan-build/scan-build (contents, props changed) vendor/clang/dist/tools/scan-build/scanview.css vendor/clang/dist/tools/scan-build/sorttable.js vendor/clang/dist/utils/C++Tests/LLVM-Code-Compile/ vendor/clang/dist/utils/C++Tests/LLVM-Code-Compile/lit.local.cfg vendor/clang/dist/utils/C++Tests/LLVM-Code-Syntax/ vendor/clang/dist/utils/C++Tests/LLVM-Code-Syntax/lit.local.cfg vendor/clang/dist/utils/analyzer/ubiviz (contents, props changed) Deleted: vendor/clang/dist/include/clang/Analysis/PathSensitive/Checkers/UndefinedAssignmentChecker.h vendor/clang/dist/lib/Analysis/BadCallChecker.cpp vendor/clang/dist/lib/Analysis/GRExprEngineInternalChecks.cpp vendor/clang/dist/lib/Analysis/UndefinedArgChecker.cpp vendor/clang/dist/lib/CodeGen/CGCXXClass.cpp vendor/clang/dist/lib/CodeGen/CGCXXExpr.cpp vendor/clang/dist/lib/CodeGen/CGCXXTemp.cpp vendor/clang/dist/test/Analysis/region-only-test.c vendor/clang/dist/test/CodeCompletion/property.m vendor/clang/dist/test/CodeGen/builtins-ffs_parity_popcount.c vendor/clang/dist/test/CodeGen/builtins-powi.c vendor/clang/dist/test/CodeGenCXX/temp-1.cpp vendor/clang/dist/test/CodeGenObjC/class-obj-hidden-visibility.m vendor/clang/dist/test/CodeGenObjC/hidden-synthesized-ivar.m vendor/clang/dist/test/CodeGenObjC/protocol-definition-hidden-visibility.m vendor/clang/dist/test/Frontend/mmacosx-version-min-test.c vendor/clang/dist/test/Index/c-index-api-test.m vendor/clang/dist/test/Index/c-index-pch.h vendor/clang/dist/test/Index/foo.h vendor/clang/dist/test/Index/objc.h vendor/clang/dist/test/Index/t1.c vendor/clang/dist/test/Index/t1.m vendor/clang/dist/test/Index/t2.c vendor/clang/dist/test/Index/t2.m vendor/clang/dist/test/Misc/diag-checker.c vendor/clang/dist/test/Parser/cxx-parse-member-pointer-op.cpp vendor/clang/dist/tools/wpa/ vendor/clang/dist/utils/ccc-analyzer vendor/clang/dist/utils/scan-build vendor/clang/dist/utils/scanview.css vendor/clang/dist/utils/sorttable.js vendor/clang/dist/utils/test/ vendor/clang/dist/utils/ubiviz Modified: vendor/clang/dist/Makefile vendor/clang/dist/clang.xcodeproj/project.pbxproj vendor/clang/dist/include/clang/AST/ASTContext.h vendor/clang/dist/include/clang/AST/Attr.h vendor/clang/dist/include/clang/AST/Decl.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/DeclCXX.h vendor/clang/dist/include/clang/AST/DeclTemplate.h vendor/clang/dist/include/clang/AST/DeclarationName.h vendor/clang/dist/include/clang/AST/Expr.h vendor/clang/dist/include/clang/AST/ExprCXX.h vendor/clang/dist/include/clang/AST/RecordLayout.h vendor/clang/dist/include/clang/AST/Redeclarable.h vendor/clang/dist/include/clang/AST/Stmt.h vendor/clang/dist/include/clang/AST/StmtCXX.h vendor/clang/dist/include/clang/AST/StmtNodes.def vendor/clang/dist/include/clang/AST/TemplateBase.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/Analysis/Analyses/LiveVariables.h vendor/clang/dist/include/clang/Analysis/PathDiagnostic.h vendor/clang/dist/include/clang/Analysis/PathSensitive/AnalysisContext.h vendor/clang/dist/include/clang/Analysis/PathSensitive/BugReporter.h vendor/clang/dist/include/clang/Analysis/PathSensitive/BugType.h vendor/clang/dist/include/clang/Analysis/PathSensitive/Checker.h vendor/clang/dist/include/clang/Analysis/PathSensitive/CheckerVisitor.def vendor/clang/dist/include/clang/Analysis/PathSensitive/ExplodedGraph.h vendor/clang/dist/include/clang/Analysis/PathSensitive/GRCoreEngine.h vendor/clang/dist/include/clang/Analysis/PathSensitive/GRExprEngine.h vendor/clang/dist/include/clang/Analysis/PathSensitive/GRState.h vendor/clang/dist/include/clang/Analysis/PathSensitive/MemRegion.h vendor/clang/dist/include/clang/Analysis/PathSensitive/ValueManager.h vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/IdentifierTable.h vendor/clang/dist/include/clang/Basic/LangOptions.h vendor/clang/dist/include/clang/Basic/OnDiskHashTable.h vendor/clang/dist/include/clang/Basic/TargetInfo.h vendor/clang/dist/include/clang/Basic/TokenKinds.def vendor/clang/dist/include/clang/CodeGen/CodeGenOptions.h vendor/clang/dist/include/clang/Driver/ArgList.h vendor/clang/dist/include/clang/Driver/CC1Options.h vendor/clang/dist/include/clang/Driver/CC1Options.td vendor/clang/dist/include/clang/Driver/Makefile vendor/clang/dist/include/clang/Driver/OptParser.td vendor/clang/dist/include/clang/Driver/OptSpecifier.h vendor/clang/dist/include/clang/Driver/Options.h vendor/clang/dist/include/clang/Frontend/ASTConsumers.h vendor/clang/dist/include/clang/Frontend/ASTUnit.h vendor/clang/dist/include/clang/Frontend/AnalysisConsumer.h vendor/clang/dist/include/clang/Frontend/CommandLineSourceLoc.h vendor/clang/dist/include/clang/Frontend/CompilerInstance.h vendor/clang/dist/include/clang/Frontend/CompilerInvocation.h vendor/clang/dist/include/clang/Frontend/DeclXML.def vendor/clang/dist/include/clang/Frontend/FrontendAction.h vendor/clang/dist/include/clang/Frontend/FrontendOptions.h vendor/clang/dist/include/clang/Frontend/PCHBitCodes.h vendor/clang/dist/include/clang/Frontend/PathDiagnosticClients.h vendor/clang/dist/include/clang/Frontend/StmtXML.def vendor/clang/dist/include/clang/Frontend/TextDiagnosticBuffer.h vendor/clang/dist/include/clang/Lex/Lexer.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Parse/Action.h vendor/clang/dist/include/clang/Parse/AttributeList.h vendor/clang/dist/include/clang/Parse/DeclSpec.h vendor/clang/dist/include/clang/Parse/Parser.h vendor/clang/dist/include/clang/Sema/CodeCompleteConsumer.h vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/Decl.cpp vendor/clang/dist/lib/AST/DeclBase.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/DeclPrinter.cpp vendor/clang/dist/lib/AST/DeclTemplate.cpp vendor/clang/dist/lib/AST/DeclarationName.cpp vendor/clang/dist/lib/AST/Expr.cpp vendor/clang/dist/lib/AST/ExprCXX.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/RecordLayoutBuilder.cpp vendor/clang/dist/lib/AST/RecordLayoutBuilder.h vendor/clang/dist/lib/AST/Stmt.cpp vendor/clang/dist/lib/AST/StmtDumper.cpp vendor/clang/dist/lib/AST/StmtPrinter.cpp vendor/clang/dist/lib/AST/StmtProfile.cpp vendor/clang/dist/lib/AST/StmtViz.cpp vendor/clang/dist/lib/AST/TemplateBase.cpp vendor/clang/dist/lib/AST/Type.cpp vendor/clang/dist/lib/AST/TypePrinter.cpp vendor/clang/dist/lib/Analysis/AnalysisContext.cpp vendor/clang/dist/lib/Analysis/ArrayBoundChecker.cpp vendor/clang/dist/lib/Analysis/AttrNonNullChecker.cpp vendor/clang/dist/lib/Analysis/BasicConstraintManager.cpp vendor/clang/dist/lib/Analysis/BasicObjCFoundationChecks.cpp vendor/clang/dist/lib/Analysis/BasicObjCFoundationChecks.h vendor/clang/dist/lib/Analysis/BasicStore.cpp vendor/clang/dist/lib/Analysis/BugReporter.cpp vendor/clang/dist/lib/Analysis/BugReporterVisitors.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Analysis/CFRefCount.cpp vendor/clang/dist/lib/Analysis/CMakeLists.txt vendor/clang/dist/lib/Analysis/CallGraph.cpp vendor/clang/dist/lib/Analysis/CallInliner.cpp vendor/clang/dist/lib/Analysis/CastToStructChecker.cpp vendor/clang/dist/lib/Analysis/CheckDeadStores.cpp vendor/clang/dist/lib/Analysis/CheckObjCDealloc.cpp vendor/clang/dist/lib/Analysis/CheckObjCInstMethSignature.cpp vendor/clang/dist/lib/Analysis/CheckObjCUnusedIVars.cpp vendor/clang/dist/lib/Analysis/CheckSecuritySyntaxOnly.cpp vendor/clang/dist/lib/Analysis/CheckSizeofPointer.cpp vendor/clang/dist/lib/Analysis/DereferenceChecker.cpp vendor/clang/dist/lib/Analysis/DivZeroChecker.cpp vendor/clang/dist/lib/Analysis/Environment.cpp vendor/clang/dist/lib/Analysis/FixedAddressChecker.cpp vendor/clang/dist/lib/Analysis/GRCoreEngine.cpp vendor/clang/dist/lib/Analysis/GRExprEngine.cpp vendor/clang/dist/lib/Analysis/GRExprEngineExperimentalChecks.cpp vendor/clang/dist/lib/Analysis/GRExprEngineInternalChecks.h vendor/clang/dist/lib/Analysis/GRState.cpp vendor/clang/dist/lib/Analysis/LiveVariables.cpp vendor/clang/dist/lib/Analysis/MallocChecker.cpp vendor/clang/dist/lib/Analysis/MemRegion.cpp vendor/clang/dist/lib/Analysis/NSAutoreleasePoolChecker.cpp vendor/clang/dist/lib/Analysis/NSErrorChecker.cpp vendor/clang/dist/lib/Analysis/PointerArithChecker.cpp vendor/clang/dist/lib/Analysis/PointerSubChecker.cpp vendor/clang/dist/lib/Analysis/PthreadLockChecker.cpp vendor/clang/dist/lib/Analysis/RangeConstraintManager.cpp vendor/clang/dist/lib/Analysis/RegionStore.cpp vendor/clang/dist/lib/Analysis/ReturnPointerRangeChecker.cpp vendor/clang/dist/lib/Analysis/ReturnStackAddressChecker.cpp vendor/clang/dist/lib/Analysis/ReturnUndefChecker.cpp vendor/clang/dist/lib/Analysis/SVals.cpp vendor/clang/dist/lib/Analysis/SimpleSValuator.cpp vendor/clang/dist/lib/Analysis/Store.cpp vendor/clang/dist/lib/Analysis/UndefinedArraySubscriptChecker.cpp vendor/clang/dist/lib/Analysis/UndefinedAssignmentChecker.cpp vendor/clang/dist/lib/Analysis/UninitializedValues.cpp vendor/clang/dist/lib/Analysis/VLASizeChecker.cpp vendor/clang/dist/lib/Analysis/ValueManager.cpp vendor/clang/dist/lib/Basic/TargetInfo.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/Basic/TokenKinds.cpp vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGCXX.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGDecl.cpp vendor/clang/dist/lib/CodeGen/CGException.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGExprAgg.cpp vendor/clang/dist/lib/CodeGen/CGExprComplex.cpp vendor/clang/dist/lib/CodeGen/CGExprConstant.cpp vendor/clang/dist/lib/CodeGen/CGExprScalar.cpp vendor/clang/dist/lib/CodeGen/CGObjCGNU.cpp vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp vendor/clang/dist/lib/CodeGen/CGRecordLayoutBuilder.cpp vendor/clang/dist/lib/CodeGen/CGRtti.cpp vendor/clang/dist/lib/CodeGen/CGStmt.cpp vendor/clang/dist/lib/CodeGen/CGVtable.cpp vendor/clang/dist/lib/CodeGen/CGVtable.h vendor/clang/dist/lib/CodeGen/CMakeLists.txt vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/CodeGen/CodeGenTypes.cpp vendor/clang/dist/lib/CodeGen/CodeGenTypes.h vendor/clang/dist/lib/CodeGen/Mangle.cpp vendor/clang/dist/lib/CodeGen/Mangle.h vendor/clang/dist/lib/CodeGen/ModuleBuilder.cpp vendor/clang/dist/lib/CodeGen/TargetABIInfo.cpp vendor/clang/dist/lib/Driver/ArgList.cpp vendor/clang/dist/lib/Driver/CC1Options.cpp vendor/clang/dist/lib/Driver/Compilation.cpp vendor/clang/dist/lib/Driver/Driver.cpp vendor/clang/dist/lib/Driver/DriverOptions.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Driver/Types.cpp vendor/clang/dist/lib/Frontend/ASTUnit.cpp vendor/clang/dist/lib/Frontend/AnalysisConsumer.cpp vendor/clang/dist/lib/Frontend/Backend.cpp vendor/clang/dist/lib/Frontend/CMakeLists.txt vendor/clang/dist/lib/Frontend/CacheTokens.cpp vendor/clang/dist/lib/Frontend/CompilerInstance.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/DependencyFile.cpp vendor/clang/dist/lib/Frontend/DiagChecker.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/GeneratePCH.cpp vendor/clang/dist/lib/Frontend/HTMLDiagnostics.cpp vendor/clang/dist/lib/Frontend/InitHeaderSearch.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Frontend/PCHReader.cpp vendor/clang/dist/lib/Frontend/PCHReaderDecl.cpp vendor/clang/dist/lib/Frontend/PCHReaderStmt.cpp vendor/clang/dist/lib/Frontend/PCHWriter.cpp vendor/clang/dist/lib/Frontend/PCHWriterStmt.cpp vendor/clang/dist/lib/Frontend/PlistDiagnostics.cpp vendor/clang/dist/lib/Frontend/PrintParserCallbacks.cpp vendor/clang/dist/lib/Frontend/RewriteMacros.cpp vendor/clang/dist/lib/Frontend/RewriteObjC.cpp vendor/clang/dist/lib/Frontend/StmtXML.cpp vendor/clang/dist/lib/Frontend/TextDiagnosticBuffer.cpp vendor/clang/dist/lib/Frontend/VerifyDiagnosticsClient.cpp vendor/clang/dist/lib/Headers/stdint.h vendor/clang/dist/lib/Index/Analyzer.cpp vendor/clang/dist/lib/Index/DeclReferenceMap.cpp vendor/clang/dist/lib/Index/ResolveLocation.cpp vendor/clang/dist/lib/Index/SelectorMap.cpp vendor/clang/dist/lib/Lex/Lexer.cpp vendor/clang/dist/lib/Lex/LiteralSupport.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/PTHLexer.cpp vendor/clang/dist/lib/Parse/AttributeList.cpp vendor/clang/dist/lib/Parse/MinimalAction.cpp vendor/clang/dist/lib/Parse/ParseCXXInlineMethods.cpp vendor/clang/dist/lib/Parse/ParseDecl.cpp vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Parse/ParseObjc.cpp vendor/clang/dist/lib/Parse/ParseStmt.cpp vendor/clang/dist/lib/Parse/ParseTemplate.cpp vendor/clang/dist/lib/Parse/ParseTentative.cpp vendor/clang/dist/lib/Parse/Parser.cpp vendor/clang/dist/lib/Rewrite/HTMLRewrite.cpp vendor/clang/dist/lib/Rewrite/TokenRewriter.cpp vendor/clang/dist/lib/Sema/CodeCompleteConsumer.cpp vendor/clang/dist/lib/Sema/Lookup.h vendor/clang/dist/lib/Sema/ParseAST.cpp vendor/clang/dist/lib/Sema/Sema.cpp vendor/clang/dist/lib/Sema/Sema.h vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaInit.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaTemplate.cpp vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/test/Analysis/MissingDealloc.m vendor/clang/dist/test/Analysis/casts.c vendor/clang/dist/test/Analysis/casts.m vendor/clang/dist/test/Analysis/cfref_PR2519.c vendor/clang/dist/test/Analysis/concrete-address.c vendor/clang/dist/test/Analysis/dead-stores.c vendor/clang/dist/test/Analysis/fields.c vendor/clang/dist/test/Analysis/misc-ps-64.m vendor/clang/dist/test/Analysis/misc-ps-basic-store.m vendor/clang/dist/test/Analysis/misc-ps-eager-assume.m vendor/clang/dist/test/Analysis/misc-ps-ranges.m vendor/clang/dist/test/Analysis/misc-ps-region-store-i386.m vendor/clang/dist/test/Analysis/misc-ps-region-store-x86_64.m vendor/clang/dist/test/Analysis/misc-ps-region-store.m vendor/clang/dist/test/Analysis/misc-ps.m vendor/clang/dist/test/Analysis/nil-receiver-undefined-larger-than-voidptr-ret.m vendor/clang/dist/test/Analysis/null-deref-ps.c vendor/clang/dist/test/Analysis/plist-output.m vendor/clang/dist/test/Analysis/rdar-6442306-1.m vendor/clang/dist/test/Analysis/rdar-6600344-nil-receiver-undefined-struct-ret.m vendor/clang/dist/test/Analysis/retain-release-gc-only.m vendor/clang/dist/test/Analysis/retain-release.m vendor/clang/dist/test/Analysis/stack-addr-ps.c vendor/clang/dist/test/Analysis/uninit-msg-expr.m vendor/clang/dist/test/Analysis/uninit-ps-rdar6145427.m vendor/clang/dist/test/Analysis/unused-ivars.m vendor/clang/dist/test/CMakeLists.txt vendor/clang/dist/test/CXX/basic/basic.lookup/basic.lookup.unqual/p15.cpp vendor/clang/dist/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp vendor/clang/dist/test/CXX/temp/temp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp vendor/clang/dist/test/CXX/temp/temp.decls/temp.class/temp.mem.func/p1.cpp vendor/clang/dist/test/CXX/temp/temp.param/p2.cpp vendor/clang/dist/test/CodeGen/2008-07-17-no-emit-on-error.c vendor/clang/dist/test/CodeGen/2008-07-22-bitfield-init-after-zero-len-array.c vendor/clang/dist/test/CodeGen/2008-07-30-implicit-initialization.c vendor/clang/dist/test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c vendor/clang/dist/test/CodeGen/2008-08-04-void-pointer-arithmetic.c vendor/clang/dist/test/CodeGen/2008-08-19-cast-of-typedef.c vendor/clang/dist/test/CodeGen/PR2001-bitfield-reload.c vendor/clang/dist/test/CodeGen/arm-arguments.c vendor/clang/dist/test/CodeGen/const-init.c vendor/clang/dist/test/CodeGen/debug-info.c vendor/clang/dist/test/CodeGen/flexible-array-init.c vendor/clang/dist/test/CodeGen/func-return-member.c vendor/clang/dist/test/CodeGen/incomplete-function-type.c vendor/clang/dist/test/CodeGen/rdr-6098585-default-after-caserange.c vendor/clang/dist/test/CodeGen/rdr-6098585-default-fallthrough-to-caserange.c vendor/clang/dist/test/CodeGen/rdr-6098585-empty-case-range.c vendor/clang/dist/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c vendor/clang/dist/test/CodeGen/rdr-6098585-unsigned-caserange.c vendor/clang/dist/test/CodeGen/stack-protector.c vendor/clang/dist/test/CodeGen/static-order.c vendor/clang/dist/test/CodeGen/switch.c vendor/clang/dist/test/CodeGen/vector.c vendor/clang/dist/test/CodeGen/visibility.c vendor/clang/dist/test/CodeGenCXX/const-init.cpp vendor/clang/dist/test/CodeGenCXX/copy-constructor-synthesis.cpp vendor/clang/dist/test/CodeGenCXX/default-arguments.cpp vendor/clang/dist/test/CodeGenCXX/dyncast.cpp vendor/clang/dist/test/CodeGenCXX/member-expressions.cpp vendor/clang/dist/test/CodeGenCXX/member-function-pointers.cpp vendor/clang/dist/test/CodeGenCXX/new.cpp vendor/clang/dist/test/CodeGenCXX/references.cpp vendor/clang/dist/test/CodeGenCXX/virt.cpp vendor/clang/dist/test/CodeGenCXX/virtual-base-cast.cpp vendor/clang/dist/test/CodeGenCXX/x86_64-arguments.cpp vendor/clang/dist/test/CodeGenObjC/constant-strings.m vendor/clang/dist/test/CodeGenObjC/continuation-class.m vendor/clang/dist/test/CodeGenObjC/dot-syntax-1.m vendor/clang/dist/test/CodeGenObjC/dot-syntax.m vendor/clang/dist/test/CodeGenObjC/encode-test.m vendor/clang/dist/test/CodeGenObjC/hidden-visibility.m vendor/clang/dist/test/CodeGenObjC/hidden.m vendor/clang/dist/test/CodeGenObjC/messages-2.m vendor/clang/dist/test/CodeGenObjC/messages.m vendor/clang/dist/test/CodeGenObjC/metadata_symbols.m vendor/clang/dist/test/CodeGenObjC/newproperty-nested-synthesis-1.m vendor/clang/dist/test/CodeGenObjC/property-getter-dot-syntax.m vendor/clang/dist/test/CodeGenObjC/property.m vendor/clang/dist/test/CodeGenObjC/variadic-sends.m vendor/clang/dist/test/Coverage/ast-printing.c vendor/clang/dist/test/Coverage/ast-printing.cpp vendor/clang/dist/test/Coverage/ast-printing.m vendor/clang/dist/test/Coverage/parse-callbacks.c vendor/clang/dist/test/Coverage/parse-callbacks.m vendor/clang/dist/test/Driver/clang-translation.c vendor/clang/dist/test/Driver/flags.c vendor/clang/dist/test/Frontend/rewrite-macros.c vendor/clang/dist/test/Index/c-index-api-loadTU-test.m vendor/clang/dist/test/PCH/method_pool.m vendor/clang/dist/test/PCH/objc_import.m vendor/clang/dist/test/PCH/objc_methods.m vendor/clang/dist/test/PCH/objc_property.m vendor/clang/dist/test/PCH/reloc.c vendor/clang/dist/test/Parser/MicrosoftExtensions.c vendor/clang/dist/test/Parser/attributes.c vendor/clang/dist/test/Parser/cxx-template-decl.cpp vendor/clang/dist/test/Parser/cxx-using-declaration.cpp vendor/clang/dist/test/Parser/if-scope-c90.c vendor/clang/dist/test/Parser/if-scope-c99.c vendor/clang/dist/test/Preprocessor/assembler-with-cpp.c vendor/clang/dist/test/Preprocessor/cxx_true.cpp vendor/clang/dist/test/Preprocessor/feature_tests.c vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Preprocessor/line-directive.c vendor/clang/dist/test/Preprocessor/macro_paste_bcpl_comment.c vendor/clang/dist/test/Preprocessor/stdint.c vendor/clang/dist/test/Rewriter/id-test-3.m vendor/clang/dist/test/Rewriter/ivar-encoding-1.m vendor/clang/dist/test/Rewriter/ivar-encoding-2.m vendor/clang/dist/test/Rewriter/metadata-test-1.m vendor/clang/dist/test/Rewriter/metadata-test-2.m vendor/clang/dist/test/Rewriter/method-encoding-1.m vendor/clang/dist/test/Rewriter/objc-encoding-bug-1.m vendor/clang/dist/test/Rewriter/objc-string-concat-1.m vendor/clang/dist/test/Rewriter/objc-synchronized-1.m vendor/clang/dist/test/Rewriter/protocol-rewrite-1.m vendor/clang/dist/test/Rewriter/rewrite-api-bug.m vendor/clang/dist/test/Rewriter/rewrite-foreach-1.m vendor/clang/dist/test/Rewriter/rewrite-foreach-2.m vendor/clang/dist/test/Rewriter/rewrite-foreach-3.m vendor/clang/dist/test/Rewriter/rewrite-foreach-4.m vendor/clang/dist/test/Rewriter/rewrite-foreach-5.m vendor/clang/dist/test/Rewriter/rewrite-foreach-6.m vendor/clang/dist/test/Rewriter/rewrite-nest.m vendor/clang/dist/test/Rewriter/rewrite-protocol-type-1.m vendor/clang/dist/test/Rewriter/rewrite-try-catch.m vendor/clang/dist/test/Rewriter/static-type-protocol-1.m vendor/clang/dist/test/Rewriter/undecl-objc-h.m vendor/clang/dist/test/Rewriter/undeclared-method-1.m vendor/clang/dist/test/Rewriter/undef-field-reference-1.m vendor/clang/dist/test/Rewriter/va-method.m vendor/clang/dist/test/Sema/align-arm-apcs.c vendor/clang/dist/test/Sema/altivec-init.c vendor/clang/dist/test/Sema/carbon.c vendor/clang/dist/test/Sema/cast.c vendor/clang/dist/test/Sema/exprs.c vendor/clang/dist/test/Sema/switch.c vendor/clang/dist/test/Sema/wchar.c vendor/clang/dist/test/SemaCXX/class-layout.cpp vendor/clang/dist/test/SemaCXX/class.cpp vendor/clang/dist/test/SemaCXX/condition.cpp vendor/clang/dist/test/SemaCXX/converting-constructor.cpp vendor/clang/dist/test/SemaCXX/implicit-int.cpp vendor/clang/dist/test/SemaCXX/nested-name-spec.cpp vendor/clang/dist/test/SemaCXX/new-delete.cpp vendor/clang/dist/test/SemaCXX/pseudo-destructors.cpp vendor/clang/dist/test/SemaCXX/qual-id-test.cpp vendor/clang/dist/test/SemaCXX/reinterpret-cast.cpp vendor/clang/dist/test/SemaCXX/switch.cpp vendor/clang/dist/test/SemaCXX/typedef-redecl.cpp vendor/clang/dist/test/SemaCXX/using-directive.cpp vendor/clang/dist/test/SemaObjC/cocoa.m vendor/clang/dist/test/SemaObjC/foreach.m vendor/clang/dist/test/SemaObjC/ivar-ref-misuse.m vendor/clang/dist/test/SemaTemplate/current-instantiation.cpp vendor/clang/dist/test/SemaTemplate/dependent-names.cpp vendor/clang/dist/test/SemaTemplate/destructor-template.cpp vendor/clang/dist/test/SemaTemplate/instantiate-function-1.cpp vendor/clang/dist/test/SemaTemplate/instantiate-member-template.cpp vendor/clang/dist/test/SemaTemplate/instantiate-method.cpp vendor/clang/dist/test/SemaTemplate/instantiate-static-var.cpp vendor/clang/dist/test/SemaTemplate/instantiation-depth.cpp vendor/clang/dist/test/SemaTemplate/nested-name-spec-template.cpp vendor/clang/dist/test/SemaTemplate/qualified-id.cpp vendor/clang/dist/test/SemaTemplate/temp_arg_nontype.cpp vendor/clang/dist/test/SemaTemplate/temp_explicit.cpp vendor/clang/dist/tools/CIndex/CIndex.cpp vendor/clang/dist/tools/CMakeLists.txt vendor/clang/dist/tools/c-index-test/CMakeLists.txt vendor/clang/dist/tools/c-index-test/Makefile vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/clang-cc/CMakeLists.txt vendor/clang/dist/tools/clang-cc/Makefile vendor/clang/dist/tools/clang-cc/Options.cpp vendor/clang/dist/tools/clang-cc/Options.h vendor/clang/dist/tools/clang-cc/clang-cc.cpp vendor/clang/dist/tools/driver/CMakeLists.txt vendor/clang/dist/tools/driver/Makefile vendor/clang/dist/tools/driver/cc1_main.cpp vendor/clang/dist/tools/driver/driver.cpp vendor/clang/dist/tools/index-test/CMakeLists.txt vendor/clang/dist/tools/index-test/Makefile vendor/clang/dist/tools/index-test/index-test.cpp vendor/clang/dist/utils/C++Tests/Clang-Code-Compile/lit.local.cfg vendor/clang/dist/utils/C++Tests/Clang-Syntax/lit.local.cfg vendor/clang/dist/utils/C++Tests/LLVM-Syntax/lit.local.cfg vendor/clang/dist/utils/C++Tests/lit.cfg vendor/clang/dist/www/analyzer/installation.html vendor/clang/dist/www/analyzer/latest_checker.html.incl vendor/clang/dist/www/cxx_status.html Modified: vendor/clang/dist/Makefile ============================================================================== --- vendor/clang/dist/Makefile Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/Makefile Tue Dec 1 11:08:04 2009 (r199990) @@ -45,7 +45,7 @@ install-local:: for hdr in `find . -type f '!' '(' -name '*~' \ -o -name '.#*' -o -name '*.in' -o -name '*.txt' \ -o -name 'Makefile' -o -name '*.td' ')' -print \ - | grep -v CVS | grep -v .svn` ; do \ + | grep -v CVS | grep -v .svn | grep -v .dir` ; do \ instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \ if test \! -d "$$instdir" ; then \ $(EchoCmd) Making install directory $$instdir ; \ @@ -58,7 +58,7 @@ ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT) $(Verb) if test -d "$(PROJ_OBJ_ROOT)/tools/clang/include" ; then \ cd $(PROJ_OBJ_ROOT)/tools/clang/include && \ for hdr in `find . -type f '!' '(' -name 'Makefile' ')' -print \ - | grep -v CVS | grep -v .tmp` ; do \ + | grep -v CVS | grep -v .tmp | grep -v .dir` ; do \ $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \ done ; \ fi Modified: vendor/clang/dist/clang.xcodeproj/project.pbxproj ============================================================================== --- vendor/clang/dist/clang.xcodeproj/project.pbxproj Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/clang.xcodeproj/project.pbxproj Tue Dec 1 11:08:04 2009 (r199990) @@ -31,14 +31,14 @@ 1A32C17F0E1C87AD00A6B483 /* ExprConstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */; }; 1A376A2D0D4AED9B002A1C52 /* CGExprConstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */; }; 1A471AB50F437BC500753CE8 /* CGBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */; }; - 1A4C41BF105B4C0B0047B5E7 /* CGCXXClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4C41BE105B4C0B0047B5E7 /* CGCXXClass.cpp */; }; + 1A4C41BF105B4C0B0047B5E7 /* CGClass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4C41BE105B4C0B0047B5E7 /* CGClass.cpp */; }; 1A535ED9107BC45E000C3AE7 /* CXXInheritance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A535ED8107BC45E000C3AE7 /* CXXInheritance.cpp */; }; 1A5D5E580E5E81010023C059 /* CGCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5D5E570E5E81010023C059 /* CGCXX.cpp */; }; 1A6B6CD410693FC900BB4A8F /* CodeCompleteConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6CD110693FC900BB4A8F /* CodeCompleteConsumer.cpp */; }; 1A6B6CD510693FC900BB4A8F /* SemaCodeComplete.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */; }; - 1A6B6E9A1069833600BB4A8F /* CGCXXExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6E991069833600BB4A8F /* CGCXXExpr.cpp */; }; + 1A6B6E9A1069833600BB4A8F /* CGExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */; }; 1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6C01F6108128710072DEE4 /* CGRtti.cpp */; }; - 1A6FE7090FD6F85800E00CA9 /* CGCXXTemp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */; }; + 1A6FE7090FD6F85800E00CA9 /* CGTemporaries.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FE7080FD6F85800E00CA9 /* CGTemporaries.cpp */; }; 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */; }; 1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7342470C7B57D500122F56 /* CGObjC.cpp */; }; 1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A81AA18108144F40094E50B /* CGVtable.cpp */; }; @@ -369,7 +369,7 @@ 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprConstant.cpp; path = lib/AST/ExprConstant.cpp; sourceTree = ""; tabWidth = 2; }; 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprConstant.cpp; path = lib/CodeGen/CGExprConstant.cpp; sourceTree = ""; tabWidth = 2; }; 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBlocks.cpp; path = lib/CodeGen/CGBlocks.cpp; sourceTree = ""; tabWidth = 2; }; - 1A4C41BE105B4C0B0047B5E7 /* CGCXXClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXClass.cpp; path = lib/CodeGen/CGCXXClass.cpp; sourceTree = ""; tabWidth = 2; }; + 1A4C41BE105B4C0B0047B5E7 /* CGClass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGClass.cpp; path = lib/CodeGen/CGClass.cpp; sourceTree = ""; tabWidth = 2; }; 1A535ED8107BC45E000C3AE7 /* CXXInheritance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXInheritance.cpp; path = lib/AST/CXXInheritance.cpp; sourceTree = ""; }; 1A535EDB107BC47B000C3AE7 /* CanonicalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanonicalType.h; path = clang/AST/CanonicalType.h; sourceTree = ""; }; 1A5D5E570E5E81010023C059 /* CGCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXX.cpp; path = lib/CodeGen/CGCXX.cpp; sourceTree = ""; tabWidth = 2; }; @@ -378,9 +378,9 @@ 1A6B6CD110693FC900BB4A8F /* CodeCompleteConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeCompleteConsumer.cpp; path = lib/Sema/CodeCompleteConsumer.cpp; sourceTree = ""; tabWidth = 2; }; 1A6B6CD210693FC900BB4A8F /* SemaCodeComplete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCodeComplete.cpp; path = lib/Sema/SemaCodeComplete.cpp; sourceTree = ""; tabWidth = 2; }; 1A6B6CD310693FC900BB4A8F /* SemaTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaTemplate.h; path = lib/Sema/SemaTemplate.h; sourceTree = ""; tabWidth = 2; }; - 1A6B6E991069833600BB4A8F /* CGCXXExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXExpr.cpp; path = lib/CodeGen/CGCXXExpr.cpp; sourceTree = ""; tabWidth = 2; }; + 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprCXX.cpp; path = lib/CodeGen/CGExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; 1A6C01F6108128710072DEE4 /* CGRtti.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRtti.cpp; path = lib/CodeGen/CGRtti.cpp; sourceTree = ""; tabWidth = 2; }; - 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXTemp.cpp; path = lib/CodeGen/CGCXXTemp.cpp; sourceTree = ""; tabWidth = 2; }; + 1A6FE7080FD6F85800E00CA9 /* CGTemporaries.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGTemporaries.cpp; path = lib/CodeGen/CGTemporaries.cpp; sourceTree = ""; tabWidth = 2; }; 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = ""; }; 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = ""; }; 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticCommonKinds.td; sourceTree = ""; }; @@ -1265,11 +1265,10 @@ 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */, 35475B1F0E79973F0000BFE4 /* CGCall.cpp */, 35475B220E7997680000BFE4 /* CGCall.h */, + 1A4C41BE105B4C0B0047B5E7 /* CGClass.cpp */, 1A5D5E570E5E81010023C059 /* CGCXX.cpp */, 1A649E1E0F9599DA005B965E /* CGCXX.h */, - 1A4C41BE105B4C0B0047B5E7 /* CGCXXClass.cpp */, - 1A6B6E991069833600BB4A8F /* CGCXXExpr.cpp */, - 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */, + 1A6B6E991069833600BB4A8F /* CGExprCXX.cpp */, 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */, 35A3E7010DD3874400757F74 /* CGDebugInfo.h */, DE4264FB0C113592005A861D /* CGDecl.cpp */, @@ -1287,6 +1286,7 @@ 1AFF8AE21012BFC900D248DA /* CGRecordLayoutBuilder.h */, 1A6C01F6108128710072DEE4 /* CGRtti.cpp */, DE4772F90C10EAE5002239E8 /* CGStmt.cpp */, + 1A6FE7080FD6F85800E00CA9 /* CGTemporaries.cpp */, 35475B230E7997680000BFE4 /* CGValue.h */, 1A81AA18108144F40094E50B /* CGVtable.cpp */, 1A81AA5D108278A20094E50B /* CGVtable.h */, @@ -1899,7 +1899,7 @@ 1A2A54C30FD1DD1C00F4CE45 /* RewriteTest.cpp in Sources */, 1A2A54C40FD1DD1C00F4CE45 /* StmtXML.cpp in Sources */, 1A2A54C50FD1DD1C00F4CE45 /* Warnings.cpp in Sources */, - 1A6FE7090FD6F85800E00CA9 /* CGCXXTemp.cpp in Sources */, + 1A6FE7090FD6F85800E00CA9 /* CGTemporaries.cpp in Sources */, BDF87CF70FD746F300BBF872 /* SemaTemplateDeduction.cpp in Sources */, 1A14D3A70FD78A3F00DA2835 /* DeclPrinter.cpp in Sources */, DE37252E0FE481AD00CF2CC2 /* Builtins.cpp in Sources */, @@ -1922,10 +1922,10 @@ 9012911D1048068D0083456D /* ASTUnit.cpp in Sources */, 90129121104812F90083456D /* CIndex.cpp in Sources */, 90F9EFAA104ABDED00D09A15 /* c-index-test.c in Sources */, - 1A4C41BF105B4C0B0047B5E7 /* CGCXXClass.cpp in Sources */, + 1A4C41BF105B4C0B0047B5E7 /* CGClass.cpp in Sources */, 1A6B6CD410693FC900BB4A8F /* CodeCompleteConsumer.cpp in Sources */, 1A6B6CD510693FC900BB4A8F /* SemaCodeComplete.cpp in Sources */, - 1A6B6E9A1069833600BB4A8F /* CGCXXExpr.cpp in Sources */, + 1A6B6E9A1069833600BB4A8F /* CGExprCXX.cpp in Sources */, 1A535ED9107BC45E000C3AE7 /* CXXInheritance.cpp in Sources */, 1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */, 1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */, Modified: vendor/clang/dist/include/clang/AST/ASTContext.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ASTContext.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/ASTContext.h Tue Dec 1 11:08:04 2009 (r199990) @@ -120,8 +120,7 @@ class ASTContext { QualType ObjCIdTypedefType; /// ObjCSelType - another pseudo built-in typedef type (set by Sema). - QualType ObjCSelType; - const RecordType *SelStructType; + QualType ObjCSelTypedefType; /// ObjCProtoType - another pseudo built-in typedef type (set by Sema). QualType ObjCProtoType; @@ -244,6 +243,7 @@ public: // pseudo-builtins QualType ObjCIdRedefinitionType; QualType ObjCClassRedefinitionType; + QualType ObjCSelRedefinitionType; /// \brief Source ranges for all of the comments in the source file, /// sorted in order of appearance in the translation unit. @@ -316,7 +316,7 @@ public: CanQualType OverloadTy; CanQualType DependentTy; CanQualType UndeducedAutoTy; - CanQualType ObjCBuiltinIdTy, ObjCBuiltinClassTy; + CanQualType ObjCBuiltinIdTy, ObjCBuiltinClassTy, ObjCBuiltinSelTy; ASTContext(const LangOptions& LOpts, SourceManager &SM, const TargetInfo &t, IdentifierTable &idents, SelectorTable &sels, @@ -532,8 +532,7 @@ public: QualType Canon = QualType()); QualType getTemplateSpecializationType(TemplateName T, - const TemplateArgumentLoc *Args, - unsigned NumArgs, + const TemplateArgumentListInfo &Args, QualType Canon = QualType()); QualType getQualifiedNameType(NestedNameSpecifier *NNS, @@ -696,7 +695,7 @@ public: void setObjCIdType(QualType T); void setObjCSelType(QualType T); - QualType getObjCSelType() const { return ObjCSelType; } + QualType getObjCSelType() const { return ObjCSelTypedefType; } void setObjCProtoType(QualType QT); QualType getObjCProtoType() const { return ObjCProtoType; } @@ -734,6 +733,8 @@ public: return getExtQualType(T, Qs); } + DeclarationName getNameForTemplate(TemplateName Name); + TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template); @@ -796,6 +797,20 @@ public: return getTypeInfo(T).first; } + /// getByteWidth - Return the size of a byte, in bits + uint64_t getByteSize() { + return getTypeSize(CharTy); + } + + /// getTypeSizeInBytes - Return the size of the specified type, in bytes. + /// This method does not work on incomplete types. + uint64_t getTypeSizeInBytes(QualType T) { + return getTypeSize(T) / getByteSize(); + } + uint64_t getTypeSizeInBytes(const Type *T) { + return getTypeSize(T) / getByteSize(); + } + /// getTypeAlign - Return the ABI-specified alignment of a type, in bits. /// This method does not work on incomplete types. unsigned getTypeAlign(QualType T) { @@ -811,10 +826,7 @@ public: /// a data type. unsigned getPreferredTypeAlign(const Type *T); - /// getDeclAlignInBytes - Return the alignment of the specified decl - /// that should be returned by __alignof(). Note that bitfields do - /// not have a valid alignment, so this method will assert on them. - unsigned getDeclAlignInBytes(const Decl *D); + unsigned getDeclAlignInBytes(const Decl *D, bool RefAsPointee = false); /// getASTRecordLayout - Get or compute information about the layout of the /// specified record (struct/union/class), which indicates its size and field @@ -1023,8 +1035,7 @@ public: return T == ObjCClassTypedefType; } bool isObjCSelType(QualType T) const { - assert(SelStructType && "isObjCSelType used before 'SEL' type is built"); - return T->getAsStructureType() == SelStructType; + return T == ObjCSelTypedefType; } bool QualifiedIdConformsQualifiedId(QualType LHS, QualType RHS); bool ObjCQualifiedIdTypesAreCompatible(QualType LHS, QualType RHS, Modified: vendor/clang/dist/include/clang/AST/Attr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Attr.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/Attr.h Tue Dec 1 11:08:04 2009 (r199990) @@ -15,12 +15,12 @@ #define LLVM_CLANG_AST_ATTR_H #include "llvm/Support/Casting.h" -using llvm::dyn_cast; - +#include "llvm/ADT/StringRef.h" #include #include #include #include +using llvm::dyn_cast; namespace clang { class ASTContext; @@ -49,6 +49,7 @@ public: AnalyzerNoReturn, // Clang-specific. Annotate, AsmLabel, // Represent GCC asm label extension. + BaseCheck, Blocks, CDecl, Cleanup, @@ -59,9 +60,11 @@ public: Deprecated, Destructor, FastCall, + Final, Format, FormatArg, GNUInline, + Hiding, IBOutletKind, // Clang-specific. Use "Kind" suffix to not conflict with Malloc, NoDebug, @@ -71,6 +74,7 @@ public: NoThrow, ObjCException, ObjCNSObject, + Override, CFReturnsRetained, // Clang/Checker-specific. NSReturnsRetained, // Clang/Checker-specific. Overloadable, // Clang-specific @@ -184,12 +188,24 @@ public: class AlignedAttr : public Attr { unsigned Alignment; public: - AlignedAttr(unsigned alignment) : Attr(Aligned), Alignment(alignment) {} + AlignedAttr(unsigned alignment) + : Attr(Aligned), Alignment(alignment) {} /// getAlignment - The specified alignment in bits. unsigned getAlignment() const { return Alignment; } + + /// getMaxAlignment - Get the maximum alignment of attributes on this list. + unsigned getMaxAlignment() const { + const AlignedAttr *Next = getNext(); + if (Next) + return std::max(Next->getMaxAlignment(), Alignment); + else + return Alignment; + } - virtual Attr* clone(ASTContext &C) const { return ::new (C) AlignedAttr(Alignment); } + virtual Attr* clone(ASTContext &C) const { + return ::new (C) AlignedAttr(Alignment); + } // Implement isa/cast/dyncast/etc. static bool classof(const Attr *A) { @@ -201,7 +217,7 @@ public: class AnnotateAttr : public Attr { std::string Annotation; public: - AnnotateAttr(const std::string &ann) : Attr(Annotate), Annotation(ann) {} + AnnotateAttr(llvm::StringRef ann) : Attr(Annotate), Annotation(ann) {} const std::string& getAnnotation() const { return Annotation; } @@ -217,7 +233,7 @@ public: class AsmLabelAttr : public Attr { std::string Label; public: - AsmLabelAttr(const std::string &L) : Attr(AsmLabel), Label(L) {} + AsmLabelAttr(llvm::StringRef L) : Attr(AsmLabel), Label(L) {} const std::string& getLabel() const { return Label; } @@ -235,7 +251,7 @@ DEF_SIMPLE_ATTR(AlwaysInline); class AliasAttr : public Attr { std::string Aliasee; public: - AliasAttr(const std::string &aliasee) : Attr(Alias), Aliasee(aliasee) {} + AliasAttr(llvm::StringRef aliasee) : Attr(Alias), Aliasee(aliasee) {} const std::string& getAliasee() const { return Aliasee; } @@ -304,11 +320,12 @@ DEF_SIMPLE_ATTR(Malloc); DEF_SIMPLE_ATTR(NoReturn); DEF_SIMPLE_ATTR(AnalyzerNoReturn); DEF_SIMPLE_ATTR(Deprecated); +DEF_SIMPLE_ATTR(Final); class SectionAttr : public Attr { std::string Name; public: - SectionAttr(const std::string &N) : Attr(Section), Name(N) {} + SectionAttr(llvm::StringRef N) : Attr(Section), Name(N) {} const std::string& getName() const { return Name; } @@ -367,11 +384,11 @@ class FormatAttr : public Attr { std::string Type; int formatIdx, firstArg; public: - FormatAttr(const std::string &type, int idx, int first) : Attr(Format), + FormatAttr(llvm::StringRef type, int idx, int first) : Attr(Format), Type(type), formatIdx(idx), firstArg(first) {} const std::string& getType() const { return Type; } - void setType(const std::string &type) { Type = type; } + void setType(llvm::StringRef type) { Type = type; } int getFormatIdx() const { return formatIdx; } int getFirstArg() const { return firstArg; } @@ -544,6 +561,11 @@ public: DEF_SIMPLE_ATTR(CFReturnsRetained); DEF_SIMPLE_ATTR(NSReturnsRetained); +// C++0x member checking attributes. +DEF_SIMPLE_ATTR(BaseCheck); +DEF_SIMPLE_ATTR(Hiding); +DEF_SIMPLE_ATTR(Override); + #undef DEF_SIMPLE_ATTR } // end namespace clang Modified: vendor/clang/dist/include/clang/AST/Decl.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Decl.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/Decl.h Tue Dec 1 11:08:04 2009 (r199990) @@ -54,6 +54,32 @@ public: TypeLoc getTypeLoc() const; }; +/// UnresolvedSet - A set of unresolved declarations. This is needed +/// in a lot of places, but isn't really worth breaking into its own +/// header right now. +class UnresolvedSet { + typedef llvm::SmallVector DeclsTy; + DeclsTy Decls; + +public: + void addDecl(NamedDecl *D) { + Decls.push_back(D); + } + + bool replace(const NamedDecl* Old, NamedDecl *New) { + for (DeclsTy::iterator I = Decls.begin(), E = Decls.end(); I != E; ++I) + if (*I == Old) + return (*I = New, true); + return false; + } + + unsigned size() const { return Decls.size(); } + + typedef DeclsTy::const_iterator iterator; + iterator begin() const { return Decls.begin(); } + iterator end() const { return Decls.end(); } +}; + /// TranslationUnitDecl - The top declaration context. class TranslationUnitDecl : public Decl, public DeclContext { ASTContext &Ctx; @@ -172,6 +198,26 @@ public: /// \brief Determine whether this declaration has linkage. bool hasLinkage() const; + /// \brief Describes the different kinds of linkage + /// (C++ [basic.link], C99 6.2.2) that an entity may have. + enum Linkage { + /// \brief No linkage, which means that the entity is unique and + /// can only be referred to from within its scope. + NoLinkage = 0, + + /// \brief Internal linkage, which indicates that the entity can + /// be referred to from within the translation unit (but not other + /// translation units). + InternalLinkage, + + /// \brief External linkage, which indicates that the entity can + /// be referred to from other translation units. + ExternalLinkage + }; + + /// \brief Determine what kind of linkage this entity has. + Linkage getLinkage() const; + /// \brief Looks through UsingDecls and ObjCCompatibleAliasDecls for /// the underlying named decl. NamedDecl *getUnderlyingDecl(); Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Tue Dec 1 11:08:04 2009 (r199990) @@ -503,12 +503,12 @@ private: /// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when /// doing something to a specific decl. class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry { - Decl *TheDecl; + const Decl *TheDecl; SourceLocation Loc; SourceManager &SM; const char *Message; public: - PrettyStackTraceDecl(Decl *theDecl, SourceLocation L, + PrettyStackTraceDecl(const Decl *theDecl, SourceLocation L, SourceManager &sm, const char *Msg) : TheDecl(theDecl), Loc(L), SM(sm), Message(Msg) {} Modified: vendor/clang/dist/include/clang/AST/DeclCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclCXX.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/DeclCXX.h Tue Dec 1 11:08:04 2009 (r199990) @@ -376,13 +376,13 @@ class CXXRecordDecl : public RecordDecl /// of this C++ class (but not its inherited conversion /// functions). Each of the entries in this overload set is a /// CXXConversionDecl. - OverloadedFunctionDecl Conversions; + UnresolvedSet Conversions; /// VisibleConversions - Overload set containing the conversion functions /// of this C++ class and all those inherited conversion functions that /// are visible in this class. Each of the entries in this overload set is /// a CXXConversionDecl or a FunctionTemplateDecl. - OverloadedFunctionDecl VisibleConversions; + UnresolvedSet VisibleConversions; /// \brief The template or declaration that this declaration /// describes or was instantiated from, respectively. @@ -400,7 +400,7 @@ class CXXRecordDecl : public RecordDecl const llvm::SmallPtrSet &TopConversionsTypeSet, const llvm::SmallPtrSet &HiddenConversionTypes); void collectConversionFunctions( - llvm::SmallPtrSet& ConversionsTypeSet); + llvm::SmallPtrSet& ConversionsTypeSet) const; protected: CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC, @@ -581,22 +581,34 @@ public: /// getConversions - Retrieve the overload set containing all of the /// conversion functions in this class. - OverloadedFunctionDecl *getConversionFunctions() { + UnresolvedSet *getConversionFunctions() { assert((this->isDefinition() || cast(getTypeForDecl())->isBeingDefined()) && "getConversionFunctions() called on incomplete type"); return &Conversions; } - const OverloadedFunctionDecl *getConversionFunctions() const { + const UnresolvedSet *getConversionFunctions() const { assert((this->isDefinition() || cast(getTypeForDecl())->isBeingDefined()) && "getConversionFunctions() called on incomplete type"); return &Conversions; } + typedef UnresolvedSet::iterator conversion_iterator; + conversion_iterator conversion_begin() const { return Conversions.begin(); } + conversion_iterator conversion_end() const { return Conversions.end(); } + + /// Replaces a conversion function with a new declaration. + /// + /// Returns true if the old conversion was found. + bool replaceConversion(const NamedDecl* Old, NamedDecl *New) { + return Conversions.replace(Old, New); + } + /// getVisibleConversionFunctions - get all conversion functions visible /// in current class; including conversion function templates. - OverloadedFunctionDecl *getVisibleConversionFunctions(); + const UnresolvedSet *getVisibleConversionFunctions(); + /// addVisibleConversionFunction - Add a new conversion function to the /// list of visible conversion functions. void addVisibleConversionFunction(CXXConversionDecl *ConvDecl); @@ -1502,9 +1514,9 @@ class UsingDirectiveDecl : public NamedD SourceLocation IdentLoc; /// NominatedNamespace - Namespace nominated by using-directive. - NamespaceDecl *NominatedNamespace; + NamedDecl *NominatedNamespace; - /// Enclosing context containing both using-directive and nomintated + /// Enclosing context containing both using-directive and nominated /// namespace. DeclContext *CommonAncestor; @@ -1520,12 +1532,12 @@ class UsingDirectiveDecl : public NamedD SourceRange QualifierRange, NestedNameSpecifier *Qualifier, SourceLocation IdentLoc, - NamespaceDecl *Nominated, + NamedDecl *Nominated, DeclContext *CommonAncestor) : NamedDecl(Decl::UsingDirective, DC, L, getName()), NamespaceLoc(NamespcLoc), QualifierRange(QualifierRange), Qualifier(Qualifier), IdentLoc(IdentLoc), - NominatedNamespace(Nominated? Nominated->getOriginalNamespace() : 0), + NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) { } @@ -1538,8 +1550,13 @@ public: /// name of the namespace. NestedNameSpecifier *getQualifier() const { return Qualifier; } + NamedDecl *getNominatedNamespaceAsWritten() { return NominatedNamespace; } + const NamedDecl *getNominatedNamespaceAsWritten() const { + return NominatedNamespace; + } + /// getNominatedNamespace - Returns namespace nominated by using-directive. - NamespaceDecl *getNominatedNamespace() { return NominatedNamespace; } + NamespaceDecl *getNominatedNamespace(); const NamespaceDecl *getNominatedNamespace() const { return const_cast(this)->getNominatedNamespace(); @@ -1562,7 +1579,7 @@ public: SourceRange QualifierRange, NestedNameSpecifier *Qualifier, SourceLocation IdentLoc, - NamespaceDecl *Nominated, + NamedDecl *Nominated, DeclContext *CommonAncestor); static bool classof(const Decl *D) { Modified: vendor/clang/dist/include/clang/AST/DeclTemplate.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclTemplate.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/DeclTemplate.h Tue Dec 1 11:08:04 2009 (r199990) @@ -955,8 +955,7 @@ public: TemplateParameterList *Params, ClassTemplateDecl *SpecializedTemplate, TemplateArgumentListBuilder &Builder, - TemplateArgumentLoc *ArgInfos, - unsigned NumArgInfos, + const TemplateArgumentListInfo &ArgInfos, ClassTemplatePartialSpecializationDecl *PrevDecl); /// Get the list of template parameters Modified: vendor/clang/dist/include/clang/AST/DeclarationName.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclarationName.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/DeclarationName.h Tue Dec 1 11:08:04 2009 (r199990) @@ -25,6 +25,7 @@ namespace llvm { namespace clang { class CXXSpecialName; class CXXOperatorIdName; + class CXXLiteralOperatorIdName; class DeclarationNameExtra; class IdentifierInfo; class MultiKeywordSelector; @@ -48,6 +49,7 @@ public: CXXDestructorName, CXXConversionFunctionName, CXXOperatorName, + CXXLiteralOperatorName, CXXUsingDirective }; @@ -115,6 +117,12 @@ private: return 0; } + CXXLiteralOperatorIdName *getAsCXXLiteralOperatorIdName() const { + if (getNameKind() == CXXLiteralOperatorName) + return reinterpret_cast(Ptr & ~PtrMask); + return 0; + } + // Construct a declaration name from the name of a C++ constructor, // destructor, or conversion function. DeclarationName(CXXSpecialName *Name) @@ -131,6 +139,12 @@ private: Ptr |= StoredDeclarationNameExtra; } + DeclarationName(CXXLiteralOperatorIdName *Name) + : Ptr(reinterpret_cast(Name)) { + assert((Ptr & PtrMask) == 0 && "Improperly aligned CXXLiteralOperatorId"); + Ptr |= StoredDeclarationNameExtra; + } + /// Construct a declaration name from a raw pointer. DeclarationName(uintptr_t Ptr) : Ptr(Ptr) { } @@ -201,7 +215,7 @@ public: N.Ptr = reinterpret_cast (P); return N; } - + static DeclarationName getFromOpaqueInteger(uintptr_t P) { DeclarationName N; N.Ptr = P; @@ -218,6 +232,10 @@ public: /// kind of overloaded operator. OverloadedOperatorKind getCXXOverloadedOperator() const; + /// getCXXLiteralIdentifier - If this name is the name of a literal + /// operator, retrieve the identifier associated with it. + IdentifierInfo *getCXXLiteralIdentifier() const; + /// getObjCSelector - Get the Objective-C selector stored in this /// declaration name. Selector getObjCSelector() const; @@ -293,7 +311,7 @@ public: /// getIdentifier - Create a declaration name that is a simple /// identifier. - DeclarationName getIdentifier(IdentifierInfo *ID) { + DeclarationName getIdentifier(const IdentifierInfo *ID) { return DeclarationName(ID); } @@ -324,6 +342,10 @@ public: /// getCXXOperatorName - Get the name of the overloadable C++ /// operator corresponding to Op. DeclarationName getCXXOperatorName(OverloadedOperatorKind Op); + + /// getCXXLiteralOperatorName - Get the name of the literal operator function + /// with II as the identifier. + DeclarationName getCXXLiteralOperatorName(IdentifierInfo *II); }; /// Insertion operator for diagnostics. This allows sending DeclarationName's Modified: vendor/clang/dist/include/clang/AST/Expr.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Expr.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/Expr.h Tue Dec 1 11:08:04 2009 (r199990) @@ -35,6 +35,7 @@ namespace clang { class CXXOperatorCallExpr; class CXXMemberCallExpr; class TemplateArgumentLoc; + class TemplateArgumentListInfo; /// Expr - This represents one expression. Note that Expr's are subclasses of /// Stmt. This allows an expression to be transparently used any place a Stmt @@ -366,6 +367,10 @@ struct ExplicitTemplateArgumentList { const TemplateArgumentLoc *getTemplateArgs() const { return reinterpret_cast (this + 1); } + + void initializeFrom(const TemplateArgumentListInfo &List); + void copyInto(TemplateArgumentListInfo &List) const; + static std::size_t sizeFor(const TemplateArgumentListInfo &List); }; /// DeclRefExpr - [C99 6.5.1p2] - A reference to a declared variable, function, @@ -423,31 +428,24 @@ class DeclRefExpr : public Expr { DeclRefExpr(NestedNameSpecifier *Qualifier, SourceRange QualifierRange, NamedDecl *D, SourceLocation NameLoc, - bool HasExplicitTemplateArgumentList, - SourceLocation LAngleLoc, - const TemplateArgumentLoc *ExplicitTemplateArgs, - unsigned NumExplicitTemplateArgs, - SourceLocation RAngleLoc, - QualType T, bool TD, bool VD); + const TemplateArgumentListInfo *TemplateArgs, + QualType T); protected: - // FIXME: Eventually, this constructor will go away and all subclasses - // will have to provide the type- and value-dependent flags. - DeclRefExpr(StmtClass SC, NamedDecl *d, QualType t, SourceLocation l) : - Expr(SC, t), DecoratedD(d, 0), Loc(l) {} + /// \brief Computes the type- and value-dependence flags for this + /// declaration reference expression. + void computeDependence(); - DeclRefExpr(StmtClass SC, NamedDecl *d, QualType t, SourceLocation l, bool TD, - bool VD) : - Expr(SC, t, TD, VD), DecoratedD(d, 0), Loc(l) {} + DeclRefExpr(StmtClass SC, NamedDecl *d, QualType t, SourceLocation l) : + Expr(SC, t, false, false), DecoratedD(d, 0), Loc(l) { + computeDependence(); + } public: - // FIXME: Eventually, this constructor will go away and all clients - // will have to provide the type- and value-dependent flags. DeclRefExpr(NamedDecl *d, QualType t, SourceLocation l) : - Expr(DeclRefExprClass, t), DecoratedD(d, 0), Loc(l) {} - - DeclRefExpr(NamedDecl *d, QualType t, SourceLocation l, bool TD, bool VD) : - Expr(DeclRefExprClass, t, TD, VD), DecoratedD(d, 0), Loc(l) {} + Expr(DeclRefExprClass, t, false, false), DecoratedD(d, 0), Loc(l) { + computeDependence(); + } /// \brief Construct an empty declaration reference expression. explicit DeclRefExpr(EmptyShell Empty) @@ -458,19 +456,8 @@ public: SourceRange QualifierRange, NamedDecl *D, SourceLocation NameLoc, - QualType T, bool TD, bool VD); - - static DeclRefExpr *Create(ASTContext &Context, - NestedNameSpecifier *Qualifier, - SourceRange QualifierRange, - NamedDecl *D, - SourceLocation NameLoc, - bool HasExplicitTemplateArgumentList, - SourceLocation LAngleLoc, - const TemplateArgumentLoc *ExplicitTemplateArgs, - unsigned NumExplicitTemplateArgs, - SourceLocation RAngleLoc, - QualType T, bool TD, bool VD); + QualType T, + const TemplateArgumentListInfo *TemplateArgs = 0); NamedDecl *getDecl() { return DecoratedD.getPointer(); } const NamedDecl *getDecl() const { return DecoratedD.getPointer(); } @@ -508,6 +495,13 @@ public: bool hasExplicitTemplateArgumentList() const { return DecoratedD.getInt() & HasExplicitTemplateArgumentListFlag; } + + /// \brief Copies the template arguments (if present) into the given + /// structure. + void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const { + if (hasExplicitTemplateArgumentList()) + getExplicitTemplateArgumentList()->copyInto(List); + } /// \brief Retrieve the location of the left angle bracket following the /// member name ('<'), if any. @@ -546,8 +540,7 @@ public: } static bool classof(const Stmt *T) { - return T->getStmtClass() == DeclRefExprClass || - T->getStmtClass() == CXXConditionDeclExprClass; + return T->getStmtClass() == DeclRefExprClass; } static bool classof(const DeclRefExpr *) { return true; } @@ -1313,9 +1306,7 @@ class MemberExpr : public Expr { MemberExpr(Expr *base, bool isarrow, NestedNameSpecifier *qual, SourceRange qualrange, NamedDecl *memberdecl, SourceLocation l, - bool has_explicit, SourceLocation langle, - const TemplateArgumentLoc *targs, unsigned numtargs, - SourceLocation rangle, QualType ty); + const TemplateArgumentListInfo *targs, QualType ty); public: MemberExpr(Expr *base, bool isarrow, NamedDecl *memberdecl, SourceLocation l, @@ -1334,11 +1325,7 @@ public: NestedNameSpecifier *qual, SourceRange qualrange, NamedDecl *memberdecl, SourceLocation l, - bool has_explicit, - SourceLocation langle, - const TemplateArgumentLoc *targs, - unsigned numtargs, - SourceLocation rangle, + const TemplateArgumentListInfo *targs, QualType ty); void setBase(Expr *E) { Base = E; } @@ -1378,10 +1365,17 @@ public: /// \brief Determines whether this member expression actually had a C++ /// template argument list explicitly specified, e.g., x.f. - bool hasExplicitTemplateArgumentList() { + bool hasExplicitTemplateArgumentList() const { return HasExplicitTemplateArgumentList; } + /// \brief Copies the template arguments (if present) into the given + /// structure. + void copyTemplateArgumentsInto(TemplateArgumentListInfo &List) const { + if (hasExplicitTemplateArgumentList()) + getExplicitTemplateArgumentList()->copyInto(List); + } + /// \brief Retrieve the location of the left angle bracket following the /// member name ('<'), if any. SourceLocation getLAngleLoc() const { @@ -1579,7 +1573,11 @@ public: CK_FloatingToIntegral, /// CK_FloatingCast - Casting between floating types of different size. - CK_FloatingCast + CK_FloatingCast, + + /// CK_MemberPointerToBoolean - Member pointer to boolean + CK_MemberPointerToBoolean + }; private: Modified: vendor/clang/dist/include/clang/AST/ExprCXX.h ============================================================================== --- vendor/clang/dist/include/clang/AST/ExprCXX.h Tue Dec 1 11:07:05 2009 (r199989) +++ vendor/clang/dist/include/clang/AST/ExprCXX.h Tue Dec 1 11:08:04 2009 (r199990) @@ -17,6 +17,7 @@ #include "clang/Basic/TypeTraits.h" #include "clang/AST/Expr.h" #include "clang/AST/Decl.h" +#include "clang/AST/TemplateBase.h" namespace clang { @@ -24,6 +25,7 @@ namespace clang { class CXXDestructorDecl; class CXXMethodDecl; class CXXTemporary; + class TemplateArgumentListInfo; //===--------------------------------------------------------------------===// // C++ Expressions. @@ -669,40 +671,6 @@ public: virtual child_iterator child_end(); }; -/// CXXConditionDeclExpr - Condition declaration of a if/switch/while/for -/// statement, e.g: "if (int x = f()) {...}". -/// The main difference with DeclRefExpr is that CXXConditionDeclExpr owns the -/// decl that it references. -/// -class CXXConditionDeclExpr : public DeclRefExpr { -public: - CXXConditionDeclExpr(SourceLocation startLoc, - SourceLocation eqLoc, VarDecl *var) - : DeclRefExpr(CXXConditionDeclExprClass, var, - var->getType().getNonReferenceType(), startLoc, - var->getType()->isDependentType(), - /*FIXME:integral constant?*/ - var->getType()->isDependentType()) {} - - SourceLocation getStartLoc() const { return getLocation(); } - - VarDecl *getVarDecl() { return cast(getDecl()); } - const VarDecl *getVarDecl() const { return cast(getDecl()); } - - virtual SourceRange getSourceRange() const { - return SourceRange(getStartLoc(), getVarDecl()->getInit()->getLocEnd()); - } - - static bool classof(const Stmt *T) { - return T->getStmtClass() == CXXConditionDeclExprClass; - } - static bool classof(const CXXConditionDeclExpr *) { return true; } - - // Iterators - virtual child_iterator child_begin(); - virtual child_iterator child_end(); -}; - /// CXXNewExpr - A new expression for memory allocation and constructor calls, /// e.g: "new CXXNewExpr(foo)". class CXXNewExpr : public Expr { @@ -975,52 +943,6 @@ public: virtual child_iterator child_end(); }; -/// \brief Represents the name of a function that has not been -/// resolved to any declaration. -/// -/// Unresolved function names occur when a function name is -/// encountered prior to an open parentheses ('(') in a C++ function -/// call, and the function name itself did not resolve to a -/// declaration. These function names can only be resolved when they -/// form the postfix-expression of a function call, so that -/// argument-dependent lookup finds declarations corresponding to -/// these functions. - -/// @code -/// template void f(T x) { -/// g(x); // g is an unresolved function name (that is also a dependent name) -/// } -/// @endcode -class UnresolvedFunctionNameExpr : public Expr { - /// The name that was present in the source - DeclarationName Name; - - /// The location of this name in the source code - SourceLocation Loc; - -public: - UnresolvedFunctionNameExpr(DeclarationName N, QualType T, SourceLocation L) - : Expr(UnresolvedFunctionNameExprClass, T, false, false), Name(N), Loc(L) { } - - /// \brief Retrieves the name that occurred in the source code. - DeclarationName getName() const { return Name; } - - /// getLocation - Retrieves the location in the source code where - /// the name occurred. - SourceLocation getLocation() const { return Loc; } - - virtual SourceRange getSourceRange() const { return SourceRange(Loc); } - - static bool classof(const Stmt *T) { - return T->getStmtClass() == UnresolvedFunctionNameExprClass; - } - static bool classof(const UnresolvedFunctionNameExpr *) { return true; } - - // Iterators - virtual child_iterator child_begin(); - virtual child_iterator child_end(); -}; - /// UnaryTypeTraitExpr - A GCC or MS unary type trait, as used in the /// implementation of TR1/C++0x type trait templates. /// Example: @@ -1063,21 +985,177 @@ public: virtual child_iterator child_end(); }; +/// \brief A reference to a name which we were able to look up during +/// parsing but could not resolve to a specific declaration. This +/// arises in several ways: +/// * we might be waiting for argument-dependent lookup +/// * the name might resolve to an overloaded function +/// and eventually: +/// * the lookup might have included a function template +/// These never include UnresolvedUsingValueDecls, which are always +/// class members and therefore appear only in +/// UnresolvedMemberLookupExprs. +class UnresolvedLookupExpr : public Expr { + /// The results. These are undesugared, which is to say, they may + /// include UsingShadowDecls. + UnresolvedSet Results; + + /// The name declared. + DeclarationName Name; + + /// The qualifier given, if any. + NestedNameSpecifier *Qualifier; + + /// The source range of the nested name specifier. + SourceRange QualifierRange; + + /// The location of the name. + SourceLocation NameLoc; + + /// True if these lookup results should be extended by + /// argument-dependent lookup if this is the operand of a function + /// call. + bool RequiresADL; + + /// True if these lookup results are overloaded. This is pretty + /// trivially rederivable if we urgently need to kill this field. + bool Overloaded; + + /// True if the name looked up had explicit template arguments. + /// This requires all the results to be function templates. + bool HasExplicitTemplateArgs; + + UnresolvedLookupExpr(QualType T, bool Dependent, + NestedNameSpecifier *Qualifier, SourceRange QRange, + DeclarationName Name, SourceLocation NameLoc, + bool RequiresADL, bool Overloaded, bool HasTemplateArgs) + : Expr(UnresolvedLookupExprClass, T, Dependent, Dependent), + Name(Name), Qualifier(Qualifier), QualifierRange(QRange), + NameLoc(NameLoc), RequiresADL(RequiresADL), Overloaded(Overloaded), + HasExplicitTemplateArgs(HasTemplateArgs) + {} + +public: + static UnresolvedLookupExpr *Create(ASTContext &C, + bool Dependent, + NestedNameSpecifier *Qualifier, + SourceRange QualifierRange, + DeclarationName Name, + SourceLocation NameLoc, + bool ADL, bool Overloaded) { + return new(C) UnresolvedLookupExpr(Dependent ? C.DependentTy : C.OverloadTy, + Dependent, Qualifier, QualifierRange, + Name, NameLoc, ADL, Overloaded, false); + } + + static UnresolvedLookupExpr *Create(ASTContext &C, + bool Dependent, + NestedNameSpecifier *Qualifier, + SourceRange QualifierRange, + DeclarationName Name, + SourceLocation NameLoc, + bool ADL, + const TemplateArgumentListInfo &Args); + + /// Computes whether an unresolved lookup on the given declarations + /// and optional template arguments is type- and value-dependent. + static bool ComputeDependence(NamedDecl * const *Begin, + NamedDecl * const *End, + const TemplateArgumentListInfo *Args); + + void addDecl(NamedDecl *Decl) { + Results.addDecl(Decl); + } + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 12:18:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C339106566B; Tue, 1 Dec 2009 12:18:17 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id C9CBD8FC13; Tue, 1 Dec 2009 12:18:15 +0000 (UTC) Received: by ewy26 with SMTP id 26so5202990ewy.3 for ; Tue, 01 Dec 2009 04:18:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=L7sH9yK+RXEiFerZ6w08IUFBHa2RoPkq0aEI7BaPXPI=; b=sKpr2NM+8bJs8VTYUhn1UMEwqOxgWDF1J2jGryhwD/s1AHbjbwcRZftQm/jLZpjHpY yNCfNupnDvJ8cWkDe8ui8qs1E4bYNd8u/oBCDW7vpal9l+Jz4NhPYu7eaIHbVSr5KRcq XOaRBxOIuPmZ5tPVqKbyVVNAZy6Cma35G35rs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=er/q7Rz9q7jsDMUbwkRWrqjtMcyyZkokyyiuETajLKmoDXKLJu2gKpoOOKQrt8C4sW 4uXxs2sR16SN+h2UliAALzXd/h4tA19viNUFocr8EX7Z68WTnkKLutcTTC60/tWgKAnc EJywpoM2uAEMqCKvugE4AxpMXd++snw+/P0oc= MIME-Version: 1.0 Received: by 10.216.93.71 with SMTP id k49mr1898224wef.172.1259668208415; Tue, 01 Dec 2009 03:50:08 -0800 (PST) In-Reply-To: <20091130233547.GA68836@citylink.fud.org.nz> References: <200911302125.nAULPvRO043110@svn.freebsd.org> <20091130233547.GA68836@citylink.fud.org.nz> From: Renato Botelho Date: Tue, 1 Dec 2009 09:49:48 -0200 Message-ID: <747dc8f30912010349t746cdc6ev779e99c0cba7bc3c@mail.gmail.com> To: Andrew Thompson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 12:18:17 -0000 On Mon, Nov 30, 2009 at 9:35 PM, Andrew Thompson wrot= e: > On Mon, Nov 30, 2009 at 09:25:57PM +0000, John Baldwin wrote: >> Author: jhb >> Date: Mon Nov 30 21:25:57 2009 >> New Revision: 199975 >> URL: http://svn.freebsd.org/changeset/base/199975 >> >> Log: >> =A0 Remove if_timer/if_watchdog now that they are no longer used. =A0The= space >> =A0 used by if_timer is reserved for expanding if_index to an int in the >> =A0 future. >> >> =A0 Reviewed by: =A0 =A0 =A0 =A0rwatson, brooks >> > > I am getting, > > =3D=3D=3D> usr.bin/netstat (all) > cc -O2 -pipe =A0-fno-strict-aliasing -DIPSEC -DSCTP -DINET6 -DNETGRAPH -D= IPX -std=3Dgnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-form= at-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -W= pointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/home/thompsa/scr= atch/fbsvn/head/usr.bin/netstat/if.c > /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c: In function 'i= ntpr': > /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c:291: error: 'st= ruct ifnet' has no member named 'if_timer' > *** Error code 1 > > Stop in /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat. > *** Error code 1 same here. --=20 Renato Botelho From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 12:35:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63544106566C; Tue, 1 Dec 2009 12:35:52 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51DC08FC17; Tue, 1 Dec 2009 12:35:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1CZquk064503; Tue, 1 Dec 2009 12:35:52 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1CZqbZ064502; Tue, 1 Dec 2009 12:35:52 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912011235.nB1CZqbZ064502@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 1 Dec 2009 12:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199991 - stable/8/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 12:35:52 -0000 Author: netchild Date: Tue Dec 1 12:35:51 2009 New Revision: 199991 URL: http://svn.freebsd.org/changeset/base/199991 Log: MFC r199626: Fix minor resource leak in a function. Reviewed by: luigi Modified: stable/8/sbin/ipfw/dummynet.c Directory Properties: stable/8/sbin/ipfw/ (props changed) Modified: stable/8/sbin/ipfw/dummynet.c ============================================================================== --- stable/8/sbin/ipfw/dummynet.c Tue Dec 1 11:08:04 2009 (r199990) +++ stable/8/sbin/ipfw/dummynet.c Tue Dec 1 12:35:51 2009 (r199991) @@ -650,6 +650,8 @@ load_extra_delays(const char *filename, } } + fclose (f); + if (samples == -1) { warnx("'%s' not found, assuming 100", ED_TOK_SAMPLES); samples = 100; From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 13:16:41 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C20D106568B; Tue, 1 Dec 2009 13:16:41 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id B94708FC1E; Tue, 1 Dec 2009 13:16:40 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 6A9B948B16; Tue, 1 Dec 2009 13:16:39 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rKFZWSgMIoAV; Tue, 1 Dec 2009 13:16:36 +0000 (GMT) Received: from rita.nodomain (unknown [192.168.205.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 7881748B03; Tue, 1 Dec 2009 13:16:35 +0000 (GMT) Message-ID: <4B1516E5.9030508@tomjudge.com> Date: Tue, 01 Dec 2009 13:15:17 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Maxim Sobolev References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> <4B14BF23.1030303@FreeBSD.org> In-Reply-To: <4B14BF23.1030303@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 13:16:41 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maxim Sobolev wrote: > Stanislav Sedov wrote: >> On Mon, 30 Nov 2009 13:25:03 -0800 >> Maxim Sobolev mentioned: >> >>> Can we change the name then? We've seen the similar issue without the >>> jumbo frames, which made me wonder. >> >> It's strange, because 'normal' frames are less than a page size in >> length, >> so the issue I was experiencing should not be reproducable with jumbo >> frames >> disabled. Can you describe a bit more what kind of problem you're >> experiencing? > > The traffic through interface abruptly halts randomly when under a load, > without any signs of a problem. What is interesting is that the > communication through unix domain sockets appears to be down too, since > some scripts that connect to database not able to complete as well, so > whatever this problem is it affect the whole network subsystem. We tried > to replace hardware and it did not help. Only after we replaced bce(4) > with IntelPro card (em) the problem has went away. > > -Maxim When you see this lock up do you also see denied requests for mbufs? All the times I have seen the issue, the system was denying mbuf requests. Tom - -- TJU13-ARIN -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJLFRbkAAoJEMSwVS7lr0OdL84H/0rPW0l53qCqMv8HQ45KLd21 9PMEYRT9GkIMR9xQ489BCtcKQEILqA9o9WJoGOHPL/9I3ecYiB3phMp/cTvtcQiu 3I2UNdeDUg3YWqZyPwgXg4snUUod9flITkCzwn8+yx7EmD4cEz9BVi7XXyqwGxoW GM9BoX2rBttO3DEP2h19JazG9U5BXPW1zZ1Jf47Or6WMMfYeC6dSMA0WMr1fxjgY VsQVyIH2EfR19ddwZkJqkx32y5+TDgjsevlu0cw/0KjxLii2NqAtLtPQNLfDC4Wo wKWpi0CXqdkCinwJsKcVISYj6TLI3wAz5U2q5l4bDNRkp/0YkgHAjdj+VSwKErg= =o5DH -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 14:48:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF00F106568F; Tue, 1 Dec 2009 14:48:17 +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 7E6758FC21; Tue, 1 Dec 2009 14:48:17 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 5A7616D41B; Tue, 1 Dec 2009 14:48:16 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 2185D844D2; Tue, 1 Dec 2009 15:48:16 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <200911302125.nAULPvRO043110@svn.freebsd.org> Date: Tue, 01 Dec 2009 15:48:16 +0100 In-Reply-To: <200911302125.nAULPvRO043110@svn.freebsd.org> (John Baldwin's message of "Mon, 30 Nov 2009 21:25:57 +0000 (UTC)") Message-ID: <86k4x6eonj.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 14:48:17 -0000 John Baldwin writes: > Log: > Remove if_timer/if_watchdog now that they are no longer used. The space > used by if_timer is reserved for expanding if_index to an int in the > future. This breaks the build; please either fix netstat or revert. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 14:56:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9A7E1065670; Tue, 1 Dec 2009 14:56:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C29D88FC0A; Tue, 1 Dec 2009 14:56:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1Eu0B4067886; Tue, 1 Dec 2009 14:56:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1Eu0Tt067882; Tue, 1 Dec 2009 14:56:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912011456.nB1Eu0Tt067882@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 1 Dec 2009 14:56:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199992 - in head: share/man/man9 usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 14:56:01 -0000 Author: bz Date: Tue Dec 1 14:56:00 2009 New Revision: 199992 URL: http://svn.freebsd.org/changeset/base/199992 Log: Unbreak user space after if_timer/if_watchdog removal in r199975. Tested by: glebius Modified: head/share/man/man9/ifnet.9 head/usr.bin/netstat/if.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Tue Dec 1 12:35:51 2009 (r199991) +++ head/share/man/man9/ifnet.9 Tue Dec 1 14:56:00 2009 (r199992) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 14, 2007 +.Dd December 1, 2009 .Os .Dt IFNET 9 .Sh NAME @@ -279,13 +279,6 @@ to refer to a particular interface by in .Xr link_addr 3 ) . (Initialized by .Fn if_alloc . ) -.It Va if_timer -.Pq Vt short -Number of seconds until the watchdog timer -.Fn if_watchdog -is called, or zero if the timer is disabled. -(Set by driver, -decremented by generic watchdog code.) .It Va if_flags .Pq Vt int Flags describing operational parameters of this interface (see below). @@ -401,11 +394,6 @@ flags and flushing queues. See the description of .Fn ifioctl below for more information. -.It Fn if_watchdog -Routine called by the generic code when the watchdog timer, -.Va if_timer , -expires. -Usually this will reset the interface. .\" .It Fn if_poll_recv .\" .It Fn if_poll_xmit .\" .It Fn if_poll_slowinput @@ -415,7 +403,7 @@ Usually this will reset the interface. .\" section, below. .It Fn if_init Initialize and bring up the hardware, -e.g., reset the chip and the watchdog timer and enable the receiver unit. +e.g., reset the chip and enable the receiver unit. Should mark the interface running, but not active .Dv ( IFF_RUNNING , ~IIF_OACTIVE ) . Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Tue Dec 1 12:35:51 2009 (r199991) +++ head/usr.bin/netstat/if.c Tue Dec 1 14:56:00 2009 (r199992) @@ -200,7 +200,6 @@ intpr(int interval1, u_long ifnetaddr, v u_long ierrors; u_long idrops; u_long collisions; - short timer; int drops; struct sockaddr *sa = NULL; char name[IFNAMSIZ]; @@ -234,8 +233,6 @@ intpr(int interval1, u_long ifnetaddr, v if (bflag) printf(" %10.10s","Obytes"); printf(" %5s", "Coll"); - if (tflag) - printf(" %s", "Time"); if (dflag) printf(" %s", "Drop"); putchar('\n'); @@ -288,7 +285,6 @@ intpr(int interval1, u_long ifnetaddr, v ierrors = ifnet.if_ierrors; idrops = ifnet.if_iqdrops; collisions = ifnet.if_collisions; - timer = ifnet.if_timer; drops = ifnet.if_snd.ifq_drops; if (ifaddraddr == 0) { @@ -435,8 +431,6 @@ intpr(int interval1, u_long ifnetaddr, v show_stat("lu", 10, obytes, link_layer|network_layer); show_stat("NRSlu", 5, collisions, link_layer); - if (tflag) - show_stat("LSd", 4, timer, link_layer); if (dflag) show_stat("LSd", 4, drops, link_layer); putchar('\n'); Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Dec 1 12:35:51 2009 (r199991) +++ head/usr.bin/netstat/main.c Tue Dec 1 14:56:00 2009 (r199992) @@ -339,7 +339,6 @@ int numeric_port; /* show ports numerica static int pflag; /* show given protocol */ int rflag; /* show routing tables (or routing stats) */ int sflag; /* show protocol statistics */ -int tflag; /* show i/f watchdog timers */ int Wflag; /* wide display */ int xflag; /* extra information, includes all socket buffer info */ int zflag; /* zero stats */ @@ -455,9 +454,6 @@ main(int argc, char *argv[]) case 'S': numeric_addr = 1; break; - case 't': - tflag = 1; - break; case 'u': af = AF_UNIX; break; Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Tue Dec 1 12:35:51 2009 (r199991) +++ head/usr.bin/netstat/netstat.h Tue Dec 1 14:56:00 2009 (r199992) @@ -49,7 +49,6 @@ extern int numeric_addr; /* show address extern int numeric_port; /* show ports numerically */ extern int rflag; /* show routing tables (or routing stats) */ extern int sflag; /* show protocol statistics */ -extern int tflag; /* show i/f watchdog timers */ extern int Wflag; /* wide display */ extern int xflag; /* extended display, includes all socket buffer info */ extern int zflag; /* zero stats */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 15:15:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F3F106566B; Tue, 1 Dec 2009 15:15:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B0D898FC1A; Tue, 1 Dec 2009 15:15:32 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 49C5546B2A; Tue, 1 Dec 2009 10:15:32 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 79DAE8A01F; Tue, 1 Dec 2009 10:15:31 -0500 (EST) From: John Baldwin To: Andrew Thompson Date: Tue, 1 Dec 2009 09:47:58 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200911302125.nAULPvRO043110@svn.freebsd.org> <20091130233547.GA68836@citylink.fud.org.nz> In-Reply-To: <20091130233547.GA68836@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912010947.58475.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 01 Dec 2009 10:15:31 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 15:15:33 -0000 On Monday 30 November 2009 6:35:47 pm Andrew Thompson wrote: > On Mon, Nov 30, 2009 at 09:25:57PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Mon Nov 30 21:25:57 2009 > > New Revision: 199975 > > URL: http://svn.freebsd.org/changeset/base/199975 > > > > Log: > > Remove if_timer/if_watchdog now that they are no longer used. The space > > used by if_timer is reserved for expanding if_index to an int in the > > future. > > > > Reviewed by: rwatson, brooks > > > > I am getting, > > ===> usr.bin/netstat (all) > cc -O2 -pipe -fno-strict-aliasing -DIPSEC -DSCTP -DINET6 -DNETGRAPH -DIPX -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes - Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c > /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c: In function 'intpr': > /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat/if.c:291: error: 'struct ifnet' has no member named 'if_timer' > *** Error code 1 > > Stop in /usr/home/thompsa/scratch/fbsvn/head/usr.bin/netstat. > *** Error code 1 Gah, will fix. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 15:15:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E7E1065679; Tue, 1 Dec 2009 15:15:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 034488FC08; Tue, 1 Dec 2009 15:15:34 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id A7C0D46B29; Tue, 1 Dec 2009 10:15:33 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B6B9A8A021; Tue, 1 Dec 2009 10:15:32 -0500 (EST) From: John Baldwin To: "Bjoern A. Zeeb" Date: Tue, 1 Dec 2009 09:53:12 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200911302125.nAULPvRO043110@svn.freebsd.org> <20091201102112.N83957@maildrop.int.zabbadoz.net> In-Reply-To: <20091201102112.N83957@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912010953.12730.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 01 Dec 2009 10:15:32 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r199975 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 15:15:34 -0000 On Tuesday 01 December 2009 5:23:09 am Bjoern A. Zeeb wrote: > On Mon, 30 Nov 2009, John Baldwin wrote: > > > Author: jhb > > Date: Mon Nov 30 21:25:57 2009 > > New Revision: 199975 > > URL: http://svn.freebsd.org/changeset/base/199975 > > > > Log: > > Remove if_timer/if_watchdog now that they are no longer used. The space > > used by if_timer is reserved for expanding if_index to an int in the > > future. > > > > Reviewed by: rwatson, brooks > > I have no idea yet if it builds or if the output of netstat still > looks sane but this is about what was missed (in userland, apart from > the traditional docs in share/doc/smm/18.net/6.t ): > > http://people.freebsd.org/~bz/20091201-01-no-if_timer.diff This looks good to me and matches what I just did to netstat locally. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 15:16:04 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCA810656DA; Tue, 1 Dec 2009 15:16:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4450C8FC12; Tue, 1 Dec 2009 15:16:04 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id E693946B32; Tue, 1 Dec 2009 10:16:03 -0500 (EST) Date: Tue, 1 Dec 2009 15:16:03 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Colin Percival In-Reply-To: <4B14B32C.3060409@freebsd.org> Message-ID: References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Brian Feldman , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 15:16:04 -0000 On Mon, 30 Nov 2009, Colin Percival wrote: > Brian Feldman wrote: >> Do not gratuitously fail *env(3) operations due to corrupt ('='-less) >> **environ entries. This puts non-getenv(3) operations in line with >> getenv(3) in that bad environ entries do not cause all operations to >> fail. There is still some inconsistency in that getenv(3) in the >> absence of any environment-modifying operation does not emit corrupt >> environ entry warnings. >> >> I also fixed another inconsistency in getenv(3) where updating the >> global environ pointer would not be reflected in the return values. >> It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) >> in order to see the change. > > The FreeBSD Security Team is currently dealing with a security issue > relating to this code. Please back out your change (at least to getenv.c; I > don't particularly care about the regression tests) until we've finished, > and then submit the patch to us for review along with a detailed explanation > of what it does. > > We've already had two major security issues arising out of getenv.c in the > past year, and I'd like to make sure we don't have a third. I think it's fair to say that the POSIXization of the environment code has been an unmitigated disaster, and speaks to the necessity for careful review of those sorts of code changes. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 15:18:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A028106566C; Tue, 1 Dec 2009 15:18:25 +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 89CD08FC1B; Tue, 1 Dec 2009 15:18:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1FIPS9068373; Tue, 1 Dec 2009 15:18:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1FIPIa068370; Tue, 1 Dec 2009 15:18:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912011518.nB1FIPIa068370@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Dec 2009 15:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199993 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 15:18:25 -0000 Author: jhb Date: Tue Dec 1 15:18:25 2009 New Revision: 199993 URL: http://svn.freebsd.org/changeset/base/199993 Log: Remove -t from the manpage and usage. Modified: head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Dec 1 14:56:00 2009 (r199992) +++ head/usr.bin/netstat/main.c Tue Dec 1 15:18:25 2009 (r199993) @@ -359,7 +359,7 @@ main(int argc, char *argv[]) af = AF_UNSPEC; - while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSstuWw:xz")) != -1) + while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSsuWw:xz")) != -1) switch(ch) { case 'A': Aflag = 1; @@ -777,7 +777,7 @@ usage(void) (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: netstat [-AaLnSWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", -" netstat -i | -I interface [-abdhntW] [-f address_family]\n" +" netstat -i | -I interface [-abdhnW] [-f address_family]\n" " [-M core] [-N system]", " netstat -w wait [-I interface] [-d] [-M core] [-N system]", " netstat -s [-s] [-z] [-f protocol_family | -p protocol]\n" Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Tue Dec 1 14:56:00 2009 (r199992) +++ head/usr.bin/netstat/netstat.1 Tue Dec 1 15:18:25 2009 (r199993) @@ -92,7 +92,7 @@ is present, display socket buffer and tc .Bk -words .Nm .Fl i | I Ar interface -.Op Fl abdhntW +.Op Fl abdhnW .Op Fl f Ar address_family .Op Fl M Ar core .Op Fl N Ar system @@ -123,9 +123,6 @@ If .Fl h is also present, print all counters in human readable form. If -.Fl t -is also present, show the contents of watchdog timers. -If .Fl W is also present, print interface names using a wider field size. .It Xo From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 15:24:45 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A9AD1065676; Tue, 1 Dec 2009 15:24:45 +0000 (UTC) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green.homeunix.org [66.92.150.152]) by mx1.freebsd.org (Postfix) with ESMTP id BD7198FC0C; Tue, 1 Dec 2009 15:24:44 +0000 (UTC) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.14.3/8.14.1) with ESMTP id nB1FOhMM043689; Tue, 1 Dec 2009 10:24:43 -0500 (EST) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.14.3/8.14.3/Submit) id nB1FOh87043688; Tue, 1 Dec 2009 10:24:43 -0500 (EST) (envelope-from green) Date: Tue, 1 Dec 2009 10:24:43 -0500 From: Brian Fundakowski Feldman To: Andrey Chernov , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20091201152442.GB35660@green.homeunix.org> References: <200912010504.nB154VnS053167@svn.freebsd.org> <20091201100602.GA77706@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091201100602.GA77706@nagual.pp.ru> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 15:24:45 -0000 On Tue, Dec 01, 2009 at 01:06:03PM +0300, Andrey Chernov wrote: > On Tue, Dec 01, 2009 at 05:04:31AM +0000, Brian Feldman wrote: > > - if (environ == NULL || environ[0] == NULL) > > - return (NULL); > > - else if (envVars == NULL || environ != intEnviron) > > + if (envVars == NULL) > > return (__findenv_environ(name, nameLen)); > > - else { > > - envNdx = envVarsTotal - 1; > > - return (__findenv(name, nameLen, &envNdx, true)); > > - } > > + > > + /* Synchronize environment. */ > > + if (__merge_environ() == -1) > > + return (NULL); > > + > > + envNdx = envVarsTotal - 1; > > + return (__findenv(name, nameLen, &envNdx, true)); > > } > > __merge_environ() should be avoided here for speed reasons. If the corrupt environment warnings are not actually that useful, then I agree that there's no other reason not to defer __merge_environ(). I actually wanted to have getenv(3) produce the warnings even if one of the other (modification) functions was never called, but that seemed impossible to do correctly without also having it call __build_environ(). The warnings I don't care much about, but having getenv(3) treat the environment as sane when setenv(3)/unsetenv(3)/putenv(3) operations are indefinitely failing is wrong. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 15:51:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78595106568B; Tue, 1 Dec 2009 15:51:27 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC3D8FC1D; Tue, 1 Dec 2009 15:51:27 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB1FpQJd059868; Tue, 1 Dec 2009 09:51:26 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Tue, 1 Dec 2009 09:51:26 -0600 (CST) From: "Sean C. Farley" To: Brian Feldman In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org> Message-ID: References: <200912010504.nB154VnS053167@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 15:51:27 -0000 On Tue, 1 Dec 2009, Brian Feldman wrote: > Author: green > Date: Tue Dec 1 05:04:31 2009 > New Revision: 199983 > URL: http://svn.freebsd.org/changeset/base/199983 > > Log: > Do not gratuitously fail *env(3) operations due to corrupt ('='-less) > **environ entries. This puts non-getenv(3) operations in line with > getenv(3) in that bad environ entries do not cause all operations to > fail. There is still some inconsistency in that getenv(3) in the > absence of any environment-modifying operation does not emit corrupt > environ entry warnings. > > I also fixed another inconsistency in getenv(3) where updating the > global environ pointer would not be reflected in the return values. > It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) > in order to see the change. A simpler patch[1] is to have the build and merge routines skip unusable environ entries and continue to the next entry. It still can return an error due to memory allocation problems, but those do not necessarily reflect a corrupt environ array. I want to test a few more things first. Sean 1. http://people.freebsd.org/~scf/getenv-1.patch -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 16:02:01 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06F57106566B; Tue, 1 Dec 2009 16:02:01 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 96BE78FC12; Tue, 1 Dec 2009 16:02:00 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB1G1xFg081957; Tue, 1 Dec 2009 10:01:59 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Tue, 1 Dec 2009 10:01:59 -0600 (CST) From: "Sean C. Farley" To: Brian Feldman In-Reply-To: <200912010504.nB154VnS053167@svn.freebsd.org> Message-ID: References: <200912010504.nB154VnS053167@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 16:02:01 -0000 On Tue, 1 Dec 2009, Brian Feldman wrote: > I also fixed another inconsistency in getenv(3) where updating the > global environ pointer would not be reflected in the return values. > It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) > in order to see the change. In the current code, if environ is replaced or none of the set/put/unset calls have been made, getenv() will use __findenv_environ() (searches environ directly) to find the entry. This is necessary since malloc() depends upon getenv() creating a cross-dependency. > @@ -426,22 +439,18 @@ getenv(const char *name) > } > > /* > - * An empty environment (environ or its first value) regardless if > - * environ has been copied before will return a NULL. > - * > - * If the environment is not empty, find an environment variable via > - * environ if environ has not been copied via an *env() call or been > - * replaced by a running program, otherwise, use the rebuilt > - * environment. > + * If we have not already allocated memory by performing > + * write operations on the environment, avoid doing so now. > */ > - if (environ == NULL || environ[0] == NULL) > - return (NULL); > - else if (envVars == NULL || environ != intEnviron) > + if (envVars == NULL) > return (__findenv_environ(name, nameLen)); > - else { > - envNdx = envVarsTotal - 1; > - return (__findenv(name, nameLen, &envNdx, true)); > - } > + > + /* Synchronize environment. */ > + if (__merge_environ() == -1) > + return (NULL); > + > + envNdx = envVarsTotal - 1; > + return (__findenv(name, nameLen, &envNdx, true)); > } Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 16:07:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E671065670; Tue, 1 Dec 2009 16:07:50 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B91B8FC2E; Tue, 1 Dec 2009 16:07:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1G7o3P069421; Tue, 1 Dec 2009 16:07:50 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1G7oQG069419; Tue, 1 Dec 2009 16:07:50 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912011607.nB1G7oQG069419@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 1 Dec 2009 16:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199995 - head/contrib/ntp/ntpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 16:07:50 -0000 Author: ume Date: Tue Dec 1 16:07:50 2009 New Revision: 199995 URL: http://svn.freebsd.org/changeset/base/199995 Log: Don't try to bind to an anycast addeess. The KAME IPv6 stack doesn't allow bind to an anycast addeess. It does away with an annoying message. Reviewed by: bz, roberto MFC after: 2 weeks Modified: head/contrib/ntp/ntpd/ntp_io.c Modified: head/contrib/ntp/ntpd/ntp_io.c ============================================================================== --- head/contrib/ntp/ntpd/ntp_io.c Tue Dec 1 15:27:39 2009 (r199994) +++ head/contrib/ntp/ntpd/ntp_io.c Tue Dec 1 16:07:50 2009 (r199995) @@ -65,6 +65,12 @@ #endif /* IPV6 Multicast Support */ #endif /* IPv6 Support */ +#ifdef INCLUDE_IPV6_SUPPORT +#include +#include +#include +#endif /* !INCLUDE_IPV6_SUPPORT */ + extern int listen_to_virtual_ips; extern const char *specific_interface; @@ -1137,6 +1143,36 @@ set_wildcard_reuse(int family, int on) } #endif /* OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */ +#ifdef INCLUDE_IPV6_SUPPORT +static isc_boolean_t +is_anycast(struct sockaddr *sa, char *name) +{ +#if defined(SIOCGIFAFLAG_IN6) && defined(IN6_IFF_ANYCAST) + struct in6_ifreq ifr6; + int fd; + u_int32_t flags6; + + if (sa->sa_family != AF_INET6) + return ISC_FALSE; + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) + return ISC_FALSE; + memset(&ifr6, 0, sizeof(ifr6)); + memcpy(&ifr6.ifr_addr, (struct sockaddr_in6 *)sa, + sizeof(struct sockaddr_in6)); + strlcpy(ifr6.ifr_name, name, IF_NAMESIZE); + if (ioctl(fd, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + close(fd); + return ISC_FALSE; + } + close(fd); + flags6 = ifr6.ifr_ifru.ifru_flags6; + if ((flags6 & IN6_IFF_ANYCAST) != 0) + return ISC_TRUE; +#endif /* !SIOCGIFAFLAG_IN6 || !IN6_IFF_ANYCAST */ + return ISC_FALSE; +} +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * update_interface strategy * @@ -1276,6 +1312,11 @@ update_interfaces( if (is_wildcard_addr(&interface.sin)) continue; +#ifdef INCLUDE_IPV6_SUPPORT + if (is_anycast((struct sockaddr *)&interface.sin, isc_if.name)) + continue; +#endif /* !INCLUDE_IPV6_SUPPORT */ + /* * map to local *address* in order * to map all duplicate interfaces to an interface structure From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 16:25:17 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BF771065670; Tue, 1 Dec 2009 16:25:17 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 501A78FC0A; Tue, 1 Dec 2009 16:25:17 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB1GPGv9010633; Tue, 1 Dec 2009 10:25:16 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Tue, 1 Dec 2009 10:25:16 -0600 (CST) From: "Sean C. Farley" To: Robert Watson In-Reply-To: Message-ID: References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, Brian Feldman , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 16:25:17 -0000 On Tue, 1 Dec 2009, Robert Watson wrote: > On Mon, 30 Nov 2009, Colin Percival wrote: *snip* >> We've already had two major security issues arising out of getenv.c >> in the past year, and I'd like to make sure we don't have a third. > > I think it's fair to say that the POSIXization of the environment code > has been an unmitigated disaster, and speaks to the necessity for > careful review of those sorts of code changes. As the author of the environment code, I agree that it has been a painful process. Interestingly, the security issue was a combination of r169661 to rtld.c, which is a correct action, and the new environ code which was developed, as opposed to committed, at the same time. Separately, the security issue would not have existed. Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 16:29:14 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4097C106568D; Tue, 1 Dec 2009 16:29:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1499F8FC0C; Tue, 1 Dec 2009 16:29:14 +0000 (UTC) Received: from dhcp-0074221542-35-1b.client.fas.harvard.edu (dhcp-0074221542-35-1b.client.fas.harvard.edu [140.247.247.224]) by cyrus.watson.org (Postfix) with ESMTPSA id 501D746B2D; Tue, 1 Dec 2009 11:29:13 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Tue, 1 Dec 2009 11:29:12 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <18889B20-51A1-4B38-A303-7642AE23655B@FreeBSD.org> References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> To: "Sean C. Farley" X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@FreeBSD.org, Brian Feldman , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 16:29:14 -0000 On 1 Dec 2009, at 11:25, Sean C. Farley wrote: >>> We've already had two major security issues arising out of getenv.c = in the past year, and I'd like to make sure we don't have a third. >>=20 >> I think it's fair to say that the POSIXization of the environment = code has been an unmitigated disaster, and speaks to the necessity for = careful review of those sorts of code changes. >=20 > As the author of the environment code, I agree that it has been a = painful process. >=20 > Interestingly, the security issue was a combination of r169661 to = rtld.c, which is a correct action, and the new environ code which was = developed, as opposed to committed, at the same time. Separately, the = security issue would not have existed. One immediately pressing question is whether we can mitigate future = possible problems along the same lines. The obvious thing is a further = (and very careful) audit if all environmental variable use in the base = system. But I wonder if there are some other things we could do, such = as: - libc environment scrubbing: try to be more robust in the presence of = the unexpected (for example, if you find corrupted stuff, ignore it more = robustly); another variation might be to have libc abort(2) if = issetugid() and unsetenv(3) would fail. - kernel environment scrubbing: the kernel is already responsible for = getting those variables across the execve(2) boundary, so is already = copying (and to a lesser extent, validating) it, and could learn to be a = bit more rigorous in its expectations, perhaps more so for = security-sensitive transitions (setuid/setgid/MAC/...) Brian's changes, although poorly timed, seem like a reasonable direction = in this regard: we're stuck with unhelpful APIs, but maybe we can do a = better job. Robert= From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 16:32:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 593F6106566C; Tue, 1 Dec 2009 16:32:01 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 483178FC1A; Tue, 1 Dec 2009 16:32:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1GW1ix070074; Tue, 1 Dec 2009 16:32:01 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1GW18g070072; Tue, 1 Dec 2009 16:32:01 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <200912011632.nB1GW18g070072@svn.freebsd.org> From: Ken Smith Date: Tue, 1 Dec 2009 16:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199996 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 16:32:01 -0000 Author: kensmith Date: Tue Dec 1 16:31:59 2009 New Revision: 199996 URL: http://svn.freebsd.org/changeset/base/199996 Log: Turn releng/8.0 over to secteam. Approved by: core (implicit) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Tue Dec 1 16:07:50 2009 (r199995) +++ svnadmin/conf/approvers Tue Dec 1 16:31:59 2009 (r199996) @@ -19,7 +19,7 @@ #^head/ re #^stable/8/ re #^stable/7/ re -^releng/8.0/ re +^releng/8.0/ (security-officer|so) ^releng/7.[0-2]/ (security-officer|so) ^releng/6.[0-4]/ (security-officer|so) ^releng/5.[0-5]/ (security-officer|so) From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 16:46:59 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB58E106566C; Tue, 1 Dec 2009 16:46:57 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 7672E8FC14; Tue, 1 Dec 2009 16:46:57 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB1GkuWG044128; Tue, 1 Dec 2009 10:46:56 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Tue, 1 Dec 2009 10:46:56 -0600 (CST) From: "Sean C. Farley" To: "Robert N. M. Watson" In-Reply-To: <18889B20-51A1-4B38-A303-7642AE23655B@FreeBSD.org> Message-ID: References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> <18889B20-51A1-4B38-A303-7642AE23655B@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: svn-src-head@FreeBSD.org, Brian Feldman , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 16:47:00 -0000 On Tue, 1 Dec 2009, Robert N. M. Watson wrote: > On 1 Dec 2009, at 11:25, Sean C. Farley wrote: > >>> I think it's fair to say that the POSIXization of the environment >>> code has been an unmitigated disaster, and speaks to the necessity >>> for careful review of those sorts of code changes. >> >> As the author of the environment code, I agree that it has been a >> painful process. >> >> Interestingly, the security issue was a combination of r169661 to >> rtld.c, which is a correct action, and the new environ code which was >> developed, as opposed to committed, at the same time. Separately, >> the security issue would not have existed. > > One immediately pressing question is whether we can mitigate future > possible problems along the same lines. The obvious thing is a further > (and very careful) audit if all environmental variable use in the base > system. But I wonder if there are some other things we could do, such > as: > > - libc environment scrubbing: try to be more robust in the presence of > the unexpected (for example, if you find corrupted stuff, ignore it > more robustly); another variation might be to have libc abort(2) if > issetugid() and unsetenv(3) would fail. The preliminary patch I sent earlier should at least make the calls behave more like they used to do (go through each variable even if corrupt). However, I do agree that more code (getenv.c and any code that calls into it) needs to be verified for more paranoid use of the environment. As for abort(), I was/still am considering having that be the result of a corrupt environ array. If it is corrupt, why attempt to use it? unsetenv() may still fail, so it may not abort() for other scenarios. > - kernel environment scrubbing: the kernel is already responsible for > getting those variables across the execve(2) boundary, so is already > copying (and to a lesser extent, validating) it, and could learn to be > a bit more rigorous in its expectations, perhaps more so for > security-sensitive transitions (setuid/setgid/MAC/...) That is a good point. I had not thought about kernel validation of the environment in addition to the validation performed in libc. > Brian's changes, although poorly timed, seem like a reasonable > direction in this regard: we're stuck with unhelpful APIs, but maybe > we can do a better job. Getting rid of putenv() and especially removing direct access of environ (replaced with API call(s)) would be my favorite API changes. Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 17:10:53 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E5EB1065696; Tue, 1 Dec 2009 17:10:53 +0000 (UTC) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green.homeunix.org [66.92.150.152]) by mx1.freebsd.org (Postfix) with ESMTP id BC0DC8FC19; Tue, 1 Dec 2009 17:10:52 +0000 (UTC) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.14.3/8.14.1) with ESMTP id nB1HApx1044356; Tue, 1 Dec 2009 12:10:51 -0500 (EST) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.14.3/8.14.3/Submit) id nB1HApOx044355; Tue, 1 Dec 2009 12:10:51 -0500 (EST) (envelope-from green) Date: Tue, 1 Dec 2009 12:10:50 -0500 From: Brian Fundakowski Feldman To: "Robert N. M. Watson" Message-ID: <20091201171050.GC35660@green.homeunix.org> References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> <18889B20-51A1-4B38-A303-7642AE23655B@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18889B20-51A1-4B38-A303-7642AE23655B@FreeBSD.org> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Colin Percival , "Sean C. Farley" Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 17:10:53 -0000 On Tue, Dec 01, 2009 at 11:29:12AM -0500, Robert N. M. Watson wrote: > > On 1 Dec 2009, at 11:25, Sean C. Farley wrote: > > >>> We've already had two major security issues arising out of getenv.c in the past year, and I'd like to make sure we don't have a third. > >> > >> I think it's fair to say that the POSIXization of the environment code has been an unmitigated disaster, and speaks to the necessity for careful review of those sorts of code changes. > > > > As the author of the environment code, I agree that it has been a painful process. > > > > Interestingly, the security issue was a combination of r169661 to rtld.c, which is a correct action, and the new environ code which was developed, as opposed to committed, at the same time. Separately, the security issue would not have existed. > > One immediately pressing question is whether we can mitigate future possible problems along the same lines. The obvious thing is a further (and very careful) audit if all environmental variable use in the base system. But I wonder if there are some other things we could do, such as: > > - libc environment scrubbing: try to be more robust in the presence of the unexpected (for example, if you find corrupted stuff, ignore it more robustly); another variation might be to have libc abort(2) if issetugid() and unsetenv(3) would fail. An abort() makes more sense than an error return where no error is ever expected (i.e. expecting unsetenv(3) to never fail is quite reasonable). > - kernel environment scrubbing: the kernel is already responsible for getting those variables across the execve(2) boundary, so is already copying (and to a lesser extent, validating) it, and could learn to be a bit more rigorous in its expectations, perhaps more so for security-sensitive transitions (setuid/setgid/MAC/...) > > Brian's changes, although poorly timed, seem like a reasonable direction in this regard: we're stuck with unhelpful APIs, but maybe we can do a better job. Do you see a clear advantage to scrubbing environment in the kernel versus libc? The libc environ functions will still need to be able to do it upon change of the environ pointer, so there's some duplication of functionality; but then again there may be iffy environ-using logic in things you run which are not using the /lib/libc.so. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 17:24:32 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 678C31065679; Tue, 1 Dec 2009 17:24:32 +0000 (UTC) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green.homeunix.org [66.92.150.152]) by mx1.freebsd.org (Postfix) with ESMTP id EBFF38FC20; Tue, 1 Dec 2009 17:24:31 +0000 (UTC) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.14.3/8.14.1) with ESMTP id nB1HOUVc044402; Tue, 1 Dec 2009 12:24:30 -0500 (EST) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.14.3/8.14.3/Submit) id nB1HOUQ9044401; Tue, 1 Dec 2009 12:24:30 -0500 (EST) (envelope-from green) Date: Tue, 1 Dec 2009 12:24:30 -0500 From: Brian Fundakowski Feldman To: "Sean C. Farley" Message-ID: <20091201172430.GD35660@green.homeunix.org> References: <200912010504.nB154VnS053167@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 17:24:32 -0000 On Tue, Dec 01, 2009 at 10:01:59AM -0600, Sean C. Farley wrote: > On Tue, 1 Dec 2009, Brian Feldman wrote: > >> I also fixed another inconsistency in getenv(3) where updating the >> global environ pointer would not be reflected in the return values. >> It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) >> in order to see the change. > > In the current code, if environ is replaced or none of the set/put/unset > calls have been made, getenv() will use __findenv_environ() (searches > environ directly) to find the entry. This is necessary since malloc() > depends upon getenv() creating a cross-dependency. Could you replace the (quoted) comment wholesale with something to that effect? >> @@ -426,22 +439,18 @@ getenv(const char *name) >> } >> >> /* >> - * An empty environment (environ or its first value) regardless if >> - * environ has been copied before will return a NULL. >> - * >> - * If the environment is not empty, find an environment variable via >> - * environ if environ has not been copied via an *env() call or been >> - * replaced by a running program, otherwise, use the rebuilt >> - * environment. >> + * If we have not already allocated memory by performing >> + * write operations on the environment, avoid doing so now. >> */ >> - if (environ == NULL || environ[0] == NULL) >> - return (NULL); >> - else if (envVars == NULL || environ != intEnviron) >> + if (envVars == NULL) >> return (__findenv_environ(name, nameLen)); >> - else { >> - envNdx = envVarsTotal - 1; >> - return (__findenv(name, nameLen, &envNdx, true)); >> - } >> + >> + /* Synchronize environment. */ >> + if (__merge_environ() == -1) >> + return (NULL); >> + >> + envNdx = envVarsTotal - 1; >> + return (__findenv(name, nameLen, &envNdx, true)); >> } -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 17:29:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB48106568D; Tue, 1 Dec 2009 17:29:25 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D299F8FC19; Tue, 1 Dec 2009 17:29:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1HTP8q071289; Tue, 1 Dec 2009 17:29:25 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1HTP4J071287; Tue, 1 Dec 2009 17:29:25 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <200912011729.nB1HTP4J071287@svn.freebsd.org> From: "Justin T. Gibbs" Date: Tue, 1 Dec 2009 17:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199997 - head/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 17:29:26 -0000 Author: gibbs Date: Tue Dec 1 17:29:25 2009 New Revision: 199997 URL: http://svn.freebsd.org/changeset/base/199997 Log: Add media ioctl support and link notifications so that devd will attempt to run dhclient on a netfront (xn) device that is setup for DHCP in /etc/rc.conf. PR: kern/136251 (fixed differently than the submitted patch) Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Tue Dec 1 16:31:59 2009 (r199996) +++ head/sys/dev/xen/netfront/netfront.c Tue Dec 1 17:29:25 2009 (r199997) @@ -155,6 +155,9 @@ static void netif_disconnect_backend(str static int setup_device(device_t dev, struct netfront_info *info); static void end_access(int ref, void *page); +static int xn_ifmedia_upd(struct ifnet *ifp); +static void xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); + /* Xenolinux helper functions */ int network_connect(struct netfront_info *); @@ -240,7 +243,9 @@ struct netfront_info { /* Receive-ring batched refills. */ #define RX_MIN_TARGET 32 #define RX_MAX_TARGET NET_RX_RING_SIZE - int rx_min_target, rx_max_target, rx_target; + int rx_min_target; + int rx_max_target; + int rx_target; /* * {tx,rx}_skbs store outstanding skbuffs. The first entry in each @@ -253,19 +258,20 @@ struct netfront_info { grant_ref_t grant_rx_ref[NET_TX_RING_SIZE + 1]; #define TX_MAX_TARGET min(NET_RX_RING_SIZE, 256) - device_t xbdev; - int tx_ring_ref; - int rx_ring_ref; - uint8_t mac[ETHER_ADDR_LEN]; + device_t xbdev; + int tx_ring_ref; + int rx_ring_ref; + uint8_t mac[ETHER_ADDR_LEN]; struct xn_chain_data xn_cdata; /* mbufs */ - struct mbuf_head xn_rx_batch; /* head of the batch queue */ + struct mbuf_head xn_rx_batch; /* head of the batch queue */ int xn_if_flags; struct callout xn_stat_ch; - u_long rx_pfn_array[NET_RX_RING_SIZE]; - multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; - mmu_update_t rx_mmu[NET_RX_RING_SIZE]; + u_long rx_pfn_array[NET_RX_RING_SIZE]; + multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; + mmu_update_t rx_mmu[NET_RX_RING_SIZE]; + struct ifmedia sc_media; }; #define rx_mbufs xn_cdata.xn_rx_chain @@ -1622,6 +1628,7 @@ xn_ifinit_locked(struct netfront_info *s ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if_link_state_change(ifp, LINK_STATE_UP); callout_reset(&sc->xn_stat_ch, hz, xn_tick, sc); @@ -1761,7 +1768,7 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, /* FALLTHROUGH */ case SIOCSIFMEDIA: case SIOCGIFMEDIA: - error = EINVAL; + error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd); break; default: error = ether_ioctl(ifp, cmd, data); @@ -1785,6 +1792,7 @@ xn_stop(struct netfront_info *sc) xn_free_tx_ring(sc); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + if_link_state_change(ifp, LINK_STATE_DOWN); } /* START of Xenolinux helper functions adapted to FreeBSD */ @@ -1903,6 +1911,11 @@ create_netdev(device_t dev) np->xbdev = dev; XN_LOCK_INIT(np, xennetif); + + ifmedia_init(&np->sc_media, 0, xn_ifmedia_upd, xn_ifmedia_sts); + ifmedia_add(&np->sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL); + ifmedia_set(&np->sc_media, IFM_ETHER|IFM_MANUAL); + np->rx_target = RX_MIN_TARGET; np->rx_min_target = RX_MIN_TARGET; np->rx_max_target = RX_MAX_TARGET; @@ -1987,7 +2000,8 @@ out: * acknowledgement. */ #if 0 -static void netfront_closing(device_t dev) +static void +netfront_closing(device_t dev) { #if 0 struct netfront_info *info = dev->dev_driver_data; @@ -2000,7 +2014,8 @@ static void netfront_closing(device_t de } #endif -static int netfront_detach(device_t dev) +static int +netfront_detach(device_t dev) { struct netfront_info *info = device_get_softc(dev); @@ -2011,8 +2026,8 @@ static int netfront_detach(device_t dev) return 0; } - -static void netif_free(struct netfront_info *info) +static void +netif_free(struct netfront_info *info) { netif_disconnect_backend(info); #if 0 @@ -2020,7 +2035,8 @@ static void netif_free(struct netfront_i #endif } -static void netif_disconnect_backend(struct netfront_info *info) +static void +netif_disconnect_backend(struct netfront_info *info) { XN_RX_LOCK(info); XN_TX_LOCK(info); @@ -2042,12 +2058,26 @@ static void netif_disconnect_backend(str } -static void end_access(int ref, void *page) +static void +end_access(int ref, void *page) { if (ref != GRANT_INVALID_REF) gnttab_end_foreign_access(ref, page); } +static int +xn_ifmedia_upd(struct ifnet *ifp) +{ + return (0); +} + +static void +xn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + ifmr->ifm_status = IFM_AVALID|IFM_ACTIVE; + ifmr->ifm_active = IFM_ETHER|IFM_MANUAL; +} + /* ** Driver registration ** */ static device_method_t netfront_methods[] = { /* Device interface */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 19:14:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E3AC106568B; Tue, 1 Dec 2009 19:14:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3528FC12; Tue, 1 Dec 2009 19:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1JEvD8073648; Tue, 1 Dec 2009 19:14:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1JEvV3073646; Tue, 1 Dec 2009 19:14:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912011914.nB1JEvV3073646@svn.freebsd.org> From: Ed Schouten Date: Tue, 1 Dec 2009 19:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199998 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 19:14:57 -0000 Author: ed Date: Tue Dec 1 19:14:57 2009 New Revision: 199998 URL: http://svn.freebsd.org/changeset/base/199998 Log: Don't allocate an input buffer for a TTY when the receiver is turned off. When the termios CREAD flag is not set, it makes little sense to allocate an input buffer. Just set the size to 0 in this case to reduce memory footprint. Disallow CREAD to be disabled for pseudo-devices to prevent foot-shooting. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Tue Dec 1 17:29:25 2009 (r199997) +++ head/sys/kern/tty.c Tue Dec 1 19:14:57 2009 (r199998) @@ -102,10 +102,11 @@ static const char *dev_console_filename; static void tty_watermarks(struct tty *tp) { - size_t bs; + size_t bs = 0; /* Provide an input buffer for 0.2 seconds of data. */ - bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX); + if (tp->t_termios.c_cflag & CREAD) + bs = MIN(tp->t_termios.c_ispeed / 5, TTYBUF_MAX); ttyinq_setsize(&tp->t_inq, tp, bs); /* Set low watermark at 10% (when 90% is available). */ @@ -890,6 +891,7 @@ ttydevsw_defparam(struct tty *tp, struct t->c_ospeed = B50; else if (t->c_ospeed > B115200) t->c_ospeed = B115200; + t->c_cflag |= CREAD; return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 21:54:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF9831065670; Tue, 1 Dec 2009 21:54:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BED118FC08; Tue, 1 Dec 2009 21:54:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1LsrKt077256; Tue, 1 Dec 2009 21:54:53 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1LsrQn077254; Tue, 1 Dec 2009 21:54:53 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200912012154.nB1LsrQn077254@svn.freebsd.org> From: Ed Maste Date: Tue, 1 Dec 2009 21:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200001 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 21:54:53 -0000 Author: emaste Date: Tue Dec 1 21:54:53 2009 New Revision: 200001 URL: http://svn.freebsd.org/changeset/base/200001 Log: Fix parenthesis typo -- copy full frame pointer for userland callchain, not just one byte. Submitted by: Ryan Stone rysto32 at gmail dot com Modified: head/sys/dev/hwpmc/hwpmc_x86.c Modified: head/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_x86.c Tue Dec 1 21:05:08 2009 (r200000) +++ head/sys/dev/hwpmc/hwpmc_x86.c Tue Dec 1 21:54:53 2009 (r200001) @@ -101,7 +101,7 @@ pmc_save_user_callchain(uintptr_t *cc, i if (copyin((void *) sp, &pc, sizeof(pc)) != 0) return (n); } else if (copyin((void *) r, &pc, sizeof(pc)) != 0 || - copyin((void *) fp, &fp, sizeof(fp) != 0)) + copyin((void *) fp, &fp, sizeof(fp)) != 0) return (n); for (; n < nframes;) { From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 22:19:24 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21BEE106566B; Tue, 1 Dec 2009 22:19:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id D102F8FC13; Tue, 1 Dec 2009 22:19:23 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nB1MJKtr004755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Dec 2009 14:19:22 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B15966B.9080102@FreeBSD.org> Date: Tue, 01 Dec 2009 14:19:23 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tom Judge References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> <4B14BF23.1030303@FreeBSD.org> <4B1516E5.9030508@tomjudge.com> In-Reply-To: <4B1516E5.9030508@tomjudge.com> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 22:19:24 -0000 Tom Judge wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Maxim Sobolev wrote: >> Stanislav Sedov wrote: >>> On Mon, 30 Nov 2009 13:25:03 -0800 >>> Maxim Sobolev mentioned: >>> >>>> Can we change the name then? We've seen the similar issue without the >>>> jumbo frames, which made me wonder. >>> It's strange, because 'normal' frames are less than a page size in >>> length, >>> so the issue I was experiencing should not be reproducable with jumbo >>> frames >>> disabled. Can you describe a bit more what kind of problem you're >>> experiencing? >> The traffic through interface abruptly halts randomly when under a load, >> without any signs of a problem. What is interesting is that the >> communication through unix domain sockets appears to be down too, since >> some scripts that connect to database not able to complete as well, so >> whatever this problem is it affect the whole network subsystem. We tried >> to replace hardware and it did not help. Only after we replaced bce(4) >> with IntelPro card (em) the problem has went away. > > When you see this lock up do you also see denied requests for mbufs? > > All the times I have seen the issue, the system was denying mbuf requests. Not sure about that, since we only have had network connection to that box, no console. However, I think that the problem with the other network subsystems that we see at the same time suggests that it might be an issue with the mbufs indeed. -Maxim From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 22:23:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07E76106568D; Tue, 1 Dec 2009 22:23:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8BCC8FC0A; Tue, 1 Dec 2009 22:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1MNFoC078096; Tue, 1 Dec 2009 22:23:15 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1MNFKI078093; Tue, 1 Dec 2009 22:23:15 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200912012223.nB1MNFKI078093@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 1 Dec 2009 22:23:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200003 - in head/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 22:23:16 -0000 Author: np Date: Tue Dec 1 22:23:15 2009 New Revision: 200003 URL: http://svn.freebsd.org/changeset/base/200003 Log: T3 firmware 7.8.0 for cxgb(4) Obtained from: Chelsio MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/cxgb_t3fw.h Modified: head/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_common.h Tue Dec 1 22:18:27 2009 (r200002) +++ head/sys/dev/cxgb/common/cxgb_common.h Tue Dec 1 22:23:15 2009 (r200003) @@ -97,7 +97,7 @@ enum { enum { FW_VERSION_MAJOR = 7, - FW_VERSION_MINOR = 7, + FW_VERSION_MINOR = 8, FW_VERSION_MICRO = 0 }; Modified: head/sys/dev/cxgb/cxgb_t3fw.h ============================================================================== --- head/sys/dev/cxgb/cxgb_t3fw.h Tue Dec 1 22:18:27 2009 (r200002) +++ head/sys/dev/cxgb/cxgb_t3fw.h Tue Dec 1 22:23:15 2009 (r200003) @@ -32,8 +32,8 @@ $FreeBSD$ #define U (unsigned char) -static unsigned int t3fw_length = 30772; -static unsigned char t3fw[30772] = { +static unsigned int t3fw_length = 30840; +static unsigned char t3fw[30840] = { U 0x60, U 0x00, U 0x74, U 0x00, U 0x20, U 0x03, U 0x80, U 0x00, U 0x20, U 0x03, U 0x70, U 0x00, @@ -55,13 +55,13 @@ static unsigned char t3fw[30772] = { U 0x1F, U 0xFF, U 0xC0, U 0x00, U 0xE3, U 0x00, U 0x04, U 0x3C, U 0x02, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6B, U 0xE8, + U 0x20, U 0x00, U 0x6C, U 0x34, U 0x1F, U 0xFF, U 0xC2, U 0x90, - U 0x20, U 0x00, U 0x6C, U 0x30, + U 0x20, U 0x00, U 0x6C, U 0x7C, U 0x1F, U 0xFF, U 0xC2, U 0x94, - U 0x20, U 0x00, U 0x6C, U 0x70, + U 0x20, U 0x00, U 0x6C, U 0xBC, U 0x1F, U 0xFF, U 0xC2, U 0x98, - U 0x20, U 0x00, U 0x6C, U 0xE4, + U 0x20, U 0x00, U 0x6D, U 0x30, U 0x1F, U 0xFF, U 0xC2, U 0x9C, U 0x20, U 0x00, U 0x03, U 0xC0, U 0xC0, U 0x00, U 0x00, U 0xE4, @@ -396,11 +396,11 @@ static unsigned char t3fw[30772] = { U 0x20, U 0x00, U 0x03, U 0xB0, U 0xE3, U 0x00, U 0x0D, U 0x3C, U 0x20, U 0x00, U 0x03, U 0xB0, - U 0x20, U 0x00, U 0x6E, U 0x08, + U 0x20, U 0x00, U 0x6E, U 0x54, U 0xE3, U 0x00, U 0x0D, U 0x3C, - U 0x20, U 0x00, U 0x6E, U 0x08, - U 0x20, U 0x00, U 0x6E, U 0x08, - U 0xE3, U 0x00, U 0x77, U 0x94, + U 0x20, U 0x00, U 0x6E, U 0x54, + U 0x20, U 0x00, U 0x6E, U 0x54, + U 0xE3, U 0x00, U 0x77, U 0xE0, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, @@ -408,8 +408,8 @@ static unsigned char t3fw[30772] = { U 0x1F, U 0xFC, U 0x00, U 0x00, U 0x1F, U 0xFF, U 0xC5, U 0x90, U 0x1F, U 0xFF, U 0xC6, U 0x70, - U 0x20, U 0x00, U 0x6E, U 0x08, - U 0x20, U 0x00, U 0x6E, U 0x08, + U 0x20, U 0x00, U 0x6E, U 0x58, + U 0x20, U 0x00, U 0x6E, U 0x58, U 0xDE, U 0xFF, U 0xFE, U 0x00, U 0x00, U 0x00, U 0x08, U 0x0C, U 0xDE, U 0xAD, U 0xBE, U 0xEF, @@ -616,47 +616,47 @@ static unsigned char t3fw[30772] = { U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x55, U 0x08, - U 0x20, U 0x00, U 0x53, U 0xD8, - U 0x20, U 0x00, U 0x55, U 0x08, - U 0x20, U 0x00, U 0x55, U 0x08, - U 0x20, U 0x00, U 0x53, U 0x14, - U 0x20, U 0x00, U 0x53, U 0x14, - U 0x20, U 0x00, U 0x53, U 0x14, - U 0x20, U 0x00, U 0x51, U 0x54, - U 0x20, U 0x00, U 0x51, U 0x54, - U 0x20, U 0x00, U 0x51, U 0x4C, - U 0x20, U 0x00, U 0x50, U 0xB8, - U 0x20, U 0x00, U 0x4F, U 0x60, - U 0x20, U 0x00, U 0x4D, U 0x40, - U 0x20, U 0x00, U 0x4B, U 0x14, - U 0x00, U 0x00, U 0x00, U 0x00, - U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x54, U 0xD8, - U 0x20, U 0x00, U 0x53, U 0xA4, - U 0x20, U 0x00, U 0x54, U 0x48, - U 0x20, U 0x00, U 0x54, U 0x48, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0x44, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x4E, U 0x80, - U 0x20, U 0x00, U 0x4C, U 0xF0, - U 0x20, U 0x00, U 0x4A, U 0xC0, + U 0x20, U 0x00, U 0x55, U 0x54, + U 0x20, U 0x00, U 0x54, U 0x24, + U 0x20, U 0x00, U 0x55, U 0x54, + U 0x20, U 0x00, U 0x55, U 0x54, + U 0x20, U 0x00, U 0x53, U 0x60, + U 0x20, U 0x00, U 0x53, U 0x60, + U 0x20, U 0x00, U 0x53, U 0x60, + U 0x20, U 0x00, U 0x51, U 0xA0, + U 0x20, U 0x00, U 0x51, U 0xA0, + U 0x20, U 0x00, U 0x51, U 0x98, + U 0x20, U 0x00, U 0x51, U 0x04, + U 0x20, U 0x00, U 0x4F, U 0xAC, + U 0x20, U 0x00, U 0x4D, U 0x8C, + U 0x20, U 0x00, U 0x4B, U 0x60, + U 0x00, U 0x00, U 0x00, U 0x00, + U 0x00, U 0x00, U 0x00, U 0x00, + U 0x20, U 0x00, U 0x55, U 0x24, + U 0x20, U 0x00, U 0x53, U 0xF0, + U 0x20, U 0x00, U 0x54, U 0x94, + U 0x20, U 0x00, U 0x54, U 0x94, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x51, U 0x90, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x4E, U 0xCC, + U 0x20, U 0x00, U 0x4D, U 0x3C, + U 0x20, U 0x00, U 0x4B, U 0x0C, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x20, U 0x00, U 0x0B, U 0xE8, U 0x20, U 0x00, U 0x3A, U 0xA8, U 0x20, U 0x00, U 0x04, U 0xC0, - U 0x20, U 0x00, U 0x46, U 0xB4, + U 0x20, U 0x00, U 0x46, U 0xFC, U 0x20, U 0x00, U 0x0B, U 0xE0, U 0x20, U 0x00, U 0x41, U 0xC0, U 0x20, U 0x00, U 0x03, U 0xF0, - U 0x20, U 0x00, U 0x46, U 0x74, - U 0x20, U 0x00, U 0x4A, U 0x9C, + U 0x20, U 0x00, U 0x46, U 0xBC, + U 0x20, U 0x00, U 0x4A, U 0xE8, U 0x20, U 0x00, U 0x3E, U 0xCC, U 0x20, U 0x00, U 0x3D, U 0xE8, U 0x20, U 0x00, U 0x3A, U 0x24, @@ -666,7 +666,7 @@ static unsigned char t3fw[30772] = { U 0x20, U 0x00, U 0x3C, U 0x44, U 0x20, U 0x00, U 0x2D, U 0xB0, U 0x20, U 0x00, U 0x28, U 0x44, - U 0x20, U 0x00, U 0x67, U 0x8C, + U 0x20, U 0x00, U 0x67, U 0xD8, U 0x20, U 0x00, U 0x23, U 0xD0, U 0x20, U 0x00, U 0x20, U 0xB0, U 0x20, U 0x00, U 0x20, U 0x5C, @@ -851,22 +851,22 @@ static unsigned char t3fw[30772] = { U 0x0B, U 0xBB, U 0x90, U 0x00, U 0x53, U 0x00, U 0x00, U 0x00, U 0x63, U 0xFF, U 0xFC, U 0x00, - U 0x20, U 0x00, U 0x6B, U 0xC4, + U 0x20, U 0x00, U 0x6C, U 0x10, U 0x10, U 0xFF, U 0xFF, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6B, U 0xE8, + U 0x20, U 0x00, U 0x6C, U 0x34, U 0x00, U 0xD2, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6C, U 0x30, + U 0x20, U 0x00, U 0x6C, U 0x7C, U 0x00, U 0xD3, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6C, U 0x70, + U 0x20, U 0x00, U 0x6C, U 0xBC, U 0x00, U 0xD4, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6C, U 0xE4, + U 0x20, U 0x00, U 0x6D, U 0x30, U 0x00, U 0xD5, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, @@ -893,8 +893,8 @@ static unsigned char t3fw[30772] = { U 0xFA, U 0xD3, U 0x0F, U 0x77, U 0x6B, U 0x06, U 0x90, U 0x60, U 0xB4, U 0x66, U 0x77, U 0x63, - U 0xF8, U 0x54, U 0x15, U 0xD3, - U 0x54, U 0x1A, U 0x7E, U 0x0F, + U 0xF8, U 0x54, U 0x15, U 0xE6, + U 0x54, U 0x1A, U 0x91, U 0x0F, U 0x14, U 0x00, U 0x63, U 0xFF, U 0xF9, U 0x00, U 0x00, U 0x00, U 0x6C, U 0x10, U 0x04, U 0xC0, @@ -1107,7 +1107,7 @@ static unsigned char t3fw[30772] = { U 0xFC, U 0x13, U 0x2C, U 0x16, U 0x18, U 0x2B, U 0x12, U 0x1A, U 0x2A, U 0x12, U 0x1B, U 0xDC, - U 0x50, U 0x58, U 0x19, U 0x91, + U 0x50, U 0x58, U 0x19, U 0xA4, U 0xC0, U 0xD0, U 0xC0, U 0x90, U 0x2E, U 0x5C, U 0xF4, U 0x2C, U 0x12, U 0x17, U 0x28, U 0x12, @@ -1345,7 +1345,7 @@ static unsigned char t3fw[30772] = { U 0xFC, U 0x2A, U 0x00, U 0x00, U 0x64, U 0x50, U 0xC0, U 0xDA, U 0x20, U 0xDB, U 0xC0, U 0x58, - U 0x16, U 0x65, U 0xC0, U 0x20, + U 0x16, U 0x78, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xC0, U 0x91, U 0x63, U 0xFD, U 0x7A, U 0x00, U 0xC0, U 0x91, U 0x63, U 0xFA, @@ -1354,7 +1354,7 @@ static unsigned char t3fw[30772] = { U 0x0A, U 0x80, U 0xC0, U 0x9A, U 0x29, U 0x24, U 0x68, U 0x2C, U 0x70, U 0x07, U 0x58, U 0x15, - U 0x55, U 0xD2, U 0xA0, U 0xD1, + U 0x68, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x03, U 0x47, U 0x0B, U 0x18, U 0xED, U 0x4F, U 0xDB, U 0x70, U 0xA8, U 0x28, U 0x78, @@ -1362,7 +1362,7 @@ static unsigned char t3fw[30772] = { U 0xF8, U 0xD9, U 0xB0, U 0x63, U 0xFA, U 0x61, U 0x00, U 0x00, U 0x2A, U 0x2C, U 0x74, U 0xDB, - U 0x40, U 0x58, U 0x0E, U 0xD1, + U 0x40, U 0x58, U 0x0E, U 0xE3, U 0x63, U 0xFA, U 0xE4, U 0x00, U 0x00, U 0x29, U 0x22, U 0x1D, U 0x2D, U 0x25, U 0x02, U 0x7B, @@ -1386,7 +1386,7 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0xD1, U 0x2E, U 0x0A, U 0x80, U 0xC0, U 0x9E, U 0x29, U 0x24, U 0x68, U 0x2C, U 0x70, - U 0x07, U 0x58, U 0x15, U 0x34, + U 0x07, U 0x58, U 0x15, U 0x47, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xC0, U 0x94, U 0x63, U 0xFB, U 0xC9, U 0xC0, U 0x96, U 0x63, @@ -1472,7 +1472,7 @@ static unsigned char t3fw[30772] = { U 0x28, U 0x2D, U 0xF6, U 0x85, U 0xC8, U 0x5A, U 0x2A, U 0x2C, U 0x74, U 0xDB, U 0x40, U 0x58, - U 0x0E, U 0x64, U 0xD2, U 0xA0, + U 0x0E, U 0x76, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x00, U 0x29, U 0xCC, U 0xF9, @@ -1497,26 +1497,26 @@ static unsigned char t3fw[30772] = { U 0x75, U 0x63, U 0xFF, U 0x7D, U 0x00, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, - U 0x40, U 0x58, U 0x15, U 0x3A, + U 0x40, U 0x58, U 0x15, U 0x4D, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x15, U 0xC9, + U 0xB6, U 0x58, U 0x15, U 0xDC, U 0x63, U 0xFF, U 0xE5, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x15, - U 0xC7, U 0x63, U 0xFF, U 0xDC, + U 0xDA, U 0x63, U 0xFF, U 0xDC, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, - U 0x50, U 0x58, U 0x16, U 0x55, + U 0x50, U 0x58, U 0x16, U 0x68, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC8, U 0x58, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x58, U 0x14, - U 0xA7, U 0x2A, U 0x21, U 0x02, + U 0xBA, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAF, U 0xBD, U 0xC0, U 0x94, U 0x09, U 0xA9, U 0x02, U 0x29, U 0x25, U 0x02, U 0x63, U 0xFF, U 0xB2, U 0x00, U 0x00, U 0x2B, U 0x21, U 0x04, U 0x58, - U 0x14, U 0x53, U 0x1D, U 0xEC, + U 0x14, U 0x66, U 0x1D, U 0xEC, U 0xAF, U 0xC0, U 0xE0, U 0x2E, U 0x24, U 0x66, U 0x8F, U 0x30, U 0x2B, U 0x20, U 0x0C, U 0x0F, @@ -1527,7 +1527,7 @@ static unsigned char t3fw[30772] = { U 0xFC, U 0x50, U 0x64, U 0xCF, U 0x56, U 0x2B, U 0x21, U 0x04, U 0xC0, U 0xC0, U 0x58, U 0x14, - U 0x48, U 0x1D, U 0xEC, U 0xA4, + U 0x5B, U 0x1D, U 0xEC, U 0xA4, U 0xC0, U 0xE0, U 0x8F, U 0x30, U 0x2B, U 0x20, U 0x0C, U 0x0F, U 0x8F, U 0x14, U 0x63, U 0xFF, @@ -1535,7 +1535,7 @@ static unsigned char t3fw[30772] = { U 0x2B, U 0x21, U 0x04, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0x58, - U 0x14, U 0x40, U 0x1D, U 0xEC, + U 0x14, U 0x53, U 0x1D, U 0xEC, U 0x9C, U 0xC0, U 0xE0, U 0x2E, U 0x24, U 0x66, U 0x8F, U 0x30, U 0x2B, U 0x20, U 0x0C, U 0x0F, @@ -1574,7 +1574,7 @@ static unsigned char t3fw[30772] = { U 0xAC, U 0xFD, U 0x65, U 0xA0, U 0xC2, U 0xCC, U 0x5F, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0x8C, - U 0x11, U 0x58, U 0x14, U 0xED, + U 0x11, U 0x58, U 0x15, U 0x00, U 0xC0, U 0x51, U 0x9A, U 0x13, U 0xC7, U 0xBF, U 0x9B, U 0xA9, U 0x8E, U 0x13, U 0x2E, U 0xE2, @@ -1613,19 +1613,19 @@ static unsigned char t3fw[30772] = { U 0x20, U 0x7F, U 0x89, U 0x05, U 0x29, U 0xD2, U 0x85, U 0x65, U 0x91, U 0x65, U 0xDA, U 0x20, - U 0x58, U 0x15, U 0x58, U 0xC9, + U 0x58, U 0x15, U 0x6B, U 0xC9, U 0x5C, U 0x60, U 0x01, U 0xFF, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x15, U 0x55, + U 0xB6, U 0x58, U 0x15, U 0x68, U 0x60, U 0x00, U 0x0C, U 0x00, U 0xC0, U 0x90, U 0x63, U 0xFF, U 0xB5, U 0x00, U 0x00, U 0xDA, - U 0x20, U 0x58, U 0x15, U 0x51, + U 0x20, U 0x58, U 0x15, U 0x64, U 0x65, U 0x51, U 0xE4, U 0x8D, U 0x13, U 0x8C, U 0x11, U 0xDB, U 0xD0, U 0x8D, U 0xD0, U 0x02, U 0x2A, U 0x02, U 0x0D, U 0x6D, - U 0x51, U 0x58, U 0x13, U 0xC3, + U 0x51, U 0x58, U 0x13, U 0xD6, U 0x9A, U 0x13, U 0x64, U 0xA1, U 0xCE, U 0xC7, U 0x5F, U 0x8F, U 0xA1, U 0x95, U 0xA9, U 0xC0, @@ -1643,7 +1643,7 @@ static unsigned char t3fw[30772] = { U 0x09, U 0x9D, U 0x02, U 0x64, U 0x81, U 0x59, U 0xC9, U 0xD3, U 0x8A, U 0x10, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x13, U 0xD3, + U 0x04, U 0x58, U 0x13, U 0xE6, U 0x8A, U 0x13, U 0xC0, U 0xB0, U 0x2B, U 0x24, U 0x66, U 0x2E, U 0xA2, U 0x09, U 0x2A, U 0xA0, @@ -1700,7 +1700,7 @@ static unsigned char t3fw[30772] = { U 0xE4, U 0xCF, U 0x2B, U 0xBC, U 0x20, U 0x2B, U 0xC6, U 0x85, U 0x2A, U 0x2C, U 0x74, U 0x8B, - U 0x11, U 0x58, U 0x0D, U 0x7F, + U 0x11, U 0x58, U 0x0D, U 0x91, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x28, U 0x20, U 0x3D, U 0xC0, U 0xE0, U 0x7C, U 0x87, U 0x7F, @@ -1734,14 +1734,14 @@ static unsigned char t3fw[30772] = { U 0xF0, U 0x63, U 0xFE, U 0x95, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x11, U 0xDD, - U 0x50, U 0x58, U 0x15, U 0x71, + U 0x50, U 0x58, U 0x15, U 0x84, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0xE1, U 0x63, U 0xFF, U 0x7A, U 0x8B, U 0x13, U 0x8C, U 0x11, U 0xDD, U 0x50, U 0xC0, U 0xAA, U 0x2E, U 0x0A, U 0x80, U 0x2A, U 0x24, U 0x68, U 0xDA, - U 0x20, U 0x58, U 0x13, U 0xD1, + U 0x20, U 0x58, U 0x13, U 0xE4, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x6C, U 0x10, U 0x06, U 0x29, @@ -1851,19 +1851,19 @@ static unsigned char t3fw[30772] = { U 0x72, U 0x63, U 0xFF, U 0x66, U 0x00, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, - U 0x40, U 0x58, U 0x13, U 0xD8, + U 0x40, U 0x58, U 0x13, U 0xEB, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x14, - U 0x68, U 0x63, U 0xFF, U 0xE8, + U 0x7B, U 0x63, U 0xFF, U 0xE8, U 0xC0, U 0xA0, U 0x63, U 0xFE, U 0x82, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x14, U 0x64, + U 0xB6, U 0x58, U 0x14, U 0x77, U 0x63, U 0xFF, U 0xD9, U 0x00, U 0xDB, U 0x40, U 0x2A, U 0x2C, - U 0x74, U 0x58, U 0x0C, U 0xDF, + U 0x74, U 0x58, U 0x0C, U 0xF1, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x8A, U 0x10, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x12, U 0xF7, + U 0x04, U 0x58, U 0x13, U 0x0A, U 0x1E, U 0xEB, U 0x46, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x63, U 0xFE, U 0xB1, U 0x00, @@ -1893,14 +1893,14 @@ static unsigned char t3fw[30772] = { U 0x22, U 0xD2, U 0x85, U 0xCF, U 0x25, U 0x60, U 0x00, U 0x0D, U 0x00, U 0xDA, U 0x60, U 0xC0, - U 0xB6, U 0x58, U 0x14, U 0x40, + U 0xB6, U 0x58, U 0x14, U 0x53, U 0xC8, U 0x5A, U 0x60, U 0x01, U 0x0F, U 0x00, U 0xDA, U 0x60, - U 0x58, U 0x14, U 0x3D, U 0x65, + U 0x58, U 0x14, U 0x50, U 0x65, U 0x51, U 0x06, U 0xDC, U 0x40, U 0xDB, U 0x30, U 0x8D, U 0x30, U 0xDA, U 0x60, U 0x0D, U 0x6D, - U 0x51, U 0x58, U 0x12, U 0xB0, + U 0x51, U 0x58, U 0x12, U 0xC3, U 0xD3, U 0xA0, U 0x64, U 0xA0, U 0xF3, U 0x84, U 0xA1, U 0xC0, U 0x51, U 0x04, U 0x04, U 0x47, @@ -1911,7 +1911,7 @@ static unsigned char t3fw[30772] = { U 0x2C, U 0x64, U 0x66, U 0x6F, U 0xC6, U 0x02, U 0x70, U 0x96, U 0x0A, U 0x2B, U 0x61, U 0x04, - U 0x58, U 0x12, U 0xC7, U 0xC0, + U 0x58, U 0x12, U 0xDA, U 0xC0, U 0xB0, U 0x2B, U 0x64, U 0x66, U 0x65, U 0x50, U 0xB4, U 0x2A, U 0x3C, U 0x10, U 0xC0, U 0xE7, @@ -1961,7 +1961,7 @@ static unsigned char t3fw[30772] = { U 0xFF, U 0x60, U 0x00, U 0x00, U 0x2A, U 0x6C, U 0x74, U 0xC0, U 0xB2, U 0xDC, U 0x20, U 0xDD, - U 0x40, U 0x58, U 0x12, U 0xA5, + U 0x40, U 0x58, U 0x12, U 0xB8, U 0xC0, U 0xB0, U 0x63, U 0xFF, U 0x63, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x00, @@ -2013,7 +2013,7 @@ static unsigned char t3fw[30772] = { U 0xA6, U 0x9D, U 0x2F, U 0x35, U 0x02, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x30, U 0xC0, - U 0xB6, U 0x58, U 0x13, U 0xC8, + U 0xB6, U 0x58, U 0x13, U 0xDB, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x6C, U 0x10, U 0x06, U 0x2A, U 0x20, U 0x06, U 0x94, U 0x10, @@ -2024,7 +2024,7 @@ static unsigned char t3fw[30772] = { U 0x92, U 0x0A, U 0xCC, U 0x5F, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0x8C, U 0x10, U 0x58, U 0x13, - U 0x2C, U 0xC0, U 0x51, U 0xD3, + U 0x3F, U 0xC0, U 0x51, U 0xD3, U 0xA0, U 0xC7, U 0xAF, U 0x9A, U 0x3A, U 0xC0, U 0xD0, U 0x1C, U 0xEA, U 0xA5, U 0x14, U 0xEA, @@ -2154,37 +2154,37 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, - U 0x10, U 0x58, U 0x12, U 0xA9, + U 0x10, U 0x58, U 0x12, U 0xBC, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xC0, U 0x91, U 0x63, U 0xFF, U 0x8F, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x13, U 0x37, + U 0xB6, U 0x58, U 0x13, U 0x4A, U 0x63, U 0xFF, U 0xE1, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x13, - U 0x35, U 0x63, U 0xFF, U 0xD8, + U 0x48, U 0x63, U 0xFF, U 0xD8, U 0x2B, U 0x21, U 0x04, U 0x58, - U 0x11, U 0xCC, U 0x1E, U 0xEA, + U 0x11, U 0xDF, U 0x1E, U 0xEA, U 0x1D, U 0x2B, U 0x20, U 0x0C, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x8F, U 0x3A, U 0x63, U 0xFE, U 0x4D, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, U 0x50, U 0x58, U 0x13, - U 0xBE, U 0xD2, U 0xA0, U 0xD1, + U 0xD1, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x2A, U 0x2C, U 0x74, U 0x8B, U 0x10, U 0x58, U 0x0B, - U 0xA7, U 0xD2, U 0xA0, U 0xD1, + U 0xB9, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x29, U 0x21, U 0x38, U 0xC0, U 0x88, U 0x79, U 0x83, U 0x2E, U 0x8C, U 0x31, U 0x0C, U 0xFC, U 0x50, U 0x64, U 0xCE, U 0x22, U 0x2B, U 0x21, U 0x04, U 0xC0, U 0xC0, U 0x58, U 0x11, - U 0xBB, U 0xC0, U 0xD0, U 0x1E, + U 0xCE, U 0xC0, U 0xD0, U 0x1E, U 0xEA, U 0x0C, U 0x8F, U 0x3A, U 0x2B, U 0x20, U 0x0C, U 0x63, U 0xFE, U 0x0D, U 0xDA, U 0x20, - U 0x58, U 0x13, U 0x1D, U 0x63, + U 0x58, U 0x13, U 0x30, U 0x63, U 0xFF, U 0x7A, U 0xDA, U 0x20, U 0x5B, U 0xFF, U 0x22, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x00, @@ -2192,7 +2192,7 @@ static unsigned char t3fw[30772] = { U 0x21, U 0x04, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0x58, U 0x11, - U 0xAF, U 0x1E, U 0xEA, U 0x00, + U 0xC2, U 0x1E, U 0xEA, U 0x00, U 0x2B, U 0x20, U 0x0C, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x8F, U 0x3A, U 0x63, U 0xFD, @@ -2376,7 +2376,7 @@ static unsigned char t3fw[30772] = { U 0xCF, U 0x0B, U 0x4B, U 0x0B, U 0x2B, U 0xC6, U 0x85, U 0xC0, U 0xB0, U 0x8C, U 0x15, U 0x58, - U 0x11, U 0x9C, U 0xD2, U 0xA0, + U 0x11, U 0xAF, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x8A, U 0x35, U 0x6F, U 0xA5, U 0x46, U 0xD8, U 0x30, U 0x8B, U 0xD5, U 0x6D, @@ -2388,7 +2388,7 @@ static unsigned char t3fw[30772] = { U 0x08, U 0x0B, U 0x47, U 0x65, U 0xB1, U 0x0B, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x2C, U 0x12, - U 0x05, U 0x58, U 0x11, U 0xBF, + U 0x05, U 0x58, U 0x11, U 0xD2, U 0xD3, U 0xA0, U 0xC0, U 0xC1, U 0xC0, U 0xD0, U 0x2D, U 0xA4, U 0x03, U 0x9C, U 0x14, U 0x63, @@ -2401,25 +2401,25 @@ static unsigned char t3fw[30772] = { U 0x88, U 0x14, U 0xCC, U 0x87, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x58, U 0x11, - U 0xB3, U 0xC0, U 0x20, U 0xD1, + U 0xC6, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x12, U 0x42, + U 0xB6, U 0x58, U 0x12, U 0x55, U 0x63, U 0xFF, U 0xE4, U 0x00, U 0x00, U 0xDA, U 0x20, U 0x8B, - U 0x10, U 0x58, U 0x12, U 0x3F, + U 0x10, U 0x58, U 0x12, U 0x52, U 0x63, U 0xFF, U 0xD8, U 0x00, U 0x9E, U 0x17, U 0x8A, U 0x12, U 0x2B, U 0x21, U 0x04, U 0x58, - U 0x10, U 0xD5, U 0x8E, U 0x17, + U 0x10, U 0xE8, U 0x8E, U 0x17, U 0xC0, U 0x90, U 0x29, U 0x24, U 0x66, U 0x63, U 0xFE, U 0x34, U 0xC0, U 0x80, U 0x63, U 0xFE, U 0x06, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0xDD, - U 0x50, U 0x58, U 0x12, U 0xC7, + U 0x50, U 0x58, U 0x12, U 0xDA, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x12, - U 0x33, U 0x63, U 0xFF, U 0xA7, + U 0x46, U 0x63, U 0xFF, U 0xA7, U 0x00, U 0x2B, U 0x21, U 0x38, U 0xC0, U 0xA8, U 0x7B, U 0xAB, U 0x02, U 0x60, U 0x01, U 0x04, @@ -2427,7 +2427,7 @@ static unsigned char t3fw[30772] = { U 0x50, U 0x64, U 0xCE, U 0x04, U 0x8A, U 0x12, U 0x2B, U 0x21, U 0x04, U 0xC0, U 0xC0, U 0x98, - U 0x17, U 0x58, U 0x10, U 0xC3, + U 0x17, U 0x58, U 0x10, U 0xD6, U 0x8E, U 0x17, U 0x63, U 0xFD, U 0xF3, U 0x2D, U 0x21, U 0x38, U 0x2D, U 0xDC, U 0xFF, U 0x0D, @@ -2458,7 +2458,7 @@ static unsigned char t3fw[30772] = { U 0x8D, U 0x14, U 0x2E, U 0x0A, U 0x80, U 0xC0, U 0x8E, U 0x28, U 0x24, U 0x68, U 0x58, U 0x11, - U 0x05, U 0xD2, U 0xA0, U 0xD1, + U 0x18, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x2E, U 0x7C, U 0x48, U 0x19, U 0xE8, U 0xF5, U 0x2A, U 0x32, U 0x16, U 0x2B, U 0x76, @@ -2483,7 +2483,7 @@ static unsigned char t3fw[30772] = { U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0xC9, U 0xC0, U 0x9E, U 0x17, U 0x8A, U 0x12, U 0x58, - U 0x10, U 0x8C, U 0x8E, U 0x17, + U 0x10, U 0x9F, U 0x8E, U 0x17, U 0xC0, U 0x34, U 0x8F, U 0x20, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0xC0, U 0x68, U 0x26, @@ -2493,7 +2493,7 @@ static unsigned char t3fw[30772] = { U 0x66, U 0x98, U 0x17, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0x58, - U 0x10, U 0x82, U 0x8E, U 0x17, + U 0x10, U 0x95, U 0x8E, U 0x17, U 0x87, U 0x16, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x63, U 0xFC, U 0xE6, U 0x8D, U 0x35, @@ -2578,13 +2578,13 @@ static unsigned char t3fw[30772] = { U 0xCD, U 0x2D, U 0x25, U 0x23, U 0xC8, U 0x55, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x58, U 0x10, - U 0x7B, U 0x29, U 0x21, U 0x02, + U 0x8E, U 0x29, U 0x21, U 0x02, U 0xCC, U 0x96, U 0xC0, U 0xE8, U 0x0E, U 0x9E, U 0x02, U 0x2E, U 0x25, U 0x02, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, - U 0xDC, U 0x40, U 0x58, U 0x10, - U 0xFC, U 0xC0, U 0x20, U 0xD1, + U 0xDC, U 0x40, U 0x58, U 0x11, + U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x2C, U 0x20, U 0x66, U 0x89, U 0x31, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, @@ -2694,28 +2694,28 @@ static unsigned char t3fw[30772] = { U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xC0, U 0x9A, U 0x63, U 0xFF, U 0xC6, U 0xDA, U 0x20, U 0x58, - U 0x11, U 0x20, U 0x63, U 0xFE, + U 0x11, U 0x33, U 0x63, U 0xFE, U 0x38, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x11, U 0x1D, + U 0xB6, U 0x58, U 0x11, U 0x30, U 0x63, U 0xFE, U 0x2E, U 0x00, U 0x68, U 0x97, U 0x3C, U 0x2B, U 0x9C, U 0xFD, U 0x64, U 0xBE, U 0x24, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0xDB, - U 0x70, U 0x58, U 0x10, U 0xD9, + U 0x70, U 0x58, U 0x10, U 0xEC, U 0xC0, U 0xC0, U 0xC0, U 0xD1, U 0x0A, U 0xDA, U 0x39, U 0x0A, U 0xDC, U 0x38, U 0x65, U 0xCD, U 0xE0, U 0x63, U 0xFE, U 0x09, U 0x8A, U 0x10, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x0F, U 0xAA, + U 0x04, U 0x58, U 0x0F, U 0xBD, U 0xC0, U 0xB0, U 0x2B, U 0x24, U 0x66, U 0x63, U 0xFE, U 0x21, U 0xDB, U 0x40, U 0x2A, U 0x2C, - U 0x74, U 0x58, U 0x09, U 0x8B, + U 0x74, U 0x58, U 0x09, U 0x9D, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x0F, - U 0xAF, U 0x63, U 0xFC, U 0xF7, + U 0xC2, U 0x63, U 0xFC, U 0xF7, U 0x6C, U 0x10, U 0x04, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x6C, U 0x10, U 0x04, U 0x29, @@ -2744,7 +2744,7 @@ static unsigned char t3fw[30772] = { U 0x9B, U 0x68, U 0x98, U 0x0B, U 0x2A, U 0x9C, U 0xF9, U 0x65, U 0xA1, U 0xB2, U 0x02, U 0x2A, - U 0x02, U 0x58, U 0x0F, U 0x91, + U 0x02, U 0x58, U 0x0F, U 0xA4, U 0x89, U 0x37, U 0x1B, U 0xE7, U 0xD7, U 0xC8, U 0x91, U 0x64, U 0x52, U 0x0E, U 0x2A, U 0x21, @@ -2787,7 +2787,7 @@ static unsigned char t3fw[30772] = { U 0x55, U 0x60, U 0x00, U 0x1E, U 0x2A, U 0x20, U 0x0C, U 0xC1, U 0xB2, U 0x8C, U 0x20, U 0x58, - U 0x11, U 0x03, U 0x9A, U 0x18, + U 0x11, U 0x16, U 0x9A, U 0x18, U 0x64, U 0xA2, U 0x45, U 0x8D, U 0x67, U 0x63, U 0xFF, U 0xCF, U 0xC0, U 0xC0, U 0x63, U 0xFF, @@ -2802,7 +2802,7 @@ static unsigned char t3fw[30772] = { U 0x01, U 0x99, U 0xD7, U 0xA0, U 0xDA, U 0x20, U 0xDB, U 0x70, U 0xC1, U 0xC8, U 0x2D, U 0x21, - U 0x20, U 0x58, U 0x10, U 0x9D, + U 0x20, U 0x58, U 0x10, U 0xB0, U 0x8C, U 0x26, U 0x8B, U 0x27, U 0x9A, U 0x16, U 0x0C, U 0xBB, U 0x0C, U 0x7A, U 0xB3, U 0x34, @@ -2820,7 +2820,7 @@ static unsigned char t3fw[30772] = { U 0x02, U 0x60, U 0x00, U 0x97, U 0xCF, U 0x58, U 0x60, U 0x00, U 0x1F, U 0xDA, U 0x20, U 0x8B, - U 0x16, U 0x58, U 0x10, U 0x63, + U 0x16, U 0x58, U 0x10, U 0x76, U 0x65, U 0xA1, U 0x38, U 0x63, U 0xFF, U 0xBD, U 0xC0, U 0x81, U 0xC0, U 0x90, U 0x8F, U 0x18, @@ -2829,7 +2829,7 @@ static unsigned char t3fw[30772] = { U 0x97, U 0xF5, U 0x63, U 0xFF, U 0xD2, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0xDC, U 0x40, U 0x58, - U 0x10, U 0x07, U 0xC0, U 0x51, + U 0x10, U 0x1A, U 0xC0, U 0x51, U 0xD6, U 0xA0, U 0xC0, U 0xC0, U 0x2B, U 0xA0, U 0x10, U 0x2C, U 0xA4, U 0x03, U 0x9B, U 0x17, @@ -2854,7 +2854,7 @@ static unsigned char t3fw[30772] = { U 0x26, U 0x18, U 0x63, U 0xFE, U 0x96, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, - U 0x50, U 0x58, U 0x11, U 0x11, + U 0x50, U 0x58, U 0x11, U 0x24, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x30, U 0x2C, U 0x20, U 0x66, U 0x89, U 0x61, U 0xB1, @@ -2877,7 +2877,7 @@ static unsigned char t3fw[30772] = { U 0x16, U 0xDC, U 0x40, U 0x2F, U 0x22, U 0x13, U 0xDD, U 0x50, U 0xB1, U 0xFF, U 0x2F, U 0x26, - U 0x13, U 0x58, U 0x0F, U 0xA6, + U 0x13, U 0x58, U 0x0F, U 0xB9, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x00, U 0x28, U 0x20, U 0x3D, U 0x08, U 0x48, U 0x40, U 0x65, @@ -2902,28 +2902,28 @@ static unsigned char t3fw[30772] = { U 0xD1, U 0x00, U 0x00, U 0x00, U 0x65, U 0x50, U 0x81, U 0xDA, U 0x20, U 0xDB, U 0x60, U 0xDC, - U 0x40, U 0x58, U 0x0F, U 0xBD, + U 0x40, U 0x58, U 0x0F, U 0xD0, U 0xC0, U 0x20, U 0xC0, U 0xF0, U 0x2F, U 0xA4, U 0x03, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x10, U 0x4B, + U 0xB6, U 0x58, U 0x10, U 0x5E, U 0x63, U 0xFF, U 0xE0, U 0x00, U 0x00, U 0x6F, U 0x95, U 0x02, U 0x63, U 0xFD, U 0x6C, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, U 0x50, U 0xC4, - U 0xE0, U 0x58, U 0x0F, U 0x3E, + U 0xE0, U 0x58, U 0x0F, U 0x51, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x8A, U 0x15, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x0E, U 0xDB, + U 0x04, U 0x58, U 0x0E, U 0xEE, U 0x23, U 0x24, U 0x66, U 0x28, U 0x60, U 0x10, U 0x98, U 0x17, U 0x63, U 0xFF, U 0x21, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x10, - U 0x3E, U 0x63, U 0xFF, U 0xAB, + U 0x51, U 0x63, U 0xFF, U 0xAB, U 0xC8, U 0x58, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0x58, U 0x0F, - U 0x22, U 0x2A, U 0x21, U 0x02, + U 0x35, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAF, U 0x9C, U 0xC0, U 0x94, U 0x09, U 0xA9, U 0x02, U 0x29, U 0x25, U 0x02, U 0x63, @@ -2932,11 +2932,11 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0xA3, U 0x2E, U 0x0A, U 0x80, U 0x2A, U 0x24, U 0x68, U 0xDA, U 0x20, U 0x58, U 0x0F, - U 0x2B, U 0xD2, U 0xA0, U 0xD1, + U 0x3E, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x2B, U 0x20, U 0x0C, U 0x58, U 0x10, - U 0x53, U 0x63, U 0xFF, U 0x6B, + U 0x66, U 0x63, U 0xFF, U 0x6B, U 0x6C, U 0x10, U 0x04, U 0x28, U 0x20, U 0x06, U 0xC0, U 0x62, U 0x28, U 0x8C, U 0xF8, U 0x65, @@ -3007,7 +3007,7 @@ static unsigned char t3fw[30772] = { U 0xAF, U 0xE7, U 0x63, U 0xFF, U 0xA6, U 0x2A, U 0x2C, U 0x74, U 0xC0, U 0xB0, U 0x2C, U 0x0A, - U 0x02, U 0x58, U 0x0E, U 0x15, + U 0x02, U 0x58, U 0x0E, U 0x28, U 0x1C, U 0xE6, U 0xFB, U 0x9C, U 0xA0, U 0x8B, U 0x20, U 0x08, U 0xBB, U 0x11, U 0x06, U 0xBB, @@ -3017,10 +3017,10 @@ static unsigned char t3fw[30772] = { U 0x26, U 0x24, U 0x68, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, U 0x50, U 0x58, - U 0x10, U 0x6F, U 0xD2, U 0xA0, + U 0x10, U 0x82, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x2B, U 0x20, U 0x0C, U 0x58, - U 0x0F, U 0xDA, U 0xC0, U 0x20, + U 0x0F, U 0xED, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x6C, U 0x10, U 0x06, U 0x07, U 0x3D, U 0x14, U 0xC0, U 0x80, @@ -3239,7 +3239,7 @@ static unsigned char t3fw[30772] = { U 0x21, U 0x23, U 0x65, U 0xD4, U 0xA0, U 0xC0, U 0xA6, U 0x2B, U 0x0A, U 0x03, U 0x2C, U 0x22, - U 0x00, U 0x58, U 0x0F, U 0x17, + U 0x00, U 0x58, U 0x0F, U 0x2A, U 0x64, U 0xA3, U 0xB9, U 0x17, U 0xE5, U 0xE6, U 0x8E, U 0x38, U 0x9A, U 0x16, U 0x64, U 0xE3, @@ -3248,11 +3248,11 @@ static unsigned char t3fw[30772] = { U 0xF3, U 0x7E, U 0x83, U 0x11, U 0xC2, U 0xB0, U 0x8C, U 0x20, U 0x2A, U 0x20, U 0x0C, U 0x58, - U 0x0F, U 0x36, U 0xD7, U 0xA0, + U 0x0F, U 0x49, U 0xD7, U 0xA0, U 0xCD, U 0xA1, U 0x60, U 0x04, U 0xA2, U 0x00, U 0xC2, U 0xB0, U 0x8C, U 0x20, U 0x2A, U 0x20, - U 0x0C, U 0x58, U 0x0F, U 0x0A, + U 0x0C, U 0x58, U 0x0F, U 0x1D, U 0xD7, U 0xA0, U 0x64, U 0xA4, U 0x86, U 0x2F, U 0x21, U 0x2E, U 0x8B, U 0x68, U 0x0F, U 0xBF, @@ -3264,7 +3264,7 @@ static unsigned char t3fw[30772] = { U 0x4C, U 0xDA, U 0x20, U 0xDB, U 0x50, U 0xC1, U 0xC4, U 0x2D, U 0x21, U 0x1F, U 0x58, U 0x0E, - U 0xD0, U 0x8B, U 0x26, U 0x9A, + U 0xE3, U 0x8B, U 0x26, U 0x9A, U 0x18, U 0x9A, U 0x19, U 0x89, U 0x27, U 0x2A, U 0xAC, U 0x38, U 0x0B, U 0x99, U 0x0C, U 0x7A, @@ -3291,11 +3291,11 @@ static unsigned char t3fw[30772] = { U 0x93, U 0xC0, U 0xE0, U 0x63, U 0xFF, U 0xE2, U 0xDA, U 0x20, U 0x8B, U 0x18, U 0x58, U 0x0E, - U 0x8D, U 0x65, U 0xA2, U 0xB1, + U 0xA0, U 0x65, U 0xA2, U 0xB1, U 0x63, U 0xFF, U 0x9E, U 0x00, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x58, - U 0x0E, U 0x35, U 0xD6, U 0xA0, + U 0x0E, U 0x48, U 0xD6, U 0xA0, U 0xC0, U 0xC0, U 0xC0, U 0xD1, U 0x2D, U 0x16, U 0x04, U 0x2C, U 0xA4, U 0x03, U 0xDC, U 0x70, @@ -3346,12 +3346,12 @@ static unsigned char t3fw[30772] = { U 0x64, U 0x41, U 0x81, U 0xC0, U 0x44, U 0x2B, U 0x0A, U 0x00, U 0x8C, U 0x20, U 0x2A, U 0x20, - U 0x0C, U 0x58, U 0x0E, U 0xAC, + U 0x0C, U 0x58, U 0x0E, U 0xBF, U 0x0A, U 0xA7, U 0x02, U 0x65, U 0xA0, U 0x0F, U 0xC0, U 0xB0, U 0x2C, U 0x22, U 0x00, U 0x2A, U 0x20, U 0x0C, U 0x58, U 0x0E, - U 0xA8, U 0xD7, U 0xA0, U 0x64, + U 0xBB, U 0xD7, U 0xA0, U 0x64, U 0xAF, U 0xEF, U 0xDA, U 0x20, U 0xC1, U 0xBC, U 0xC1, U 0xC8, U 0x2D, U 0x21, U 0x20, U 0x8F, @@ -3360,7 +3360,7 @@ static unsigned char t3fw[30772] = { U 0x26, U 0x0E, U 0x99, U 0x0C, U 0x09, U 0x09, U 0x48, U 0x29, U 0x25, U 0x25, U 0x58, U 0x0E, - U 0x70, U 0xC0, U 0x90, U 0xC0, + U 0x83, U 0xC0, U 0x90, U 0xC0, U 0x50, U 0xC0, U 0xC2, U 0x88, U 0x60, U 0x9A, U 0x19, U 0x1E, U 0xE5, U 0x6E, U 0xC0, U 0xA1, @@ -3442,7 +3442,7 @@ static unsigned char t3fw[30772] = { U 0xFD, U 0x0B, U 0x2D, U 0xE6, U 0x85, U 0xDA, U 0x20, U 0x8B, U 0x19, U 0x8C, U 0x15, U 0x8D, - U 0x14, U 0x58, U 0x0D, U 0x71, + U 0x14, U 0x58, U 0x0D, U 0x84, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDC, U 0x70, U 0xDF, U 0x50, U 0xDB, U 0x60, U 0x2D, U 0x6C, @@ -3467,20 +3467,20 @@ static unsigned char t3fw[30772] = { U 0xFF, U 0xE8, U 0x88, U 0x14, U 0x65, U 0x81, U 0x68, U 0xDA, U 0x20, U 0xDB, U 0x60, U 0x8C, - U 0x15, U 0x58, U 0x0D, U 0x88, + U 0x15, U 0x58, U 0x0D, U 0x9B, U 0xC0, U 0x20, U 0xC0, U 0x90, U 0x29, U 0xA4, U 0x03, U 0xD1, U 0x0F, U 0x8A, U 0x16, U 0x2B, U 0x21, U 0x04, U 0x58, U 0x0C, - U 0xAF, U 0xC0, U 0xA0, U 0x2A, + U 0xC2, U 0xC0, U 0xA0, U 0x2A, U 0x24, U 0x66, U 0x8E, U 0x68, U 0x63, U 0xFD, U 0xCA, U 0x00, U 0x00, U 0x2B, U 0x9C, U 0xF9, U 0x65, U 0xB0, U 0xFD, U 0xDA, - U 0x20, U 0x58, U 0x0C, U 0xB4, + U 0x20, U 0x58, U 0x0C, U 0xC7, U 0x63, U 0xFC, U 0x22, U 0x00, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x0E, U 0x0D, + U 0xB6, U 0x58, U 0x0E, U 0x20, U 0x63, U 0xFF, U 0xBA, U 0x00, U 0x2B, U 0x20, U 0x0C, U 0x0C, U 0xBE, U 0x11, U 0xA7, U 0xEE, @@ -3500,7 +3500,7 @@ static unsigned char t3fw[30772] = { U 0xC6, U 0x02, U 0x70, U 0x96, U 0x0C, U 0x8A, U 0x16, U 0x2B, U 0x21, U 0x04, U 0x58, U 0x0C, - U 0x93, U 0xC0, U 0xD0, U 0x2D, + U 0xA6, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x8E, U 0x30, U 0x77, U 0xE7, U 0x4D, U 0x1C, U 0xE4, U 0xF1, U 0x1B, U 0xE4, @@ -3528,7 +3528,7 @@ static unsigned char t3fw[30772] = { U 0x8B, U 0x14, U 0x2C, U 0x25, U 0x23, U 0xC8, U 0xB7, U 0x02, U 0x2A, U 0x02, U 0x06, U 0x6B, - U 0x02, U 0x58, U 0x0C, U 0xC4, + U 0x02, U 0x58, U 0x0C, U 0xD7, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAE, U 0xF7, U 0xC0, U 0xD8, U 0x0D, U 0xAD, U 0x02, U 0x2D, @@ -3536,38 +3536,38 @@ static unsigned char t3fw[30772] = { U 0xEC, U 0x00, U 0x8E, U 0x14, U 0xC8, U 0xE8, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x58, U 0x0C, - U 0xBD, U 0x2A, U 0x21, U 0x02, + U 0xD0, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAE, U 0xDA, U 0x07, U 0xAF, U 0x02, U 0x2F, U 0x25, U 0x02, U 0x63, U 0xFE, U 0xD1, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x8D, - U 0x14, U 0x58, U 0x0E, U 0x61, + U 0x14, U 0x58, U 0x0E, U 0x74, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x2B, U 0x20, - U 0x0C, U 0x58, U 0x0D, U 0xCC, + U 0x0C, U 0x58, U 0x0D, U 0xDF, U 0x63, U 0xFE, U 0xB6, U 0x00, U 0xDA, U 0x20, U 0x2B, U 0x20, - U 0x0C, U 0x58, U 0x0D, U 0xEE, + U 0x0C, U 0x58, U 0x0E, U 0x01, U 0x63, U 0xFE, U 0xAA, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x2D, U 0x12, U 0x04, U 0x2E, U 0x0A, U 0x80, U 0x28, U 0x0A, U 0x00, U 0x28, U 0x24, - U 0x68, U 0x58, U 0x0C, U 0xBC, + U 0x68, U 0x58, U 0x0C, U 0xCF, U 0x63, U 0xFA, U 0xE5, U 0x00, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x0D, - U 0xC0, U 0x89, U 0x14, U 0xCD, + U 0xD3, U 0x89, U 0x14, U 0xCD, U 0x92, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x58, - U 0x0D, U 0x2B, U 0xDB, U 0xA0, + U 0x0D, U 0x3E, U 0xDB, U 0xA0, U 0xC0, U 0x20, U 0xC0, U 0xA0, U 0x2A, U 0xB4, U 0x03, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x2A, U 0x2C, U 0x74, U 0x8B, U 0x15, U 0x58, U 0x06, - U 0x35, U 0xD2, U 0xA0, U 0xD1, + U 0x47, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x00, U 0x6C, U 0x10, U 0x0E, U 0x28, U 0x21, U 0x02, U 0x24, U 0x16, @@ -3804,15 +3804,15 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0x90, U 0x63, U 0xFF, U 0x5E, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, - U 0x11, U 0x58, U 0x0C, U 0x37, + U 0x11, U 0x58, U 0x0C, U 0x4A, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x0C, U 0xC6, + U 0xB6, U 0x58, U 0x0C, U 0xD9, U 0x63, U 0xFF, U 0xE5, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x0C, - U 0xC4, U 0x63, U 0xFF, U 0xDC, + U 0xD7, U 0x63, U 0xFF, U 0xDC, U 0x2A, U 0x2C, U 0x74, U 0x8B, - U 0x11, U 0x58, U 0x05, U 0x3F, + U 0x11, U 0x58, U 0x05, U 0x51, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x6C, U 0x10, U 0x06, U 0x28, U 0x20, U 0x06, U 0x8A, U 0x33, @@ -3946,7 +3946,7 @@ static unsigned char t3fw[30772] = { U 0x2D, U 0x20, U 0x6A, U 0x0D, U 0x2D, U 0x41, U 0x65, U 0xDF, U 0x7E, U 0xDA, U 0x20, U 0xC0, - U 0xB0, U 0x58, U 0x0C, U 0x8E, + U 0xB0, U 0x58, U 0x0C, U 0xA1, U 0x64, U 0xAF, U 0x18, U 0xC0, U 0xF1, U 0x63, U 0xFE, U 0xEF, U 0x9F, U 0x27, U 0x63, U 0xFF, @@ -4041,7 +4041,7 @@ static unsigned char t3fw[30772] = { U 0xEE, U 0x12, U 0xDA, U 0x70, U 0xC0, U 0xB3, U 0x2C, U 0x3C, U 0x18, U 0xDD, U 0x50, U 0x58, - U 0x0A, U 0x86, U 0x89, U 0x40, + U 0x0A, U 0x99, U 0x89, U 0x40, U 0xC0, U 0x80, U 0x63, U 0xFE, U 0xE3, U 0x06, U 0x6E, U 0x02, U 0x02, U 0x2A, U 0x02, U 0xDB, @@ -4049,7 +4049,7 @@ static unsigned char t3fw[30772] = { U 0x50, U 0x58, U 0x00, U 0x04, U 0x9A, U 0x10, U 0xDB, U 0x50, U 0xDA, U 0x70, U 0x58, U 0x04, - U 0x53, U 0x88, U 0x10, U 0x63, + U 0x65, U 0x88, U 0x10, U 0x63, U 0xFE, U 0xF7, U 0x00, U 0x00, U 0x6C, U 0x10, U 0x06, U 0x92, U 0x12, U 0x1E, U 0xE2, U 0xC6, @@ -4149,7 +4149,7 @@ static unsigned char t3fw[30772] = { U 0x14, U 0x7B, U 0xA3, U 0x17, U 0x9D, U 0x13, U 0x2A, U 0x20, U 0x0C, U 0x8B, U 0x10, U 0x8C, - U 0x20, U 0x58, U 0x0B, U 0xB0, + U 0x20, U 0x58, U 0x0B, U 0xC3, U 0x8C, U 0x14, U 0x8D, U 0x13, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 22:32:56 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B6F01065693; Tue, 1 Dec 2009 22:32:56 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.freebsd.org (Postfix) with ESMTP id 090E48FC2A; Tue, 1 Dec 2009 22:32:53 +0000 (UTC) Received: by people.fsn.hu (Postfix, from userid 1001) id 1323A1431C8; Tue, 1 Dec 2009 23:14:26 +0100 (CET) X-CRM114-Version: 20090423-BlameSteveJobs ( TRE 0.7.6 (BSD) ) MF-ACE0E1EA [pR: 20.2708] X-CRM114-CacheID: sfid-20091201_23142_1023A4EA X-CRM114-Status: Good ( pR: 20.2708 ) Message-ID: <4B159540.9000503@fsn.hu> Date: Tue, 01 Dec 2009 23:14:24 +0100 From: Attila Nagy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.23) Gecko/20090817 Thunderbird/2.0.0.23 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Maxim Sobolev References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> <4B14BF23.1030303@FreeBSD.org> In-Reply-To: <4B14BF23.1030303@FreeBSD.org> X-Stationery: 0.4.10 Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (people.fsn.hu); Tue, 01 Dec 2009 23:14:25 +0100 (CET) Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-stable-7@FreeBSD.org, Tom Judge Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 22:32:56 -0000 Maxim Sobolev wrote: > Stanislav Sedov wrote: >> On Mon, 30 Nov 2009 13:25:03 -0800 >> Maxim Sobolev mentioned: >> >>> Can we change the name then? We've seen the similar issue without >>> the jumbo frames, which made me wonder. >> >> It's strange, because 'normal' frames are less than a page size in >> length, >> so the issue I was experiencing should not be reproducable with jumbo >> frames >> disabled. Can you describe a bit more what kind of problem you're >> experiencing? > > The traffic through interface abruptly halts randomly when under a > load, without any signs of a problem. What is interesting is that the > communication through unix domain sockets appears to be down too, > since some scripts that connect to database not able to complete as > well, so whatever this problem is it affect the whole network > subsystem. We tried to replace hardware and it did not help. Only > after we replaced bce(4) with IntelPro card (em) the problem has went > away. Sorry, I've just noticed this thread and did not read the earlier posts. I can see similar, although only (at least for now) on version 8 (running something around RC2), also with bce interfaces and "heavy" -in terms of pps, this is a DNS server- network load. Everything which involves network halts for some minutes, but the machine is completely usable from the console. top shows some processes (I don't have an output, but as far as I can remember they were only that which did network IO) in the "keglim" state. Then something happens and the machine starts to work again. Can this be the same, or is it completely different? From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 22:38:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7534310656B9; Tue, 1 Dec 2009 22:38:17 +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 636B18FC17; Tue, 1 Dec 2009 22:38:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1McHT3078548; Tue, 1 Dec 2009 22:38:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1McHGq078545; Tue, 1 Dec 2009 22:38:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912012238.nB1McHGq078545@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Dec 2009 22:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200004 - stable/8/sys/boot/i386/zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 22:38:17 -0000 Author: jhb Date: Tue Dec 1 22:38:17 2009 New Revision: 200004 URL: http://svn.freebsd.org/changeset/base/200004 Log: MFC 199579: Always use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot to fully support booting from large volumes. Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c stable/8/sys/boot/i386/zfsboot/zfsldr.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Tue Dec 1 22:23:15 2009 (r200003) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Tue Dec 1 22:38:17 2009 (r200004) @@ -138,8 +138,8 @@ struct dsk { unsigned unit; unsigned slice; unsigned part; - unsigned start; int init; + daddr_t start; }; static char cmd[512]; static char kname[1024]; @@ -163,7 +163,7 @@ static int parse(void); static void printf(const char *,...); static void putchar(int); static uint32_t memsize(void); -static int drvread(struct dsk *, void *, unsigned, unsigned); +static int drvread(struct dsk *, void *, daddr_t, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); @@ -310,7 +310,8 @@ static int vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { char *p; - unsigned int lba, nb; + daddr_t lba; + unsigned int nb; struct dsk *dsk = (struct dsk *) priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) @@ -964,7 +965,7 @@ static struct { #endif static int -drvread(struct dsk *dsk, void *buf, unsigned lba, unsigned nblk) +drvread(struct dsk *dsk, void *buf, daddr_t lba, unsigned nblk) { #ifdef GPT static unsigned c = 0x2d5c7c2f; @@ -999,7 +1000,7 @@ drvread(struct dsk *dsk, void *buf, unsi v86.es = VTOPSEG(buf); v86.eax = lba; v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; + v86.ecx = lba >> 32; v86.edx = nblk << 8 | dsk->drive; v86int(); v86.ctl = V86_FLAGS; Modified: stable/8/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsldr.S Tue Dec 1 22:23:15 2009 (r200003) +++ stable/8/sys/boot/i386/zfsboot/zfsldr.S Tue Dec 1 22:38:17 2009 (r200004) @@ -83,7 +83,7 @@ ebpb: .byte 0 # BIOS physical drive nu * Trampoline used by boot2 to call read to read data from the disk via * the BIOS. Call with: * - * %cx:%ax - long - LBA to read in + * %ecx:%eax - long - LBA to read in * %es:(%bx) - caddr_t - buffer to read data into * %dl - byte - drive to read from * %dh - byte - num sectors to read @@ -94,10 +94,8 @@ xread: push %ss # Address /* * Setup an EDD disk packet and pass it to read */ -xread.1: # Starting - pushl $0x0 # absolute - push %cx # block - push %ax # number +xread.1: pushl %ecx # Starting absolute block + pushl %eax # block number push %es # Address of push %bx # transfer buffer xor %ax,%ax # Number of @@ -195,7 +193,7 @@ main.4: xor %dx,%dx # Partition:drive */ main.5: mov %dx,MEM_ARG # Save args movb $NSECT,%dh # Sector count - movw $1024,%ax # Offset to boot2 + movl $1024,%eax # Offset to boot2 callw nread.1 # Read disk main.6: mov $MEM_BUF,%si # BTX (before reloc) mov 0xa(%si),%bx # Get BTX length and set @@ -245,10 +243,11 @@ seta20.3: sti # Enable interrupts /* * Trampoline used to call read from within boot1. */ -nread: xor %ax,%ax # Sector offset in partition +nread: xor %eax,%eax # Sector offset in partition nread.1: mov $MEM_BUF,%bx # Transfer buffer - add 0x8(%si),%ax # Get - mov 0xa(%si),%cx # LBA + xor %ecx,%ecx # Get + addl 0x8(%si),%eax # LBA + adc $0,%ecx push %cs # Read from callw xread.1 # disk jnc return # If success, return From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 22:38:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD5E110656A5; Tue, 1 Dec 2009 22:38:37 +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 BBCB88FC0A; Tue, 1 Dec 2009 22:38:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1McbTD078590; Tue, 1 Dec 2009 22:38:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1Mcbl4078587; Tue, 1 Dec 2009 22:38:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912012238.nB1Mcbl4078587@svn.freebsd.org> From: John Baldwin Date: Tue, 1 Dec 2009 22:38:37 +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: r200005 - stable/7/sys/boot/i386/zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 22:38:38 -0000 Author: jhb Date: Tue Dec 1 22:38:37 2009 New Revision: 200005 URL: http://svn.freebsd.org/changeset/base/200005 Log: MFC 199579: Always use 64-bit LBAs for disk addresses in zfsboot and gptzfsboot to fully support booting from large volumes. Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c stable/7/sys/boot/i386/zfsboot/zfsldr.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsboot.c Tue Dec 1 22:38:17 2009 (r200004) +++ stable/7/sys/boot/i386/zfsboot/zfsboot.c Tue Dec 1 22:38:37 2009 (r200005) @@ -138,8 +138,8 @@ struct dsk { unsigned unit; unsigned slice; unsigned part; - unsigned start; int init; + daddr_t start; }; static char cmd[512]; static char kname[1024]; @@ -163,7 +163,7 @@ static int parse(void); static void printf(const char *,...); static void putchar(int); static uint32_t memsize(void); -static int drvread(struct dsk *, void *, unsigned, unsigned); +static int drvread(struct dsk *, void *, daddr_t, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); @@ -310,7 +310,8 @@ static int vdev_read(vdev_t *vdev, void *priv, off_t off, void *buf, size_t bytes) { char *p; - unsigned int lba, nb; + daddr_t lba; + unsigned int nb; struct dsk *dsk = (struct dsk *) priv; if ((off & (DEV_BSIZE - 1)) || (bytes & (DEV_BSIZE - 1))) @@ -964,7 +965,7 @@ static struct { #endif static int -drvread(struct dsk *dsk, void *buf, unsigned lba, unsigned nblk) +drvread(struct dsk *dsk, void *buf, daddr_t lba, unsigned nblk) { #ifdef GPT static unsigned c = 0x2d5c7c2f; @@ -999,7 +1000,7 @@ drvread(struct dsk *dsk, void *buf, unsi v86.es = VTOPSEG(buf); v86.eax = lba; v86.ebx = VTOPOFF(buf); - v86.ecx = lba >> 16; + v86.ecx = lba >> 32; v86.edx = nblk << 8 | dsk->drive; v86int(); v86.ctl = V86_FLAGS; Modified: stable/7/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsldr.S Tue Dec 1 22:38:17 2009 (r200004) +++ stable/7/sys/boot/i386/zfsboot/zfsldr.S Tue Dec 1 22:38:37 2009 (r200005) @@ -83,7 +83,7 @@ ebpb: .byte 0 # BIOS physical drive nu * Trampoline used by boot2 to call read to read data from the disk via * the BIOS. Call with: * - * %cx:%ax - long - LBA to read in + * %ecx:%eax - long - LBA to read in * %es:(%bx) - caddr_t - buffer to read data into * %dl - byte - drive to read from * %dh - byte - num sectors to read @@ -94,10 +94,8 @@ xread: push %ss # Address /* * Setup an EDD disk packet and pass it to read */ -xread.1: # Starting - pushl $0x0 # absolute - push %cx # block - push %ax # number +xread.1: pushl %ecx # Starting absolute block + pushl %eax # block number push %es # Address of push %bx # transfer buffer xor %ax,%ax # Number of @@ -195,7 +193,7 @@ main.4: xor %dx,%dx # Partition:drive */ main.5: mov %dx,MEM_ARG # Save args movb $NSECT,%dh # Sector count - movw $1024,%ax # Offset to boot2 + movl $1024,%eax # Offset to boot2 callw nread.1 # Read disk main.6: mov $MEM_BUF,%si # BTX (before reloc) mov 0xa(%si),%bx # Get BTX length and set @@ -245,10 +243,11 @@ seta20.3: sti # Enable interrupts /* * Trampoline used to call read from within boot1. */ -nread: xor %ax,%ax # Sector offset in partition +nread: xor %eax,%eax # Sector offset in partition nread.1: mov $MEM_BUF,%bx # Transfer buffer - add 0x8(%si),%ax # Get - mov 0xa(%si),%cx # LBA + xor %ecx,%ecx # Get + addl 0x8(%si),%eax # LBA + adc $0,%ecx push %cs # Read from callw xread.1 # disk jnc return # If success, return From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 22:59:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06445106566B; Tue, 1 Dec 2009 22:59:38 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8CB88FC17; Tue, 1 Dec 2009 22:59:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1MxbpL079171; Tue, 1 Dec 2009 22:59:37 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1MxbUj079169; Tue, 1 Dec 2009 22:59:37 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912012259.nB1MxbUj079169@svn.freebsd.org> From: Fabien Thomas Date: Tue, 1 Dec 2009 22:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200007 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 22:59:38 -0000 Author: fabient Date: Tue Dec 1 22:59:37 2009 New Revision: 200007 URL: http://svn.freebsd.org/changeset/base/200007 Log: MFC 198343: Handle the case where there is only one PMC in the system. Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_mod.c Tue Dec 1 22:41:38 2009 (r200006) +++ stable/8/sys/dev/hwpmc/hwpmc_mod.c Tue Dec 1 22:59:37 2009 (r200007) @@ -790,7 +790,7 @@ pmc_link_target_process(struct pmc *pm, KASSERT(PMC_IS_VIRTUAL_MODE(PMC_TO_MODE(pm)), ("[pmc,%d] Attaching a non-process-virtual pmc=%p to pid=%d", __LINE__, pm, pp->pp_proc->p_pid)); - KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < ((int) md->pmd_npmc - 1), + KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= ((int) md->pmd_npmc - 1), ("[pmc,%d] Illegal reference count %d for process record %p", __LINE__, pp->pp_refcnt, (void *) pp)); @@ -843,7 +843,7 @@ pmc_unlink_target_process(struct pmc *pm KASSERT(pm != NULL && pp != NULL, ("[pmc,%d] Null pm %p or pp %p", __LINE__, pm, pp)); - KASSERT(pp->pp_refcnt >= 1 && pp->pp_refcnt < (int) md->pmd_npmc, + KASSERT(pp->pp_refcnt >= 1 && pp->pp_refcnt <= (int) md->pmd_npmc, ("[pmc,%d] Illegal ref count %d on process record %p", __LINE__, pp->pp_refcnt, (void *) pp)); @@ -1110,7 +1110,7 @@ pmc_detach_one_process(struct proc *p, s * descriptor from the target hash table and unset the P_HWPMC * flag in the struct proc. */ - KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < (int) md->pmd_npmc, + KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= (int) md->pmd_npmc, ("[pmc,%d] Illegal refcnt %d for process struct %p", __LINE__, pp->pp_refcnt, pp)); @@ -1785,7 +1785,7 @@ pmc_hook_handler(struct thread *td, int pmc_detach_one_process(td->td_proc, pm, PMC_FLAG_NONE); - KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < (int) md->pmd_npmc, + KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= (int) md->pmd_npmc, ("[pmc,%d] Illegal ref count %d on pp %p", __LINE__, pp->pp_refcnt, pp)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:01:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01BCD1065670; Tue, 1 Dec 2009 23:01:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53588FC08; Tue, 1 Dec 2009 23:01:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1N1TP3079291; Tue, 1 Dec 2009 23:01:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1N1TgN079287; Tue, 1 Dec 2009 23:01:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912012301.nB1N1TgN079287@svn.freebsd.org> From: Alexander Motin Date: Tue, 1 Dec 2009 23:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200008 - in head/sys: cam/ata sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:01:30 -0000 Author: mav Date: Tue Dec 1 23:01:29 2009 New Revision: 200008 URL: http://svn.freebsd.org/changeset/base/200008 Log: Add CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands. It is not needed for SATA controllers, but required for PATA. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/sys/ata.h Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Dec 1 22:59:37 2009 (r200007) +++ head/sys/cam/ata/ata_all.c Tue Dec 1 23:01:29 2009 (r200008) @@ -93,8 +93,8 @@ ata_op_string(struct ata_cmd *cmd) case 0x39: return ("WRITE_MUL48"); case 0x3a: return ("WRITE_STREAM_DMA48"); case 0x3b: return ("WRITE_STREAM48"); - case 0x3d: return ("WRITE_DMA_FUA"); - case 0x3e: return ("WRITE_DMA_FUA48"); + case 0x3d: return ("WRITE_DMA_FUA48"); + case 0x3e: return ("WRITE_DMA_QUEUED_FUA48"); case 0x3f: return ("WRITE_LOG_EXT"); case 0x40: return ("READ_VERIFY"); case 0x42: return ("READ_VERIFY48"); @@ -119,7 +119,7 @@ ata_op_string(struct ata_cmd *cmd) case 0xca: return ("WRITE_DMA"); case 0xcc: return ("WRITE_DMA_QUEUED"); case 0xcd: return ("CFA_WRITE_MULTIPLE_WITHOUT_ERASE"); - case 0xce: return ("WRITE_MULTIPLE_FUA48"); + case 0xce: return ("WRITE_MUL_FUA48"); case 0xd1: return ("CHECK_MEDIA_CARD_TYPE"); case 0xda: return ("GET_MEDIA_STATUS"); case 0xde: return ("MEDIA_LOCK"); @@ -309,6 +309,11 @@ ata_28bit_cmd(struct ccb_ataio *ataio, u { bzero(&ataio->cmd, sizeof(ataio->cmd)); ataio->cmd.flags = 0; + if (cmd == ATA_READ_DMA || + cmd == ATA_READ_DMA_QUEUED || + cmd == ATA_WRITE_DMA || + cmd == ATA_WRITE_DMA_QUEUED) + ataio->cmd.flags |= CAM_ATAIO_DMA; ataio->cmd.command = cmd; ataio->cmd.features = features; ataio->cmd.lba_low = lba; @@ -324,6 +329,15 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u { bzero(&ataio->cmd, sizeof(ataio->cmd)); ataio->cmd.flags = CAM_ATAIO_48BIT; + if (cmd == ATA_READ_DMA48 || + cmd == ATA_READ_DMA_QUEUED48 || + cmd == ATA_READ_STREAM_DMA48 || + cmd == ATA_WRITE_DMA48 || + cmd == ATA_WRITE_DMA_FUA48 || + cmd == ATA_WRITE_DMA_QUEUED48 || + cmd == ATA_WRITE_DMA_QUEUED_FUA48 || + cmd == ATA_WRITE_STREAM_DMA48) + ataio->cmd.flags |= CAM_ATAIO_DMA; ataio->cmd.command = cmd; ataio->cmd.features = features; ataio->cmd.lba_low = lba; Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Tue Dec 1 22:59:37 2009 (r200007) +++ head/sys/cam/ata/ata_all.h Tue Dec 1 23:01:29 2009 (r200008) @@ -41,6 +41,7 @@ struct ata_cmd { #define CAM_ATAIO_FPDMA 0x02 /* FPDMA command */ #define CAM_ATAIO_CONTROL 0x04 /* Control, not a command */ #define CAM_ATAIO_NEEDRESULT 0x08 /* Request requires result. */ +#define CAM_ATAIO_DMA 0x10 /* DMA command */ u_int8_t command; u_int8_t features; Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Tue Dec 1 22:59:37 2009 (r200007) +++ head/sys/sys/ata.h Tue Dec 1 23:01:29 2009 (r200008) @@ -291,12 +291,21 @@ struct ata_params { #define ATA_READ_DMA_QUEUED48 0x26 /* read DMA QUEUED 48bit LBA */ #define ATA_READ_NATIVE_MAX_ADDRESS48 0x27 /* read native max addr 48bit */ #define ATA_READ_MUL48 0x29 /* read multi 48bit LBA */ +#define ATA_READ_STREAM_DMA48 0x2a /* read DMA stream 48bit LBA */ +#define ATA_READ_STREAM48 0x2b /* read stream 48bit LBA */ #define ATA_WRITE 0x30 /* write */ #define ATA_WRITE48 0x34 /* write 48bit LBA */ #define ATA_WRITE_DMA48 0x35 /* write DMA 48bit LBA */ #define ATA_WRITE_DMA_QUEUED48 0x36 /* write DMA QUEUED 48bit LBA*/ #define ATA_SET_MAX_ADDRESS48 0x37 /* set max address 48bit */ #define ATA_WRITE_MUL48 0x39 /* write multi 48bit LBA */ +#define ATA_WRITE_STREAM_DMA48 0x3a +#define ATA_WRITE_STREAM48 0x3b +#define ATA_WRITE_DMA_FUA48 0x3d +#define ATA_WRITE_DMA_QUEUED_FUA48 0x3e +#define ATA_WRITE_LOG_EXT 0x3f +#define ATA_READ_VERIFY 0x40 +#define ATA_READ_VERIFY48 0x42 #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ #define ATA_SEEK 0x70 /* seek */ @@ -312,6 +321,7 @@ struct ata_params { #define ATA_READ_DMA 0xc8 /* read DMA */ #define ATA_WRITE_DMA 0xca /* write DMA */ #define ATA_WRITE_DMA_QUEUED 0xcc /* write DMA QUEUED */ +#define ATA_WRITE_MUL_FUA48 0xce #define ATA_STANDBY_IMMEDIATE 0xe0 /* standby immediate */ #define ATA_IDLE_IMMEDIATE 0xe1 /* idle immediate */ #define ATA_STANDBY_CMD 0xe2 /* standby */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:01:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 825DE106566B; Tue, 1 Dec 2009 23:01:59 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577E38FC08; Tue, 1 Dec 2009 23:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1N1xI1079335; Tue, 1 Dec 2009 23:01:59 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1N1xFE079333; Tue, 1 Dec 2009 23:01:59 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912012301.nB1N1xFE079333@svn.freebsd.org> From: Fabien Thomas Date: Tue, 1 Dec 2009 23:01:59 +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: r200009 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:01:59 -0000 Author: fabient Date: Tue Dec 1 23:01:59 2009 New Revision: 200009 URL: http://svn.freebsd.org/changeset/base/200009 Log: MFC 198343: Handle the case where there is only one PMC in the system. Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_mod.c Tue Dec 1 23:01:29 2009 (r200008) +++ stable/7/sys/dev/hwpmc/hwpmc_mod.c Tue Dec 1 23:01:59 2009 (r200009) @@ -793,7 +793,7 @@ pmc_link_target_process(struct pmc *pm, KASSERT(PMC_IS_VIRTUAL_MODE(PMC_TO_MODE(pm)), ("[pmc,%d] Attaching a non-process-virtual pmc=%p to pid=%d", __LINE__, pm, pp->pp_proc->p_pid)); - KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < ((int) md->pmd_npmc - 1), + KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= ((int) md->pmd_npmc - 1), ("[pmc,%d] Illegal reference count %d for process record %p", __LINE__, pp->pp_refcnt, (void *) pp)); @@ -846,7 +846,7 @@ pmc_unlink_target_process(struct pmc *pm KASSERT(pm != NULL && pp != NULL, ("[pmc,%d] Null pm %p or pp %p", __LINE__, pm, pp)); - KASSERT(pp->pp_refcnt >= 1 && pp->pp_refcnt < (int) md->pmd_npmc, + KASSERT(pp->pp_refcnt >= 1 && pp->pp_refcnt <= (int) md->pmd_npmc, ("[pmc,%d] Illegal ref count %d on process record %p", __LINE__, pp->pp_refcnt, (void *) pp)); @@ -1113,7 +1113,7 @@ pmc_detach_one_process(struct proc *p, s * descriptor from the target hash table and unset the P_HWPMC * flag in the struct proc. */ - KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < (int) md->pmd_npmc, + KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= (int) md->pmd_npmc, ("[pmc,%d] Illegal refcnt %d for process struct %p", __LINE__, pp->pp_refcnt, pp)); @@ -1788,7 +1788,7 @@ pmc_hook_handler(struct thread *td, int pmc_detach_one_process(td->td_proc, pm, PMC_FLAG_NONE); - KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt < (int) md->pmd_npmc, + KASSERT(pp->pp_refcnt >= 0 && pp->pp_refcnt <= (int) md->pmd_npmc, ("[pmc,%d] Illegal ref count %d on pp %p", __LINE__, pp->pp_refcnt, pp)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:06:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFEAA106566C; Tue, 1 Dec 2009 23:06:17 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE5CB8FC18; Tue, 1 Dec 2009 23:06:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1N6HJv079472; Tue, 1 Dec 2009 23:06:17 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1N6HEh079470; Tue, 1 Dec 2009 23:06:17 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912012306.nB1N6HEh079470@svn.freebsd.org> From: Fabien Thomas Date: Tue, 1 Dec 2009 23:06:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200010 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:06:18 -0000 Author: fabient Date: Tue Dec 1 23:06:17 2009 New Revision: 200010 URL: http://svn.freebsd.org/changeset/base/200010 Log: MFC 199763: - fix a LOR between process lock and pmc thread mutex - fix a system deadlock on process exit when the sample buffer is full (pmclog_loop blocked in fo_write) and pmcstat exit. Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_logging.c Tue Dec 1 23:01:59 2009 (r200009) +++ stable/8/sys/dev/hwpmc/hwpmc_logging.c Tue Dec 1 23:06:17 2009 (r200010) @@ -240,6 +240,7 @@ pmclog_loop(void *arg) int error; struct pmc_owner *po; struct pmclog_buffer *lb; + struct proc *p; struct ucred *ownercred; struct ucred *mycred; struct thread *td; @@ -248,12 +249,13 @@ pmclog_loop(void *arg) size_t nbytes; po = (struct pmc_owner *) arg; + p = po->po_owner; td = curthread; mycred = td->td_ucred; - PROC_LOCK(po->po_owner); - ownercred = crhold(po->po_owner->p_ucred); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + ownercred = crhold(p->p_ucred); + PROC_UNLOCK(p); PMCDBG(LOG,INI,1, "po=%p kt=%p", po, po->po_kthread); KASSERT(po->po_kthread == curthread->td_proc, @@ -324,16 +326,16 @@ pmclog_loop(void *arg) error = fo_write(po->po_file, &auio, ownercred, 0, td); td->td_ucred = mycred; - mtx_lock(&pmc_kthread_mtx); - if (error) { /* XXX some errors are recoverable */ /* XXX also check for SIGPIPE if a socket */ /* send a SIGIO to the owner and exit */ - PROC_LOCK(po->po_owner); - psignal(po->po_owner, SIGIO); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + psignal(p, SIGIO); + PROC_UNLOCK(p); + + mtx_lock(&pmc_kthread_mtx); po->po_error = error; /* save for flush log */ @@ -342,6 +344,8 @@ pmclog_loop(void *arg) break; } + mtx_lock(&pmc_kthread_mtx); + /* put the used buffer back into the global pool */ PMCLOG_INIT_BUFFER_DESCRIPTOR(lb); @@ -525,15 +529,20 @@ static void pmclog_stop_kthread(struct pmc_owner *po) { /* - * Unset flag, wakeup the helper thread, + * Close the file to force the thread out of fo_write, + * unset flag, wakeup the helper thread, * wait for it to exit */ - mtx_assert(&pmc_kthread_mtx, MA_OWNED); + if (po->po_file != NULL) + fo_close(po->po_file, curthread); + + mtx_lock(&pmc_kthread_mtx); po->po_flags &= ~PMC_PO_OWNS_LOGFILE; wakeup_one(po); if (po->po_kthread) msleep(po->po_kthread, &pmc_kthread_mtx, PPAUSE, "pmckstp", 0); + mtx_unlock(&pmc_kthread_mtx); } /* @@ -602,10 +611,8 @@ pmclog_configure_log(struct pmc_mdep *md error: /* shutdown the thread */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not " "stopped", __LINE__, po)); @@ -641,10 +648,8 @@ pmclog_deconfigure_log(struct pmc_owner ("[pmclog,%d] po=%p no log file", __LINE__, po)); /* stop the kthread, this will reset the 'OWNS_LOGFILE' flag */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not stopped", __LINE__, po)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:07:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 443451065693; Tue, 1 Dec 2009 23:07:39 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32C748FC14; Tue, 1 Dec 2009 23:07:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1N7dj7079544; Tue, 1 Dec 2009 23:07:39 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1N7dPS079542; Tue, 1 Dec 2009 23:07:39 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912012307.nB1N7dPS079542@svn.freebsd.org> From: Fabien Thomas Date: Tue, 1 Dec 2009 23:07:39 +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: r200011 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:07:39 -0000 Author: fabient Date: Tue Dec 1 23:07:38 2009 New Revision: 200011 URL: http://svn.freebsd.org/changeset/base/200011 Log: MFC 199763: - fix a LOR between process lock and pmc thread mutex - fix a system deadlock on process exit when the sample buffer is full (pmclog_loop blocked in fo_write) and pmcstat exit. Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_logging.c Tue Dec 1 23:06:17 2009 (r200010) +++ stable/7/sys/dev/hwpmc/hwpmc_logging.c Tue Dec 1 23:07:38 2009 (r200011) @@ -240,6 +240,7 @@ pmclog_loop(void *arg) int error; struct pmc_owner *po; struct pmclog_buffer *lb; + struct proc *p; struct ucred *ownercred; struct ucred *mycred; struct thread *td; @@ -248,12 +249,13 @@ pmclog_loop(void *arg) size_t nbytes; po = (struct pmc_owner *) arg; + p = po->po_owner; td = curthread; mycred = td->td_ucred; - PROC_LOCK(po->po_owner); - ownercred = crhold(po->po_owner->p_ucred); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + ownercred = crhold(p->p_ucred); + PROC_UNLOCK(p); PMCDBG(LOG,INI,1, "po=%p kt=%p", po, po->po_kthread); KASSERT(po->po_kthread == curthread->td_proc, @@ -324,16 +326,16 @@ pmclog_loop(void *arg) error = fo_write(po->po_file, &auio, ownercred, 0, td); td->td_ucred = mycred; - mtx_lock(&pmc_kthread_mtx); - if (error) { /* XXX some errors are recoverable */ /* XXX also check for SIGPIPE if a socket */ /* send a SIGIO to the owner and exit */ - PROC_LOCK(po->po_owner); - psignal(po->po_owner, SIGIO); - PROC_UNLOCK(po->po_owner); + PROC_LOCK(p); + psignal(p, SIGIO); + PROC_UNLOCK(p); + + mtx_lock(&pmc_kthread_mtx); po->po_error = error; /* save for flush log */ @@ -342,6 +344,8 @@ pmclog_loop(void *arg) break; } + mtx_lock(&pmc_kthread_mtx); + /* put the used buffer back into the global pool */ PMCLOG_INIT_BUFFER_DESCRIPTOR(lb); @@ -525,15 +529,20 @@ static void pmclog_stop_kthread(struct pmc_owner *po) { /* - * Unset flag, wakeup the helper thread, + * Close the file to force the thread out of fo_write, + * unset flag, wakeup the helper thread, * wait for it to exit */ - mtx_assert(&pmc_kthread_mtx, MA_OWNED); + if (po->po_file != NULL) + fo_close(po->po_file, curthread); + + mtx_lock(&pmc_kthread_mtx); po->po_flags &= ~PMC_PO_OWNS_LOGFILE; wakeup_one(po); if (po->po_kthread) msleep(po->po_kthread, &pmc_kthread_mtx, PPAUSE, "pmckstp", 0); + mtx_unlock(&pmc_kthread_mtx); } /* @@ -602,10 +611,8 @@ pmclog_configure_log(struct pmc_mdep *md error: /* shutdown the thread */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not " "stopped", __LINE__, po)); @@ -641,10 +648,8 @@ pmclog_deconfigure_log(struct pmc_owner ("[pmclog,%d] po=%p no log file", __LINE__, po)); /* stop the kthread, this will reset the 'OWNS_LOGFILE' flag */ - mtx_lock(&pmc_kthread_mtx); if (po->po_kthread) pmclog_stop_kthread(po); - mtx_unlock(&pmc_kthread_mtx); KASSERT(po->po_kthread == NULL, ("[pmclog,%d] po=%p kthread not stopped", __LINE__, po)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:15:59 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3D8810656A5; Tue, 1 Dec 2009 23:15:59 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from tomjudge.vm.bytemark.co.uk (tomjudge.vm.bytemark.co.uk [80.68.91.100]) by mx1.freebsd.org (Postfix) with ESMTP id 4E8E88FC34; Tue, 1 Dec 2009 23:15:58 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id 3172048AED; Tue, 1 Dec 2009 23:15:58 +0000 (GMT) X-Virus-Scanned: Debian amavisd-new at tomjudge.vm.bytemark.co.uk Received: from tomjudge.vm.bytemark.co.uk ([127.0.0.1]) by localhost (tomjudge.vm.bytemark.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ms3Ntq1ZRzik; Tue, 1 Dec 2009 23:15:52 +0000 (GMT) Received: from rita.nodomain (unknown [192.168.205.6]) by tomjudge.vm.bytemark.co.uk (Postfix) with ESMTP id A35C948AE7; Tue, 1 Dec 2009 23:15:51 +0000 (GMT) Message-ID: <4B15A358.8060909@tomjudge.com> Date: Tue, 01 Dec 2009 23:14:32 +0000 From: Tom Judge User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: Maxim Sobolev References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> <4B14BF23.1030303@FreeBSD.org> <4B1516E5.9030508@tomjudge.com> <4B15966B.9080102@FreeBSD.org> In-Reply-To: <4B15966B.9080102@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:15:59 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maxim Sobolev wrote: > Tom Judge wrote: >> >> >> When you see this lock up do you also see denied requests for mbufs? >> >> All the times I have seen the issue, the system was denying mbuf >> requests. > > Not sure about that, since we only have had network connection to that > box, no console. However, I think that the problem with the other > network subsystems that we see at the same time suggests that it might > be an issue with the mbufs indeed. > If you could put some simple cron job in that dumps the denied counters to disk every minute or so that would help diagnose the issue. Tom - -- TJU13-ARIN -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJLFaNYAAoJEMSwVS7lr0OdIwkIAJdQXEU9a+nQ9tjq8YezkRHU /SMEst2To8NxH+AktOLr0dkOmMi484VFJRWLUEyBBi1AAKELNfLucTwCisvhTLmX 6LgqDWghJdPnx014HWozHLbkakeeL/rmFyo5ZdbfWhkQgPxwcxyB5EkKHLcOz0OF SnRT57vTdFQwHPOSMV5DcvO2XwTP2zHdqecT2edvAbY4LQeP8QTtLkOrwuPHnP1w vknrpNxgd+A7Wt1ME0HMUD4UuZUvuHekw5DhM07YJGWSJXdu3HmO2DJf3jMznLAV EC43I+Uouz6zo3fVCp5Jhvmf57fK6wAFxhhdvuVPn0niD6VDgnxj5gSoUKOyyNg= =mWfX -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:23:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65F2A106566C; Tue, 1 Dec 2009 23:23:53 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 545B78FC08; Tue, 1 Dec 2009 23:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1NNr3f079968; Tue, 1 Dec 2009 23:23:53 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1NNqv2079966; Tue, 1 Dec 2009 23:23:52 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912012323.nB1NNqv2079966@svn.freebsd.org> From: Fabien Thomas Date: Tue, 1 Dec 2009 23:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200012 - stable/8/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:23:53 -0000 Author: fabient Date: Tue Dec 1 23:23:52 2009 New Revision: 200012 URL: http://svn.freebsd.org/changeset/base/200012 Log: MFC 198339: Fix the NO_PROXY handling. PR: 139751 Modified: stable/8/lib/libfetch/common.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Tue Dec 1 23:07:38 2009 (r200011) +++ stable/8/lib/libfetch/common.c Tue Dec 1 23:23:52 2009 (r200012) @@ -772,7 +772,7 @@ fetch_no_proxy_match(const char *host) break; d_len = q - p; - if (d_len > 0 && h_len > d_len && + if (d_len > 0 && h_len >= d_len && strncasecmp(host + h_len - d_len, p, d_len) == 0) { /* domain name matches */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 1 23:24:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE268106566C; Tue, 1 Dec 2009 23:24:42 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACF438FC22; Tue, 1 Dec 2009 23:24:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB1NOgFC080032; Tue, 1 Dec 2009 23:24:42 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB1NOgTw080030; Tue, 1 Dec 2009 23:24:42 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912012324.nB1NOgTw080030@svn.freebsd.org> From: Fabien Thomas Date: Tue, 1 Dec 2009 23:24:42 +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: r200013 - stable/7/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2009 23:24:42 -0000 Author: fabient Date: Tue Dec 1 23:24:42 2009 New Revision: 200013 URL: http://svn.freebsd.org/changeset/base/200013 Log: MFC 198339: Fix the NO_PROXY handling. PR: 139751 Modified: stable/7/lib/libfetch/common.c Directory Properties: stable/7/lib/libfetch/ (props changed) Modified: stable/7/lib/libfetch/common.c ============================================================================== --- stable/7/lib/libfetch/common.c Tue Dec 1 23:23:52 2009 (r200012) +++ stable/7/lib/libfetch/common.c Tue Dec 1 23:24:42 2009 (r200013) @@ -772,7 +772,7 @@ fetch_no_proxy_match(const char *host) break; d_len = q - p; - if (d_len > 0 && h_len > d_len && + if (d_len > 0 && h_len >= d_len && strncasecmp(host + h_len - d_len, p, d_len) == 0) { /* domain name matches */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 00:37:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 600FB1065676; Wed, 2 Dec 2009 00:37:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FAB78FC0C; Wed, 2 Dec 2009 00:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB20b3xK081614; Wed, 2 Dec 2009 00:37:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB20b3WB081612; Wed, 2 Dec 2009 00:37:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912020037.nB20b3WB081612@svn.freebsd.org> From: Andrew Thompson Date: Wed, 2 Dec 2009 00:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200014 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 00:37:03 -0000 Author: thompsa Date: Wed Dec 2 00:37:03 2009 New Revision: 200014 URL: http://svn.freebsd.org/changeset/base/200014 Log: Remove unknown ath hal device entries. Modified: head/sys/arm/conf/CAMBRIA Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Tue Dec 1 23:24:42 2009 (r200013) +++ head/sys/arm/conf/CAMBRIA Wed Dec 2 00:37:03 2009 (r200014) @@ -135,11 +135,8 @@ device ath_rf5413 # #device ath_ar5416 #options AH_SUPPORT_AR5416 # NB: for 11n descriptor format -#device ath_rf2133 #device ath_ar9160 #device ath_ar9280 -#device ath_rf9280 -#device ath_ar9285 # NB: 2 USB 2.0 ports standard device usb From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 00:38:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C35B1065679; Wed, 2 Dec 2009 00:38:11 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B8C88FC1A; Wed, 2 Dec 2009 00:38:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB20cBFs081678; Wed, 2 Dec 2009 00:38:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB20cBgR081674; Wed, 2 Dec 2009 00:38:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912020038.nB20cBgR081674@svn.freebsd.org> From: Andrew Thompson Date: Wed, 2 Dec 2009 00:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200015 - in head/sys: arm/conf i386/conf pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 00:38:11 -0000 Author: thompsa Date: Wed Dec 2 00:38:11 2009 New Revision: 200015 URL: http://svn.freebsd.org/changeset/base/200015 Log: Add missing ath_ar9* ath hal entries. Modified: head/sys/arm/conf/AVILA head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Wed Dec 2 00:37:03 2009 (r200014) +++ head/sys/arm/conf/AVILA Wed Dec 2 00:38:11 2009 (r200015) @@ -132,6 +132,7 @@ device ath_rf5413 device ath_ar5416 options AH_SUPPORT_AR5416 device ath_ar9160 +device ath_ar9280 device usb #options USB_DEBUG Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Dec 2 00:37:03 2009 (r200014) +++ head/sys/i386/conf/NOTES Wed Dec 2 00:38:11 2009 (r200015) @@ -578,6 +578,8 @@ device ath_hal # pci/cardbus chip supp #device ath_rf5413 #device ath_ar5416 # AR5416 chips options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +#device ath_ar9160 # AR9160 chips +#device ath_ar9280 # AR9160 chips device ath_rate_sample # SampleRate tx rate control for ath device ce device cp Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Wed Dec 2 00:37:03 2009 (r200014) +++ head/sys/pc98/conf/NOTES Wed Dec 2 00:38:11 2009 (r200015) @@ -432,6 +432,8 @@ device ath_hal # pci/cardbus chip supp #device ath_rf5413 #device ath_ar5416 # AR5416 chips options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +#device ath_ar9160 # AR9160 chips +#device ath_ar9280 # AR9160 chips device ath_rate_sample # SampleRate tx rate control for ath # From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 02:42:37 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2B661065692; Wed, 2 Dec 2009 02:42:37 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7B9CE8FC1A; Wed, 2 Dec 2009 02:42:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nB22Z0TD077715; Tue, 1 Dec 2009 19:35:00 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 01 Dec 2009 19:35:18 -0700 (MST) Message-Id: <20091201.193518.387188323.imp@bsdimp.com> To: rwatson@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, green@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, cperciva@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 02:42:37 -0000 In message: Robert Watson writes: : On Mon, 30 Nov 2009, Colin Percival wrote: : : > Brian Feldman wrote: : >> Do not gratuitously fail *env(3) operations due to corrupt ('='-less) : >> **environ entries. This puts non-getenv(3) operations in line with : >> getenv(3) in that bad environ entries do not cause all operations to : >> fail. There is still some inconsistency in that getenv(3) in the : >> absence of any environment-modifying operation does not emit corrupt : >> environ entry warnings. : >> : >> I also fixed another inconsistency in getenv(3) where updating the : >> global environ pointer would not be reflected in the return values. : >> It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) : >> in order to see the change. : > : > The FreeBSD Security Team is currently dealing with a security issue : > relating to this code. Please back out your change (at least to getenv.c; I : > don't particularly care about the regression tests) until we've finished, : > and then submit the patch to us for review along with a detailed explanation : > of what it does. : > : > We've already had two major security issues arising out of getenv.c in the : > past year, and I'd like to make sure we don't have a third. : : I think it's fair to say that the POSIXization of the environment code has : been an unmitigated disaster, and speaks to the necessity for careful review : of those sorts of code changes. Why we're not just reverting the whole thing as a bad idea is beyond me. Clearly the tiny incremental benefits have been far overshadowed by this fiasco. Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 02:47:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E203A106566B; Wed, 2 Dec 2009 02:47:29 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF2DE8FC12; Wed, 2 Dec 2009 02:47:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB22lT0N084426; Wed, 2 Dec 2009 02:47:29 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB22lTxU084418; Wed, 2 Dec 2009 02:47:29 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200912020247.nB22lTxU084418@svn.freebsd.org> From: Garrett Wollman Date: Wed, 2 Dec 2009 02:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200016 - in stable/8/lib/libc: gen rpc stdio yp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 02:47:30 -0000 Author: wollman Date: Wed Dec 2 02:47:29 2009 New Revision: 200016 URL: http://svn.freebsd.org/changeset/base/200016 Log: MFC revs 199781,199782,199784,199785,199786: Eliminate dead stores. In __mbsconv(), if prec was zero, nconv could have been used uninitialized. Initialize it to a safe value so that there's no chance of returning an error if stack garbage happens to be equal to (size_t)-1 or (size_t)-2. In svc_raw_reply(), don't leave stat uninitialized if the MSG_ACCEPTED && SUCCESS case succeeds. The stack garbage might be zero. In clnt_raw_create(), avoid minor race condition initializing the file-scope variable clntraw_private. Found by: Clang static analyzer Modified: stable/8/lib/libc/gen/getcap.c stable/8/lib/libc/gen/getusershell.c stable/8/lib/libc/gen/wordexp.c stable/8/lib/libc/rpc/clnt_raw.c stable/8/lib/libc/rpc/getnetconfig.c stable/8/lib/libc/rpc/key_call.c stable/8/lib/libc/rpc/svc_raw.c stable/8/lib/libc/stdio/fgetws.c stable/8/lib/libc/stdio/fvwrite.c stable/8/lib/libc/stdio/vfwprintf.c stable/8/lib/libc/yp/yplib.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/getcap.c ============================================================================== --- stable/8/lib/libc/gen/getcap.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/gen/getcap.c Wed Dec 2 02:47:29 2009 (r200016) @@ -647,7 +647,7 @@ int cgetnext(char **bp, char **db_array) { size_t len; - int done, hadreaderr, i, savederrno, status; + int done, hadreaderr, savederrno, status; char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; @@ -658,7 +658,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (-1); } - for(;;) { + for (;;) { if (toprec && !gottoprec) { gottoprec = 1; line = toprec; @@ -709,7 +709,6 @@ cgetnext(char **bp, char **db_array) /* * Line points to a name line. */ - i = 0; done = 0; np = nbuf; for (;;) { Modified: stable/8/lib/libc/gen/getusershell.c ============================================================================== --- stable/8/lib/libc/gen/getusershell.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/gen/getusershell.c Wed Dec 2 02:47:29 2009 (r200016) @@ -124,7 +124,7 @@ _local_initshells(rv, cb_data, ap) if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return NS_UNAVAIL; - sp = cp = line; + cp = line; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; Modified: stable/8/lib/libc/gen/wordexp.c ============================================================================== --- stable/8/lib/libc/gen/wordexp.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/gen/wordexp.c Wed Dec 2 02:47:29 2009 (r200016) @@ -282,7 +282,7 @@ we_check(const char *words, int flags) if (c == '\0' || level != 0) return (WRDE_SYNTAX); } else - c = *--words; + --words; break; default: break; Modified: stable/8/lib/libc/rpc/clnt_raw.c ============================================================================== --- stable/8/lib/libc/rpc/clnt_raw.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/rpc/clnt_raw.c Wed Dec 2 02:47:29 2009 (r200016) @@ -92,13 +92,13 @@ clnt_raw_create(prog, vers) rpcprog_t prog; rpcvers_t vers; { - struct clntraw_private *clp = clntraw_private; + struct clntraw_private *clp; struct rpc_msg call_msg; - XDR *xdrs = &clp->xdr_stream; - CLIENT *client = &clp->client_object; + XDR *xdrs; + CLIENT *client; mutex_lock(&clntraw_lock); - if (clp == NULL) { + if ((clp = clntraw_private) == NULL) { clp = (struct clntraw_private *)calloc(1, sizeof (*clp)); if (clp == NULL) { mutex_unlock(&clntraw_lock); @@ -110,6 +110,9 @@ clnt_raw_create(prog, vers) clp->_raw_buf = __rpc_rawcombuf; clntraw_private = clp; } + xdrs = &clp->xdr_stream; + client = &clp->client_object; + /* * pre-serialize the static part of the call msg and stash it away */ Modified: stable/8/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/8/lib/libc/rpc/getnetconfig.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/rpc/getnetconfig.c Wed Dec 2 02:47:29 2009 (r200016) @@ -412,13 +412,13 @@ void *handlep; * Noone needs these entries anymore, then frees them. * Make sure all info in netconfig_info structure has been reinitialized. */ - q = p = ni.head; + q = ni.head; ni.eof = ni.ref = 0; ni.head = NULL; ni.tail = NULL; mutex_unlock(&ni_lock); - while (q) { + while (q != NULL) { p = q->next; if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups); free(q->ncp); Modified: stable/8/lib/libc/rpc/key_call.c ============================================================================== --- stable/8/lib/libc/rpc/key_call.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/rpc/key_call.c Wed Dec 2 02:47:29 2009 (r200016) @@ -302,7 +302,7 @@ int vers; void *localhandle; struct netconfig *nconf; struct netconfig *tpconf; - struct key_call_private *kcp = key_call_private_main; + struct key_call_private *kcp; struct timeval wait_time; struct utsname u; int main_thread; Modified: stable/8/lib/libc/rpc/svc_raw.c ============================================================================== --- stable/8/lib/libc/rpc/svc_raw.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/rpc/svc_raw.c Wed Dec 2 02:47:29 2009 (r200016) @@ -176,9 +176,8 @@ svc_raw_reply(xprt, msg) msg->acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; msg->acpted_rply.ar_results.where = NULL; - if (!xdr_replymsg(xdrs, msg) || - !SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where)) - stat = FALSE; + stat = xdr_replymsg(xdrs, msg) && + SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where); } else { stat = xdr_replymsg(xdrs, msg); } Modified: stable/8/lib/libc/stdio/fgetws.c ============================================================================== --- stable/8/lib/libc/stdio/fgetws.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/stdio/fgetws.c Wed Dec 2 02:47:29 2009 (r200016) @@ -89,7 +89,7 @@ fgetws(wchar_t * __restrict ws, int n, F if (!__mbsinit(&fp->_mbstate)) /* Incomplete character */ goto error; - *wsp++ = L'\0'; + *wsp = L'\0'; FUNLOCKFILE(fp); return (ws); Modified: stable/8/lib/libc/stdio/fvwrite.c ============================================================================== --- stable/8/lib/libc/stdio/fvwrite.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/stdio/fvwrite.c Wed Dec 2 02:47:29 2009 (r200016) @@ -60,7 +60,7 @@ __sfvwrite(fp, uio) char *nl; int nlknown, nldist; - if ((len = uio->uio_resid) == 0) + if (uio->uio_resid == 0) return (0); /* make sure we can write */ if (prepwrite(fp) != 0) Modified: stable/8/lib/libc/stdio/vfwprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vfwprintf.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/stdio/vfwprintf.c Wed Dec 2 02:47:29 2009 (r200016) @@ -293,7 +293,7 @@ __mbsconv(char *mbsarg, int prec) * number of characters to print. */ p = mbsarg; - insize = nchars = 0; + insize = nchars = nconv = 0; mbs = initial_mbs; while (nchars != (size_t)prec) { nconv = mbrlen(p, MB_CUR_MAX, &mbs); Modified: stable/8/lib/libc/yp/yplib.c ============================================================================== --- stable/8/lib/libc/yp/yplib.c Wed Dec 2 00:38:11 2009 (r200015) +++ stable/8/lib/libc/yp/yplib.c Wed Dec 2 02:47:29 2009 (r200016) @@ -241,7 +241,7 @@ static bool_t ypmatch_cache_lookup(struct dom_binding *ypdb, char *map, keydat *key, valdat *val) { - struct ypmatch_ent *c = ypdb->cache; + struct ypmatch_ent *c; ypmatch_cache_expire(ypdb); From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 03:08:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB52C1065672; Wed, 2 Dec 2009 03:08:29 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8DA58FC0A; Wed, 2 Dec 2009 03:08:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB238Tt9085137; Wed, 2 Dec 2009 03:08:29 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB238Tdm085126; Wed, 2 Dec 2009 03:08:29 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <200912020308.nB238Tdm085126@svn.freebsd.org> From: Garrett Wollman Date: Wed, 2 Dec 2009 03:08:29 +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: r200017 - in stable/7/lib/libc: gen rpc stdio yp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 03:08:29 -0000 Author: wollman Date: Wed Dec 2 03:08:29 2009 New Revision: 200017 URL: http://svn.freebsd.org/changeset/base/200017 Log: MFC revs 199781,199782,199784,199786: Eliminate dead stores. In __mbsconv(), if prec was zero, nconv could have been used uninitialized. Initialize it to a safe value so that there's no chance of returning an error if stack garbage happens to be equal to (size_t)-1 or (size_t)-2. In clnt_raw_create(), avoid minor race condition initializing the file-scope variable clntraw_private. Mark head rev 199785 as merged; 7-STABLE's version of svc_raw_reply() doesn't have the same bug (or even look all that similar). Found by: Clang static analyzer Modified: stable/7/lib/libc/gen/getcap.c stable/7/lib/libc/gen/getusershell.c stable/7/lib/libc/gen/wordexp.c stable/7/lib/libc/rpc/clnt_raw.c stable/7/lib/libc/rpc/getnetconfig.c stable/7/lib/libc/rpc/key_call.c stable/7/lib/libc/stdio/fgetws.c stable/7/lib/libc/stdio/fvwrite.c stable/7/lib/libc/stdio/vfwprintf.c stable/7/lib/libc/yp/yplib.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/getcap.c ============================================================================== --- stable/7/lib/libc/gen/getcap.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/gen/getcap.c Wed Dec 2 03:08:29 2009 (r200017) @@ -647,7 +647,7 @@ int cgetnext(char **bp, char **db_array) { size_t len; - int done, hadreaderr, i, savederrno, status; + int done, hadreaderr, savederrno, status; char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; @@ -658,7 +658,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (-1); } - for(;;) { + for (;;) { if (toprec && !gottoprec) { gottoprec = 1; line = toprec; @@ -709,7 +709,6 @@ cgetnext(char **bp, char **db_array) /* * Line points to a name line. */ - i = 0; done = 0; np = nbuf; for (;;) { Modified: stable/7/lib/libc/gen/getusershell.c ============================================================================== --- stable/7/lib/libc/gen/getusershell.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/gen/getusershell.c Wed Dec 2 03:08:29 2009 (r200017) @@ -124,7 +124,7 @@ _local_initshells(rv, cb_data, ap) if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return NS_UNAVAIL; - sp = cp = line; + cp = line; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; Modified: stable/7/lib/libc/gen/wordexp.c ============================================================================== --- stable/7/lib/libc/gen/wordexp.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/gen/wordexp.c Wed Dec 2 03:08:29 2009 (r200017) @@ -282,7 +282,7 @@ we_check(const char *words, int flags) if (c == '\0' || level != 0) return (WRDE_SYNTAX); } else - c = *--words; + --words; break; default: break; Modified: stable/7/lib/libc/rpc/clnt_raw.c ============================================================================== --- stable/7/lib/libc/rpc/clnt_raw.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/rpc/clnt_raw.c Wed Dec 2 03:08:29 2009 (r200017) @@ -92,13 +92,13 @@ clnt_raw_create(prog, vers) rpcprog_t prog; rpcvers_t vers; { - struct clntraw_private *clp = clntraw_private; + struct clntraw_private *clp; struct rpc_msg call_msg; - XDR *xdrs = &clp->xdr_stream; - CLIENT *client = &clp->client_object; + XDR *xdrs; + CLIENT *client; mutex_lock(&clntraw_lock); - if (clp == NULL) { + if ((clp = clntraw_private) == NULL) { clp = (struct clntraw_private *)calloc(1, sizeof (*clp)); if (clp == NULL) { mutex_unlock(&clntraw_lock); @@ -110,6 +110,9 @@ clnt_raw_create(prog, vers) clp->_raw_buf = __rpc_rawcombuf; clntraw_private = clp; } + xdrs = &clp->xdr_stream; + client = &clp->client_object; + /* * pre-serialize the static part of the call msg and stash it away */ Modified: stable/7/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/7/lib/libc/rpc/getnetconfig.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/rpc/getnetconfig.c Wed Dec 2 03:08:29 2009 (r200017) @@ -412,13 +412,13 @@ void *handlep; * Noone needs these entries anymore, then frees them. * Make sure all info in netconfig_info structure has been reinitialized. */ - q = p = ni.head; + q = ni.head; ni.eof = ni.ref = 0; ni.head = NULL; ni.tail = NULL; mutex_unlock(&ni_lock); - while (q) { + while (q != NULL) { p = q->next; if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups); free(q->ncp); Modified: stable/7/lib/libc/rpc/key_call.c ============================================================================== --- stable/7/lib/libc/rpc/key_call.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/rpc/key_call.c Wed Dec 2 03:08:29 2009 (r200017) @@ -302,7 +302,7 @@ int vers; void *localhandle; struct netconfig *nconf; struct netconfig *tpconf; - struct key_call_private *kcp = key_call_private_main; + struct key_call_private *kcp; struct timeval wait_time; struct utsname u; int main_thread; Modified: stable/7/lib/libc/stdio/fgetws.c ============================================================================== --- stable/7/lib/libc/stdio/fgetws.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/stdio/fgetws.c Wed Dec 2 03:08:29 2009 (r200017) @@ -89,7 +89,7 @@ fgetws(wchar_t * __restrict ws, int n, F if (!__mbsinit(&fp->_extra->mbstate)) /* Incomplete character */ goto error; - *wsp++ = L'\0'; + *wsp = L'\0'; FUNLOCKFILE(fp); return (ws); Modified: stable/7/lib/libc/stdio/fvwrite.c ============================================================================== --- stable/7/lib/libc/stdio/fvwrite.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/stdio/fvwrite.c Wed Dec 2 03:08:29 2009 (r200017) @@ -60,7 +60,7 @@ __sfvwrite(fp, uio) char *nl; int nlknown, nldist; - if ((len = uio->uio_resid) == 0) + if (uio->uio_resid == 0) return (0); /* make sure we can write */ if (prepwrite(fp) != 0) Modified: stable/7/lib/libc/stdio/vfwprintf.c ============================================================================== --- stable/7/lib/libc/stdio/vfwprintf.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/stdio/vfwprintf.c Wed Dec 2 03:08:29 2009 (r200017) @@ -367,7 +367,7 @@ __mbsconv(char *mbsarg, int prec) * number of characters to print. */ p = mbsarg; - insize = nchars = 0; + insize = nchars = nconv = 0; mbs = initial; while (nchars != (size_t)prec) { nconv = mbrlen(p, MB_CUR_MAX, &mbs); Modified: stable/7/lib/libc/yp/yplib.c ============================================================================== --- stable/7/lib/libc/yp/yplib.c Wed Dec 2 02:47:29 2009 (r200016) +++ stable/7/lib/libc/yp/yplib.c Wed Dec 2 03:08:29 2009 (r200017) @@ -241,7 +241,7 @@ static bool_t ypmatch_cache_lookup(struct dom_binding *ypdb, char *map, keydat *key, valdat *val) { - struct ypmatch_ent *c = ypdb->cache; + struct ypmatch_ent *c; ypmatch_cache_expire(ypdb); From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 06:49:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D82C1065679; Wed, 2 Dec 2009 06:49:23 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F032C8FC17; Wed, 2 Dec 2009 06:49:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB26nMir089711; Wed, 2 Dec 2009 06:49:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB26nMYd089710; Wed, 2 Dec 2009 06:49:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912020649.nB26nMYd089710@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 2 Dec 2009 06:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200018 - head/sys/powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 06:49:23 -0000 Author: nwhitehorn Date: Wed Dec 2 06:49:22 2009 New Revision: 200018 URL: http://svn.freebsd.org/changeset/base/200018 Log: Bump limits on PowerPC. This allows large executables like parts of LLVM to function. Reviewed by: grehan Obtained from: NetBSD MFC after: 2 weeks Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Wed Dec 2 03:08:29 2009 (r200017) +++ head/sys/powerpc/include/vmparam.h Wed Dec 2 06:49:22 2009 (r200018) @@ -38,23 +38,23 @@ #define USRSTACK VM_MAXUSER_ADDRESS #ifndef MAXTSIZ -#define MAXTSIZ (16*1024*1024) /* max text size */ +#define MAXTSIZ (64*1024*1024) /* max text size */ #endif #ifndef DFLDSIZ -#define DFLDSIZ (32*1024*1024) /* default data size */ +#define DFLDSIZ (128*1024*1024) /* default data size */ #endif #ifndef MAXDSIZ -#define MAXDSIZ (512*1024*1024) /* max data size */ +#define MAXDSIZ (1*1024*1024*1024) /* max data size */ #endif #ifndef DFLSSIZ -#define DFLSSIZ (1*1024*1024) /* default stack size */ +#define DFLSSIZ (8*1024*1024) /* default stack size */ #endif #ifndef MAXSSIZ -#define MAXSSIZ (32*1024*1024) /* max stack size */ +#define MAXSSIZ (64*1024*1024) /* max stack size */ #endif /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 07:51:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AB8F1065670; Wed, 2 Dec 2009 07:51:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 348C38FC0A; Wed, 2 Dec 2009 07:51:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB27pQuW091004; Wed, 2 Dec 2009 07:51:26 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB27pQiP091002; Wed, 2 Dec 2009 07:51:26 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912020751.nB27pQiP091002@svn.freebsd.org> From: Christian Brueffer Date: Wed, 2 Dec 2009 07:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200019 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 07:51:26 -0000 Author: brueffer Date: Wed Dec 2 07:51:25 2009 New Revision: 200019 URL: http://svn.freebsd.org/changeset/base/200019 Log: Fix the dprintf() prototype. PR: 141087 Submitted by: Jeremy Huddleston MFC after: 3 days Modified: head/lib/libc/stdio/printf.3 Modified: head/lib/libc/stdio/printf.3 ============================================================================== --- head/lib/libc/stdio/printf.3 Wed Dec 2 06:49:22 2009 (r200018) +++ head/lib/libc/stdio/printf.3 Wed Dec 2 07:51:25 2009 (r200019) @@ -32,7 +32,7 @@ .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 3, 2009 +.Dd December 2, 2009 .Dt PRINTF 3 .Os .Sh NAME @@ -55,7 +55,7 @@ .Ft int .Fn asprintf "char **ret" "const char *format" ... .Ft int -.Fn dprintf "int" "const char * restrict format" ... +.Fn dprintf "int fd" "const char * restrict format" ... .In stdarg.h .Ft int .Fn vprintf "const char * restrict format" "va_list ap" From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 08:52:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9F49106566B; Wed, 2 Dec 2009 08:52:06 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F428FC0A; Wed, 2 Dec 2009 08:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB28q6Wd092494; Wed, 2 Dec 2009 08:52:06 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB28q60m092493; Wed, 2 Dec 2009 08:52:06 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912020852.nB28q60m092493@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 2 Dec 2009 08:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200020 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 08:52:07 -0000 Author: luigi Date: Wed Dec 2 08:52:06 2009 New Revision: 200020 URL: http://svn.freebsd.org/changeset/base/200020 Log: change the type of the opcode from enum *:8 to u_int8_t so the size and alignment of the ipfw_insn is not compiler dependent. No changes in the code generated by gcc. There was only one instance of this kind in our entire source tree, so i suspect the old definition was a poor choice (which i made). MFC after: 3 days Modified: head/sys/netinet/ip_fw.h Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Dec 2 07:51:25 2009 (r200019) +++ head/sys/netinet/ip_fw.h Wed Dec 2 08:52:06 2009 (r200020) @@ -237,7 +237,7 @@ enum ipfw_opcodes { /* arguments (4 byt * */ typedef struct _ipfw_insn { /* template for instructions */ - enum ipfw_opcodes opcode:8; + u_int8_t opcode; u_int8_t len; /* number of 32-bit words */ #define F_NOT 0x80 #define F_OR 0x40 From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 09:00:00 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A492E1065670; Wed, 2 Dec 2009 09:00:00 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 40BAA8FC14; Wed, 2 Dec 2009 09:00:00 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nB28xuh6007958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Dec 2009 00:59:57 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B162C8E.3090507@FreeBSD.org> Date: Wed, 02 Dec 2009 00:59:58 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Attila Nagy References: <200911151143.nAFBhTSD036619@svn.freebsd.org> <4B141D2E.1000203@FreeBSD.org> <4B142655.6030703@tomjudge.com> <4B14382F.5080000@FreeBSD.org> <20091130205141.2911011e.stas@FreeBSD.org> <4B14BF23.1030303@FreeBSD.org> <4B159540.9000503@fsn.hu> In-Reply-To: <4B159540.9000503@fsn.hu> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-stable-7@FreeBSD.org, Tom Judge Subject: Re: svn: stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 09:00:00 -0000 Attila Nagy wrote: > Maxim Sobolev wrote: >> Stanislav Sedov wrote: >>> On Mon, 30 Nov 2009 13:25:03 -0800 >>> Maxim Sobolev mentioned: >>> >>>> Can we change the name then? We've seen the similar issue without >>>> the jumbo frames, which made me wonder. >>> >>> It's strange, because 'normal' frames are less than a page size in >>> length, >>> so the issue I was experiencing should not be reproducable with jumbo >>> frames >>> disabled. Can you describe a bit more what kind of problem you're >>> experiencing? >> >> The traffic through interface abruptly halts randomly when under a >> load, without any signs of a problem. What is interesting is that the >> communication through unix domain sockets appears to be down too, >> since some scripts that connect to database not able to complete as >> well, so whatever this problem is it affect the whole network >> subsystem. We tried to replace hardware and it did not help. Only >> after we replaced bce(4) with IntelPro card (em) the problem has went >> away. > Sorry, I've just noticed this thread and did not read the earlier posts. > I can see similar, although only (at least for now) on version 8 > (running something around RC2), also with bce interfaces and "heavy" -in > terms of pps, this is a DNS server- network load. > > Everything which involves network halts for some minutes, but the > machine is completely usable from the console. top shows some processes > (I don't have an output, but as far as I can remember they were only > that which did network IO) in the "keglim" state. > Then something happens and the machine starts to work again. > > Can this be the same, or is it completely different? It really looks like the same issue. Those boxes are heavy-duty VoIP switches, so that they are handling high PPS as well in our case. -Maxim From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 09:37:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52DB2106566C; Wed, 2 Dec 2009 09:37:42 +0000 (UTC) (envelope-from fluffy@fluffy.khv.ru) Received: from ns.ael.RU (ns.ael.ru [62.76.207.226]) by mx1.freebsd.org (Postfix) with ESMTP id 631778FC08; Wed, 2 Dec 2009 09:37:40 +0000 (UTC) Received: from Fluffy.Khv.RU (85.9.168.188.retail.ttk.ru [188.168.9.85] (may be forged)) by ns.ael.RU (8.14.3/8.14.3/Fluffy/5.3) with ESMTP id nB29QVch030491; Wed, 2 Dec 2009 19:26:32 +1000 (VLAT) (envelope-from fluffy@fluffy.khv.ru) Received: from fluffy.khv.ru (localhost [127.0.0.1]) by Fluffy.Khv.RU (8.14.3/8.14.3/Fluffy/5.4.1) with ESMTP id nB29Q37h000220; Wed, 2 Dec 2009 19:26:03 +1000 (VLAT) (envelope-from fluffy@fluffy.khv.ru) From: Dima Panov Organization: Twilight Zone To: cvs-all@freebsd.org Date: Wed, 2 Dec 2009 19:25:56 +1000 User-Agent: KMail/1.12.3 (FreeBSD/9.0-900002-CURRENT; KDE/4.3.3; amd64; ; ) References: <200911261349.nAQDnco2083469@svn.freebsd.org> In-Reply-To: <200911261349.nAQDnco2083469@svn.freebsd.org> X-Face: "RE-2'yS-N:*/7DHOjQ%Az<.+SG>K7B'k(&; qb0K4]Hv>J}"l9,=:m2_]-3S/}`b\]yA-g !y3en*Zl(i-86iM?Q[w@!=rW&JdT>KHW@dri>+qMcy42O, 5#izEqa-K+=B<@A X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (ns.ael.RU [62.76.207.226]); Wed, 02 Dec 2009 19:26:33 +1000 (VLAT) X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00,RDNS_NONE, SPF_FAIL,SPF_HELO_FAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ns.ael.RU Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r199827 - in head: include lib/libc/compat-43 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 09:37:42 -0000 --nextPart5006014.CNh04PIApl Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thursday 26 November 2009 23:49:38 Konstantin Belousov wrote: > Author: kib > Date: Thu Nov 26 13:49:37 2009 > New Revision: 199827 > URL: http://svn.freebsd.org/changeset/base/199827 >=20 > Log: > Implement sighold, sigignore, sigpause, sigrelse, sigset functions > from SUSv4 XSI. Note that the functions are obsoleted, and only > provided to ease porting from System V-like systems. Since sigpause > already exists in compat with different interface, XSI sigpause is > named xsi_sigpause. >=20 > Reviewed by: davidxu > MFC after: 3 weeks >=20 > Modified: > head/include/signal.h > head/lib/libc/compat-43/Makefile.inc > head/lib/libc/compat-43/Symbol.map > head/lib/libc/compat-43/sigcompat.c > head/lib/libc/compat-43/sigpause.2 > head/sys/sys/signal.h > head/sys/sys/signalvar.h kib, you forgot about osversion bump, it is strongly needed. This changeset caused jdk (may be not only jdk) breakage, as jdk-bsd-patches always provide own implementations of sigingnore() for FreeBSD. Patch for jdk16 port will be ready soon. =2D-=20 Dima "Red Fox" Panov @ Home | C73E 2B72 1FFD 61BD E206 1234 A626 76ED 93E3 = B018 Khabarovsk, Russia | 2D30 2CCB 9984 130C 6F87 BAFC FB8B A09D D539 = 8F29 KDE@FreeBSD Team | FreeBSD committer since 10.08.2009 | FreeBSD since Sept = 1995 Twitter.com:fluffy_khv | Skype:dima.panov | Jabber.org:fluffy.khv | ICQ:174= 5024 --nextPart5006014.CNh04PIApl Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEABECAAYFAksWMqoACgkQpiZ27ZPjsBjjqQCgv5rA31KssMf9Ox6LU/v8D/RC O3QAoL40+xAoqz7X8k+UOFSGLr4q+ahu =LEYU -----END PGP SIGNATURE----- --nextPart5006014.CNh04PIApl-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 10:10:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17314106566B; Wed, 2 Dec 2009 10:10:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 045C28FC13; Wed, 2 Dec 2009 10:10:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2AAbtw094406; Wed, 2 Dec 2009 10:10:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2AAbCb094399; Wed, 2 Dec 2009 10:10:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912021010.nB2AAbCb094399@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Dec 2009 10:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200021 - in stable/8/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 10:10:38 -0000 Author: mav Date: Wed Dec 2 10:10:37 2009 New Revision: 200021 URL: http://svn.freebsd.org/changeset/base/200021 Log: MFC r199279, r199280, r199281: - Fix several device freeze counting bugs. - Remove code that years ago was closing race between request submission to SIM and device/SIM freeze. That race become impossible after moving from spl to mutex locking, while this workaround causes some unexpected effects. Modified: stable/8/sys/cam/cam_periph.c stable/8/sys/cam/cam_queue.c stable/8/sys/cam/cam_queue.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_ch.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Wed Dec 2 08:52:06 2009 (r200020) +++ stable/8/sys/cam/cam_periph.c Wed Dec 2 10:10:37 2009 (r200021) @@ -981,16 +981,21 @@ camperiphdone(struct cam_periph *periph, { union ccb *saved_ccb; cam_status status; - int frozen; + int frozen = 0; int sense; struct scsi_start_stop_unit *scsi_cmd; u_int32_t relsim_flags, timeout; - u_int32_t qfrozen_cnt; - int xpt_done_ccb; + int xpt_done_ccb = FALSE; - xpt_done_ccb = FALSE; status = done_ccb->ccb_h.status; - frozen = (status & CAM_DEV_QFRZN) != 0; + if (status & CAM_DEV_QFRZN) { + frozen = 1; + /* + * Clear freeze flag now for case of retry, + * freeze will be dropped later. + */ + done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + } sense = (status & CAM_AUTOSNS_VALID) != 0; status &= CAM_STATUS_MASK; @@ -998,17 +1003,6 @@ camperiphdone(struct cam_periph *periph, relsim_flags = 0; saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; - /* - * Unfreeze the queue once if it is already frozen.. - */ - if (frozen != 0) { - qfrozen_cnt = cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/0, - /*openings*/0, - /*timeout*/0, - /*getcount_only*/0); - } - switch (status) { case CAM_REQ_CMP: { @@ -1185,14 +1179,33 @@ camperiphdone(struct cam_periph *periph, */ if (done_ccb->ccb_h.retry_count > 0) done_ccb->ccb_h.retry_count--; - - qfrozen_cnt = cam_release_devq(done_ccb->ccb_h.path, - /*relsim_flags*/relsim_flags, - /*openings*/0, - /*timeout*/timeout, - /*getcount_only*/0); - if (xpt_done_ccb == TRUE) + /* + * Drop freeze taken due to CAM_DEV_QFREEZE flag set on recovery + * request. + */ + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/relsim_flags, + /*openings*/0, + /*timeout*/timeout, + /*getcount_only*/0); + if (xpt_done_ccb == TRUE) { + /* + * Copy frozen flag from recovery request if it is set there + * for some reason. + */ + if (frozen != 0) + done_ccb->ccb_h.status |= CAM_DEV_QFRZN; (*done_ccb->ccb_h.cbfcnp)(periph, done_ccb); + } else { + /* Drop freeze taken, if this recovery request got error. */ + if (frozen != 0) { + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*openings*/0, + /*timeout*/0, + /*getcount_only*/0); + } + } } /* @@ -1452,6 +1465,11 @@ camperiphscsisenseerror(union ccb *ccb, action_string = "No recovery CCB supplied"; goto sense_error_done; } + /* + * Clear freeze flag for original request here, as + * this freeze will be dropped as part of ERESTART. + */ + ccb->ccb_h.status &= ~CAM_DEV_QFRZN; bcopy(ccb, save_ccb, sizeof(*save_ccb)); print_ccb = save_ccb; periph->flags |= CAM_PERIPH_RECOVERY_INPROG; Modified: stable/8/sys/cam/cam_queue.c ============================================================================== --- stable/8/sys/cam/cam_queue.c Wed Dec 2 08:52:06 2009 (r200020) +++ stable/8/sys/cam/cam_queue.c Wed Dec 2 10:10:37 2009 (r200021) @@ -334,7 +334,6 @@ cam_ccbq_init(struct cam_ccbq *ccbq, int } ccbq->devq_openings = openings; ccbq->dev_openings = openings; - TAILQ_INIT(&ccbq->active_ccbs); return (0); } Modified: stable/8/sys/cam/cam_queue.h ============================================================================== --- stable/8/sys/cam/cam_queue.h Wed Dec 2 08:52:06 2009 (r200020) +++ stable/8/sys/cam/cam_queue.h Wed Dec 2 10:10:37 2009 (r200021) @@ -60,7 +60,6 @@ struct cam_ccbq { int dev_openings; int dev_active; int held; - struct ccb_hdr_tailq active_ccbs; }; struct cam_ed; @@ -209,9 +208,6 @@ static __inline void cam_ccbq_send_ccb(struct cam_ccbq *ccbq, union ccb *send_ccb) { - TAILQ_INSERT_TAIL(&ccbq->active_ccbs, - &(send_ccb->ccb_h), - xpt_links.tqe); send_ccb->ccb_h.pinfo.index = CAM_ACTIVE_INDEX; ccbq->dev_active++; ccbq->dev_openings--; @@ -220,8 +216,7 @@ cam_ccbq_send_ccb(struct cam_ccbq *ccbq, static __inline void cam_ccbq_ccb_done(struct cam_ccbq *ccbq, union ccb *done_ccb) { - TAILQ_REMOVE(&ccbq->active_ccbs, &done_ccb->ccb_h, - xpt_links.tqe); + ccbq->dev_active--; ccbq->dev_openings++; ccbq->held++; Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Dec 2 08:52:06 2009 (r200020) +++ stable/8/sys/cam/cam_xpt.c Wed Dec 2 10:10:37 2009 (r200021) @@ -3273,16 +3273,13 @@ xpt_run_dev_sendq(struct cam_eb *bus) devq->send_queue.qfrozen_cnt++; while ((devq->send_queue.entries > 0) - && (devq->send_openings > 0)) { + && (devq->send_openings > 0) + && (devq->send_queue.qfrozen_cnt <= 1)) { struct cam_ed_qinfo *qinfo; struct cam_ed *device; union ccb *work_ccb; struct cam_sim *sim; - if (devq->send_queue.qfrozen_cnt > 1) { - break; - } - qinfo = (struct cam_ed_qinfo *)camq_remove(&devq->send_queue, CAMQ_HEAD); device = qinfo->device; @@ -3330,9 +3327,7 @@ xpt_run_dev_sendq(struct cam_eb *bus) } mtx_unlock(&xsoftc.xpt_lock); } - devq->active_dev = device; cam_ccbq_remove_ccb(&device->ccbq, work_ccb); - cam_ccbq_send_ccb(&device->ccbq, work_ccb); devq->send_openings--; @@ -3370,8 +3365,6 @@ xpt_run_dev_sendq(struct cam_eb *bus) */ sim = work_ccb->ccb_h.path->bus->sim; (*(sim->sim_action))(sim, work_ccb); - - devq->active_dev = NULL; } devq->send_queue.qfrozen_cnt--; } @@ -4102,45 +4095,18 @@ xpt_dev_async_default(u_int32_t async_co u_int32_t xpt_freeze_devq(struct cam_path *path, u_int count) { - struct ccb_hdr *ccbh; mtx_assert(path->bus->sim->mtx, MA_OWNED); - path->device->ccbq.queue.qfrozen_cnt += count; - - /* - * Mark the last CCB in the queue as needing - * to be requeued if the driver hasn't - * changed it's state yet. This fixes a race - * where a ccb is just about to be queued to - * a controller driver when it's interrupt routine - * freezes the queue. To completly close the - * hole, controller drives must check to see - * if a ccb's status is still CAM_REQ_INPROG - * just before they queue - * the CCB. See ahc_action/ahc_freeze_devq for - * an example. - */ - ccbh = TAILQ_LAST(&path->device->ccbq.active_ccbs, ccb_hdr_tailq); - if (ccbh && ccbh->status == CAM_REQ_INPROG) - ccbh->status = CAM_REQUEUE_REQ; return (path->device->ccbq.queue.qfrozen_cnt); } u_int32_t xpt_freeze_simq(struct cam_sim *sim, u_int count) { - mtx_assert(sim->mtx, MA_OWNED); + mtx_assert(sim->mtx, MA_OWNED); sim->devq->send_queue.qfrozen_cnt += count; - if (sim->devq->active_dev != NULL) { - struct ccb_hdr *ccbh; - - ccbh = TAILQ_LAST(&sim->devq->active_dev->ccbq.active_ccbs, - ccb_hdr_tailq); - if (ccbh && ccbh->status == CAM_REQ_INPROG) - ccbh->status = CAM_REQUEUE_REQ; - } return (sim->devq->send_queue.qfrozen_cnt); } Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Wed Dec 2 08:52:06 2009 (r200020) +++ stable/8/sys/cam/scsi/scsi_cd.c Wed Dec 2 10:10:37 2009 (r200021) @@ -1570,7 +1570,8 @@ cddone(struct cam_periph *periph, union bp->bio_resid = bp->bio_bcount; bp->bio_error = error; bp->bio_flags |= BIO_ERROR; - cam_release_devq(done_ccb->ccb_h.path, + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, @@ -1658,7 +1659,8 @@ cddone(struct cam_periph *periph, union struct ccb_getdev cgd; /* Don't wedge this device's queue */ - cam_release_devq(done_ccb->ccb_h.path, + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, Modified: stable/8/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ch.c Wed Dec 2 08:52:06 2009 (r200020) +++ stable/8/sys/cam/scsi/scsi_ch.c Wed Dec 2 10:10:37 2009 (r200021) @@ -606,7 +606,8 @@ chdone(struct cam_periph *periph, union retry_scheduled = 0; /* Don't wedge this device's queue */ - cam_release_devq(done_ccb->ccb_h.path, + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(done_ccb->ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 10:32:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B360B106566B; Wed, 2 Dec 2009 10:32:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E0828FC0C; Wed, 2 Dec 2009 10:32:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2AWYuV000913; Wed, 2 Dec 2009 10:32:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2AWYpm000902; Wed, 2 Dec 2009 10:32:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912021032.nB2AWYpm000902@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Dec 2009 10:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200022 - in stable/8: . contrib/top lib/libusb sbin/camcontrol sys/cam sys/cam/ata sys/dev/ahci sys/dev/siis tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/co... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 10:32:34 -0000 Author: mav Date: Wed Dec 2 10:32:34 2009 New Revision: 200022 URL: http://svn.freebsd.org/changeset/base/200022 Log: MFC r199747, r199799, r199821: - Extend XPT-SIM transfer settings control API. Now it allows to report to SATA SIM number of tags supported by each device, implement ATA mode and SATA revision negotiation for both SATA and PATA SIMs. - Make ahci(4) and siis(4) to use submitted maximum tag number, when scheduling requests. It allows to support NCQ on devices with lower tags count then controller supports. - Make PMP driver to report attached devices connection speeds. - Implement ATA mode negotiation between user settings, device and controller capabilities. - Improve ATA mode/SATA revision control. Modified: stable/8/sbin/camcontrol/camcontrol.8 stable/8/sbin/camcontrol/camcontrol.c stable/8/sys/cam/ata/ata_all.c stable/8/sys/cam/ata/ata_all.h stable/8/sys/cam/ata/ata_pmp.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam_ccb.h stable/8/sys/cam/cam_xpt.c stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h stable/8/sys/dev/siis/siis.c stable/8/sys/dev/siis/siis.h Directory Properties: stable/8/ (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.8 Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sbin/camcontrol/camcontrol.8 Wed Dec 2 10:32:34 2009 (r200022) @@ -149,6 +149,7 @@ .Op generic args .Op Fl c .Op Fl D Ar enable|disable +.Op Fl M Ar mode .Op Fl O Ar offset .Op Fl q .Op Fl R Ar syncrate @@ -705,6 +706,8 @@ Show or set current negotiation settings This is the default. .It Fl D Ar enable|disable Enable or disable disconnection. +.It Fl M Ar mode +Set ATA mode. .It Fl O Ar offset Set the command delay offset. .It Fl q Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sbin/camcontrol/camcontrol.c Wed Dec 2 10:32:34 2009 (r200022) @@ -125,7 +125,7 @@ struct camcontrol_opts { #ifndef MINIMALISTIC static const char scsicmd_opts[] = "a:c:i:o:r"; static const char readdefect_opts[] = "f:GP"; -static const char negotiate_opts[] = "acD:O:qR:T:UW:"; +static const char negotiate_opts[] = "acD:M:O:qR:T:UW:"; #endif struct camcontrol_opts option_table[] = { @@ -226,6 +226,12 @@ static int scsireadcapacity(struct cam_d static int atapm(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); #endif /* MINIMALISTIC */ +#ifndef min +#define min(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef max +#define max(a,b) (((a)>(b))?(a):(b)) +#endif camcontrol_optret getoption(char *arg, cam_cmdmask *cmdnum, cam_argmask *argnum, @@ -950,21 +956,27 @@ camxferrate(struct cam_device *device) if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; + } else if (ccb->cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &ccb->cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); } else if (ccb->cts.transport == XPORT_SATA) { - struct ccb_trans_settings_sata *sata = + struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_SPEED) - speed = sata->bitrate; + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); } mb = speed / 1000; if (mb > 0) { - fprintf(stdout, "%s%d: %d.%03dMB/s transfers ", + fprintf(stdout, "%s%d: %d.%03dMB/s transfers", device->device_name, device->dev_unit_num, mb, speed % 1000); } else { - fprintf(stdout, "%s%d: %dKB/s transfers ", + fprintf(stdout, "%s%d: %dKB/s transfers", device->device_name, device->dev_unit_num, speed); } @@ -975,7 +987,7 @@ camxferrate(struct cam_device *device) if (((spi->valid & CTS_SPI_VALID_SYNC_OFFSET) != 0) && (spi->sync_offset != 0)) - fprintf(stdout, "(%d.%03dMHz, offset %d", freq / 1000, + fprintf(stdout, " (%d.%03dMHz, offset %d", freq / 1000, freq % 1000, spi->sync_offset); if (((spi->valid & CTS_SPI_VALID_BUS_WIDTH) != 0) @@ -995,18 +1007,24 @@ camxferrate(struct cam_device *device) struct ccb_trans_settings_ata *ata = &ccb->cts.xport_specific.ata; - if (ata->valid & CTS_ATA_VALID_BYTECOUNT) { - fprintf(stdout, "(PIO size %dbytes)", - ata->bytecount); - } + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); + if (ata->valid & CTS_ATA_VALID_BYTECOUNT) + printf("PIO size %dbytes", ata->bytecount); + printf(")"); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &ccb->cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_BYTECOUNT) { - fprintf(stdout, "(PIO size %dbytes)", - sata->bytecount); - } + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + printf("PIO size %dbytes", sata->bytecount); + printf(")"); } if (ccb->cts.protocol == PROTO_SCSI) { @@ -2757,7 +2775,44 @@ cts_print(struct cam_device *device, str "enabled" : "disabled"); } } + if (cts->transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts->xport_specific.ata; + + if ((ata->valid & CTS_ATA_VALID_MODE) != 0) { + fprintf(stdout, "%sATA mode: %s\n", pathstr, + ata_mode2string(ata->mode)); + } + if ((ata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { + fprintf(stdout, "%sPIO transaction length: %d\n", + pathstr, ata->bytecount); + } + } + if (cts->transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts->xport_specific.sata; + if ((sata->valid & CTS_SATA_VALID_REVISION) != 0) { + fprintf(stdout, "%sSATA revision: %d.x\n", pathstr, + sata->revision); + } + if ((sata->valid & CTS_SATA_VALID_MODE) != 0) { + fprintf(stdout, "%sATA mode: %s\n", pathstr, + ata_mode2string(sata->mode)); + } + if ((sata->valid & CTS_SATA_VALID_BYTECOUNT) != 0) { + fprintf(stdout, "%sPIO transaction length: %d\n", + pathstr, sata->bytecount); + } + if ((sata->valid & CTS_SATA_VALID_PM) != 0) { + fprintf(stdout, "%sPMP presence: %d\n", pathstr, + sata->pm_present); + } + if ((sata->valid & CTS_SATA_VALID_TAGS) != 0) { + fprintf(stdout, "%sNumber of tags: %d\n", pathstr, + sata->tags); + } + } if (cts->protocol == PROTO_SCSI) { struct ccb_trans_settings_scsi *scsi= &cts->proto_specific.scsi; @@ -3057,6 +3112,7 @@ ratecontrol(struct cam_device *device, i int user_settings = 0; int retval = 0; int disc_enable = -1, tag_enable = -1; + int mode = -1; int offset = -1; double syncrate = -1; int bus_width = -1; @@ -3065,12 +3121,10 @@ ratecontrol(struct cam_device *device, i struct ccb_pathinq cpi; ccb = cam_getccb(device); - if (ccb == NULL) { warnx("ratecontrol: error allocating ccb"); return(1); } - while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c){ case 'a': @@ -3091,6 +3145,15 @@ ratecontrol(struct cam_device *device, i } change_settings = 1; break; + case 'M': + mode = ata_string2mode(optarg); + if (mode < 0) { + warnx("unknown mode '%s'", optarg); + retval = 1; + goto ratecontrol_bailout; + } + change_settings = 1; + break; case 'O': offset = strtol(optarg, NULL, 0); if (offset < 0) { @@ -3105,7 +3168,6 @@ ratecontrol(struct cam_device *device, i break; case 'R': syncrate = atof(optarg); - if (syncrate < 0) { warnx("sync rate %f is < 0", syncrate); retval = 1; @@ -3141,17 +3203,14 @@ ratecontrol(struct cam_device *device, i break; } } - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_pathinq) - sizeof(struct ccb_hdr)); - /* * Grab path inquiry information, so we can determine whether * or not the initiator is capable of the things that the user * requests. */ ccb->ccb_h.func_code = XPT_PATH_INQ; - if (cam_send_ccb(device, ccb) < 0) { perror("error sending XPT_PATH_INQ CCB"); if (arglist & CAM_ARG_VERBOSE) { @@ -3161,7 +3220,6 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("XPT_PATH_INQ CCB failed"); if (arglist & CAM_ARG_VERBOSE) { @@ -3171,17 +3229,14 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - bcopy(&ccb->cpi, &cpi, sizeof(struct ccb_pathinq)); - bzero(&(&ccb->ccb_h)[1], sizeof(struct ccb_trans_settings) - sizeof(struct ccb_hdr)); - - if (quiet == 0) - fprintf(stdout, "Current Parameters:\n"); - + if (quiet == 0) { + fprintf(stdout, "%s parameters:\n", + user_settings ? "User" : "Current"); + } retval = get_print_cts(device, user_settings, quiet, &ccb->cts); - if (retval != 0) goto ratecontrol_bailout; @@ -3191,16 +3246,20 @@ ratecontrol(struct cam_device *device, i if (change_settings) { int didsettings = 0; struct ccb_trans_settings_spi *spi = NULL; + struct ccb_trans_settings_ata *ata = NULL; + struct ccb_trans_settings_sata *sata = NULL; struct ccb_trans_settings_scsi *scsi = NULL; - if (ccb->cts.transport == XPORT_SPI) { + if (ccb->cts.transport == XPORT_SPI) spi = &ccb->cts.xport_specific.spi; - spi->valid = 0; - } - if (ccb->cts.protocol == PROTO_SCSI) { + if (ccb->cts.transport == XPORT_ATA) + ata = &ccb->cts.xport_specific.ata; + if (ccb->cts.transport == XPORT_SATA) + sata = &ccb->cts.xport_specific.sata; + if (ccb->cts.protocol == PROTO_SCSI) scsi = &ccb->cts.proto_specific.scsi; - scsi->valid = 0; - } + ccb->cts.xport_specific.valid = 0; + ccb->cts.proto_specific.valid = 0; if (spi && disc_enable != -1) { spi->valid |= CTS_SPI_VALID_DISC; if (disc_enable == 0) @@ -3208,7 +3267,6 @@ ratecontrol(struct cam_device *device, i else spi->flags |= CTS_SPI_FLAGS_DISC_ENB; } - if (scsi && tag_enable != -1) { if ((cpi.hba_inquiry & PI_TAG_ABLE) == 0) { warnx("HBA does not support tagged queueing, " @@ -3216,21 +3274,16 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - scsi->valid |= CTS_SCSI_VALID_TQ; - if (tag_enable == 0) scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; else scsi->flags |= CTS_SCSI_FLAGS_TAG_ENB; didsettings++; } - if (spi && offset != -1) { if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { - warnx("HBA at %s%d is not cable of changing " - "offset", cpi.dev_name, - cpi.unit_number); + warnx("HBA is not capable of changing offset"); retval = 1; goto ratecontrol_bailout; } @@ -3238,28 +3291,23 @@ ratecontrol(struct cam_device *device, i spi->sync_offset = offset; didsettings++; } - if (spi && syncrate != -1) { int prelim_sync_period; u_int freq; if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { - warnx("HBA at %s%d is not cable of changing " - "transfer rates", cpi.dev_name, - cpi.unit_number); + warnx("HBA is not capable of changing " + "transfer rates"); retval = 1; goto ratecontrol_bailout; } - spi->valid |= CTS_SPI_VALID_SYNC_RATE; - /* * The sync rate the user gives us is in MHz. * We need to translate it into KHz for this * calculation. */ syncrate *= 1000; - /* * Next, we calculate a "preliminary" sync period * in tenths of a nanosecond. @@ -3268,14 +3316,43 @@ ratecontrol(struct cam_device *device, i prelim_sync_period = 0; else prelim_sync_period = 10000000 / syncrate; - spi->sync_period = scsi_calc_syncparam(prelim_sync_period); - freq = scsi_calc_syncsrate(spi->sync_period); didsettings++; } - + if (sata && syncrate != -1) { + if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { + warnx("HBA is not capable of changing " + "transfer rates"); + retval = 1; + goto ratecontrol_bailout; + } + sata->revision = ata_speed2revision(syncrate * 100); + if (sata->revision < 0) { + warnx("Invalid rate %f", syncrate); + retval = 1; + goto ratecontrol_bailout; + } + sata->valid |= CTS_SATA_VALID_REVISION; + didsettings++; + } + if ((ata || sata) && mode != -1) { + if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { + warnx("HBA is not capable of changing " + "transfer rates"); + retval = 1; + goto ratecontrol_bailout; + } + if (ata) { + ata->mode = mode; + ata->valid |= CTS_ATA_VALID_MODE; + } else { + sata->mode = mode; + sata->valid |= CTS_SATA_VALID_MODE; + } + didsettings++; + } /* * The bus_width argument goes like this: * 0 == 8 bit @@ -3286,7 +3363,6 @@ ratecontrol(struct cam_device *device, i * number. */ if (spi && bus_width != -1) { - /* * We might as well validate things here with a * decipherable error message, rather than what @@ -3310,17 +3386,19 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - spi->valid |= CTS_SPI_VALID_BUS_WIDTH; spi->bus_width = bus_width >> 4; didsettings++; } - if (didsettings == 0) { goto ratecontrol_bailout; } + if (!user_settings && (ata || sata)) { + warnx("You can modify only user settings for ATA/SATA"); + retval = 1; + goto ratecontrol_bailout; + } ccb->ccb_h.func_code = XPT_SET_TRAN_SETTINGS; - if (cam_send_ccb(device, ccb) < 0) { perror("error sending XPT_SET_TRAN_SETTINGS CCB"); if (arglist & CAM_ARG_VERBOSE) { @@ -3330,7 +3408,6 @@ ratecontrol(struct cam_device *device, i retval = 1; goto ratecontrol_bailout; } - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("XPT_SET_TRANS_SETTINGS CCB failed"); if (arglist & CAM_ARG_VERBOSE) { @@ -3341,11 +3418,9 @@ ratecontrol(struct cam_device *device, i goto ratecontrol_bailout; } } - if (send_tur) { retval = testunitready(device, retry_count, timeout, (arglist & CAM_ARG_VERBOSE) ? 0 : 1); - /* * If the TUR didn't succeed, just bail. */ @@ -3354,7 +3429,6 @@ ratecontrol(struct cam_device *device, i fprintf(stderr, "Test Unit Ready failed\n"); goto ratecontrol_bailout; } - /* * If the user wants things quiet, there's no sense in * getting the transfer settings, if we're not going @@ -3362,13 +3436,11 @@ ratecontrol(struct cam_device *device, i */ if (quiet != 0) goto ratecontrol_bailout; - - fprintf(stdout, "New Parameters:\n"); + fprintf(stdout, "New parameters:\n"); retval = get_print_cts(device, user_settings, 0, NULL); } ratecontrol_bailout: - cam_freeccb(ccb); return(retval); } @@ -4255,8 +4327,8 @@ usage(int verbose) " \n" " camcontrol tags [dev_id][generic args] [-N tags] [-q] [-v]\n" " camcontrol negotiate [dev_id][generic args] [-a][-c]\n" -" [-D ][-O offset][-q]\n" -" [-R syncrate][-v][-T ]\n" +" [-D ][-M mode][-O offset]\n" +" [-q][-R syncrate][-v][-T ]\n" " [-U][-W bus_width]\n" " camcontrol format [dev_id][generic args][-q][-r][-w][-y]\n" " camcontrol idle [dev_id][generic args][-t time]\n" @@ -4347,6 +4419,7 @@ usage(int verbose) "-a send a test unit ready after negotiation\n" "-c report/set current negotiation settings\n" "-D \"enable\" or \"disable\" disconnection\n" +"-M mode set ATA mode\n" "-O offset set command delay offset\n" "-q be quiet, don't report anything\n" "-R syncrate synchronization rate in MHz\n" Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/cam/ata/ata_all.c Wed Dec 2 10:32:34 2009 (r200022) @@ -491,22 +491,143 @@ ata_max_umode(struct ata_params *ap) } int -ata_max_mode(struct ata_params *ap, int mode, int maxmode) +ata_max_mode(struct ata_params *ap, int maxmode) { - if (maxmode && mode > maxmode) - mode = maxmode; + if (maxmode == 0) + maxmode = ATA_DMA_MAX; + if (maxmode >= ATA_UDMA0 && ata_max_umode(ap) > 0) + return (min(maxmode, ata_max_umode(ap))); + if (maxmode >= ATA_WDMA0 && ata_max_wmode(ap) > 0) + return (min(maxmode, ata_max_wmode(ap))); + return (min(maxmode, ata_max_pmode(ap))); +} - if (mode >= ATA_UDMA0 && ata_max_umode(ap) > 0) - return (min(mode, ata_max_umode(ap))); +char * +ata_mode2string(int mode) +{ + switch (mode) { + case -1: return "UNSUPPORTED"; + case 0: return "NONE"; + case ATA_PIO0: return "PIO0"; + case ATA_PIO1: return "PIO1"; + case ATA_PIO2: return "PIO2"; + case ATA_PIO3: return "PIO3"; + case ATA_PIO4: return "PIO4"; + case ATA_WDMA0: return "WDMA0"; + case ATA_WDMA1: return "WDMA1"; + case ATA_WDMA2: return "WDMA2"; + case ATA_UDMA0: return "UDMA0"; + case ATA_UDMA1: return "UDMA1"; + case ATA_UDMA2: return "UDMA2"; + case ATA_UDMA3: return "UDMA3"; + case ATA_UDMA4: return "UDMA4"; + case ATA_UDMA5: return "UDMA5"; + case ATA_UDMA6: return "UDMA6"; + default: + if (mode & ATA_DMA_MASK) + return "BIOSDMA"; + else + return "BIOSPIO"; + } +} - if (mode >= ATA_WDMA0 && ata_max_wmode(ap) > 0) - return (min(mode, ata_max_wmode(ap))); +int +ata_string2mode(char *str) +{ + if (!strcasecmp(str, "PIO0")) return (ATA_PIO0); + if (!strcasecmp(str, "PIO1")) return (ATA_PIO1); + if (!strcasecmp(str, "PIO2")) return (ATA_PIO2); + if (!strcasecmp(str, "PIO3")) return (ATA_PIO3); + if (!strcasecmp(str, "PIO4")) return (ATA_PIO4); + if (!strcasecmp(str, "WDMA0")) return (ATA_WDMA0); + if (!strcasecmp(str, "WDMA1")) return (ATA_WDMA1); + if (!strcasecmp(str, "WDMA2")) return (ATA_WDMA2); + if (!strcasecmp(str, "UDMA0")) return (ATA_UDMA0); + if (!strcasecmp(str, "UDMA16")) return (ATA_UDMA0); + if (!strcasecmp(str, "UDMA1")) return (ATA_UDMA1); + if (!strcasecmp(str, "UDMA25")) return (ATA_UDMA1); + if (!strcasecmp(str, "UDMA2")) return (ATA_UDMA2); + if (!strcasecmp(str, "UDMA33")) return (ATA_UDMA2); + if (!strcasecmp(str, "UDMA3")) return (ATA_UDMA3); + if (!strcasecmp(str, "UDMA44")) return (ATA_UDMA3); + if (!strcasecmp(str, "UDMA4")) return (ATA_UDMA4); + if (!strcasecmp(str, "UDMA66")) return (ATA_UDMA4); + if (!strcasecmp(str, "UDMA5")) return (ATA_UDMA5); + if (!strcasecmp(str, "UDMA100")) return (ATA_UDMA5); + if (!strcasecmp(str, "UDMA6")) return (ATA_UDMA6); + if (!strcasecmp(str, "UDMA133")) return (ATA_UDMA6); + return (-1); +} + + +u_int +ata_mode2speed(int mode) +{ + switch (mode) { + case ATA_PIO0: + default: + return (3300); + case ATA_PIO1: + return (5200); + case ATA_PIO2: + return (8300); + case ATA_PIO3: + return (11100); + case ATA_PIO4: + return (16700); + case ATA_WDMA0: + return (4200); + case ATA_WDMA1: + return (13300); + case ATA_WDMA2: + return (16700); + case ATA_UDMA0: + return (16700); + case ATA_UDMA1: + return (25000); + case ATA_UDMA2: + return (33300); + case ATA_UDMA3: + return (44400); + case ATA_UDMA4: + return (66700); + case ATA_UDMA5: + return (100000); + case ATA_UDMA6: + return (133000); + } +} - if (mode > ata_max_pmode(ap)) - return (min(mode, ata_max_pmode(ap))); +u_int +ata_revision2speed(int revision) +{ + switch (revision) { + case 1: + default: + return (150000); + case 2: + return (300000); + case 3: + return (600000); + } +} - return (mode); +int +ata_speed2revision(u_int speed) +{ + switch (speed) { + case 0: + return (0); + case 150000: + return (1); + case 300000: + return (2); + case 600000: + return (3); + default: + return (-1); + } } int Modified: stable/8/sys/cam/ata/ata_all.h ============================================================================== --- stable/8/sys/cam/ata/ata_all.h Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/cam/ata/ata_all.h Wed Dec 2 10:32:34 2009 (r200022) @@ -112,7 +112,13 @@ void ata_bpack(int8_t *src, int8_t *dst, int ata_max_pmode(struct ata_params *ap); int ata_max_wmode(struct ata_params *ap); int ata_max_umode(struct ata_params *ap); -int ata_max_mode(struct ata_params *ap, int mode, int maxmode); +int ata_max_mode(struct ata_params *ap, int maxmode); + +char * ata_mode2string(int mode); +int ata_string2mode(char *str); +u_int ata_mode2speed(int mode); +u_int ata_revision2speed(int revision); +int ata_speed2revision(u_int speed); int ata_identify_match(caddr_t identbuffer, caddr_t table_entry); int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/cam/ata/ata_pmp.c Wed Dec 2 10:32:34 2009 (r200022) @@ -516,6 +516,7 @@ printf("PM RESET %d%s\n", softc->pm_step static void pmpdone(struct cam_periph *periph, union ccb *done_ccb) { + struct ccb_trans_settings cts; struct pmp_softc *softc; struct ccb_ataio *ataio; union ccb *work_ccb; @@ -635,6 +636,19 @@ pmpdone(struct cam_periph *periph, union done_ccb->ataio.res.sector_count; if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) { printf("PM status: %d - %08x\n", softc->pm_step, res); + /* Report device speed. */ + if (xpt_create_path(&dpath, periph, + xpt_path_path_id(periph->path), + softc->pm_step, 0) == CAM_REQ_CMP) { + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, dpath, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cts.xport_specific.sata.revision = (res & 0x0f0) >> 4; + cts.xport_specific.sata.valid = CTS_SATA_VALID_REVISION; + xpt_action((union ccb *)&cts); + xpt_free_path(dpath); + } softc->found |= (1 << softc->pm_step); softc->pm_step++; } else { Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/cam/ata/ata_xpt.c Wed Dec 2 10:32:34 2009 (r200022) @@ -275,7 +275,7 @@ probeschedule(struct cam_periph *periph) static void probestart(struct cam_periph *periph, union ccb *start_ccb) { - /* Probe the device that our peripheral driver points to */ + struct ccb_trans_settings cts; struct ccb_ataio *ataio; struct ccb_scsiio *csio; probe_softc *softc; @@ -333,6 +333,55 @@ probestart(struct cam_periph *periph, un ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); break; case PROBE_SETMODE: + { + int mode, wantmode; + + mode = 0; + /* Fetch user modes from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_MODE) + mode = cts.xport_specific.ata.mode; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_MODE) + mode = cts.xport_specific.sata.mode; + } +negotiate: + /* Honor device capabilities. */ + wantmode = mode = ata_max_mode(ident_buf, mode); + /* Report modes to SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + if (path->device->transport == XPORT_ATA) { + cts.xport_specific.ata.mode = mode; + cts.xport_specific.ata.valid = CTS_ATA_VALID_MODE; + } else { + cts.xport_specific.sata.mode = mode; + cts.xport_specific.sata.valid = CTS_SATA_VALID_MODE; + } + xpt_action((union ccb *)&cts); + /* Fetch user modes from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_MODE) + mode = cts.xport_specific.ata.mode; + } else { + if (cts.xport_specific.ata.valid & CTS_SATA_VALID_MODE) + mode = cts.xport_specific.sata.mode; + } + /* If SIM disagree - renegotiate. */ + if (mode != wantmode) + goto negotiate; cam_fill_ataio(ataio, 1, probedone, @@ -341,12 +390,11 @@ probestart(struct cam_periph *periph, un /*data_ptr*/NULL, /*dxfer_len*/0, 30 * 1000); - ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, - ata_max_mode(ident_buf, ATA_UDMA6, ATA_UDMA6)); + ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode); break; + } case PROBE_SET_MULTI: { - struct ccb_trans_settings cts; u_int sectors; sectors = max(1, min(ident_buf->sectors_intr & 0xff, 16)); @@ -564,6 +612,7 @@ proberequestbackoff(struct cam_periph *p static void probedone(struct cam_periph *periph, union ccb *done_ccb) { + struct ccb_trans_settings cts; struct ata_params *ident_buf; probe_softc *softc; struct cam_path *path; @@ -619,9 +668,7 @@ noerror: PROBE_SET_ACTION(softc, PROBE_IDENTIFY); } else if (sign == 0x9669 && done_ccb->ccb_h.target_id == 15) { - struct ccb_trans_settings cts; - - /* Report SIM that PM is present. */ + /* Report SIM that PM is present. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; @@ -716,11 +763,17 @@ noerror: ATA_QUEUE_LEN(ident_buf->queue) + 1; } ata_find_quirk(path->device); - /* XXX: If not all tags allowed, we must to tell SIM which are. */ - if (path->device->mintags < path->bus->sim->max_tagged_dev_openings) - path->device->mintags = path->device->maxtags = 0; if (path->device->mintags != 0 && path->bus->sim->max_tagged_dev_openings != 0) { + /* Report SIM which tags are allowed. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + cts.xport_specific.sata.tags = path->device->maxtags; + cts.xport_specific.sata.valid = CTS_SATA_VALID_TAGS; + xpt_action((union ccb *)&cts); + /* Reconfigure queues for tagged queueing. */ xpt_start_tags(path); } ata_device_transport(path); Modified: stable/8/sys/cam/cam_ccb.h ============================================================================== --- stable/8/sys/cam/cam_ccb.h Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/cam/cam_ccb.h Wed Dec 2 10:32:34 2009 (r200022) @@ -819,19 +819,23 @@ struct ccb_trans_settings_sas { struct ccb_trans_settings_ata { u_int valid; /* Which fields to honor */ #define CTS_ATA_VALID_MODE 0x01 -#define CTS_ATA_VALID_BYTECOUNT 0x04 - u_int32_t mode; +#define CTS_ATA_VALID_BYTECOUNT 0x02 + int mode; /* Mode */ u_int bytecount; /* Length of PIO transaction */ }; struct ccb_trans_settings_sata { u_int valid; /* Which fields to honor */ -#define CTS_SATA_VALID_SPEED 0x01 -#define CTS_SATA_VALID_PM 0x02 -#define CTS_SATA_VALID_BYTECOUNT 0x04 - u_int32_t bitrate; /* Mbps */ - u_int pm_present; /* PM is present (XPT->SIM) */ +#define CTS_SATA_VALID_MODE 0x01 +#define CTS_SATA_VALID_BYTECOUNT 0x02 +#define CTS_SATA_VALID_REVISION 0x04 +#define CTS_SATA_VALID_PM 0x08 +#define CTS_SATA_VALID_TAGS 0x10 + int mode; /* Legacy PATA mode */ u_int bytecount; /* Length of PIO transaction */ + int revision; /* SATA revision */ + u_int pm_present; /* PM is present (XPT->SIM) */ + u_int tags; /* Number of allowed tags */ }; /* Get/Set transfer rate/width/disconnection/tag queueing settings */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/cam/cam_xpt.c Wed Dec 2 10:32:34 2009 (r200022) @@ -1140,12 +1140,19 @@ xpt_announce_periph(struct cam_periph *p if (sas->valid & CTS_SAS_VALID_SPEED) speed = sas->bitrate; } + if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + struct ccb_trans_settings_ata *ata = + &cts.xport_specific.ata; + + if (ata->valid & CTS_ATA_VALID_MODE) + speed = ata_mode2speed(ata->mode); + } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &cts.xport_specific.sata; - if (sata->valid & CTS_SATA_VALID_SPEED) - speed = sata->bitrate; + if (sata->valid & CTS_SATA_VALID_REVISION) + speed = ata_revision2speed(sata->revision); } mb = speed / 1000; @@ -1195,15 +1202,25 @@ xpt_announce_periph(struct cam_periph *p struct ccb_trans_settings_ata *ata = &cts.xport_specific.ata; + printf(" ("); + if (ata->valid & CTS_ATA_VALID_MODE) + printf("%s, ", ata_mode2string(ata->mode)); if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf(" (PIO size %dbytes)", ata->bytecount); + printf("PIO size %dbytes", ata->bytecount); + printf(")"); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &cts.xport_specific.sata; + printf(" ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + printf("SATA %d.x, ", sata->revision); + if (sata->valid & CTS_SATA_VALID_MODE) + printf("%s, ", ata_mode2string(sata->mode)); if (sata->valid & CTS_SATA_VALID_BYTECOUNT) - printf(" (PIO size %dbytes)", sata->bytecount); + printf("PIO size %dbytes", sata->bytecount); + printf(")"); } if (path->device->inq_flags & SID_CmdQue || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Wed Dec 2 10:10:37 2009 (r200021) +++ stable/8/sys/dev/ahci/ahci.c Wed Dec 2 10:32:34 2009 (r200022) @@ -72,7 +72,7 @@ static void ahci_dmasetprd(void *arg, bu static void ahci_execute_transaction(struct ahci_slot *slot); static void ahci_timeout(struct ahci_slot *slot); static void ahci_end_transaction(struct ahci_slot *slot, enum ahci_err_type et); -static int ahci_setup_fis(struct ahci_cmd_tab *ctp, union ccb *ccb, int tag); +static int ahci_setup_fis(device_t dev, struct ahci_cmd_tab *ctp, union ccb *ccb, int tag); static void ahci_dmainit(device_t dev); static void ahci_dmasetupc_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static void ahci_dmafini(device_t dev); @@ -776,7 +776,7 @@ ahci_ch_attach(device_t dev) struct ahci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ahci_channel *ch = device_get_softc(dev); struct cam_devq *devq; - int rid, error; + int rid, error, i, sata_rev = 0; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -795,9 +795,16 @@ ahci_ch_attach(device_t dev) pci_get_subvendor(ctlr->dev) == 0x1043 && pci_get_subdevice(ctlr->dev) == 0x81e4 && ch->unit == 0) - ch->sata_rev = 1; + sata_rev = 1; resource_int_value(device_get_name(dev), - device_get_unit(dev), "sata_rev", &ch->sata_rev); + device_get_unit(dev), "sata_rev", &sata_rev); + for (i = 0; i < 16; i++) { + ch->user[i].revision = sata_rev; + ch->user[i].mode = 0; + ch->user[i].bytecount = 8192; + ch->user[i].tags = ch->numslots; + ch->curr[i] = ch->user[i]; + } rid = ch->unit; if (!(ch->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE))) @@ -1275,6 +1282,10 @@ ahci_check_collision(device_t dev, union if (ch->numtslots != 0 && ch->taggedtarget != ccb->ccb_h.target_id) return (1); + /* Tagged command while we have no supported tag free. */ + if (((~ch->oslots) & (0xffffffff >> (32 - + ch->curr[ccb->ccb_h.target_id].tags))) == 0) + return (1); } else { /* Untagged command while tagged are active. */ if (ch->numrslots != 0 && ch->numtslots != 0) @@ -1298,15 +1309,21 @@ ahci_begin_transaction(device_t dev, uni { struct ahci_channel *ch = device_get_softc(dev); struct ahci_slot *slot; - int tag; + int tag, tags; /* Choose empty slot. */ + tags = ch->numslots; + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) + tags = ch->curr[ccb->ccb_h.target_id].tags; tag = ch->lastslot; - while (ch->slot[tag].state != AHCI_SLOT_EMPTY) { - if (++tag >= ch->numslots) + while (1) { + if (tag >= tags) tag = 0; - KASSERT(tag != ch->lastslot, ("ahci: ALL SLOTS BUSY!")); - } + if (ch->slot[tag].state == AHCI_SLOT_EMPTY) + break; + tag++; + }; ch->lastslot = tag; /* Occupy chosen slot. */ slot = &ch->slot[tag]; @@ -1315,6 +1332,7 @@ ahci_begin_transaction(device_t dev, uni if (ch->numrslots == 0 && ch->pm_level > 3) callout_stop(&ch->pm_timer); /* Update channel stats. */ + ch->oslots |= (1 << slot->slot); ch->numrslots++; if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { @@ -1392,7 +1410,7 @@ ahci_execute_transaction(struct ahci_slo ctp = (struct ahci_cmd_tab *) (ch->dma.work + AHCI_CT_OFFSET + (AHCI_CT_SIZE * slot->slot)); /* Setup the FIS for this request */ - if (!(fis_size = ahci_setup_fis(ctp, ccb, slot->slot))) { + if (!(fis_size = ahci_setup_fis(dev, ctp, ccb, slot->slot))) { device_printf(ch->dev, "Setting up SATA FIS failed\n"); ahci_end_transaction(slot, AHCI_ERR_INVALID); return; @@ -1635,6 +1653,7 @@ ahci_end_transaction(struct ahci_slot *s ccb->ccb_h.status |= CAM_REQ_CMP_ERR; } /* Free slot. */ + ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); slot->state = AHCI_SLOT_EMPTY; @@ -1664,7 +1683,7 @@ ahci_end_transaction(struct ahci_slot *s } else xpt_done(ccb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 10:36:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8238106566B; Wed, 2 Dec 2009 10:36:41 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C77D78FC12; Wed, 2 Dec 2009 10:36:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2AafjF001089; Wed, 2 Dec 2009 10:36:41 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2Aafdo001087; Wed, 2 Dec 2009 10:36:41 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912021036.nB2Aafdo001087@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 2 Dec 2009 10:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200023 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 10:36:41 -0000 Author: luigi Date: Wed Dec 2 10:36:41 2009 New Revision: 200023 URL: http://svn.freebsd.org/changeset/base/200023 Log: Add new sockopt names for ipfw and dummynet. This commit is just grabbing entries for the new names that will be used in the future, so you don't need to rebuild anything now. MFC after: 3 days Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Wed Dec 2 10:32:34 2009 (r200022) +++ head/sys/netinet/in.h Wed Dec 2 10:36:41 2009 (r200023) @@ -423,12 +423,20 @@ __END_DECLS #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ #define IP_BINDANY 24 /* bool: allow bind to any address */ +/* + * Options for controlling the firewall and dummynet. + * Historical options (from 40 to 64) will eventually be + * replaced by only two options, IP_FW3 and IP_DUMMYNET3. + */ #define IP_FW_TABLE_ADD 40 /* add entry */ #define IP_FW_TABLE_DEL 41 /* delete entry */ #define IP_FW_TABLE_FLUSH 42 /* flush table */ #define IP_FW_TABLE_GETSIZE 43 /* get table size */ #define IP_FW_TABLE_LIST 44 /* list table contents */ +#define IP_FW3 48 /* generic ipfw v.3 sockopts */ +#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */ + #define IP_FW_ADD 50 /* add a firewall rule to chain */ #define IP_FW_DEL 51 /* delete a firewall rule from chain */ #define IP_FW_FLUSH 52 /* flush firewall rule chain */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 10:47:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F20BD106566C; Wed, 2 Dec 2009 10:47:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD0288FC13; Wed, 2 Dec 2009 10:47:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2AlBtX001402; Wed, 2 Dec 2009 10:47:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2AlB2J001397; Wed, 2 Dec 2009 10:47:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912021047.nB2AlB2J001397@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Dec 2009 10:47:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200024 - in stable/8: . contrib/top lib/libusb sbin/atacontrol sys/conf sys/dev/ata sys/modules/ata/atausb sys/sys tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 10:47:12 -0000 Author: mav Date: Wed Dec 2 10:47:11 2009 New Revision: 200024 URL: http://svn.freebsd.org/changeset/base/200024 Log: MFC r199822: Drop USB mass storage devices support from ata(4). It is out of the build as long as I remember, and completely superseded by better maintained umass(4). It's main idea was to optionally avoid CAM dependency for such devices, but with move ATA to CAM, it is not actual any more. No objections: hselasky@, thompsa@, arch@ Deleted: stable/8/sys/dev/ata/ata-usb.c stable/8/sys/modules/ata/atausb/ Modified: stable/8/sbin/atacontrol/atacontrol.c stable/8/sys/conf/files stable/8/sys/dev/ata/ata-all.c stable/8/sys/sys/ata.h Directory Properties: stable/8/ (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sbin/atacontrol/atacontrol.c ============================================================================== --- stable/8/sbin/atacontrol/atacontrol.c Wed Dec 2 10:36:41 2009 (r200023) +++ stable/8/sbin/atacontrol/atacontrol.c Wed Dec 2 10:47:11 2009 (r200024) @@ -56,9 +56,6 @@ mode2str(int mode) case ATA_UDMA6: return "UDMA133"; case ATA_SA150: return "SATA150"; case ATA_SA300: return "SATA300"; - case ATA_USB: return "USB"; - case ATA_USB1: return "USB1"; - case ATA_USB2: return "USB2"; case ATA_DMA: return "BIOSDMA"; default: return "???"; } @@ -84,9 +81,6 @@ str2mode(char *str) if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6; if (!strcasecmp(str, "SATA150")) return ATA_SA150; if (!strcasecmp(str, "SATA300")) return ATA_SA300; - if (!strcasecmp(str, "USB")) return ATA_USB; - if (!strcasecmp(str, "USB1")) return ATA_USB1; - if (!strcasecmp(str, "USB2")) return ATA_USB2; if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA; return -1; } Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Wed Dec 2 10:36:41 2009 (r200023) +++ stable/8/sys/conf/files Wed Dec 2 10:47:11 2009 (r200024) @@ -530,7 +530,6 @@ dev/ata/chipsets/ata-sis.c optional ata dev/ata/chipsets/ata-via.c optional ata pci | atavia dev/ata/ata-disk.c optional atadisk dev/ata/ata-raid.c optional ataraid -dev/ata/ata-usb.c optional atausb usb dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Wed Dec 2 10:36:41 2009 (r200023) +++ stable/8/sys/dev/ata/ata-all.c Wed Dec 2 10:47:11 2009 (r200024) @@ -942,9 +942,6 @@ ata_mode2str(int mode) case ATA_UDMA6: return "UDMA133"; case ATA_SA150: return "SATA150"; case ATA_SA300: return "SATA300"; - case ATA_USB: return "USB"; - case ATA_USB1: return "USB1"; - case ATA_USB2: return "USB2"; default: if (mode & ATA_DMA_MASK) return "BIOSDMA"; Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Wed Dec 2 10:36:41 2009 (r200023) +++ stable/8/sys/sys/ata.h Wed Dec 2 10:47:11 2009 (r200024) @@ -278,9 +278,6 @@ struct ata_params { #define ATA_SA150 0x47 #define ATA_SA300 0x48 #define ATA_DMA_MAX 0x4f -#define ATA_USB 0x80 -#define ATA_USB1 0x81 -#define ATA_USB2 0x82 /* ATA commands */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 12:26:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F7C1065670; Wed, 2 Dec 2009 12:26:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2BCF8FC0A; Wed, 2 Dec 2009 12:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2CQQpF003531; Wed, 2 Dec 2009 12:26:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2CQQvI003529; Wed, 2 Dec 2009 12:26:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912021226.nB2CQQvI003529@svn.freebsd.org> From: Alexander Motin Date: Wed, 2 Dec 2009 12:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200025 - stable/8/sbin/atacontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 12:26:26 -0000 Author: mav Date: Wed Dec 2 12:26:26 2009 New Revision: 200025 URL: http://svn.freebsd.org/changeset/base/200025 Log: MFC r199644: Add some missing WDMA/UDMA modes. Modified: stable/8/sbin/atacontrol/atacontrol.c Directory Properties: stable/8/sbin/atacontrol/ (props changed) Modified: stable/8/sbin/atacontrol/atacontrol.c ============================================================================== --- stable/8/sbin/atacontrol/atacontrol.c Wed Dec 2 10:47:11 2009 (r200024) +++ stable/8/sbin/atacontrol/atacontrol.c Wed Dec 2 12:26:26 2009 (r200025) @@ -49,8 +49,13 @@ mode2str(int mode) case ATA_PIO2: return "PIO2"; case ATA_PIO3: return "PIO3"; case ATA_PIO4: return "PIO4"; + case ATA_WDMA0: return "WDMA0"; + case ATA_WDMA1: return "WDMA1"; case ATA_WDMA2: return "WDMA2"; + case ATA_UDMA0: return "UDMA0"; + case ATA_UDMA1: return "UDMA1"; case ATA_UDMA2: return "UDMA33"; + case ATA_UDMA3: return "UDMA44"; case ATA_UDMA4: return "UDMA66"; case ATA_UDMA5: return "UDMA100"; case ATA_UDMA6: return "UDMA133"; @@ -70,9 +75,15 @@ str2mode(char *str) if (!strcasecmp(str, "PIO2")) return ATA_PIO2; if (!strcasecmp(str, "PIO3")) return ATA_PIO3; if (!strcasecmp(str, "PIO4")) return ATA_PIO4; + if (!strcasecmp(str, "WDMA0")) return ATA_WDMA0; + if (!strcasecmp(str, "WDMA1")) return ATA_WDMA1; if (!strcasecmp(str, "WDMA2")) return ATA_WDMA2; + if (!strcasecmp(str, "UDMA0")) return ATA_UDMA0; + if (!strcasecmp(str, "UDMA1")) return ATA_UDMA1; if (!strcasecmp(str, "UDMA2")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA33")) return ATA_UDMA2; + if (!strcasecmp(str, "UDMA3")) return ATA_UDMA3; + if (!strcasecmp(str, "UDMA44")) return ATA_UDMA3; if (!strcasecmp(str, "UDMA4")) return ATA_UDMA4; if (!strcasecmp(str, "UDMA66")) return ATA_UDMA4; if (!strcasecmp(str, "UDMA5")) return ATA_UDMA5; From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 13:24:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F6BE106566B; Wed, 2 Dec 2009 13:24:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 039798FC18; Wed, 2 Dec 2009 13:24:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2DOLwN006678; Wed, 2 Dec 2009 13:24:21 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2DOLuO006676; Wed, 2 Dec 2009 13:24:21 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <200912021324.nB2DOLuO006676@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 2 Dec 2009 13:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200026 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 13:24:22 -0000 Author: glebius Date: Wed Dec 2 13:24:21 2009 New Revision: 200026 URL: http://svn.freebsd.org/changeset/base/200026 Log: Until this moment carp(4) used a strange logging priority. It used debug priority for such important information as MASTER/BACKUP state change, and used a normal logging priority for such innocent messages as receiving short packet (which is a normal VRRP packet between some other routers) or receving a CARP packet on non-carp interface (someone else running CARP). This commit shifts message logging priorities to a more sane default. Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Dec 2 12:26:26 2009 (r200025) +++ head/sys/netinet/ip_carp.c Wed Dec 2 13:24:21 2009 (r200026) @@ -550,7 +550,7 @@ carp_input(struct mbuf *m, int hlen) /* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { CARPSTATS_INC(carps_badif); - CARP_LOG("carp_input: packet received on non-carp " + CARP_DEBUG("carp_input: packet received on non-carp " "interface: %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -571,7 +571,7 @@ carp_input(struct mbuf *m, int hlen) if (m->m_pkthdr.len < iplen + sizeof(*ch)) { CARPSTATS_INC(carps_badlen); - CARP_LOG("carp_input: received len %zd < " + CARP_DEBUG("carp_input: received len %zd < " "sizeof(struct carp_header) on %s\n", m->m_len - sizeof(struct ip), m->m_pkthdr.rcvif->if_xname); @@ -582,7 +582,7 @@ carp_input(struct mbuf *m, int hlen) if (iplen + sizeof(*ch) < m->m_len) { if ((m = m_pullup(m, iplen + sizeof(*ch))) == NULL) { CARPSTATS_INC(carps_hdrops); - CARP_LOG("carp_input: pullup failed\n"); + CARP_DEBUG("carp_input: pullup failed\n"); return; } ip = mtod(m, struct ip *); @@ -596,7 +596,7 @@ carp_input(struct mbuf *m, int hlen) len = iplen + sizeof(*ch); if (len > m->m_pkthdr.len) { CARPSTATS_INC(carps_badlen); - CARP_LOG("carp_input: packet too short %d on %s\n", + CARP_DEBUG("carp_input: packet too short %d on %s\n", m->m_pkthdr.len, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -614,7 +614,7 @@ carp_input(struct mbuf *m, int hlen) m->m_data += iplen; if (carp_cksum(m, len - iplen)) { CARPSTATS_INC(carps_badsum); - CARP_LOG("carp_input: checksum failed on %s\n", + CARP_DEBUG("carp_input: checksum failed on %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); return; @@ -643,7 +643,7 @@ carp6_input(struct mbuf **mp, int *offp, /* check if received on a valid carp interface */ if (m->m_pkthdr.rcvif->if_carp == NULL) { CARPSTATS_INC(carps_badif); - CARP_LOG("carp6_input: packet received on non-carp " + CARP_DEBUG("carp6_input: packet received on non-carp " "interface: %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -653,7 +653,7 @@ carp6_input(struct mbuf **mp, int *offp, /* verify that the IP TTL is 255 */ if (ip6->ip6_hlim != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); - CARP_LOG("carp6_input: received ttl %d != 255 on %s\n", + CARP_DEBUG("carp6_input: received ttl %d != 255 on %s\n", ip6->ip6_hlim, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -665,7 +665,7 @@ carp6_input(struct mbuf **mp, int *offp, IP6_EXTHDR_GET(ch, struct carp_header *, m, *offp, sizeof(*ch)); if (ch == NULL) { CARPSTATS_INC(carps_badlen); - CARP_LOG("carp6_input: packet size %u too small\n", len); + CARP_DEBUG("carp6_input: packet size %u too small\n", len); return (IPPROTO_DONE); } @@ -674,7 +674,7 @@ carp6_input(struct mbuf **mp, int *offp, m->m_data += *offp; if (carp_cksum(m, sizeof(*ch))) { CARPSTATS_INC(carps_badsum); - CARP_LOG("carp6_input: checksum failed, on %s\n", + CARP_DEBUG("carp6_input: checksum failed, on %s\n", m->m_pkthdr.rcvif->if_xname); m_freem(m); return (IPPROTO_DONE); @@ -727,7 +727,7 @@ carp_input_c(struct mbuf *m, struct carp CARPSTATS_INC(carps_badver); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); - CARP_LOG("%s; invalid version %d\n", + CARP_DEBUG("%s; invalid version %d\n", SC2IFP(sc)->if_xname, ch->carp_version); m_freem(m); @@ -772,7 +772,7 @@ carp_input_c(struct mbuf *m, struct carp if (timevalcmp(&sc_tv, &ch_tv, >) || timevalcmp(&sc_tv, &ch_tv, ==)) { callout_stop(&sc->sc_ad_tmo); - CARP_DEBUG("%s: MASTER -> BACKUP " + CARP_LOG("%s: MASTER -> BACKUP " "(more frequent advertisement received)\n", SC2IFP(sc)->if_xname); carp_set_state(sc, BACKUP); @@ -787,7 +787,7 @@ carp_input_c(struct mbuf *m, struct carp */ if (carp_opts[CARPCTL_PREEMPT] && timevalcmp(&sc_tv, &ch_tv, <)) { - CARP_DEBUG("%s: BACKUP -> MASTER " + CARP_LOG("%s: BACKUP -> MASTER " "(preempting a slower master)\n", SC2IFP(sc)->if_xname); carp_master_down_locked(sc); @@ -801,7 +801,7 @@ carp_input_c(struct mbuf *m, struct carp */ sc_tv.tv_sec = sc->sc_advbase * 3; if (timevalcmp(&sc_tv, &ch_tv, <)) { - CARP_DEBUG("%s: BACKUP -> MASTER " + CARP_LOG("%s: BACKUP -> MASTER " "(master timed out)\n", SC2IFP(sc)->if_xname); carp_master_down_locked(sc); @@ -1024,7 +1024,7 @@ carp_send_ad_locked(struct carp_softc *s if (in6_setscope(&ip6->ip6_dst, sc->sc_carpdev, NULL) != 0) { SC2IFP(sc)->if_oerrors++; m_freem(m); - CARP_LOG("%s: in6_setscope failed\n", __func__); + CARP_DEBUG("%s: in6_setscope failed\n", __func__); return; } @@ -1385,12 +1385,12 @@ carp_setrun(struct carp_softc *sc, sa_fa #ifdef INET6 carp_send_na(sc); #endif /* INET6 */ - CARP_DEBUG("%s: INIT -> MASTER (preempting)\n", + CARP_LOG("%s: INIT -> MASTER (preempting)\n", SC2IFP(sc)->if_xname); carp_set_state(sc, MASTER); carp_setroute(sc, RTM_ADD); } else { - CARP_DEBUG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); + CARP_LOG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); carp_set_state(sc, BACKUP); carp_setroute(sc, RTM_DELETE); carp_setrun(sc, 0); From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 13:29:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9465A1065698; Wed, 2 Dec 2009 13:29:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 08E068FC1F; Wed, 2 Dec 2009 13:29:17 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id nB2DT4Ic069614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 2 Dec 2009 15:29:04 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id nB2DT4lt042699; Wed, 2 Dec 2009 15:29:04 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id nB2DT4qb042698; Wed, 2 Dec 2009 15:29:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Dec 2009 15:29:04 +0200 From: Kostik Belousov To: Dima Panov Message-ID: <20091202132904.GH2368@deviant.kiev.zoral.com.ua> References: <200911261349.nAQDnco2083469@svn.freebsd.org> <200912021926.02346.fluffy@fluffy.khv.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h2J70RNbM0WNXG3M" Content-Disposition: inline In-Reply-To: <200912021926.02346.fluffy@fluffy.khv.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-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 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: svn commit: r199827 - in head: include lib/libc/compat-43 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 13:29:18 -0000 --h2J70RNbM0WNXG3M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 02, 2009 at 07:25:56PM +1000, Dima Panov wrote: > On Thursday 26 November 2009 23:49:38 Konstantin Belousov wrote: > > Author: kib > > Date: Thu Nov 26 13:49:37 2009 > > New Revision: 199827 > > URL: http://svn.freebsd.org/changeset/base/199827 > >=20 > > Log: > > Implement sighold, sigignore, sigpause, sigrelse, sigset functions > > from SUSv4 XSI. Note that the functions are obsoleted, and only > > provided to ease porting from System V-like systems. Since sigpause > > already exists in compat with different interface, XSI sigpause is > > named xsi_sigpause. > >=20 > > Reviewed by: davidxu > > MFC after: 3 weeks > >=20 > > Modified: > > head/include/signal.h > > head/lib/libc/compat-43/Makefile.inc > > head/lib/libc/compat-43/Symbol.map > > head/lib/libc/compat-43/sigcompat.c > > head/lib/libc/compat-43/sigpause.2 > > head/sys/sys/signal.h > > head/sys/sys/signalvar.h >=20 > kib, you forgot about osversion bump, it is strongly needed. No. My interpretation of __FreeBSD_version is that the bump indicates incompatible change in the interfaces. Sometime it is used to mark the point where big changes hit the tree, possibly not related to interface change. Also, __FreeBSD_version denotes the kernel "version". We do support running earlier usermode on the later kernels. Think about kernel-only upgrades, compatXx libs and jails which can run arbitrary earlier usermode. (The change in question is purely libc). Said this, I think it is actually harmful practice to bump __FreeBSD_version after API additions or feature implementation. I can bump version for this case, but due to the above reason, it would not make much sense. >=20 > This changeset caused jdk (may be not only jdk) breakage, as jdk-bsd-patc= hes > always provide own implementations of sigingnore() for FreeBSD. >=20 > Patch for jdk16 port will be ready soon. Ok, thanks for working on this. --h2J70RNbM0WNXG3M Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksWa58ACgkQC3+MBN1Mb4hLuACg7g8APMvdYvJweHwy6Zyfn7Wl +b8Anj9tGX1ZpyLFas+xlIFJAy+YeAJQ =jyC5 -----END PGP SIGNATURE----- --h2J70RNbM0WNXG3M-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 14:32:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C97AB106566B; Wed, 2 Dec 2009 14:32:01 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD3618FC16; Wed, 2 Dec 2009 14:32:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2EW1ru014372; Wed, 2 Dec 2009 14:32:01 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2EW10c014370; Wed, 2 Dec 2009 14:32:01 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912021432.nB2EW10c014370@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 2 Dec 2009 14:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200027 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 14:32:02 -0000 Author: ume Date: Wed Dec 2 14:32:01 2009 New Revision: 200027 URL: http://svn.freebsd.org/changeset/base/200027 Log: Teach an IPv6 to send_pkt() and ipfw_tick(). It fixes the issue which keep-alive doesn't work for an IPv6. PR: kern/117234 Submitted by: mlaier, Joost Bekkers MFC after: 1 month Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Wed Dec 2 13:24:21 2009 (r200026) +++ head/sys/netinet/ipfw/ip_fw2.c Wed Dec 2 14:32:01 2009 (r200027) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET6 #include +#include #endif #include /* XXX for in_cksum */ @@ -249,6 +250,10 @@ static struct mtx ipfw_dyn_mtx; /* mute #define IPFW_DYN_UNLOCK() mtx_unlock(&ipfw_dyn_mtx) #define IPFW_DYN_LOCK_ASSERT() mtx_assert(&ipfw_dyn_mtx, MA_OWNED) +static struct mbuf *send_pkt(struct mbuf *, struct ipfw_flow_id *, + u_int32_t, u_int32_t, int); + + /* * Timeouts for various events in handing dynamic rules. */ @@ -708,60 +713,18 @@ send_reject6(struct ip_fw_args *args, in m = args->m; if (code == ICMP6_UNREACH_RST && args->f_id.proto == IPPROTO_TCP) { struct tcphdr *tcp; - tcp_seq ack, seq; - int flags; - struct { - struct ip6_hdr ip6; - struct tcphdr th; - } ti; tcp = (struct tcphdr *)((char *)ip6 + hlen); - if ((tcp->th_flags & TH_RST) != 0) { - m_freem(m); - args->m = NULL; - return; - } - - ti.ip6 = *ip6; - ti.th = *tcp; - ti.th.th_seq = ntohl(ti.th.th_seq); - ti.th.th_ack = ntohl(ti.th.th_ack); - ti.ip6.ip6_nxt = IPPROTO_TCP; - - if (ti.th.th_flags & TH_ACK) { - ack = 0; - seq = ti.th.th_ack; - flags = TH_RST; - } else { - ack = ti.th.th_seq; - if ((m->m_flags & M_PKTHDR) != 0) { - /* - * total new data to ACK is: - * total packet length, - * minus the header length, - * minus the tcp header length. - */ - ack += m->m_pkthdr.len - hlen - - (ti.th.th_off << 2); - } else if (ip6->ip6_plen) { - ack += ntohs(ip6->ip6_plen) + sizeof(*ip6) - - hlen - (ti.th.th_off << 2); - } else { - m_freem(m); - return; - } - if (tcp->th_flags & TH_SYN) - ack++; - seq = 0; - flags = TH_RST|TH_ACK; + if ((tcp->th_flags & TH_RST) == 0) { + struct mbuf *m0; + m0 = send_pkt(args->m, &(args->f_id), + ntohl(tcp->th_seq), ntohl(tcp->th_ack), + tcp->th_flags | TH_RST); + if (m0 != NULL) + ip6_output(m0, NULL, NULL, 0, NULL, NULL, + NULL); } - bcopy(&ti, ip6, sizeof(ti)); - /* - * m is only used to recycle the mbuf - * The data in it is never read so we don't need - * to correct the offsets or anything - */ - tcp_respond(NULL, ip6, tcp, m, ack, seq, flags); + m_freem(m); } else if (code != ICMP6_UNREACH_RST) { /* Send an ICMPv6 unreach. */ #if 0 /* @@ -1649,13 +1612,16 @@ send_pkt(struct mbuf *replyto, struct ip u_int32_t ack, int flags) { struct mbuf *m; - struct ip *ip; - struct tcphdr *tcp; + int len, dir; + struct ip *h = NULL; /* stupid compiler */ +#ifdef INET6 + struct ip6_hdr *h6 = NULL; +#endif + struct tcphdr *th = NULL; MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == 0) + if (m == NULL) return (NULL); - m->m_pkthdr.rcvif = (struct ifnet *)0; M_SETFIB(m, id->fib); #ifdef MAC @@ -1667,67 +1633,118 @@ send_pkt(struct mbuf *replyto, struct ip (void)replyto; /* don't warn about unused arg */ #endif - m->m_pkthdr.len = m->m_len = sizeof(struct ip) + sizeof(struct tcphdr); + switch (id->addr_type) { + case 4: + len = sizeof(struct ip) + sizeof(struct tcphdr); + break; +#ifdef INET6 + case 6: + len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + break; +#endif + default: + /* XXX: log me?!? */ + m_freem(m); + return (NULL); + } + dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN); + m->m_data += max_linkhdr; + m->m_flags |= M_SKIP_FIREWALL; + m->m_pkthdr.len = m->m_len = len; + m->m_pkthdr.rcvif = NULL; + bzero(m->m_data, len); + + switch (id->addr_type) { + case 4: + h = mtod(m, struct ip *); + + /* prepare for checksum */ + h->ip_p = IPPROTO_TCP; + h->ip_len = htons(sizeof(struct tcphdr)); + if (dir) { + h->ip_src.s_addr = htonl(id->src_ip); + h->ip_dst.s_addr = htonl(id->dst_ip); + } else { + h->ip_src.s_addr = htonl(id->dst_ip); + h->ip_dst.s_addr = htonl(id->src_ip); + } - ip = mtod(m, struct ip *); - bzero(ip, m->m_len); - tcp = (struct tcphdr *)(ip + 1); /* no IP options */ - ip->ip_p = IPPROTO_TCP; - tcp->th_off = 5; - /* - * Assume we are sending a RST (or a keepalive in the reverse - * direction), swap src and destination addresses and ports. - */ - ip->ip_src.s_addr = htonl(id->dst_ip); - ip->ip_dst.s_addr = htonl(id->src_ip); - tcp->th_sport = htons(id->dst_port); - tcp->th_dport = htons(id->src_port); - if (flags & TH_RST) { /* we are sending a RST */ + th = (struct tcphdr *)(h + 1); + break; +#ifdef INET6 + case 6: + h6 = mtod(m, struct ip6_hdr *); + + /* prepare for checksum */ + h6->ip6_nxt = IPPROTO_TCP; + h6->ip6_plen = htons(sizeof(struct tcphdr)); + if (dir) { + h6->ip6_src = id->src_ip6; + h6->ip6_dst = id->dst_ip6; + } else { + h6->ip6_src = id->dst_ip6; + h6->ip6_dst = id->src_ip6; + } + + th = (struct tcphdr *)(h6 + 1); + break; +#endif + } + + if (dir) { + th->th_sport = htons(id->src_port); + th->th_dport = htons(id->dst_port); + } else { + th->th_sport = htons(id->dst_port); + th->th_dport = htons(id->src_port); + } + th->th_off = sizeof(struct tcphdr) >> 2; + + if (flags & TH_RST) { if (flags & TH_ACK) { - tcp->th_seq = htonl(ack); - tcp->th_ack = htonl(0); - tcp->th_flags = TH_RST; + th->th_seq = htonl(ack); + th->th_flags = TH_RST; } else { if (flags & TH_SYN) seq++; - tcp->th_seq = htonl(0); - tcp->th_ack = htonl(seq); - tcp->th_flags = TH_RST | TH_ACK; + th->th_ack = htonl(seq); + th->th_flags = TH_RST | TH_ACK; } } else { /* - * We are sending a keepalive. flags & TH_SYN determines - * the direction, forward if set, reverse if clear. - * NOTE: seq and ack are always assumed to be correct - * as set by the caller. This may be confusing... + * Keepalive - use caller provided sequence numbers */ - if (flags & TH_SYN) { - /* - * we have to rewrite the correct addresses! - */ - ip->ip_dst.s_addr = htonl(id->dst_ip); - ip->ip_src.s_addr = htonl(id->src_ip); - tcp->th_dport = htons(id->dst_port); - tcp->th_sport = htons(id->src_port); - } - tcp->th_seq = htonl(seq); - tcp->th_ack = htonl(ack); - tcp->th_flags = TH_ACK; + th->th_seq = htonl(seq); + th->th_ack = htonl(ack); + th->th_flags = TH_ACK; + } + + switch (id->addr_type) { + case 4: + th->th_sum = in_cksum(m, len); + + /* finish the ip header */ + h->ip_v = 4; + h->ip_hl = sizeof(*h) >> 2; + h->ip_tos = IPTOS_LOWDELAY; + h->ip_off = 0; + h->ip_len = len; + h->ip_ttl = V_ip_defttl; + h->ip_sum = 0; + break; +#ifdef INET6 + case 6: + th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*h6), + sizeof(struct tcphdr)); + + /* finish the ip6 header */ + h6->ip6_vfc |= IPV6_VERSION; + h6->ip6_hlim = IPV6_DEFHLIM; + break; +#endif } - /* - * set ip_len to the payload size so we can compute - * the tcp checksum on the pseudoheader - * XXX check this, could save a couple of words ? - */ - ip->ip_len = htons(sizeof(struct tcphdr)); - tcp->th_sum = in_cksum(m, m->m_pkthdr.len); - /* - * now fill fields left out earlier - */ - ip->ip_ttl = V_ip_defttl; - ip->ip_len = m->m_pkthdr.len; - m->m_flags |= M_SKIP_FIREWALL; + return (m); } @@ -4530,13 +4547,16 @@ static void ipfw_tick(void * vnetx) { struct mbuf *m0, *m, *mnext, **mtailp; +#ifdef INET6 + struct mbuf *m6, **m6_tailp; +#endif int i; ipfw_dyn_rule *q; #ifdef VIMAGE struct vnet *vp = vnetx; #endif - CURVNET_SET(vp); + CURVNET_SET(vp); if (V_dyn_keepalive == 0 || V_ipfw_dyn_v == NULL || V_dyn_count == 0) goto done; @@ -4548,6 +4568,10 @@ ipfw_tick(void * vnetx) */ m0 = NULL; mtailp = &m0; +#ifdef INET6 + m6 = NULL; + m6_tailp = &m6; +#endif IPFW_DYN_LOCK(); for (i = 0 ; i < V_curr_dyn_buckets ; i++) { for (q = V_ipfw_dyn_v[i] ; q ; q = q->next ) { @@ -4563,14 +4587,37 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - *mtailp = send_pkt(NULL, &(q->id), q->ack_rev - 1, + m = send_pkt(NULL, &(q->id), q->ack_rev - 1, q->ack_fwd, TH_SYN); - if (*mtailp != NULL) - mtailp = &(*mtailp)->m_nextpkt; - *mtailp = send_pkt(NULL, &(q->id), q->ack_fwd - 1, + mnext = send_pkt(NULL, &(q->id), q->ack_fwd - 1, q->ack_rev, 0); - if (*mtailp != NULL) - mtailp = &(*mtailp)->m_nextpkt; + + switch (q->id.addr_type) { + case 4: + if (m != NULL) { + *mtailp = m; + mtailp = &(*mtailp)->m_nextpkt; + } + if (mnext != NULL) { + *mtailp = mnext; + mtailp = &(*mtailp)->m_nextpkt; + } + break; +#ifdef INET6 + case 6: + if (m != NULL) { + *m6_tailp = m; + m6_tailp = &(*m6_tailp)->m_nextpkt; + } + if (mnext != NULL) { + *m6_tailp = mnext; + m6_tailp = &(*m6_tailp)->m_nextpkt; + } + break; +#endif + } + + m = mnext = NULL; } } IPFW_DYN_UNLOCK(); @@ -4579,6 +4626,13 @@ ipfw_tick(void * vnetx) m->m_nextpkt = NULL; ip_output(m, NULL, NULL, 0, NULL, NULL); } +#ifdef INET6 + for (m = mnext = m6; m != NULL; m = mnext) { + mnext = m->m_nextpkt; + m->m_nextpkt = NULL; + ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); + } +#endif done: callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz, ipfw_tick, vnetx); From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:05:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59A441065695; Wed, 2 Dec 2009 15:05:27 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 468A18FC16; Wed, 2 Dec 2009 15:05:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2F5RXE018943; Wed, 2 Dec 2009 15:05:27 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2F5RIt018936; Wed, 2 Dec 2009 15:05:27 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912021505.nB2F5RIt018936@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 2 Dec 2009 15:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200028 - in head: . etc etc/defaults etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:05:27 -0000 Author: ume Date: Wed Dec 2 15:05:26 2009 New Revision: 200028 URL: http://svn.freebsd.org/changeset/base/200028 Log: Unify rc.firewall and rc.firewall6, and obsolete rc.firewall6 and rc.d/ip6fw. Reviewed by: dougb, jhb MFC after: 1 month Deleted: head/etc/rc.d/ip6fw head/etc/rc.firewall6 Modified: head/ObsoleteFiles.inc head/etc/Makefile head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/ipfw head/etc/rc.firewall Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Dec 2 14:32:01 2009 (r200027) +++ head/ObsoleteFiles.inc Wed Dec 2 15:05:26 2009 (r200028) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20091202: unify rc.firewall and rc.firewall6. +OLD_FILES+=etc/rc.d/ip6fw +OLD_FILES+=etc/rc.firewall6 # 20091117: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz # 20091027: pselect.3 implemented as syscall Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Wed Dec 2 14:32:01 2009 (r200027) +++ head/etc/Makefile Wed Dec 2 15:05:26 2009 (r200028) @@ -15,7 +15,7 @@ BIN1= auth.conf \ inetd.conf libalias.conf login.access login.conf mac.conf motd \ netconfig network.subr networks newsyslog.conf nsswitch.conf \ phones profile protocols \ - rc rc.bsdextended rc.firewall rc.firewall6 rc.initdiskless \ + rc rc.bsdextended rc.firewall rc.initdiskless \ rc.sendmail rc.shutdown \ rc.subr remote rpc services shells \ sysctl.conf syslog.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Dec 2 14:32:01 2009 (r200027) +++ head/etc/defaults/rc.conf Wed Dec 2 15:05:26 2009 (r200028) @@ -118,7 +118,10 @@ firewall_type="UNKNOWN" # Firewall type firewall_quiet="NO" # Set to YES to suppress rule display firewall_logging="NO" # Set to YES to enable events logging firewall_flags="" # Flags passed to ipfw when type is a file -firewall_client_net="192.0.2.0/24" # Network address for "client" firewall. +firewall_client_net="192.0.2.0/24" # IPv4 Network address for "client" + # firewall. +#firewall_client_net_ipv6="2001:db8:2:1::/64" # IPv6 network prefix for + # "client" firewall. firewall_simple_iif="ed1" # Inside network interface for "simple" # firewall. firewall_simple_inet="192.0.2.16/28" # Inside network address for "simple" @@ -127,12 +130,22 @@ firewall_simple_oif="ed0" # Outside netw # firewall. firewall_simple_onet="192.0.2.0/28" # Outside network address for "simple" # firewall. +#firewall_simple_iif_ipv6="ed1" # Inside IPv6 network interface for "simple" + # firewall. +#firewall_simple_inet_ipv6="2001:db8:2:800::/56" # Inside IPv6 network prefix + # for "simple" firewall. +#firewall_simple_oif_ipv6="ed0" # Outside IPv6 network interface for "simple" + # firewall. +#firewall_simple_onet_ipv6="2001:db8:2:0::/56" # Outside IPv6 network prefix + # for "simple" firewall. firewall_myservices="" # List of TCP ports on which this host # offers services for "workstation" firewall. firewall_allowservices="" # List of IPs which have access to # $firewall_myservices for "workstation" # firewall. -firewall_trusted="" # List of IPs which have full access to this +firewall_trusted="" # List of IPv4s which have full access to this + # host for "workstation" firewall. +firewall_trusted_ipv6="" # List of IPv6s which have full access to this # host for "workstation" firewall. firewall_logdeny="NO" # Set to YES to log default denied incoming # packets for "workstation" firewall. @@ -472,13 +485,6 @@ ipv6_faith_prefix="NO" # Set faith pref # faithd(8) setup. ipv6_ipv4mapping="NO" # Set to "YES" to enable IPv4 mapped IPv6 addr # communication. (like ::ffff:a.b.c.d) -ipv6_firewall_enable="NO" # Set to YES to enable IPv6 firewall - # functionality -ipv6_firewall_script="/etc/rc.firewall6" # Which script to run to set up the IPv6 firewall -ipv6_firewall_type="UNKNOWN" # IPv6 Firewall type (see /etc/rc.firewall6) -ipv6_firewall_quiet="NO" # Set to YES to suppress rule display -ipv6_firewall_logging="NO" # Set to YES to enable events logging -ipv6_firewall_flags="" # Flags passed to ip6fw when type is a file ipv6_ipfilter_rules="/etc/ipf6.rules" # rules definition file for ipfilter, # see /usr/src/contrib/ipfilter/rules # for examples Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Wed Dec 2 14:32:01 2009 (r200027) +++ head/etc/rc.d/Makefile Wed Dec 2 15:05:26 2009 (r200028) @@ -15,7 +15,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI hcsecd \ hostapd hostid hostid_save hostname \ inetd initrandom \ - ip6addrctl ip6fw ipfilter ipfs ipfw ipmon \ + ip6addrctl ipfilter ipfs ipfw ipmon \ ipnat ipsec ipxrouted \ jail \ kadmind kerberos keyserv kldxref kpasswdd \ Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Wed Dec 2 14:32:01 2009 (r200027) +++ head/etc/rc.d/ipfw Wed Dec 2 15:05:26 2009 (r200028) @@ -17,6 +17,8 @@ start_precmd="ipfw_prestart" stop_cmd="ipfw_stop" required_modules="ipfw" +set_rcvar_obsolete ipv6_firewall_enable + ipfw_prestart() { if checkyesno dummynet_enable; then @@ -61,7 +63,13 @@ ipfw_start() # Enable the firewall # if ! ${SYSCTL_W} net.inet.ip.fw.enable=1 1>/dev/null 2>&1; then - warn "failed to enable firewall" + warn "failed to enable IPv4 firewall" + fi + if afexists inet6; then + if ! ${SYSCTL_W} net.inet6.ip6.fw.enable=1 1>/dev/null 2>&1 + then + warn "failed to enable IPv6 firewall" + fi fi } @@ -70,6 +78,9 @@ ipfw_stop() # Disable the firewall # ${SYSCTL_W} net.inet.ip.fw.enable=0 + if afexists inet6; then + ${SYSCTL_W} net.inet6.ip6.fw.enable=0 + fi if [ -f /etc/rc.d/natd ] ; then /etc/rc.d/natd quietstop fi Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Wed Dec 2 14:32:01 2009 (r200027) +++ head/etc/rc.firewall Wed Dec 2 15:05:26 2009 (r200028) @@ -85,12 +85,42 @@ setup_loopback () { ${fwcmd} add 100 pass all from any to any via lo0 ${fwcmd} add 200 deny all from any to 127.0.0.0/8 ${fwcmd} add 300 deny ip from 127.0.0.0/8 to any + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add 400 deny all from any to ::1 + ${fwcmd} add 500 deny all from ::1 to any + fi +} + +setup_ipv6_mandatory () { + [ $ipv6_available -eq 0 ] || return 0 + + ############ + # Only in rare cases do you want to change these rules + # + # ND + # + # DAD + ${fwcmd} add pass ipv6-icmp from :: to ff02::/16 + # RS, RA, NS, NA, redirect... + ${fwcmd} add pass ipv6-icmp from fe80::/10 to fe80::/10 + ${fwcmd} add pass ipv6-icmp from fe80::/10 to ff02::/16 + + # Allow ICMPv6 destination unreach + ${fwcmd} add pass ipv6-icmp from any to any icmp6types 1 + + # Allow NS/NA/toobig (don't filter it out) + ${fwcmd} add pass ipv6-icmp from any to any icmp6types 2,135,136 } if [ -n "${1}" ]; then firewall_type="${1}" fi +. /etc/rc.subr +. /etc/network.subr +afexists inet6 +ipv6_available=$? + ############ # Set quiet mode if requested # @@ -109,6 +139,7 @@ esac ${fwcmd} -f flush setup_loopback +setup_ipv6_mandatory ############ # Network Address Translation. All packets are passed to natd(8) @@ -166,11 +197,13 @@ case ${firewall_type} in # against people from outside your own network. # # Configuration: - # firewall_client_net: Network address of local network. + # firewall_client_net: Network address of local IPv4 network. + # firewall_client_net_ipv6: Network address of local IPv6 network. ############ # set this to your local network net="$firewall_client_net" + net6="$firewall_client_net_ipv6" # Allow limited broadcast traffic from my own net. ${fwcmd} add pass all from ${net} to 255.255.255.255 @@ -178,6 +211,16 @@ case ${firewall_type} in # Allow any traffic to or from my own net. ${fwcmd} add pass all from me to ${net} ${fwcmd} add pass all from ${net} to me + if [ -n "$net6" ]; then + ${fwcmd} add pass all from me6 to ${net6} + ${fwcmd} add pass all from ${net6} to me6 + fi + + if [ -n "$net6" ]; then + # Allow any link-local multicast traffic + ${fwcmd} add pass all from fe80::/10 to ff02::/16 + ${fwcmd} add pass all from ${net6} to ff02::/16 + fi # Allow TCP through if setup succeeded ${fwcmd} add pass tcp from any to any established @@ -212,23 +255,38 @@ case ${firewall_type} in # on the inside at this machine for those services. # # Configuration: - # firewall_simple_iif: Inside network interface. - # firewall_simple_inet: Inside network address. - # firewall_simple_oif: Outside network interface. - # firewall_simple_onet: Outside network address. + # firewall_simple_iif: Inside IPv4 network interface. + # firewall_simple_inet: Inside IPv4 network address. + # firewall_simple_oif: Outside IPv4 network interface. + # firewall_simple_onet: Outside IPv4 network address. + # firewall_simple_iif_ipv6: Inside IPv6 network interface. + # firewall_simple_inet_ipv6: Inside IPv6 network prefix. + # firewall_simple_oif_ipv6: Outside IPv6 network interface. + # firewall_simple_onet_ipv6: Outside IPv6 network prefix. ############ # set these to your outside interface network oif="$firewall_simple_oif" onet="$firewall_simple_onet" + oif6="${firewall_simple_oif_ipv6:-$firewall_simple_oif}" + onet6="$firewall_simple_onet_ipv6" # set these to your inside interface network iif="$firewall_simple_iif" inet="$firewall_simple_inet" + iif6="${firewall_simple_iif_ipv6:-$firewall_simple_iif}" + inet6="$firewall_simple_inet_ipv6" # Stop spoofing ${fwcmd} add deny all from ${inet} to any in via ${oif} ${fwcmd} add deny all from ${onet} to any in via ${iif} + if [ -n "$inet6" ]; then + ${fwcmd} add deny all from ${inet6} to any in via ${oif6} + if [ -n "$onet6" ]; then + ${fwcmd} add deny all from ${onet6} to any in \ + via ${iif6} + fi + fi # Stop RFC1918 nets on the outside interface ${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif} @@ -254,7 +312,7 @@ case ${firewall_type} in case ${natd_enable} in [Yy][Ee][Ss]) if [ -n "${natd_interface}" ]; then - ${fwcmd} add divert natd all from any to any via ${natd_interface} + ${fwcmd} add divert natd ip4 from any to any via ${natd_interface} fi ;; esac @@ -273,6 +331,55 @@ case ${firewall_type} in ${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif} ${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif} + if [ -n "$inet6" ]; then + # Stop unique local unicast address on the outside interface + ${fwcmd} add deny all from fc00::/7 to any via ${oif6} + ${fwcmd} add deny all from any to fc00::/7 via ${oif6} + + # Stop site-local on the outside interface + ${fwcmd} add deny all from fec0::/10 to any via ${oif6} + ${fwcmd} add deny all from any to fec0::/10 via ${oif6} + + # Disallow "internal" addresses to appear on the wire. + ${fwcmd} add deny all from ::ffff:0.0.0.0/96 to any \ + via ${oif6} + ${fwcmd} add deny all from any to ::ffff:0.0.0.0/96 \ + via ${oif6} + + # Disallow packets to malicious IPv4 compatible prefix. + ${fwcmd} add deny all from ::224.0.0.0/100 to any via ${oif6} + ${fwcmd} add deny all from any to ::224.0.0.0/100 via ${oif6} + ${fwcmd} add deny all from ::127.0.0.0/104 to any via ${oif6} + ${fwcmd} add deny all from any to ::127.0.0.0/104 via ${oif6} + ${fwcmd} add deny all from ::0.0.0.0/104 to any via ${oif6} + ${fwcmd} add deny all from any to ::0.0.0.0/104 via ${oif6} + ${fwcmd} add deny all from ::255.0.0.0/104 to any via ${oif6} + ${fwcmd} add deny all from any to ::255.0.0.0/104 via ${oif6} + + ${fwcmd} add deny all from ::0.0.0.0/96 to any via ${oif6} + ${fwcmd} add deny all from any to ::0.0.0.0/96 via ${oif6} + + # Disallow packets to malicious 6to4 prefix. + ${fwcmd} add deny all from 2002:e000::/20 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:e000::/20 via ${oif6} + ${fwcmd} add deny all from 2002:7f00::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:7f00::/24 via ${oif6} + ${fwcmd} add deny all from 2002:0000::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:0000::/24 via ${oif6} + ${fwcmd} add deny all from 2002:ff00::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:ff00::/24 via ${oif6} + + ${fwcmd} add deny all from 2002:0a00::/24 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:0a00::/24 via ${oif6} + ${fwcmd} add deny all from 2002:ac10::/28 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:ac10::/28 via ${oif6} + ${fwcmd} add deny all from 2002:c0a8::/32 to any via ${oif6} + ${fwcmd} add deny all from any to 2002:c0a8::/32 via ${oif6} + + ${fwcmd} add deny all from ff05::/16 to any via ${oif6} + ${fwcmd} add deny all from any to ff05::/16 via ${oif6} + fi + # Allow TCP through if setup succeeded ${fwcmd} add pass tcp from any to any established @@ -291,7 +398,11 @@ case ${firewall_type} in ${fwcmd} add pass tcp from any to me 80 setup # Reject&Log all setup of incoming connections from the outside - ${fwcmd} add deny log tcp from any to any in via ${oif} setup + ${fwcmd} add deny log ip4 from any to any in via ${oif} setup proto tcp + if [ -n "$inet6" ]; then + ${fwcmd} add deny log ip6 from any to any in via ${oif6} \ + setup proto tcp + fi # Allow setup of any other TCP connection ${fwcmd} add pass tcp from any to any setup @@ -313,7 +424,7 @@ case ${firewall_type} in # offers services. # firewall_allowservices: List of IPs which has access to # $firewall_myservices. - # firewall_trusted: List of IPs which has full access + # firewall_trusted: List of IPv4s which has full access # to this host. Be very carefull # when setting this. This option can # seriously degrade the level of @@ -324,25 +435,44 @@ case ${firewall_type} in # firewall_nologports: List of TCP/UDP ports for which # denied incomming packets are not # logged. - + # firewall_trusted_ipv6: List of IPv6s which has full access + # to this host. Be very carefull + # when setting this. This option can + # seriously degrade the level of + # protection provided by the firewall. + # Allow packets for which a state has been built. ${fwcmd} add check-state # For services permitted below. ${fwcmd} add pass tcp from me to any established + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass tcp from me6 to any established + fi # Allow any connection out, adding state for each. ${fwcmd} add pass tcp from me to any setup keep-state ${fwcmd} add pass udp from me to any keep-state ${fwcmd} add pass icmp from me to any keep-state + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass tcp from me6 to any setup keep-state + ${fwcmd} add pass udp from me6 to any keep-state + ${fwcmd} add pass ipv6-icmp from me6 to any keep-state + fi # Allow DHCP. ${fwcmd} add pass udp from 0.0.0.0 68 to 255.255.255.255 67 out ${fwcmd} add pass udp from any 67 to me 68 in ${fwcmd} add pass udp from any 67 to 255.255.255.255 68 in + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass udp from fe80::/10 to me6 546 in + fi # Some servers will ping the IP while trying to decide if it's # still in use. ${fwcmd} add pass icmp from any to any icmptype 8 + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass ipv6-icmp from any to any icmp6type 128,129 + fi # Allow "mandatory" ICMP in. ${fwcmd} add pass icmp from any to any icmptype 3,4,11 @@ -361,6 +491,9 @@ case ${firewall_type} in for i in ${firewall_allowservices} ; do for j in ${firewall_myservices} ; do ${fwcmd} add pass tcp from $i to me $j + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass tcp from $i to me6 $j + fi done done @@ -370,7 +503,10 @@ case ${firewall_type} in for i in ${firewall_trusted} ; do ${fwcmd} add pass ip from $i to me done - + for i in ${firewall_trusted_ipv6} ; do + ${fwcmd} add pass all from $i to me6 + done + ${fwcmd} add 65000 count ip from any to any # Drop packets to ports where we don't want logging From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:20:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36FE1065693; Wed, 2 Dec 2009 15:20:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C1C4F8FC13; Wed, 2 Dec 2009 15:20:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FKV5A021090; Wed, 2 Dec 2009 15:20:31 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FKVLd021088; Wed, 2 Dec 2009 15:20:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912021520.nB2FKVLd021088@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 2 Dec 2009 15:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200029 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:20:31 -0000 Author: luigi Date: Wed Dec 2 15:20:31 2009 New Revision: 200029 URL: http://svn.freebsd.org/changeset/base/200029 Log: small changes for portability and diff reduction wrt/ FreeBSD 7. No functional differences. - use the div64() macro to wrap 64 bit divisions (which almost always are 64 / 32 bits) so they are easier to handle with compilers or OS that do not have native support for 64bit divisions; - use a local variable for p_numbytes even if not strictly necessary on HEAD, as it reduces diffs with FreeBSD7 - in dummynet_send() check that a tag is present before dereferencing the pointer. - add a couple of blank lines for readability near the end of a function MFC after: 3 days Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Wed Dec 2 15:05:26 2009 (r200028) +++ head/sys/netinet/ipfw/ip_dummynet.c Wed Dec 2 15:20:31 2009 (r200029) @@ -570,7 +570,7 @@ compute_extra_bits(struct mbuf *pkt, str if (!p->samples || p->samples_no == 0) return 0; index = random() % p->samples_no; - extra_bits = ((dn_key)p->samples[index] * p->bandwidth) / 1000; + extra_bits = div64((dn_key)p->samples[index] * p->bandwidth, 1000); if (index >= p->loss_level) { struct dn_pkt_tag *dt = dn_tag_get(pkt); if (dt) @@ -696,11 +696,20 @@ ready_event_wfq(struct dn_pipe *p, struc int p_was_empty = (p->head == NULL); struct dn_heap *sch = &(p->scheduler_heap); struct dn_heap *neh = &(p->not_eligible_heap); + int64_t p_numbytes = p->numbytes; + + /* + * p->numbytes is only 32bits in FBSD7, but we might need 64 bits. + * Use a local variable for the computations, and write back the + * results when done, saturating if needed. + * The local variable has no impact on performance and helps + * reducing diffs between the various branches. + */ DUMMYNET_LOCK_ASSERT(); if (p->if_name[0] == 0) /* tx clock is simulated */ - p->numbytes += (curr_time - p->sched_time) * p->bandwidth; + p_numbytes += (curr_time - p->sched_time) * p->bandwidth; else { /* * tx clock is for real, * the ifq must be empty or this is a NOP. @@ -717,7 +726,7 @@ ready_event_wfq(struct dn_pipe *p, struc * While we have backlogged traffic AND credit, we need to do * something on the queue. */ - while (p->numbytes >= 0 && (sch->elements > 0 || neh->elements > 0)) { + while (p_numbytes >= 0 && (sch->elements > 0 || neh->elements > 0)) { if (sch->elements > 0) { /* Have some eligible pkts to send out. */ struct dn_flow_queue *q = sch->p[0].object; @@ -727,10 +736,10 @@ ready_event_wfq(struct dn_pipe *p, struc int len_scaled = p->bandwidth ? len * 8 * hz : 0; heap_extract(sch, NULL); /* Remove queue from heap. */ - p->numbytes -= len_scaled; + p_numbytes -= len_scaled; move_pkt(pkt, q, p, len); - p->V += (len << MY_M) / p->sum; /* Update V. */ + p->V += div64((len << MY_M), p->sum); /* Update V. */ q->S = q->F; /* Update start time. */ if (q->len == 0) { /* Flow not backlogged any more. */ @@ -745,7 +754,7 @@ ready_event_wfq(struct dn_pipe *p, struc * (we will fix this later). */ len = (q->head)->m_pkthdr.len; - q->F += (len << MY_M) / (uint64_t)fs->weight; + q->F += div64((len << MY_M), fs->weight); if (DN_KEY_LEQ(q->S, p->V)) heap_insert(neh, q->S, q); else @@ -768,11 +777,11 @@ ready_event_wfq(struct dn_pipe *p, struc } if (p->if_name[0] != '\0') { /* Tx clock is from a real thing */ - p->numbytes = -1; /* Mark not ready for I/O. */ + p_numbytes = -1; /* Mark not ready for I/O. */ break; } } - if (sch->elements == 0 && neh->elements == 0 && p->numbytes >= 0) { + if (sch->elements == 0 && neh->elements == 0 && p_numbytes >= 0) { p->idle_time = curr_time; /* * No traffic and no events scheduled. @@ -798,11 +807,11 @@ ready_event_wfq(struct dn_pipe *p, struc * If we are under credit, schedule the next ready event. * Also fix the delivery time of the last packet. */ - if (p->if_name[0]==0 && p->numbytes < 0) { /* This implies bw > 0. */ + if (p->if_name[0]==0 && p_numbytes < 0) { /* This implies bw > 0. */ dn_key t = 0; /* Number of ticks i have to wait. */ if (p->bandwidth > 0) - t = (p->bandwidth - 1 - p->numbytes) / p->bandwidth; + t = div64(p->bandwidth - 1 - p_numbytes, p->bandwidth); dn_tag_get(p->tail)->output_time += t; p->sched_time = curr_time; heap_insert(&wfq_ready_heap, curr_time + t, (void *)p); @@ -812,6 +821,9 @@ ready_event_wfq(struct dn_pipe *p, struc */ } + /* Write back p_numbytes (adjust 64->32bit if necessary). */ + p->numbytes = p_numbytes; + /* * If the delay line was empty call transmit_event() now. * Otherwise, the scheduler will take care of it. @@ -938,12 +950,20 @@ dummynet_send(struct mbuf *m) struct dn_pkt_tag *pkt; struct mbuf *n; struct ip *ip; + int dst; for (; m != NULL; m = n) { n = m->m_nextpkt; m->m_nextpkt = NULL; - pkt = dn_tag_get(m); - switch (pkt->dn_dir) { + if (m_tag_first(m) == NULL) { + pkt = NULL; /* probably unnecessary */ + dst = DN_TO_DROP; + } else { + pkt = dn_tag_get(m); + dst = pkt->dn_dir; + } + + switch (dst) { case DN_TO_IP_OUT: ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; @@ -1218,7 +1238,8 @@ red_drops(struct dn_flow_set *fs, struct * XXX check wraps... */ if (q->avg) { - u_int t = (curr_time - q->idle_time) / fs->lookup_step; + u_int t = div64(curr_time - q->idle_time, + fs->lookup_step); q->avg = (t < fs->lookup_depth) ? SCALE_MUL(q->avg, fs->w_q_lookup[t]) : 0; @@ -1258,7 +1279,7 @@ red_drops(struct dn_flow_set *fs, struct } if (fs->flags_fs & DN_QSIZE_IS_BYTES) - p_b = (p_b * len) / fs->max_pkt_size; + p_b = div64(p_b * len, fs->max_pkt_size); if (++q->count == 0) q->random = random() & 0xffff; else { @@ -1475,7 +1496,7 @@ dummynet_io(struct mbuf **m0, int dir, s heap_extract(&(pipe->idle_heap), q); q->S = MAX64(q->F, pipe->V); } - q->F = q->S + (len << MY_M) / (uint64_t)fs->weight; + q->F = q->S + div64(len << MY_M, fs->weight); if (pipe->not_eligible_heap.elements == 0 && pipe->scheduler_heap.elements == 0) @@ -2245,8 +2266,10 @@ ip_dn_ctl(struct sockopt *sopt) error = delete_pipe(p); break ; } + if (p != NULL) free(p, M_TEMP); + return error ; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:24:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51EC8106568D; Wed, 2 Dec 2009 15:24:58 +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 404308FC14; Wed, 2 Dec 2009 15:24:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FOvr5021717; Wed, 2 Dec 2009 15:24:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FOvrv021715; Wed, 2 Dec 2009 15:24:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912021524.nB2FOvrv021715@svn.freebsd.org> From: John Baldwin Date: Wed, 2 Dec 2009 15:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200030 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:24:58 -0000 Author: jhb Date: Wed Dec 2 15:24:57 2009 New Revision: 200030 URL: http://svn.freebsd.org/changeset/base/200030 Log: MFC 194429: Add support for UMA_SLAB_KERNEL to page_free(). (While I'm here remove an unnecessary newline character from the end of two panic messages.) Modified: stable/7/sys/vm/uma_core.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/uma_core.c ============================================================================== --- stable/7/sys/vm/uma_core.c Wed Dec 2 15:20:31 2009 (r200029) +++ stable/7/sys/vm/uma_core.c Wed Dec 2 15:24:57 2009 (r200030) @@ -1033,8 +1033,10 @@ page_free(void *mem, int size, u_int8_t if (flags & UMA_SLAB_KMEM) map = kmem_map; + else if (flags & UMA_SLAB_KERNEL) + map = kernel_map; else - panic("UMA: page_free used with invalid flags %d\n", flags); + panic("UMA: page_free used with invalid flags %d", flags); kmem_free(map, (vm_offset_t)mem, size); } @@ -1292,7 +1294,7 @@ keg_ctor(void *mem, int size, void *udat printf("zone %s ipers %d rsize %d size %d\n", zone->uz_name, keg->uk_ipers, keg->uk_rsize, keg->uk_size); - panic("UMA slab won't fit.\n"); + panic("UMA slab won't fit."); } } From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:30:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DECDA1065679; Wed, 2 Dec 2009 15:30:53 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA57F8FC1B; Wed, 2 Dec 2009 15:30:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FUr9I022596; Wed, 2 Dec 2009 15:30:53 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FUrUV022592; Wed, 2 Dec 2009 15:30:53 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200912021530.nB2FUrUV022592@svn.freebsd.org> From: Tony Finch Date: Wed, 2 Dec 2009 15:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200031 - stable/8/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:30:54 -0000 Author: fanf Date: Wed Dec 2 15:30:53 2009 New Revision: 200031 URL: http://svn.freebsd.org/changeset/base/200031 Log: MFC 199813, 199817, 199842, 199867: Update unifdef to latest upstream version. Modified: stable/8/usr.bin/unifdef/unifdef.1 stable/8/usr.bin/unifdef/unifdef.c stable/8/usr.bin/unifdef/unifdefall.sh Directory Properties: stable/8/usr.bin/unifdef/ (props changed) Modified: stable/8/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.1 Wed Dec 2 15:24:57 2009 (r200030) +++ stable/8/usr.bin/unifdef/unifdef.1 Wed Dec 2 15:30:53 2009 (r200031) @@ -1,6 +1,6 @@ .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" Copyright (c) 2002 - 2005 Tony Finch . All rights reserved. +.\" Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)unifdef.1 8.2 (Berkeley) 4/1/94 -.\" $dotat: things/unifdef.1,v 1.51 2005/03/08 12:39:01 fanf2 Exp $ +.\" $dotat: unifdef/unifdef.1,v 1.60 2009/11/25 00:11:02 fanf2 Exp $ .\" $FreeBSD$ .\" .Dd September 24, 2002 @@ -41,7 +41,7 @@ .Nd remove preprocessor conditionals from code .Sh SYNOPSIS .Nm -.Op Fl cdeklnst +.Op Fl BbcdeKknst .Op Fl I Ns Ar path .Op Fl D Ns Ar sym Ns Op = Ns Ar val .Op Fl U Ns Ar sym @@ -70,46 +70,85 @@ utility acts on .Ic #if , #ifdef , #ifndef , #elif , #else , and .Ic #endif -lines, -and it understands only the commonly-used subset +lines. +A directive is only processed +if the symbols specified on the command line are sufficient to allow +.Nm +to get a definite value for its control expression. +If the result is false, +the directive and the following lines under its control are removed. +If the result is true, +only the directive is removed. +An +.Ic #ifdef +or +.Ic #ifndef +directive is passed through unchanged +if its controlling symbol is not specified on the command line. +Any +.Ic #if +or +.Ic #elif +control expression that has an unknown value or that +.Nm +cannot parse is passed through unchanged. +By default, +.Nm +ignores +.Ic #if +and +.Ic #elif +lines with constant expressions; +it can be told to process them by specifying the +.Fl k +flag on the command line. +.Pp +It understands a commonly-used subset of the expression syntax for .Ic #if and .Ic #elif -lines. -It handles +lines: +integer constants, integer values of symbols defined on the command line, the .Fn defined -operator applied to symbols defined or undefined on the command line, +operator, the operators .Ic \&! , < , > , <= , >= , == , != , && , || , and parenthesized expressions. -Anything that it does not understand is passed through unharmed. -It only processes -.Ic #ifdef -and -.Ic #ifndef -directives if the symbol is specified on the command line, -otherwise they are also passed through unchanged. -By default, it ignores -.Ic #if -and -.Ic #elif -lines with constant expressions, -or they may be processed by specifying the -.Fl k -flag on the command line. +A kind of +.Dq "short circuit" +evaluation is used for the +.Ic && +operator: +if either operand is definitely false then the result is false, +even if the value of the other operand is unknown. +Similarly, +if either operand of +.Ic || +is definitely true then the result is true. +.Pp +In most cases, the +.Nm +utility does not distinguish between object-like macros +(without arguments) and function-like arguments (with arguments). +If a macro is not explicitly defined, or is defined with the +.Fl D +flag on the command-line, its arguments are ignored. +If a macro is explicitly undefined on the command line with the +.Fl U +flag, it may not have any arguments since this leads to a syntax error. .Pp The .Nm -utility also understands just enough about C +utility understands just enough about C to know when one of the directives is inactive because it is inside a comment, or affected by a backslash-continued line. It spots unusually-formatted preprocessor directives -and knows when the layout is too odd to handle. +and knows when the layout is too odd for it to handle. .Pp A script called .Nm unifdefall @@ -125,8 +164,7 @@ and their definitions (or lack thereof), then invokes .Nm with appropriate arguments to process the file. -.Pp -Available options: +.Sh OPTIONS .Pp .Bl -tag -width indent -compact .It Fl D Ns Ar sym Ns Op = Ns Ar val @@ -143,6 +181,19 @@ Specify that a symbol is undefined. If the same symbol appears in more than one argument, the last occurrence dominates. .Pp +.It Fl B +Compress blank lines around a deleted section. +Mutually exclusive with the +.Fl b +option. +.Pp +.It Fl b +Replace removed lines with blank lines +instead of deleting them. +Mutually exclusive with the +.Fl B +option. +.Pp .It Fl c If the .Fl c @@ -174,6 +225,16 @@ option changes the behaviour so that, where possible, such lines are left unprocessed instead of reporting an error. .Pp +.It Fl K +Always treat the result of +.Ic && +and +.Ic || +operators as unknown if either operand is unknown, +instead of short-circuiting when unknown operands can't affect the result. +This option is for compatibility with older versions of +.Nm . +.Pp .It Fl k Process .Ic #if @@ -186,10 +247,6 @@ because they typically start and are used as a kind of comment to sketch out future or past development. It would be rude to strip them out, just as it would be for normal comments. .Pp -.It Fl l -Replace removed lines with blank lines -instead of deleting them. -.Pp .It Fl n Add .Li #line @@ -235,7 +292,7 @@ comments and line continuations inside those .Ic #ifdef Ns s . -One specifies ignored symbols with +You can specify ignored symbols with .Fl iD Ns Ar sym Ns Oo = Ns Ar val Oc and .Fl iU Ns Ar sym @@ -313,7 +370,7 @@ command appeared in support was added in .Fx 4.7 . .Sh AUTHORS -This implementation was originally written by +The original implementation was written by .An Dave Yost Aq Dave@Yost.com . .An Tony Finch Aq dot@dotat.at rewrote it to support Modified: stable/8/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/8/usr.bin/unifdef/unifdef.c Wed Dec 2 15:24:57 2009 (r200030) +++ stable/8/usr.bin/unifdef/unifdef.c Wed Dec 2 15:30:53 2009 (r200031) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 - 2008 Tony Finch + * Copyright (c) 2002 - 2009 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,27 +24,20 @@ */ /* - * This code is derived from software contributed to Berkeley by Dave Yost. + * This code was derived from software contributed to Berkeley by Dave Yost. * It was rewritten to support ANSI C by Tony Finch. The original version * of unifdef carried the 4-clause BSD copyright licence. None of its code * remains in this version (though some of the names remain) so it now * carries a more liberal licence. + * + * The latest version is available from http://dotat.at/prog/unifdef */ #include -#ifndef lint -#if 0 -static const char copyright[] = -"@(#) Copyright (c) 1985, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif #ifdef __IDSTRING -__IDSTRING(Berkeley, "@(#)unifdef.c 8.1 (Berkeley) 6/6/93"); -__IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.8 2000/07/03 02:51:36 matt Exp $"); -__IDSTRING(dotat, "$dotat: things/unifdef.c,v 1.178 2008/03/02 22:23:32 fanf2 Exp $"); +__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $"); #endif -#endif /* not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); #endif @@ -88,6 +81,7 @@ typedef enum { LT_DODGY_LAST = LT_DODGY + LT_ENDIF, LT_PLAIN, /* ordinary line */ LT_EOF, /* end of file */ + LT_ERROR, /* unevaluable #if */ LT_COUNT } Linetype; @@ -98,7 +92,7 @@ static char const * const linetype_name[ "DODGY IF", "DODGY TRUE", "DODGY FALSE", "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", "DODGY ELSE", "DODGY ENDIF", - "PLAIN", "EOF" + "PLAIN", "EOF", "ERROR" }; /* state of #if processing */ @@ -166,11 +160,13 @@ static char const * const linestate_name * Globals. */ +static bool compblank; /* -B: compress blank lines */ +static bool lnblank; /* -b: blank deleted lines */ static bool complement; /* -c: do the complement */ static bool debugging; /* -d: debugging reports */ static bool iocccok; /* -e: fewer IOCCC errors */ +static bool strictlogic; /* -K: keep ambiguous #ifs */ static bool killconsts; /* -k: eval constant #ifs */ -static bool lnblank; /* -l: blank deleted lines */ static bool lnnum; /* -n: add #line directives */ static bool symlist; /* -s: output symbol list */ static bool text; /* -t: this is a text file */ @@ -194,7 +190,9 @@ static bool ignoring[MAXDEPT static int stifline[MAXDEPTH]; /* start of current #if */ static int depth; /* current #if nesting */ static int delcount; /* count of deleted lines */ -static bool keepthis; /* don't delete constant #if */ +static unsigned blankcount; /* count of blank lines */ +static unsigned blankmax; /* maximum recent blankcount */ +static bool constexpr; /* constant #if expression */ static int exitstat; /* program exit status */ @@ -204,13 +202,14 @@ static void done(void); static void error(const char *); static int findsym(const char *); static void flushline(bool); -static Linetype getline(void); +static Linetype parseline(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); static void keywordedit(const char *); static void nest(void); static void process(void); +static const char *skipargs(const char *); static const char *skipcomment(const char *); static const char *skipsym(const char *); static void state(Ifstate); @@ -218,7 +217,7 @@ static int strlcmp(const ch static void unnest(void); static void usage(void); -#define endsym(c) (!isalpha((unsigned char)c) && !isdigit((unsigned char)c) && c != '_') +#define endsym(c) (!isalnum((unsigned char)c) && c != '_') /* * The main program. @@ -228,7 +227,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:cdeklnst")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -253,6 +252,13 @@ main(int argc, char *argv[]) case 'I': /* no-op for compatibility with cpp */ break; + case 'B': /* compress blank lines around removed section */ + compblank = true; + break; + case 'b': /* blank deleted lines instead of omitting them */ + case 'l': /* backwards compatibility */ + lnblank = true; + break; case 'c': /* treat -D as -U and vice versa */ complement = true; break; @@ -262,12 +268,12 @@ main(int argc, char *argv[]) case 'e': /* fewer errors from dodgy lines */ iocccok = true; break; + case 'K': /* keep ambiguous #ifs */ + strictlogic = true; + break; case 'k': /* process constant #ifs */ killconsts = true; break; - case 'l': /* blank deleted lines instead of omitting them */ - lnblank = true; - break; case 'n': /* add #line directive after deleted lines */ lnnum = true; break; @@ -282,6 +288,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (compblank && lnblank) + errx(2, "-B and -b are mutually exclusive"); if (argc > 1) { errx(2, "can only do one file"); } else if (argc == 1 && strcmp(*argv, "-") != 0) { @@ -300,7 +308,7 @@ main(int argc, char *argv[]) static void usage(void) { - fprintf(stderr, "usage: unifdef [-cdeklnst] [-Ipath]" + fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); exit(2); } @@ -381,46 +389,46 @@ static state_fn * const trans_table[IS_C /* IS_OUTSIDE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, - print, done }, + print, done, abort }, /* IS_FALSE_PREFIX */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_PREFIX */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, - print, Eeof }, + print, Eeof, abort }, /* IS_PASS_MIDDLE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_MIDDLE */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_MIDDLE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_PASS_ELSE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_ELSE */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_ELSE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_TRAILER */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, - drop, Eeof } + drop, Eeof, abort } /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) - PLAIN EOF */ + PLAIN EOF ERROR */ }; /* @@ -454,9 +462,11 @@ keywordedit(const char *replacement) static void nest(void) { - depth += 1; - if (depth >= MAXDEPTH) + if (depth > MAXDEPTH-1) + abort(); /* bug */ + if (depth == MAXDEPTH-1) error("Too many levels of nesting"); + depth += 1; stifline[depth] = linenum; } static void @@ -481,15 +491,23 @@ flushline(bool keep) if (symlist) return; if (keep ^ complement) { - if (lnnum && delcount > 0) - printf("#line %d\n", linenum); - fputs(tline, stdout); - delcount = 0; + bool blankline = tline[strspn(tline, " \t\n")] == '\0'; + if (blankline && compblank && blankcount != blankmax) { + delcount += 1; + blankcount += 1; + } else { + if (lnnum && delcount > 0) + printf("#line %d\n", linenum); + fputs(tline, stdout); + delcount = 0; + blankmax = blankcount = blankline ? blankcount + 1 : 0; + } } else { if (lnblank) putc('\n', stdout); exitstat = 1; delcount += 1; + blankcount = 0; } } @@ -501,9 +519,12 @@ process(void) { Linetype lineval; + /* When compressing blank lines, act as if the file + is preceded by a large number of blank lines. */ + blankmax = blankcount = 1000; for (;;) { linenum++; - lineval = getline(); + lineval = parseline(); trans_table[ifstate[depth]][lineval](); debug("process %s -> %s depth %d", linetype_name[lineval], @@ -517,7 +538,7 @@ process(void) * help from skipcomment(). */ static Linetype -getline(void) +parseline(void) { const char *cp; int cursym; @@ -613,17 +634,40 @@ getline(void) /* * These are the binary operators that are supported by the expression - * evaluator. Note that if support for division is added then we also - * need short-circuiting booleans because of divide-by-zero. + * evaluator. */ -static int op_lt(int a, int b) { return (a < b); } -static int op_gt(int a, int b) { return (a > b); } -static int op_le(int a, int b) { return (a <= b); } -static int op_ge(int a, int b) { return (a >= b); } -static int op_eq(int a, int b) { return (a == b); } -static int op_ne(int a, int b) { return (a != b); } -static int op_or(int a, int b) { return (a || b); } -static int op_and(int a, int b) { return (a && b); } +static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { + if(at == LT_IF || bt == LT_IF) return (LT_IF); + return (*p = v, v ? LT_TRUE : LT_FALSE); +} +static Linetype op_lt(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a < b, at, bt); +} +static Linetype op_gt(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a > b, at, bt); +} +static Linetype op_le(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a <= b, at, bt); +} +static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a >= b, at, bt); +} +static Linetype op_eq(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a == b, at, bt); +} +static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a != b, at, bt); +} +static Linetype op_or(int *p, Linetype at, int a, Linetype bt, int b) { + if (!strictlogic && (at == LT_TRUE || bt == LT_TRUE)) + return (*p = 1, LT_TRUE); + return op_strict(p, a || b, at, bt); +} +static Linetype op_and(int *p, Linetype at, int a, Linetype bt, int b) { + if (!strictlogic && (at == LT_FALSE || bt == LT_FALSE)) + return (*p = 0, LT_FALSE); + return op_strict(p, a && b, at, bt); +} /* * An evaluation function takes three arguments, as follows: (1) a pointer to @@ -632,8 +676,8 @@ static int op_and(int a, int b) { return * value of the expression; and (3) a pointer to a char* that points to the * expression to be evaluated and that is updated to the end of the expression * when evaluation is complete. The function returns LT_FALSE if the value of - * the expression is zero, LT_TRUE if it is non-zero, or LT_IF if the - * expression could not be evaluated. + * the expression is zero, LT_TRUE if it is non-zero, LT_IF if the expression + * depends on an unknown symbol, or LT_ERROR if there is a parse failure. */ struct ops; @@ -652,7 +696,7 @@ static const struct ops { eval_fn *inner; struct op { const char *str; - int (*fn)(int, int); + Linetype (*fn)(int *, Linetype, int, Linetype, int); } op[5]; } eval_ops[] = { { eval_table, { { "||", op_or } } }, @@ -667,8 +711,8 @@ static const struct ops { /* * Function for evaluating the innermost parts of expressions, - * viz. !expr (expr) defined(symbol) symbol number - * We reset the keepthis flag when we find a non-constant subexpression. + * viz. !expr (expr) number defined(symbol) symbol + * We reset the constexpr flag in the last two cases. */ static Linetype eval_unary(const struct ops *ops, int *valp, const char **cpp) @@ -677,25 +721,34 @@ eval_unary(const struct ops *ops, int *v char *ep; int sym; bool defparen; + Linetype lt; cp = skipcomment(*cpp); if (*cp == '!') { debug("eval%d !", ops - eval_ops); cp++; - if (eval_unary(ops, valp, &cp) == LT_IF) - return (LT_IF); - *valp = !*valp; + lt = eval_unary(ops, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); + if (lt != LT_IF) { + *valp = !*valp; + lt = *valp ? LT_TRUE : LT_FALSE; + } } else if (*cp == '(') { cp++; debug("eval%d (", ops - eval_ops); - if (eval_table(eval_ops, valp, &cp) == LT_IF) - return (LT_IF); + lt = eval_table(eval_ops, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); cp = skipcomment(cp); if (*cp++ != ')') - return (LT_IF); + return (LT_ERROR); } else if (isdigit((unsigned char)*cp)) { debug("eval%d number", ops - eval_ops); *valp = strtol(cp, &ep, 0); + if (ep == cp) + return (LT_ERROR); + lt = *valp ? LT_TRUE : LT_FALSE; cp = skipsym(cp); } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { cp = skipcomment(cp+7); @@ -707,36 +760,43 @@ eval_unary(const struct ops *ops, int *v defparen = false; } sym = findsym(cp); - if (sym < 0) - return (LT_IF); - *valp = (value[sym] != NULL); + if (sym < 0) { + lt = LT_IF; + } else { + *valp = (value[sym] != NULL); + lt = *valp ? LT_TRUE : LT_FALSE; + } cp = skipsym(cp); cp = skipcomment(cp); if (defparen && *cp++ != ')') - return (LT_IF); - keepthis = false; + return (LT_ERROR); + constexpr = false; } else if (!endsym(*cp)) { debug("eval%d symbol", ops - eval_ops); sym = findsym(cp); - if (sym < 0) - return (LT_IF); - if (value[sym] == NULL) + cp = skipsym(cp); + if (sym < 0) { + lt = LT_IF; + cp = skipargs(cp); + } else if (value[sym] == NULL) { *valp = 0; - else { + lt = LT_FALSE; + } else { *valp = strtol(value[sym], &ep, 0); if (*ep != '\0' || ep == value[sym]) - return (LT_IF); + return (LT_ERROR); + lt = *valp ? LT_TRUE : LT_FALSE; + cp = skipargs(cp); } - cp = skipsym(cp); - keepthis = false; + constexpr = false; } else { debug("eval%d bad expr", ops - eval_ops); - return (LT_IF); + return (LT_ERROR); } *cpp = cp; debug("eval%d = %d", ops - eval_ops, *valp); - return (*valp ? LT_TRUE : LT_FALSE); + return (lt); } /* @@ -748,11 +808,13 @@ eval_table(const struct ops *ops, int *v const struct op *op; const char *cp; int val; + Linetype lt, rt; debug("eval%d", ops - eval_ops); cp = *cpp; - if (ops->inner(ops+1, valp, &cp) == LT_IF) - return (LT_IF); + lt = ops->inner(ops+1, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); for (;;) { cp = skipcomment(cp); for (op = ops->op; op->str != NULL; op++) @@ -762,14 +824,16 @@ eval_table(const struct ops *ops, int *v break; cp += strlen(op->str); debug("eval%d %s", ops - eval_ops, op->str); - if (ops->inner(ops+1, &val, &cp) == LT_IF) - return (LT_IF); - *valp = op->fn(*valp, val); + rt = ops->inner(ops+1, &val, &cp); + if (rt == LT_ERROR) + return (LT_ERROR); + lt = op->fn(valp, lt, *valp, rt, val); } *cpp = cp; debug("eval%d = %d", ops - eval_ops, *valp); - return (*valp ? LT_TRUE : LT_FALSE); + debug("eval%d lt = %s", ops - eval_ops, linetype_name[lt]); + return (lt); } /* @@ -784,10 +848,10 @@ ifeval(const char **cpp) int val = 0; debug("eval %s", *cpp); - keepthis = killconsts ? false : true; + constexpr = killconsts ? false : true; ret = eval_table(eval_ops, &val, cpp); debug("eval = %d", val); - return (keepthis ? LT_IF : ret); + return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret); } /* @@ -899,6 +963,31 @@ skipcomment(const char *cp) } /* + * Skip macro arguments. + */ +static const char * +skipargs(const char *cp) +{ + const char *ocp = cp; + int level = 0; + cp = skipcomment(cp); + if (*cp != '(') + return (cp); + do { + if (*cp == '(') + level++; + if (*cp == ')') + level--; + cp = skipcomment(cp+1); + } while (level != 0 && *cp != '\0'); + if (level == 0) + return (cp); + else + /* Rewind and re-detect the syntax error later. */ + return (ocp); +} + +/* * Skip over an identifier. */ static const char * Modified: stable/8/usr.bin/unifdef/unifdefall.sh ============================================================================== --- stable/8/usr.bin/unifdef/unifdefall.sh Wed Dec 2 15:24:57 2009 (r200030) +++ stable/8/usr.bin/unifdef/unifdefall.sh Wed Dec 2 15:30:53 2009 (r200031) @@ -1,29 +1,61 @@ #!/bin/sh # -# remove all the #if's from a source file +# unifdefall: remove all the #if's from a source file # -# $dotat: things/unifdefall.sh,v 1.9 2002/09/24 19:43:57 fanf2 Exp $ +# Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $dotat: unifdef/unifdefall.sh,v 1.24 2009/11/26 12:54:39 fanf2 Exp $ # $FreeBSD$ set -e -basename=`basename $0` -tmp=`mktemp -d -t $basename` || exit 2 - -unifdef -s "$@" | sort | uniq > $tmp/ctrl -cpp -dM "$@" | sort | - sed -Ee 's/^#define[ ]+(.*[^ ])[ ]*$/\1/' > $tmp/hashdefs -sed -Ee 's/^([A-Za-z0-9_]+).*$/\1/' $tmp/hashdefs > $tmp/alldef -comm -23 $tmp/ctrl $tmp/alldef > $tmp/undef -comm -12 $tmp/ctrl $tmp/alldef > $tmp/def +basename=$(basename $0) +tmp=$(mktemp -d "${TMPDIR:-/tmp}/$basename.XXXXXXXXXX") || exit 2 +trap 'rm -r "$tmp" || exit 1' EXIT -echo unifdef -k \\ > $tmp/cmd -sed -Ee 's/^(.*)$/-U\1 \\/' $tmp/undef >> $tmp/cmd -while read sym -do sed -Ee '/^('"$sym"')([(][^)]*[)])?([ ]+(.*))?$/!d;s//-D\1=\4/' $tmp/hashdefs -done < $tmp/def | - sed -Ee 's/\\/\\\\/g;s/"/\\"/g;s/^/"/;s/$/" \\/' >> $tmp/cmd -echo '"$@"' >> $tmp/cmd -sh $tmp/cmd "$@" +export LC_ALL=C -rm -r $tmp +# list of all controlling macros +unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +# list of all macro definitions +cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" +# list of defined macro names +sed 's/[^A-Za-z0-9_].*$//' <"$tmp/hashdefs" >"$tmp/alldef" +# list of undefined and defined controlling macros +comm -23 "$tmp/ctrl" "$tmp/alldef" >"$tmp/undef" +comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tmp/def" +# create a sed script that extracts the controlling macro definitions +# and converts them to unifdef command-line arguments +sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D&=/p|' <"$tmp/def" >"$tmp/script" +# create the final unifdef command +{ echo unifdef -k \\ + # convert the controlling undefined macros to -U arguments + sed 's/.*/-U& \\/' <"$tmp/undef" + # convert the controlling defined macros to quoted -D arguments + sed -nf "$tmp/script" <"$tmp/hashdefs" | + sed "s/'/'\\\\''/g;s/.*/'&' \\\\/" + echo '"$@"' +} >"$tmp/cmd" +# run the command we just created +sh "$tmp/cmd" "$@" From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:33:34 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B99D5106566B; Wed, 2 Dec 2009 15:33:34 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 72FE48FC19; Wed, 2 Dec 2009 15:33:34 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB2FXTqC032102; Wed, 2 Dec 2009 09:33:30 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Wed, 2 Dec 2009 09:33:29 -0600 (CST) From: "Sean C. Farley" To: "M. Warner Losh" In-Reply-To: <20091201.193518.387188323.imp@bsdimp.com> Message-ID: References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> <20091201.193518.387188323.imp@bsdimp.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.6 required=4.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: green@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, rwatson@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:33:34 -0000 On Tue, 1 Dec 2009, M. Warner Losh wrote: > In message: > Robert Watson writes: > : On Mon, 30 Nov 2009, Colin Percival wrote: > : > : > Brian Feldman wrote: > : >> Do not gratuitously fail *env(3) operations due to corrupt ('='-less) > : >> **environ entries. This puts non-getenv(3) operations in line with > : >> getenv(3) in that bad environ entries do not cause all operations to > : >> fail. There is still some inconsistency in that getenv(3) in the > : >> absence of any environment-modifying operation does not emit corrupt > : >> environ entry warnings. > : >> > : >> I also fixed another inconsistency in getenv(3) where updating the > : >> global environ pointer would not be reflected in the return values. > : >> It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) > : >> in order to see the change. > : > > : > The FreeBSD Security Team is currently dealing with a security > : > issue relating to this code. Please back out your change (at > : > least to getenv.c; I don't particularly care about the regression > : > tests) until we've finished, and then submit the patch to us for > : > review along with a detailed explanation of what it does. > : > > : > We've already had two major security issues arising out of > : > getenv.c in the past year, and I'd like to make sure we don't have > : > a third. > : > : I think it's fair to say that the POSIXization of the environment > : code has been an unmitigated disaster, and speaks to the necessity > : for careful review of those sorts of code changes. > > Why we're not just reverting the whole thing as a bad idea is beyond > me. Clearly the tiny incremental benefits have been far overshadowed > by this fiasco. Which "whole thing"? The code or the POSIX-compliance? Technically, it is not pure compliance because the code has a few BSD requirements in it such as keeping old name=value entries even when new ones are created. It was my fault for not checking how unsetenv() was used in all of base. The change to use unsetenv() in rtld.c was committed just prior to my change which introduced a version of unsetenv() that returned an int to allow checking. I am testing a change to have unsetenv() not stop in its attempt to unset a variable which should mimic the old behavior. One difference between our man page and IEEE Std 1003.1-2008 is the part concerning that the "environment shall be unchanged" which I will introduce to the man page: Upon successful completion, zero shall be returned. Otherwise, -1 shall be returned, errno set to indicate the error, and the environment shall be unchanged. After my change, unsetenv() will not return an error if environ is corrupt. It will wipe the variable. The only time errors will be returned are when the name passed to unsetenv() is invalid or when memory allocation fails. One question is whether the code should abort() when it detects a corrupt environ array or do its best to complete the request from the caller. Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:34:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1C01106568D; Wed, 2 Dec 2009 15:34:13 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA5A8FC2E; Wed, 2 Dec 2009 15:34:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FYDYE023144; Wed, 2 Dec 2009 15:34:13 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FYDEW023140; Wed, 2 Dec 2009 15:34:13 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200912021534.nB2FYDEW023140@svn.freebsd.org> From: Tony Finch Date: Wed, 2 Dec 2009 15:34:13 +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: r200032 - stable/7/usr.bin/unifdef X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:34:13 -0000 Author: fanf Date: Wed Dec 2 15:34:13 2009 New Revision: 200032 URL: http://svn.freebsd.org/changeset/base/200032 Log: MFC 199813, 199817, 199842, 199867: Update unifdef to latest upstream version. Modified: stable/7/usr.bin/unifdef/unifdef.1 stable/7/usr.bin/unifdef/unifdef.c stable/7/usr.bin/unifdef/unifdefall.sh Directory Properties: stable/7/usr.bin/unifdef/ (props changed) Modified: stable/7/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/7/usr.bin/unifdef/unifdef.1 Wed Dec 2 15:30:53 2009 (r200031) +++ stable/7/usr.bin/unifdef/unifdef.1 Wed Dec 2 15:34:13 2009 (r200032) @@ -1,6 +1,6 @@ .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. -.\" Copyright (c) 2002 - 2005 Tony Finch . All rights reserved. +.\" Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Dave Yost. It was rewritten to support ANSI C by Tony Finch. @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)unifdef.1 8.2 (Berkeley) 4/1/94 -.\" $dotat: things/unifdef.1,v 1.51 2005/03/08 12:39:01 fanf2 Exp $ +.\" $dotat: unifdef/unifdef.1,v 1.60 2009/11/25 00:11:02 fanf2 Exp $ .\" $FreeBSD$ .\" .Dd September 24, 2002 @@ -41,7 +41,7 @@ .Nd remove preprocessor conditionals from code .Sh SYNOPSIS .Nm -.Op Fl cdeklnst +.Op Fl BbcdeKknst .Op Fl I Ns Ar path .Op Fl D Ns Ar sym Ns Op = Ns Ar val .Op Fl U Ns Ar sym @@ -70,46 +70,85 @@ utility acts on .Ic #if , #ifdef , #ifndef , #elif , #else , and .Ic #endif -lines, -and it understands only the commonly-used subset +lines. +A directive is only processed +if the symbols specified on the command line are sufficient to allow +.Nm +to get a definite value for its control expression. +If the result is false, +the directive and the following lines under its control are removed. +If the result is true, +only the directive is removed. +An +.Ic #ifdef +or +.Ic #ifndef +directive is passed through unchanged +if its controlling symbol is not specified on the command line. +Any +.Ic #if +or +.Ic #elif +control expression that has an unknown value or that +.Nm +cannot parse is passed through unchanged. +By default, +.Nm +ignores +.Ic #if +and +.Ic #elif +lines with constant expressions; +it can be told to process them by specifying the +.Fl k +flag on the command line. +.Pp +It understands a commonly-used subset of the expression syntax for .Ic #if and .Ic #elif -lines. -It handles +lines: +integer constants, integer values of symbols defined on the command line, the .Fn defined -operator applied to symbols defined or undefined on the command line, +operator, the operators .Ic \&! , < , > , <= , >= , == , != , && , || , and parenthesized expressions. -Anything that it does not understand is passed through unharmed. -It only processes -.Ic #ifdef -and -.Ic #ifndef -directives if the symbol is specified on the command line, -otherwise they are also passed through unchanged. -By default, it ignores -.Ic #if -and -.Ic #elif -lines with constant expressions, -or they may be processed by specifying the -.Fl k -flag on the command line. +A kind of +.Dq "short circuit" +evaluation is used for the +.Ic && +operator: +if either operand is definitely false then the result is false, +even if the value of the other operand is unknown. +Similarly, +if either operand of +.Ic || +is definitely true then the result is true. +.Pp +In most cases, the +.Nm +utility does not distinguish between object-like macros +(without arguments) and function-like arguments (with arguments). +If a macro is not explicitly defined, or is defined with the +.Fl D +flag on the command-line, its arguments are ignored. +If a macro is explicitly undefined on the command line with the +.Fl U +flag, it may not have any arguments since this leads to a syntax error. .Pp The .Nm -utility also understands just enough about C +utility understands just enough about C to know when one of the directives is inactive because it is inside a comment, or affected by a backslash-continued line. It spots unusually-formatted preprocessor directives -and knows when the layout is too odd to handle. +and knows when the layout is too odd for it to handle. .Pp A script called .Nm unifdefall @@ -125,8 +164,7 @@ and their definitions (or lack thereof), then invokes .Nm with appropriate arguments to process the file. -.Pp -Available options: +.Sh OPTIONS .Pp .Bl -tag -width indent -compact .It Fl D Ns Ar sym Ns Op = Ns Ar val @@ -143,6 +181,19 @@ Specify that a symbol is undefined. If the same symbol appears in more than one argument, the last occurrence dominates. .Pp +.It Fl B +Compress blank lines around a deleted section. +Mutually exclusive with the +.Fl b +option. +.Pp +.It Fl b +Replace removed lines with blank lines +instead of deleting them. +Mutually exclusive with the +.Fl B +option. +.Pp .It Fl c If the .Fl c @@ -174,6 +225,16 @@ option changes the behaviour so that, where possible, such lines are left unprocessed instead of reporting an error. .Pp +.It Fl K +Always treat the result of +.Ic && +and +.Ic || +operators as unknown if either operand is unknown, +instead of short-circuiting when unknown operands can't affect the result. +This option is for compatibility with older versions of +.Nm . +.Pp .It Fl k Process .Ic #if @@ -186,10 +247,6 @@ because they typically start and are used as a kind of comment to sketch out future or past development. It would be rude to strip them out, just as it would be for normal comments. .Pp -.It Fl l -Replace removed lines with blank lines -instead of deleting them. -.Pp .It Fl n Add .Li #line @@ -235,7 +292,7 @@ comments and line continuations inside those .Ic #ifdef Ns s . -One specifies ignored symbols with +You can specify ignored symbols with .Fl iD Ns Ar sym Ns Oo = Ns Ar val Oc and .Fl iU Ns Ar sym @@ -313,7 +370,7 @@ command appeared in support was added in .Fx 4.7 . .Sh AUTHORS -This implementation was originally written by +The original implementation was written by .An Dave Yost Aq Dave@Yost.com . .An Tony Finch Aq dot@dotat.at rewrote it to support Modified: stable/7/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/7/usr.bin/unifdef/unifdef.c Wed Dec 2 15:30:53 2009 (r200031) +++ stable/7/usr.bin/unifdef/unifdef.c Wed Dec 2 15:34:13 2009 (r200032) @@ -1,13 +1,5 @@ /* - * Copyright (c) 2002 - 2005 Tony Finch . All rights reserved. - * - * This code is derived from software contributed to Berkeley by Dave Yost. - * It was rewritten to support ANSI C by Tony Finch. The original version of - * unifdef carried the following copyright notice. None of its code remains - * in this version (though some of the names remain). - * - * Copyright (c) 1985, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002 - 2009 Tony Finch * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,20 +23,21 @@ * SUCH DAMAGE. */ +/* + * This code was derived from software contributed to Berkeley by Dave Yost. + * It was rewritten to support ANSI C by Tony Finch. The original version + * of unifdef carried the 4-clause BSD copyright licence. None of its code + * remains in this version (though some of the names remain) so it now + * carries a more liberal licence. + * + * The latest version is available from http://dotat.at/prog/unifdef + */ + #include -#ifndef lint -#if 0 -static const char copyright[] = -"@(#) Copyright (c) 1985, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif #ifdef __IDSTRING -__IDSTRING(Berkeley, "@(#)unifdef.c 8.1 (Berkeley) 6/6/93"); -__IDSTRING(NetBSD, "$NetBSD: unifdef.c,v 1.8 2000/07/03 02:51:36 matt Exp $"); -__IDSTRING(dotat, "$dotat: things/unifdef.c,v 1.171 2005/03/08 12:38:48 fanf2 Exp $"); +__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.190 2009/11/27 17:21:26 fanf2 Exp $"); #endif -#endif /* not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); #endif @@ -88,6 +81,7 @@ typedef enum { LT_DODGY_LAST = LT_DODGY + LT_ENDIF, LT_PLAIN, /* ordinary line */ LT_EOF, /* end of file */ + LT_ERROR, /* unevaluable #if */ LT_COUNT } Linetype; @@ -98,7 +92,7 @@ static char const * const linetype_name[ "DODGY IF", "DODGY TRUE", "DODGY FALSE", "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", "DODGY ELSE", "DODGY ENDIF", - "PLAIN", "EOF" + "PLAIN", "EOF", "ERROR" }; /* state of #if processing */ @@ -166,11 +160,13 @@ static char const * const linestate_name * Globals. */ +static bool compblank; /* -B: compress blank lines */ +static bool lnblank; /* -b: blank deleted lines */ static bool complement; /* -c: do the complement */ static bool debugging; /* -d: debugging reports */ static bool iocccok; /* -e: fewer IOCCC errors */ +static bool strictlogic; /* -K: keep ambiguous #ifs */ static bool killconsts; /* -k: eval constant #ifs */ -static bool lnblank; /* -l: blank deleted lines */ static bool lnnum; /* -n: add #line directives */ static bool symlist; /* -s: output symbol list */ static bool text; /* -t: this is a text file */ @@ -194,7 +190,9 @@ static bool ignoring[MAXDEPT static int stifline[MAXDEPTH]; /* start of current #if */ static int depth; /* current #if nesting */ static int delcount; /* count of deleted lines */ -static bool keepthis; /* don't delete constant #if */ +static unsigned blankcount; /* count of blank lines */ +static unsigned blankmax; /* maximum recent blankcount */ +static bool constexpr; /* constant #if expression */ static int exitstat; /* program exit status */ @@ -204,13 +202,14 @@ static void done(void); static void error(const char *); static int findsym(const char *); static void flushline(bool); -static Linetype getline(void); +static Linetype parseline(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); static void keywordedit(const char *); static void nest(void); static void process(void); +static const char *skipargs(const char *); static const char *skipcomment(const char *); static const char *skipsym(const char *); static void state(Ifstate); @@ -218,7 +217,7 @@ static int strlcmp(const ch static void unnest(void); static void usage(void); -#define endsym(c) (!isalpha((unsigned char)c) && !isdigit((unsigned char)c) && c != '_') +#define endsym(c) (!isalnum((unsigned char)c) && c != '_') /* * The main program. @@ -228,7 +227,7 @@ main(int argc, char *argv[]) { int opt; - while ((opt = getopt(argc, argv, "i:D:U:I:cdeklnst")) != -1) + while ((opt = getopt(argc, argv, "i:D:U:I:BbcdeKklnst")) != -1) switch (opt) { case 'i': /* treat stuff controlled by these symbols as text */ /* @@ -253,6 +252,13 @@ main(int argc, char *argv[]) case 'I': /* no-op for compatibility with cpp */ break; + case 'B': /* compress blank lines around removed section */ + compblank = true; + break; + case 'b': /* blank deleted lines instead of omitting them */ + case 'l': /* backwards compatibility */ + lnblank = true; + break; case 'c': /* treat -D as -U and vice versa */ complement = true; break; @@ -262,12 +268,12 @@ main(int argc, char *argv[]) case 'e': /* fewer errors from dodgy lines */ iocccok = true; break; + case 'K': /* keep ambiguous #ifs */ + strictlogic = true; + break; case 'k': /* process constant #ifs */ killconsts = true; break; - case 'l': /* blank deleted lines instead of omitting them */ - lnblank = true; - break; case 'n': /* add #line directive after deleted lines */ lnnum = true; break; @@ -282,6 +288,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; + if (compblank && lnblank) + errx(2, "-B and -b are mutually exclusive"); if (argc > 1) { errx(2, "can only do one file"); } else if (argc == 1 && strcmp(*argv, "-") != 0) { @@ -300,7 +308,7 @@ main(int argc, char *argv[]) static void usage(void) { - fprintf(stderr, "usage: unifdef [-cdeklnst] [-Ipath]" + fprintf(stderr, "usage: unifdef [-BbcdeKknst] [-Ipath]" " [-Dsym[=val]] [-Usym] [-iDsym[=val]] [-iUsym] ... [file]\n"); exit(2); } @@ -381,46 +389,46 @@ static state_fn * const trans_table[IS_C /* IS_OUTSIDE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Eendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eendif, - print, done }, + print, done, abort }, /* IS_FALSE_PREFIX */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Strue, Sfalse,Selse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Mpass, Eioccc,Eioccc,Eioccc,Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_PREFIX */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Dfalse,Dfalse,Dfalse,Delse, Dendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, - print, Eeof }, + print, Eeof, abort }, /* IS_PASS_MIDDLE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Pelif, Mtrue, Delif, Pelse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Pelif, Oelif, Oelif, Pelse, Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_MIDDLE */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Pelif, Mtrue, Delif, Pelse, Pendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eioccc,Eioccc,Eioccc,Eioccc,Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_MIDDLE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Melif, Melif, Melif, Melse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eioccc,Eioccc,Eioccc,Eioccc,Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_PASS_ELSE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Pendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Pendif, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_ELSE */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Eelif, Eelif, Eelif, Eelse, Eioccc, - drop, Eeof }, + drop, Eeof, abort }, /* IS_TRUE_ELSE */ { Itrue, Ifalse,Fpass, Ftrue, Ffalse,Eelif, Eelif, Eelif, Eelse, Dendif, Oiffy, Oiffy, Fpass, Oif, Oif, Eelif, Eelif, Eelif, Eelse, Eioccc, - print, Eeof }, + print, Eeof, abort }, /* IS_FALSE_TRAILER */ { Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Dendif, Idrop, Idrop, Fdrop, Fdrop, Fdrop, Dfalse,Dfalse,Dfalse,Delse, Eioccc, - drop, Eeof } + drop, Eeof, abort } /*TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF TRUEI FALSEI IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF (DODGY) - PLAIN EOF */ + PLAIN EOF ERROR */ }; /* @@ -454,9 +462,11 @@ keywordedit(const char *replacement) static void nest(void) { - depth += 1; - if (depth >= MAXDEPTH) + if (depth > MAXDEPTH-1) + abort(); /* bug */ + if (depth == MAXDEPTH-1) error("Too many levels of nesting"); + depth += 1; stifline[depth] = linenum; } static void @@ -481,15 +491,23 @@ flushline(bool keep) if (symlist) return; if (keep ^ complement) { - if (lnnum && delcount > 0) - printf("#line %d\n", linenum); - fputs(tline, stdout); - delcount = 0; + bool blankline = tline[strspn(tline, " \t\n")] == '\0'; + if (blankline && compblank && blankcount != blankmax) { + delcount += 1; + blankcount += 1; + } else { + if (lnnum && delcount > 0) + printf("#line %d\n", linenum); + fputs(tline, stdout); + delcount = 0; + blankmax = blankcount = blankline ? blankcount + 1 : 0; + } } else { if (lnblank) putc('\n', stdout); exitstat = 1; delcount += 1; + blankcount = 0; } } @@ -501,9 +519,12 @@ process(void) { Linetype lineval; + /* When compressing blank lines, act as if the file + is preceded by a large number of blank lines. */ + blankmax = blankcount = 1000; for (;;) { linenum++; - lineval = getline(); + lineval = parseline(); trans_table[ifstate[depth]][lineval](); debug("process %s -> %s depth %d", linetype_name[lineval], @@ -517,7 +538,7 @@ process(void) * help from skipcomment(). */ static Linetype -getline(void) +parseline(void) { const char *cp; int cursym; @@ -586,9 +607,21 @@ getline(void) if (incomment) linestate = LS_DIRTY; } - /* skipcomment should have changed the state */ - if (linestate == LS_HASH) - abort(); /* bug */ + /* skipcomment normally changes the state, except + if the last line of the file lacks a newline, or + if there is too much whitespace in a directive */ + if (linestate == LS_HASH) { + size_t len = cp - tline; + if (fgets(tline + len, MAXLINE - len, input) == NULL) { + /* append the missing newline */ + tline[len+0] = '\n'; + tline[len+1] = '\0'; + cp++; + linestate = LS_START; + } else { + linestate = LS_DIRTY; + } + } } if (linestate == LS_DIRTY) { while (*cp != '\0') @@ -601,17 +634,40 @@ getline(void) /* * These are the binary operators that are supported by the expression - * evaluator. Note that if support for division is added then we also - * need short-circuiting booleans because of divide-by-zero. + * evaluator. */ -static int op_lt(int a, int b) { return (a < b); } -static int op_gt(int a, int b) { return (a > b); } -static int op_le(int a, int b) { return (a <= b); } -static int op_ge(int a, int b) { return (a >= b); } -static int op_eq(int a, int b) { return (a == b); } -static int op_ne(int a, int b) { return (a != b); } -static int op_or(int a, int b) { return (a || b); } -static int op_and(int a, int b) { return (a && b); } +static Linetype op_strict(int *p, int v, Linetype at, Linetype bt) { + if(at == LT_IF || bt == LT_IF) return (LT_IF); + return (*p = v, v ? LT_TRUE : LT_FALSE); +} +static Linetype op_lt(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a < b, at, bt); +} +static Linetype op_gt(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a > b, at, bt); +} +static Linetype op_le(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a <= b, at, bt); +} +static Linetype op_ge(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a >= b, at, bt); +} +static Linetype op_eq(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a == b, at, bt); +} +static Linetype op_ne(int *p, Linetype at, int a, Linetype bt, int b) { + return op_strict(p, a != b, at, bt); +} +static Linetype op_or(int *p, Linetype at, int a, Linetype bt, int b) { + if (!strictlogic && (at == LT_TRUE || bt == LT_TRUE)) + return (*p = 1, LT_TRUE); + return op_strict(p, a || b, at, bt); +} +static Linetype op_and(int *p, Linetype at, int a, Linetype bt, int b) { + if (!strictlogic && (at == LT_FALSE || bt == LT_FALSE)) + return (*p = 0, LT_FALSE); + return op_strict(p, a && b, at, bt); +} /* * An evaluation function takes three arguments, as follows: (1) a pointer to @@ -620,8 +676,8 @@ static int op_and(int a, int b) { return * value of the expression; and (3) a pointer to a char* that points to the * expression to be evaluated and that is updated to the end of the expression * when evaluation is complete. The function returns LT_FALSE if the value of - * the expression is zero, LT_TRUE if it is non-zero, or LT_IF if the - * expression could not be evaluated. + * the expression is zero, LT_TRUE if it is non-zero, LT_IF if the expression + * depends on an unknown symbol, or LT_ERROR if there is a parse failure. */ struct ops; @@ -640,7 +696,7 @@ static const struct ops { eval_fn *inner; struct op { const char *str; - int (*fn)(int, int); + Linetype (*fn)(int *, Linetype, int, Linetype, int); } op[5]; } eval_ops[] = { { eval_table, { { "||", op_or } } }, @@ -655,8 +711,8 @@ static const struct ops { /* * Function for evaluating the innermost parts of expressions, - * viz. !expr (expr) defined(symbol) symbol number - * We reset the keepthis flag when we find a non-constant subexpression. + * viz. !expr (expr) number defined(symbol) symbol + * We reset the constexpr flag in the last two cases. */ static Linetype eval_unary(const struct ops *ops, int *valp, const char **cpp) @@ -664,63 +720,83 @@ eval_unary(const struct ops *ops, int *v const char *cp; char *ep; int sym; + bool defparen; + Linetype lt; cp = skipcomment(*cpp); if (*cp == '!') { debug("eval%d !", ops - eval_ops); cp++; - if (eval_unary(ops, valp, &cp) == LT_IF) - return (LT_IF); - *valp = !*valp; + lt = eval_unary(ops, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); + if (lt != LT_IF) { + *valp = !*valp; + lt = *valp ? LT_TRUE : LT_FALSE; + } } else if (*cp == '(') { cp++; debug("eval%d (", ops - eval_ops); - if (eval_table(eval_ops, valp, &cp) == LT_IF) - return (LT_IF); + lt = eval_table(eval_ops, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); cp = skipcomment(cp); if (*cp++ != ')') - return (LT_IF); + return (LT_ERROR); } else if (isdigit((unsigned char)*cp)) { debug("eval%d number", ops - eval_ops); *valp = strtol(cp, &ep, 0); + if (ep == cp) + return (LT_ERROR); + lt = *valp ? LT_TRUE : LT_FALSE; cp = skipsym(cp); } else if (strncmp(cp, "defined", 7) == 0 && endsym(cp[7])) { cp = skipcomment(cp+7); debug("eval%d defined", ops - eval_ops); - if (*cp++ != '(') - return (LT_IF); - cp = skipcomment(cp); + if (*cp == '(') { + cp = skipcomment(cp+1); + defparen = true; + } else { + defparen = false; + } sym = findsym(cp); - if (sym < 0) - return (LT_IF); - *valp = (value[sym] != NULL); + if (sym < 0) { + lt = LT_IF; + } else { + *valp = (value[sym] != NULL); + lt = *valp ? LT_TRUE : LT_FALSE; + } cp = skipsym(cp); cp = skipcomment(cp); - if (*cp++ != ')') - return (LT_IF); - keepthis = false; + if (defparen && *cp++ != ')') + return (LT_ERROR); + constexpr = false; } else if (!endsym(*cp)) { debug("eval%d symbol", ops - eval_ops); sym = findsym(cp); - if (sym < 0) - return (LT_IF); - if (value[sym] == NULL) + cp = skipsym(cp); + if (sym < 0) { + lt = LT_IF; + cp = skipargs(cp); + } else if (value[sym] == NULL) { *valp = 0; - else { + lt = LT_FALSE; + } else { *valp = strtol(value[sym], &ep, 0); if (*ep != '\0' || ep == value[sym]) - return (LT_IF); + return (LT_ERROR); + lt = *valp ? LT_TRUE : LT_FALSE; + cp = skipargs(cp); } - cp = skipsym(cp); - keepthis = false; + constexpr = false; } else { debug("eval%d bad expr", ops - eval_ops); - return (LT_IF); + return (LT_ERROR); } *cpp = cp; debug("eval%d = %d", ops - eval_ops, *valp); - return (*valp ? LT_TRUE : LT_FALSE); + return (lt); } /* @@ -732,11 +808,13 @@ eval_table(const struct ops *ops, int *v const struct op *op; const char *cp; int val; + Linetype lt, rt; debug("eval%d", ops - eval_ops); cp = *cpp; - if (ops->inner(ops+1, valp, &cp) == LT_IF) - return (LT_IF); + lt = ops->inner(ops+1, valp, &cp); + if (lt == LT_ERROR) + return (LT_ERROR); for (;;) { cp = skipcomment(cp); for (op = ops->op; op->str != NULL; op++) @@ -746,14 +824,16 @@ eval_table(const struct ops *ops, int *v break; cp += strlen(op->str); debug("eval%d %s", ops - eval_ops, op->str); - if (ops->inner(ops+1, &val, &cp) == LT_IF) - return (LT_IF); - *valp = op->fn(*valp, val); + rt = ops->inner(ops+1, &val, &cp); + if (rt == LT_ERROR) + return (LT_ERROR); + lt = op->fn(valp, lt, *valp, rt, val); } *cpp = cp; debug("eval%d = %d", ops - eval_ops, *valp); - return (*valp ? LT_TRUE : LT_FALSE); + debug("eval%d lt = %s", ops - eval_ops, linetype_name[lt]); + return (lt); } /* @@ -765,13 +845,13 @@ static Linetype ifeval(const char **cpp) { int ret; - int val; + int val = 0; debug("eval %s", *cpp); - keepthis = killconsts ? false : true; + constexpr = killconsts ? false : true; ret = eval_table(eval_ops, &val, cpp); debug("eval = %d", val); - return (keepthis ? LT_IF : ret); + return (constexpr ? LT_IF : ret == LT_ERROR ? LT_IF : ret); } /* @@ -883,6 +963,31 @@ skipcomment(const char *cp) } /* + * Skip macro arguments. + */ +static const char * +skipargs(const char *cp) +{ + const char *ocp = cp; + int level = 0; + cp = skipcomment(cp); + if (*cp != '(') + return (cp); + do { + if (*cp == '(') + level++; + if (*cp == ')') + level--; + cp = skipcomment(cp+1); + } while (level != 0 && *cp != '\0'); + if (level == 0) + return (cp); + else + /* Rewind and re-detect the syntax error later. */ + return (ocp); +} + +/* * Skip over an identifier. */ static const char * @@ -894,7 +999,7 @@ skipsym(const char *cp) } /* - * Look for the symbol in the symbol table. If is is found, we return + * Look for the symbol in the symbol table. If it is found, we return * the symbol table index, else we return -1. */ static int Modified: stable/7/usr.bin/unifdef/unifdefall.sh ============================================================================== --- stable/7/usr.bin/unifdef/unifdefall.sh Wed Dec 2 15:30:53 2009 (r200031) +++ stable/7/usr.bin/unifdef/unifdefall.sh Wed Dec 2 15:34:13 2009 (r200032) @@ -1,29 +1,61 @@ #!/bin/sh # -# remove all the #if's from a source file +# unifdefall: remove all the #if's from a source file # -# $dotat: things/unifdefall.sh,v 1.9 2002/09/24 19:43:57 fanf2 Exp $ +# Copyright (c) 2002 - 2009 Tony Finch . All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $dotat: unifdef/unifdefall.sh,v 1.24 2009/11/26 12:54:39 fanf2 Exp $ # $FreeBSD$ set -e -basename=`basename $0` -tmp=`mktemp -d -t $basename` || exit 2 - -unifdef -s "$@" | sort | uniq > $tmp/ctrl -cpp -dM "$@" | sort | - sed -Ee 's/^#define[ ]+(.*[^ ])[ ]*$/\1/' > $tmp/hashdefs -sed -Ee 's/^([A-Za-z0-9_]+).*$/\1/' $tmp/hashdefs > $tmp/alldef -comm -23 $tmp/ctrl $tmp/alldef > $tmp/undef -comm -12 $tmp/ctrl $tmp/alldef > $tmp/def +basename=$(basename $0) +tmp=$(mktemp -d "${TMPDIR:-/tmp}/$basename.XXXXXXXXXX") || exit 2 +trap 'rm -r "$tmp" || exit 1' EXIT -echo unifdef -k \\ > $tmp/cmd -sed -Ee 's/^(.*)$/-U\1 \\/' $tmp/undef >> $tmp/cmd -while read sym -do sed -Ee '/^('"$sym"')([(][^)]*[)])?([ ]+(.*))?$/!d;s//-D\1=\4/' $tmp/hashdefs -done < $tmp/def | - sed -Ee 's/\\/\\\\/g;s/"/\\"/g;s/^/"/;s/$/" \\/' >> $tmp/cmd -echo '"$@"' >> $tmp/cmd -sh $tmp/cmd "$@" +export LC_ALL=C -rm -r $tmp +# list of all controlling macros +unifdef -s "$@" | sort | uniq >"$tmp/ctrl" +# list of all macro definitions +cpp -dM "$@" | sort | sed 's/^#define //' >"$tmp/hashdefs" +# list of defined macro names +sed 's/[^A-Za-z0-9_].*$//' <"$tmp/hashdefs" >"$tmp/alldef" +# list of undefined and defined controlling macros +comm -23 "$tmp/ctrl" "$tmp/alldef" >"$tmp/undef" +comm -12 "$tmp/ctrl" "$tmp/alldef" >"$tmp/def" +# create a sed script that extracts the controlling macro definitions +# and converts them to unifdef command-line arguments +sed 's|.*|s/^&\\(([^)]*)\\)\\{0,1\\} /-D&=/p|' <"$tmp/def" >"$tmp/script" +# create the final unifdef command +{ echo unifdef -k \\ + # convert the controlling undefined macros to -U arguments + sed 's/.*/-U& \\/' <"$tmp/undef" + # convert the controlling defined macros to quoted -D arguments + sed -nf "$tmp/script" <"$tmp/hashdefs" | + sed "s/'/'\\\\''/g;s/.*/'&' \\\\/" + echo '"$@"' +} >"$tmp/cmd" +# run the command we just created +sh "$tmp/cmd" "$@" From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:39:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2F9D106568D; Wed, 2 Dec 2009 15:39:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C44DA8FC18; Wed, 2 Dec 2009 15:39:18 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 793DB46B2A; Wed, 2 Dec 2009 10:39:18 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id AEB138A01B; Wed, 2 Dec 2009 10:39:17 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Date: Wed, 2 Dec 2009 10:37:11 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912021524.nB2FOvrv021715@svn.freebsd.org> In-Reply-To: <200912021524.nB2FOvrv021715@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912021037.11828.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 02 Dec 2009 10:39:17 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r200030 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:39:19 -0000 On Wednesday 02 December 2009 10:24:57 am John Baldwin wrote: > Author: jhb > Date: Wed Dec 2 15:24:57 2009 > New Revision: 200030 > URL: http://svn.freebsd.org/changeset/base/200030 > > Log: > MFC 194429: > Add support for UMA_SLAB_KERNEL to page_free(). (While I'm here remove an > unnecessary newline character from the end of two panic messages.) This fixes "UMA free:" panics when draining zones during a memory shortage after the MFC of 194454 and 195385 in change 196838. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:45:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91FA6106566B; Wed, 2 Dec 2009 15:45:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5668FC19; Wed, 2 Dec 2009 15:45:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FjtMI024715; Wed, 2 Dec 2009 15:45:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FjtQ0024710; Wed, 2 Dec 2009 15:45:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912021545.nB2FjtQ0024710@svn.freebsd.org> From: Andriy Gapon Date: Wed, 2 Dec 2009 15:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200033 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:45:55 -0000 Author: avg Date: Wed Dec 2 15:45:55 2009 New Revision: 200033 URL: http://svn.freebsd.org/changeset/base/200033 Log: mca: improve status checking, recording and reporting - directly print mca information in case we fail to allocate memory for a record - include bank number into mca record - print raw mca status value for extended information Reviewed by: jhb MFC after: 10 days Modified: head/sys/amd64/amd64/mca.c head/sys/amd64/include/mca.h head/sys/i386/i386/mca.c head/sys/i386/include/mca.h Modified: head/sys/amd64/amd64/mca.c ============================================================================== --- head/sys/amd64/amd64/mca.c Wed Dec 2 15:34:13 2009 (r200032) +++ head/sys/amd64/amd64/mca.c Wed Dec 2 15:45:55 2009 (r200033) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: head/sys/amd64/include/mca.h ============================================================================== --- head/sys/amd64/include/mca.h Wed Dec 2 15:34:13 2009 (r200032) +++ head/sys/amd64/include/mca.h Wed Dec 2 15:45:55 2009 (r200033) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL Modified: head/sys/i386/i386/mca.c ============================================================================== --- head/sys/i386/i386/mca.c Wed Dec 2 15:34:13 2009 (r200032) +++ head/sys/i386/i386/mca.c Wed Dec 2 15:45:55 2009 (r200033) @@ -117,48 +117,6 @@ sysctl_mca_records(SYSCTL_HANDLER_ARGS) return (SYSCTL_OUT(req, &record, sizeof(record))); } -static struct mca_record * -mca_record_entry(int bank) -{ - struct mca_internal *rec; - uint64_t status; - u_int p[4]; - - status = rdmsr(MSR_MC_STATUS(bank)); - if (!(status & MC_STATUS_VAL)) - return (NULL); - - rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT | M_ZERO); - if (rec == NULL) { - printf("MCA: Unable to allocate space for an event.\n"); - return (NULL); - } - - /* Save exception information. */ - rec->rec.mr_status = status; - if (status & MC_STATUS_ADDRV) - rec->rec.mr_addr = rdmsr(MSR_MC_ADDR(bank)); - if (status & MC_STATUS_MISCV) - rec->rec.mr_misc = rdmsr(MSR_MC_MISC(bank)); - rec->rec.mr_tsc = rdtsc(); - rec->rec.mr_apic_id = PCPU_GET(apic_id); - - /* - * Clear machine check. Don't do this for uncorrectable - * errors so that the BIOS can see them. - */ - if (!(rec->rec.mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { - wrmsr(MSR_MC_STATUS(bank), 0); - do_cpuid(0, p); - } - - mtx_lock_spin(&mca_lock); - STAILQ_INSERT_TAIL(&mca_records, rec, link); - mca_count++; - mtx_unlock_spin(&mca_lock); - return (&rec->rec); -} - static const char * mca_error_ttype(uint16_t mca_error) { @@ -219,11 +177,13 @@ mca_error_request(uint16_t mca_error) } /* Dump details about a single machine check. */ -static void -mca_log(struct mca_record *rec) +static void __nonnull(1) +mca_log(const struct mca_record *rec) { uint16_t mca_error; + printf("MCA: bank %d, status 0x%016llx\n", rec->mr_bank, + (long long)rec->mr_status); printf("MCA: CPU %d ", rec->mr_apic_id); if (rec->mr_status & MC_STATUS_UC) printf("UNCOR "); @@ -329,6 +289,59 @@ mca_log(struct mca_record *rec) printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr); } +static int __nonnull(2) +mca_check_status(int bank, struct mca_record *rec) +{ + uint64_t status; + u_int p[4]; + + status = rdmsr(MSR_MC_STATUS(bank)); + if (!(status & MC_STATUS_VAL)) + return (0); + + /* Save exception information. */ + rec->mr_status = status; + rec->mr_bank = bank; + rec->mr_addr = 0; + if (status & MC_STATUS_ADDRV) + rec->mr_addr = rdmsr(MSR_MC_ADDR(bank)); + rec->mr_misc = 0; + if (status & MC_STATUS_MISCV) + rec->mr_misc = rdmsr(MSR_MC_MISC(bank)); + rec->mr_tsc = rdtsc(); + rec->mr_apic_id = PCPU_GET(apic_id); + + /* + * Clear machine check. Don't do this for uncorrectable + * errors so that the BIOS can see them. + */ + if (!(rec->mr_status & (MC_STATUS_PCC | MC_STATUS_UC))) { + wrmsr(MSR_MC_STATUS(bank), 0); + do_cpuid(0, p); + } + return (1); +} + +static void __nonnull(1) +mca_record_entry(const struct mca_record *record) +{ + struct mca_internal *rec; + + rec = malloc(sizeof(*rec), M_MCA, M_NOWAIT); + if (rec == NULL) { + printf("MCA: Unable to allocate space for an event.\n"); + mca_log(record); + return; + } + + rec->rec = *record; + rec->logged = 0; + mtx_lock_spin(&mca_lock); + STAILQ_INSERT_TAIL(&mca_records, rec, link); + mca_count++; + mtx_unlock_spin(&mca_lock); +} + /* * This scans all the machine check banks of the current CPU to see if * there are any machine checks. Any non-recoverable errors are @@ -341,7 +354,7 @@ mca_log(struct mca_record *rec) static int mca_scan(int mcip) { - struct mca_record *rec; + struct mca_record rec; uint64_t mcg_cap, ucmask; int count, i, recoverable; @@ -354,13 +367,13 @@ mca_scan(int mcip) ucmask |= MC_STATUS_OVER; mcg_cap = rdmsr(MSR_MCG_CAP); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - rec = mca_record_entry(i); - if (rec != NULL) { + if (mca_check_status(i, &rec)) { count++; - if (rec->mr_status & ucmask) { + if (rec.mr_status & ucmask) { recoverable = 0; - mca_log(rec); + mca_log(&rec); } + mca_record_entry(&rec); } } return (mcip ? recoverable : count); Modified: head/sys/i386/include/mca.h ============================================================================== --- head/sys/i386/include/mca.h Wed Dec 2 15:34:13 2009 (r200032) +++ head/sys/i386/include/mca.h Wed Dec 2 15:45:55 2009 (r200033) @@ -36,6 +36,7 @@ struct mca_record { uint64_t mr_misc; uint64_t mr_tsc; int mr_apic_id; + int mr_bank; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:50:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B601065672; Wed, 2 Dec 2009 15:50:43 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63CE48FC1A; Wed, 2 Dec 2009 15:50:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FohFn025395; Wed, 2 Dec 2009 15:50:43 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FohaR025393; Wed, 2 Dec 2009 15:50:43 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912021550.nB2FohaR025393@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 2 Dec 2009 15:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200034 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:50:43 -0000 Author: luigi Date: Wed Dec 2 15:50:43 2009 New Revision: 200034 URL: http://svn.freebsd.org/changeset/base/200034 Log: Dispatch sockopt calls to ipfw and dummynet using the new option numbers, IP_FW3 and IP_DUMMYNET3. Right now the modules return an error if called with those arguments so there is no danger of unwanted behaviour. MFC after: 3 days Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Wed Dec 2 15:45:55 2009 (r200033) +++ head/sys/netinet/raw_ip.c Wed Dec 2 15:50:43 2009 (r200034) @@ -535,6 +535,7 @@ rip_ctloutput(struct socket *so, struct error = sooptcopyout(sopt, &optval, sizeof optval); break; + case IP_FW3: /* generic ipfw v.3 functions */ case IP_FW_ADD: /* ADD actually returns the body... */ case IP_FW_GET: case IP_FW_TABLE_GETSIZE: @@ -547,6 +548,7 @@ rip_ctloutput(struct socket *so, struct error = ENOPROTOOPT; break; + case IP_DUMMYNET3: /* generic dummynet v.3 functions */ case IP_DUMMYNET_GET: if (ip_dn_ctl_ptr != NULL) error = ip_dn_ctl_ptr(sopt); @@ -592,6 +594,7 @@ rip_ctloutput(struct socket *so, struct inp->inp_flags &= ~INP_HDRINCL; break; + case IP_FW3: /* generic ipfw v.3 functions */ case IP_FW_ADD: case IP_FW_DEL: case IP_FW_FLUSH: @@ -608,6 +611,7 @@ rip_ctloutput(struct socket *so, struct error = ENOPROTOOPT; break; + case IP_DUMMYNET3: /* generic dummynet v.3 functions */ case IP_DUMMYNET_CONFIGURE: case IP_DUMMYNET_DEL: case IP_DUMMYNET_FLUSH: From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 15:56:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3326D106566B; Wed, 2 Dec 2009 15:56:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 227B78FC15; Wed, 2 Dec 2009 15:56:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2FuJPZ026186; Wed, 2 Dec 2009 15:56:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2FuJLp026184; Wed, 2 Dec 2009 15:56:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912021556.nB2FuJLp026184@svn.freebsd.org> From: Ed Schouten Date: Wed, 2 Dec 2009 15:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200035 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 15:56:19 -0000 Author: ed Date: Wed Dec 2 15:56:18 2009 New Revision: 200035 URL: http://svn.freebsd.org/changeset/base/200035 Log: Make work when included by itself. There are several reasons why it didn't work: - It was missing for __BEGIN_DECLS. - It uses various primitive types that were not declared. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Dec 2 15:50:43 2009 (r200034) +++ head/lib/libutil/libutil.h Wed Dec 2 15:56:18 2009 (r200035) @@ -39,6 +39,34 @@ #ifndef _LIBUTIL_H_ #define _LIBUTIL_H_ +#include +#include + +#ifndef _GID_T_DECLARED +typedef __gid_t gid_t; +#define _GID_T_DECLARED +#endif + +#ifndef _INT64_T_DECLARED +typedef __int64_t int64_t; +#define _INT64_T_DECLARED +#endif + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif + +#ifndef _UID_T_DECLARED +typedef __uid_t uid_t; +#define _UID_T_DECLARED +#endif + #define PROPERTY_MAX_NAME 64 #define PROPERTY_MAX_VALUE 512 From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 16:08:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACFDC106566B; Wed, 2 Dec 2009 16:08:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B7608FC13; Wed, 2 Dec 2009 16:08:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2G8XXD027893; Wed, 2 Dec 2009 16:08:33 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2G8Xop027891; Wed, 2 Dec 2009 16:08:33 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200912021608.nB2G8Xop027891@svn.freebsd.org> From: Scott Long Date: Wed, 2 Dec 2009 16:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200036 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 16:08:33 -0000 Author: scottl Date: Wed Dec 2 16:08:33 2009 New Revision: 200036 URL: http://svn.freebsd.org/changeset/base/200036 Log: Fix several cases where the periph lock was held over malloc. Submitted by: Jaakko Heinonen Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Dec 2 15:56:18 2009 (r200035) +++ head/sys/cam/scsi/scsi_cd.c Wed Dec 2 16:08:33 2009 (r200036) @@ -2673,12 +2673,10 @@ cdioctl(struct disk *dp, u_long cmd, voi authinfo = (struct dvd_authinfo *)addr; - cam_periph_lock(periph); if (cmd == DVDIOCREPORTKEY) error = cdreportkey(periph, authinfo); else error = cdsendkey(periph, authinfo); - cam_periph_unlock(periph); break; } case DVDIOCREADSTRUCTURE: { @@ -2686,9 +2684,7 @@ cdioctl(struct disk *dp, u_long cmd, voi dvdstruct = (struct dvd_struct *)addr; - cam_periph_lock(periph); error = cdreaddvdstructure(periph, dvdstruct); - cam_periph_unlock(periph); break; } @@ -3732,8 +3728,6 @@ cdreportkey(struct cam_periph *periph, s databuf = NULL; lba = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); - switch (authinfo->format) { case DVD_REPORT_AGID: length = sizeof(struct scsi_report_key_data_agid); @@ -3759,9 +3753,7 @@ cdreportkey(struct cam_periph *periph, s length = 0; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -3769,6 +3761,8 @@ cdreportkey(struct cam_periph *periph, s } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); scsi_report_key(&ccb->csio, /* retries */ 1, @@ -3869,12 +3863,14 @@ cdreportkey(struct cam_periph *periph, s goto bailout; break; /* NOTREACHED */ } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); + if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3889,8 +3885,6 @@ cdsendkey(struct cam_periph *periph, str error = 0; databuf = NULL; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); - switch(authinfo->format) { case DVD_SEND_CHALLENGE: { struct scsi_report_key_data_challenge *challenge_data; @@ -3942,11 +3936,12 @@ cdsendkey(struct cam_periph *periph, str break; } default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } + cam_periph_lock(periph); + ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + scsi_send_key(&ccb->csio, /* retries */ 1, /* cbfcnp */ cddone, @@ -3961,13 +3956,12 @@ cdsendkey(struct cam_periph *periph, str error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA); -bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3985,8 +3979,6 @@ cdreaddvdstructure(struct cam_periph *pe /* The address is reserved for many of the formats */ address = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); - switch(dvdstruct->format) { case DVD_STRUCT_PHYSICAL: length = sizeof(struct scsi_read_dvd_struct_data_physical); @@ -4004,13 +3996,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_manufacturer); break; case DVD_STRUCT_CMI: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_copy_manage); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PROTDISCID: length = sizeof(struct scsi_read_dvd_struct_data_prot_discid); break; @@ -4027,21 +4013,9 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_spare_area); break; case DVD_STRUCT_RMD_LAST: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd_borderout); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_RMD_RMA: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PRERECORDED: length = sizeof(struct scsi_read_dvd_struct_data_leadin); break; @@ -4049,13 +4023,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_disc_id); break; case DVD_STRUCT_DCB: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_dcb); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_LIST: /* * This is the maximum allocation length for the READ DVD @@ -4067,9 +4035,7 @@ cdreaddvdstructure(struct cam_periph *pe length = 65535; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -4077,6 +4043,9 @@ cdreaddvdstructure(struct cam_periph *pe } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + scsi_read_dvd_structure(&ccb->csio, /* retries */ 1, /* cbfcnp */ cddone, @@ -4164,13 +4133,14 @@ cdreaddvdstructure(struct cam_periph *pe min(sizeof(dvdstruct->data), dvdstruct->length)); break; } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 16:09:14 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E361065695; Wed, 2 Dec 2009 16:09:14 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 13A4F8FC14; Wed, 2 Dec 2009 16:09:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nB2G5B1a086738; Wed, 2 Dec 2009 09:05:11 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 02 Dec 2009 09:05:29 -0700 (MST) Message-Id: <20091202.090529.1219863310.imp@bsdimp.com> To: kostikbel@gmail.com From: "M. Warner Losh" In-Reply-To: <20091202132904.GH2368@deviant.kiev.zoral.com.ua> References: <200911261349.nAQDnco2083469@svn.freebsd.org> <200912021926.02346.fluffy@fluffy.khv.ru> <20091202132904.GH2368@deviant.kiev.zoral.com.ua> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: fluffy@fluffy.khv.ru, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: svn commit: r199827 - in head: include lib/libc/compat-43 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 16:09:14 -0000 In message: <20091202132904.GH2368@deviant.kiev.zoral.com.ua> Kostik Belousov writes: : On Wed, Dec 02, 2009 at 07:25:56PM +1000, Dima Panov wrote: : > On Thursday 26 November 2009 23:49:38 Konstantin Belousov wrote: : > > Author: kib : > > Date: Thu Nov 26 13:49:37 2009 : > > New Revision: 199827 : > > URL: http://svn.freebsd.org/changeset/base/199827 : > > : > > Log: : > > Implement sighold, sigignore, sigpause, sigrelse, sigset functions : > > from SUSv4 XSI. Note that the functions are obsoleted, and only : > > provided to ease porting from System V-like systems. Since sigpause : > > already exists in compat with different interface, XSI sigpause is : > > named xsi_sigpause. : > > : > > Reviewed by: davidxu : > > MFC after: 3 weeks : > > : > > Modified: : > > head/include/signal.h : > > head/lib/libc/compat-43/Makefile.inc : > > head/lib/libc/compat-43/Symbol.map : > > head/lib/libc/compat-43/sigcompat.c : > > head/lib/libc/compat-43/sigpause.2 : > > head/sys/sys/signal.h : > > head/sys/sys/signalvar.h : > : > kib, you forgot about osversion bump, it is strongly needed. : No. My interpretation of __FreeBSD_version is that the bump indicates : incompatible change in the interfaces. Sometime it is used to mark the : point where big changes hit the tree, possibly not related to interface : change. : : Also, __FreeBSD_version denotes the kernel "version". We do support : running earlier usermode on the later kernels. Think about kernel-only : upgrades, compatXx libs and jails which can run arbitrary earlier : usermode. (The change in question is purely libc). : : Said this, I think it is actually harmful practice to bump : __FreeBSD_version after API additions or feature implementation. : : I can bump version for this case, but due to the above reason, : it would not make much sense. In the past, __FreeBSD_version has been used to expose changes in interfaces (both plus, minus and delta) that are necessary for the entire system. Adding an interface definitely qualifies because this is a build-time issue, not a run time one. Unfortunately, __FreeBSD_version has also been used to force kernel recompiles lately since it is encoded in the kernel modules. Despite this, it isn't just for kernels... Warner : > This changeset caused jdk (may be not only jdk) breakage, as jdk-bsd-patches : > always provide own implementations of sigingnore() for FreeBSD. : > : > Patch for jdk16 port will be ready soon. : : Ok, thanks for working on this. From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 16:26:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35913106568D; Wed, 2 Dec 2009 16:26:19 +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 245C28FC1B; Wed, 2 Dec 2009 16:26:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2GQJJg030297; Wed, 2 Dec 2009 16:26:19 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2GQIKZ030295; Wed, 2 Dec 2009 16:26:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912021626.nB2GQIKZ030295@svn.freebsd.org> From: John Baldwin Date: Wed, 2 Dec 2009 16:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200037 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 16:26:19 -0000 Author: jhb Date: Wed Dec 2 16:26:18 2009 New Revision: 200037 URL: http://svn.freebsd.org/changeset/base/200037 Log: ndis_scan_results() can sleep if the scan results are not ready when ndis_scan() is called. However, ndis_scan() is invoked from softclock() and cannot sleep. Move ndis_scan_results() to the ndis' driver's scan_end hook instead. Submitted by: Paul B Mahol onemda of gmail MFC after: 1 week Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Wed Dec 2 16:08:33 2009 (r200036) +++ head/sys/dev/if_ndis/if_ndis.c Wed Dec 2 16:26:18 2009 (r200037) @@ -3222,14 +3222,8 @@ ndis_newstate(struct ieee80211vap *vap, static void ndis_scan(void *arg) { - struct ndis_softc *sc = arg; - struct ieee80211com *ic; - struct ieee80211vap *vap; - - ic = sc->ifp->if_l2com; - vap = TAILQ_FIRST(&ic->ic_vaps); + struct ieee80211vap *vap = arg; - ndis_scan_results(sc); ieee80211_scan_done(vap); } @@ -3377,7 +3371,7 @@ ndis_scan_start(struct ieee80211com *ic) return; } /* Set a timer to collect the results */ - callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, sc); + callout_reset(&sc->ndis_scan_callout, hz * 3, ndis_scan, vap); } static void @@ -3401,5 +3395,7 @@ ndis_scan_mindwell(struct ieee80211_scan static void ndis_scan_end(struct ieee80211com *ic) { - /* ignore */ + struct ndis_softc *sc = ic->ic_ifp->if_softc; + + ndis_scan_results(sc); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 16:34:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58567106566B; Wed, 2 Dec 2009 16:34:21 +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 441768FC08; Wed, 2 Dec 2009 16:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2GYLVP031409; Wed, 2 Dec 2009 16:34:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2GYLSq031398; Wed, 2 Dec 2009 16:34:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912021634.nB2GYLSq031398@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 2 Dec 2009 16:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200038 - in head: contrib/gcc/config lib/csu/amd64 lib/csu/arm lib/csu/i386-elf lib/csu/ia64 lib/csu/mips lib/csu/powerpc lib/csu/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 16:34:21 -0000 Author: kib Date: Wed Dec 2 16:34:20 2009 New Revision: 200038 URL: http://svn.freebsd.org/changeset/base/200038 Log: Properly support -fPIE by linking PIE binaries with specially-built Scrt1.o instead of crt1.o, since the later is built as non-PIC. Separate i386-elf crt1.c into the pure assembler part and C code, supplying all data extracted by assembler stub as explicit parameters [1]. Hide and localize _start1 symbol used as an interface between asm and C code. In collaboration with: kan Inspired by: PR i386/127387 [1] Prodded and tested by: rdivacky [1] MFC after: 3 weeks Added: head/lib/csu/i386-elf/crt1_c.c - copied, changed from r200027, head/lib/csu/i386-elf/crt1.c head/lib/csu/i386-elf/crt1_s.S (contents, props changed) Deleted: head/lib/csu/i386-elf/crt1.c Modified: head/contrib/gcc/config/freebsd-spec.h head/lib/csu/amd64/Makefile head/lib/csu/arm/Makefile head/lib/csu/i386-elf/Makefile head/lib/csu/ia64/Makefile head/lib/csu/mips/Makefile head/lib/csu/powerpc/Makefile head/lib/csu/sparc64/Makefile Modified: head/contrib/gcc/config/freebsd-spec.h ============================================================================== --- head/contrib/gcc/config/freebsd-spec.h Wed Dec 2 16:26:18 2009 (r200037) +++ head/contrib/gcc/config/freebsd-spec.h Wed Dec 2 16:34:20 2009 (r200038) @@ -103,9 +103,10 @@ Boston, MA 02110-1301, USA. */ %{p:gcrt1.o%s} \ %{!p: \ %{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ + %{!profile: \ + %{pie: Scrt1.o%s;:crt1.o%s}}}}} \ crti.o%s \ - %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}" + %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" /* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386. Here we tack on our own magical crtend.o file (see crtstuff.c) which provides part of @@ -113,8 +114,7 @@ Boston, MA 02110-1301, USA. */ entering `main', followed by the normal "finalizer" file, `crtn.o'. */ #define FBSD_ENDFILE_SPEC "\ - %{!shared:crtend.o%s} \ - %{shared:crtendS.o%s} \ + %{shared|pie:crtendS.o%s;:crtend.o%s} \ crtn.o%s " /* Provide a LIB_SPEC appropriate for FreeBSD as configured and as Modified: head/lib/csu/amd64/Makefile ============================================================================== --- head/lib/csu/amd64/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/amd64/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include CFLAGS+= -fno-omit-frame-pointer @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.CURDIR}/crt1.c + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: head/lib/csu/arm/Makefile ============================================================================== --- head/lib/csu/arm/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/arm/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: head/lib/csu/i386-elf/Makefile ============================================================================== --- head/lib/csu/i386-elf/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/i386-elf/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -2,8 +2,8 @@ .PATH: ${.CURDIR}/../common -SRCS= crt1.c crti.S crtn.S -FILES= ${SRCS:N*.h:R:S/$/.o/g} gcrt1.o +SRCS= crti.S crtn.S +FILES= ${SRCS:N*.h:R:S/$/.o/g} gcrt1.o crt1.o Scrt1.o FILESOWN= ${LIBOWN} FILESGRP= ${LIBGRP} FILESMODE= ${LIBMODE} @@ -11,9 +11,23 @@ FILESDIR= ${LIBDIR} WARNS?= 6 CFLAGS+= -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include -CLEANFILES= ${FILES} +CLEANFILES= ${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o -gcrt1.o: crt1.c - ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.CURDIR}/crt1.c +gcrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -c -o gcrt1_c.o ${.CURDIR}/crt1_c.c + +gcrt1.o: gcrt1_c.o crt1_s.o + ${LD} ${LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o + +crt1.o: crt1_c.o crt1_s.o + ${LD} ${LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o + objcopy --localize-symbol _start1 crt1.o + +Scrt1_c.o: crt1_c.c + ${CC} ${CFLAGS} -DGCRT -fPIC -DPIC -c -o Scrt1_c.o ${.CURDIR}/crt1_c.c + +Scrt1.o: Scrt1_c.o crt1_s.o + ${LD} ${LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o + objcopy --localize-symbol _start1 Scrt1.o .include Copied and modified: head/lib/csu/i386-elf/crt1_c.c (from r200027, head/lib/csu/i386-elf/crt1.c) ============================================================================== --- head/lib/csu/i386-elf/crt1.c Wed Dec 2 14:32:01 2009 (r200027, copy source) +++ head/lib/csu/i386-elf/crt1_c.c Wed Dec 2 16:34:20 2009 (r200038) @@ -22,6 +22,8 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ */ #ifndef lint @@ -55,35 +57,15 @@ extern int etext; char **environ; const char *__progname = ""; -static __inline fptr -get_rtld_cleanup(void) -{ - fptr retval; +void _start1(fptr, int, char *[]) __dead2; -#ifdef __GNUC__ - __asm__("movl %%edx,%0" : "=rm"(retval)); -#else - retval = (fptr)0; /* XXXX Fix this for other compilers */ -#endif - return(retval); -} - -/* The entry function. */ +/* The entry function, C part. */ void -_start(char *ap, ...) +_start1(fptr cleanup, int argc, char *argv[]) { - fptr cleanup; - int argc; - char **argv; char **env; const char *s; -#ifdef __GNUC__ - __asm__("and $0xfffffff0,%esp"); -#endif - cleanup = get_rtld_cleanup(); - argv = ≈ - argc = *(long *)(void *)(argv - 1); env = argv + argc + 1; environ = env; if (argc > 0 && argv[0] != NULL) { @@ -110,4 +92,4 @@ __asm__("eprol:"); exit( main(argc, argv, env) ); } -__asm__(".ident\t\"$FreeBSD$\""); +__asm(".hidden _start1"); Added: head/lib/csu/i386-elf/crt1_s.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/i386-elf/crt1_s.S Wed Dec 2 16:34:20 2009 (r200038) @@ -0,0 +1,44 @@ +/*- + * Copyright 2009 Konstantin Belousov. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + + + .text + .align 4 + .globl _start + .type _start, @function +_start: xorl %ebp,%ebp + pushl %ebp + movl %esp,%ebp + andl $0xfffffff0,%esp # align stack + leal 8(%ebp),%eax + pushl %eax # argv + pushl 4(%ebp) # argc + pushl %edx # rtld cleanup + call _start1 + .size _start, . - _start + + .ident "$FreeBSD$" Modified: head/lib/csu/ia64/Makefile ============================================================================== --- head/lib/csu/ia64/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/ia64/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -4,7 +4,7 @@ SRCS= crt1.S crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.S ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.S + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/mips/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: head/lib/csu/powerpc/Makefile ============================================================================== --- head/lib/csu/powerpc/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/powerpc/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -Wall -Wno-unused \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../libc/include @@ -16,6 +16,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} Modified: head/lib/csu/sparc64/Makefile ============================================================================== --- head/lib/csu/sparc64/Makefile Wed Dec 2 16:26:18 2009 (r200037) +++ head/lib/csu/sparc64/Makefile Wed Dec 2 16:34:20 2009 (r200038) @@ -4,7 +4,7 @@ SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} -OBJS+= gcrt1.o +OBJS+= Scrt1.o gcrt1.o CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../../libc/include all: ${OBJS} @@ -14,6 +14,9 @@ CLEANFILES= ${OBJS} gcrt1.o: crt1.c ${CC} ${CFLAGS} -DGCRT -c -o gcrt1.o ${.ALLSRC} +Scrt1.o: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -c -o Scrt1.o ${.ALLSRC} + realinstall: ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${OBJS} ${DESTDIR}${LIBDIR} From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 16:40:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68948106566B; Wed, 2 Dec 2009 16:40:23 +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 57CDC8FC15; Wed, 2 Dec 2009 16:40:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2GeNIL032251; Wed, 2 Dec 2009 16:40:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2GeNPL032249; Wed, 2 Dec 2009 16:40:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912021640.nB2GeNPL032249@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 2 Dec 2009 16:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200039 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 16:40:23 -0000 Author: kib Date: Wed Dec 2 16:40:23 2009 New Revision: 200039 URL: http://svn.freebsd.org/changeset/base/200039 Log: Bump __FreeBSD_version for sigpause(3) addition [1] and PIE support in csu. Requested by: fluffy [1] Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Dec 2 16:34:20 2009 (r200038) +++ head/sys/sys/param.h Wed Dec 2 16:40:23 2009 (r200039) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900002 /* Master, propagated to newvers */ +#define __FreeBSD_version 900003 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 17:16:07 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A5191065693; Wed, 2 Dec 2009 17:16:07 +0000 (UTC) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green.homeunix.org [66.92.150.152]) by mx1.freebsd.org (Postfix) with ESMTP id C9F338FC13; Wed, 2 Dec 2009 17:16:06 +0000 (UTC) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.14.3/8.14.1) with ESMTP id nB2HG4vO050740; Wed, 2 Dec 2009 12:16:04 -0500 (EST) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.14.3/8.14.3/Submit) id nB2HG4Wn050739; Wed, 2 Dec 2009 12:16:04 -0500 (EST) (envelope-from green) Date: Wed, 2 Dec 2009 12:16:03 -0500 From: Brian Fundakowski Feldman To: "Sean C. Farley" Message-ID: <20091202171603.GE35660@green.homeunix.org> References: <200912010504.nB154VnS053167@svn.freebsd.org> <4B14B32C.3060409@freebsd.org> <20091201.193518.387188323.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, rwatson@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 17:16:07 -0000 On Wed, Dec 02, 2009 at 09:33:29AM -0600, Sean C. Farley wrote: > On Tue, 1 Dec 2009, M. Warner Losh wrote: > >> In message: >> Robert Watson writes: >> : On Mon, 30 Nov 2009, Colin Percival wrote: >> : >> : > Brian Feldman wrote: >> : >> Do not gratuitously fail *env(3) operations due to corrupt ('='-less) >> : >> **environ entries. This puts non-getenv(3) operations in line with >> : >> getenv(3) in that bad environ entries do not cause all operations to >> : >> fail. There is still some inconsistency in that getenv(3) in the >> : >> absence of any environment-modifying operation does not emit corrupt >> : >> environ entry warnings. >> : >> >> : >> I also fixed another inconsistency in getenv(3) where updating the >> : >> global environ pointer would not be reflected in the return values. >> : >> It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) >> : >> in order to see the change. >> : > >> : > The FreeBSD Security Team is currently dealing with a security : > >> issue relating to this code. Please back out your change (at : > least to >> getenv.c; I don't particularly care about the regression : > tests) until >> we've finished, and then submit the patch to us for : > review along with >> a detailed explanation of what it does. >> : > >> : > We've already had two major security issues arising out of : > >> getenv.c in the past year, and I'd like to make sure we don't have : > a >> third. >> : >> : I think it's fair to say that the POSIXization of the environment : code >> has been an unmitigated disaster, and speaks to the necessity : for >> careful review of those sorts of code changes. >> >> Why we're not just reverting the whole thing as a bad idea is beyond me. >> Clearly the tiny incremental benefits have been far overshadowed by this >> fiasco. > > Which "whole thing"? The code or the POSIX-compliance? Technically, it is > not pure compliance because the code has a few BSD requirements in it such > as keeping old name=value entries even when new ones are created. > > It was my fault for not checking how unsetenv() was used in all of base. > The change to use unsetenv() in rtld.c was committed just prior to my > change which introduced a version of unsetenv() that returned an int to > allow checking. > > I am testing a change to have unsetenv() not stop in its attempt to unset a > variable which should mimic the old behavior. > > One difference between our man page and IEEE Std 1003.1-2008 is the part > concerning that the "environment shall be unchanged" which I will introduce > to the man page: > > Upon successful completion, zero shall be returned. Otherwise, -1 > shall be returned, errno set to indicate the error, and the > environment shall be unchanged. > > After my change, unsetenv() will not return an error if environ is corrupt. > It will wipe the variable. The only time errors will be returned are when > the name passed to unsetenv() is invalid or when memory allocation fails. > > One question is whether the code should abort() when it detects a corrupt > environ array or do its best to complete the request from the caller. The consensus seems to be that either of those two behaviors is okay. I lean more heavily toward repairing environ and moving on because it seems likely that as often as not, *env(3) will not occur immediately after (unintentional) environ corruption and abort() won't make debugging much easier, only make lives harder. Of course, we could also see what Solaris, Linux, NetBSD and friends do... Using abort() and assert() against data provided directly by the user (that is, data that is not supposed to be already "owned" by the library) is somewhat evil. It annoys me to no end as a developer when libraries do that (one of the guiltiest examples being libdbus.) -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 17:50:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F5E10656C8; Wed, 2 Dec 2009 17:50:53 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47A508FC1E; Wed, 2 Dec 2009 17:50:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2HorNN044996; Wed, 2 Dec 2009 17:50:53 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2HorZ2044994; Wed, 2 Dec 2009 17:50:53 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912021750.nB2HorZ2044994@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 2 Dec 2009 17:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200040 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 17:50:53 -0000 Author: luigi Date: Wed Dec 2 17:50:52 2009 New Revision: 200040 URL: http://svn.freebsd.org/changeset/base/200040 Log: - initialize src_ip in the main loop to prevent a compiler warning (gcc 4.x under linux, not sure how real is the complaint). - rename a macro argument to prevent name clashes. - add the macro name on a couple of #endif - add a blank line for readability. MFC after: 3 days Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Wed Dec 2 16:40:23 2009 (r200039) +++ head/sys/netinet/ipfw/ip_fw2.c Wed Dec 2 17:50:52 2009 (r200040) @@ -186,6 +186,7 @@ SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, de &default_to_accept, 0, "Make the default rule accept all packets."); TUNABLE_INT("net.inet.ip.fw.default_to_accept", &default_to_accept); + #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); @@ -195,8 +196,9 @@ SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, "Deny packets with unknown IPv6 Extension Headers"); -#endif -#endif +#endif /* INET6 */ + +#endif /* SYSCTL_NODE */ /* * Description of dynamic rules. @@ -2260,6 +2262,7 @@ ipfw_chk(struct ip_fw_args *args) return (IP_FW_PASS); /* accept */ dst_ip.s_addr = 0; /* make sure it is initialized */ + src_ip.s_addr = 0; /* make sure it is initialized */ pktlen = m->m_pkthdr.len; args->f_id.fib = M_GETFIB(m); /* note mbuf not altered) */ proto = args->f_id.proto = 0; /* mark f_id invalid */ @@ -2271,15 +2274,15 @@ ipfw_chk(struct ip_fw_args *args) * pointer might become stale after other pullups (but we never use it * this way). */ -#define PULLUP_TO(len, p, T) \ +#define PULLUP_TO(_len, p, T) \ do { \ - int x = (len) + sizeof(T); \ + int x = (_len) + sizeof(T); \ if ((m)->m_len < x) { \ args->m = m = m_pullup(m, x); \ if (m == NULL) \ goto pullup_failed; \ } \ - p = (mtod(m, char *) + (len)); \ + p = (mtod(m, char *) + (_len)); \ } while (0) /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 18:09:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ADDF106566B; Wed, 2 Dec 2009 18:09:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 699278FC19; Wed, 2 Dec 2009 18:09:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2I9Mkb049581; Wed, 2 Dec 2009 18:09:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2I9MKt049579; Wed, 2 Dec 2009 18:09:22 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912021809.nB2I9MKt049579@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 2 Dec 2009 18:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200041 - head/sys/fs/portalfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 18:09:22 -0000 Author: trasz Date: Wed Dec 2 18:09:22 2009 New Revision: 200041 URL: http://svn.freebsd.org/changeset/base/200041 Log: Don't use ap->a_td->td_ucred when we were passed ap->a_cred. Modified: head/sys/fs/portalfs/portal_vnops.c Modified: head/sys/fs/portalfs/portal_vnops.c ============================================================================== --- head/sys/fs/portalfs/portal_vnops.c Wed Dec 2 17:50:52 2009 (r200040) +++ head/sys/fs/portalfs/portal_vnops.c Wed Dec 2 18:09:22 2009 (r200041) @@ -246,7 +246,7 @@ portal_open(ap) /* * Create a new socket. */ - error = socreate(AF_UNIX, &so, SOCK_STREAM, 0, ap->a_td->td_ucred, + error = socreate(AF_UNIX, &so, SOCK_STREAM, 0, ap->a_cred, ap->a_td); if (error) goto bad; From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 18:11:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A81321065670; Wed, 2 Dec 2009 18:11:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96C1B8FC08; Wed, 2 Dec 2009 18:11:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2IBE3X050110; Wed, 2 Dec 2009 18:11:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2IBEx8050108; Wed, 2 Dec 2009 18:11:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912021811.nB2IBEx8050108@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 2 Dec 2009 18:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200042 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 18:11:14 -0000 Author: trasz Date: Wed Dec 2 18:11:14 2009 New Revision: 200042 URL: http://svn.freebsd.org/changeset/base/200042 Log: Add missing parameter description. Modified: head/share/man/man9/VOP_OPENCLOSE.9 Modified: head/share/man/man9/VOP_OPENCLOSE.9 ============================================================================== --- head/share/man/man9/VOP_OPENCLOSE.9 Wed Dec 2 18:09:22 2009 (r200041) +++ head/share/man/man9/VOP_OPENCLOSE.9 Wed Dec 2 18:11:14 2009 (r200042) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2007 +.Dd December 2, 2009 .Os .Dt VOP_OPEN 9 .Sh NAME @@ -55,6 +55,8 @@ The arguments are: The vnode of the file. .It Fa mode The access mode required by the calling process. +.It Fa cred +The caller's credentials. .It Fa td The thread which is accessing the file. .It Fa fp From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 19:11:54 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C6CF1065693; Wed, 2 Dec 2009 19:11:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4C7E58FC27; Wed, 2 Dec 2009 19:11:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nB2J3HNJ089051; Wed, 2 Dec 2009 12:03:17 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 02 Dec 2009 12:03:36 -0700 (MST) Message-Id: <20091202.120336.-491321773.imp@bsdimp.com> To: scf@FreeBSD.org From: "M. Warner Losh" In-Reply-To: References: <20091201.193518.387188323.imp@bsdimp.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: green@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, rwatson@FreeBSD.org, cperciva@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r199983 - in head: lib/libc/stdlib tools/regression/environ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 19:11:54 -0000 In message: "Sean C. Farley" writes: : On Tue, 1 Dec 2009, M. Warner Losh wrote: : : > In message: : > Robert Watson writes: : > : On Mon, 30 Nov 2009, Colin Percival wrote: : > : : > : > Brian Feldman wrote: : > : >> Do not gratuitously fail *env(3) operations due to corrupt ('='-less) : > : >> **environ entries. This puts non-getenv(3) operations in line with : > : >> getenv(3) in that bad environ entries do not cause all operations to : > : >> fail. There is still some inconsistency in that getenv(3) in the : > : >> absence of any environment-modifying operation does not emit corrupt : > : >> environ entry warnings. : > : >> : > : >> I also fixed another inconsistency in getenv(3) where updating the : > : >> global environ pointer would not be reflected in the return values. : > : >> It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) : > : >> in order to see the change. : > : > : > : > The FreeBSD Security Team is currently dealing with a security : > : > issue relating to this code. Please back out your change (at : > : > least to getenv.c; I don't particularly care about the regression : > : > tests) until we've finished, and then submit the patch to us for : > : > review along with a detailed explanation of what it does. : > : > : > : > We've already had two major security issues arising out of : > : > getenv.c in the past year, and I'd like to make sure we don't have : > : > a third. : > : : > : I think it's fair to say that the POSIXization of the environment : > : code has been an unmitigated disaster, and speaks to the necessity : > : for careful review of those sorts of code changes. : > : > Why we're not just reverting the whole thing as a bad idea is beyond : > me. Clearly the tiny incremental benefits have been far overshadowed : > by this fiasco. : : Which "whole thing"? The code or the POSIX-compliance? Technically, it : is not pure compliance because the code has a few BSD requirements in it : such as keeping old name=value entries even when new ones are created. I'm calling for something fairly radical: Go back to the code that was working before and abandon all this POSIX code. If someone wants to reimplement it correctly, securely and audits the system to prove it, then it can go back in. We've had two black eyes from the current code and I have little confidence that all the subtle problems have been resolved with it. My gut tells me there are more lurking, although that can be hard to quantify into an actionable item. I don't think there's much support for this position, so the next best thing is what consensus appears to be calling for: fix the current code in a fail-safe manner. Warner From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 19:28:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 111E21065695; Wed, 2 Dec 2009 19:28:56 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2E818FC26; Wed, 2 Dec 2009 19:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2JStP9070436; Wed, 2 Dec 2009 19:28:55 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2JSte0070434; Wed, 2 Dec 2009 19:28:55 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200912021928.nB2JSte0070434@svn.freebsd.org> From: Tony Finch Date: Wed, 2 Dec 2009 19:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200043 - stable/8/games/factor X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 19:28:56 -0000 Author: fanf Date: Wed Dec 2 19:28:55 2009 New Revision: 200043 URL: http://svn.freebsd.org/changeset/base/200043 Log: MFC 199815: Fix performance bugs in factor(6). Modified: stable/8/games/factor/factor.c Directory Properties: stable/8/games/factor/ (props changed) Modified: stable/8/games/factor/factor.c ============================================================================== --- stable/8/games/factor/factor.c Wed Dec 2 18:11:14 2009 (r200042) +++ stable/8/games/factor/factor.c Wed Dec 2 19:28:55 2009 (r200043) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -35,18 +31,20 @@ */ #ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1989, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)factor.c 8.4 (Berkeley) 5/4/95"; -__RCSID("$NetBSD: factor.c,v 1.13 2002/06/18 23:07:36 simonb Exp $"); +#include +#ifdef __COPYRIGHT +__COPYRIGHT("@(#) Copyright (c) 1989, 1993\ + The Regents of the University of California. All rights reserved."); +#endif +#ifdef __SCCSID +__SCCSID("@(#)factor.c 8.4 (Berkeley) 5/4/95"); +#endif +#ifdef __RCSID +__RCSID("$NetBSD: factor.c,v 1.19 2009/08/12 05:54:31 dholland Exp $"); +#endif +#ifdef __FBSDID +__FBSDID("$FreeBSD$"); #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ /* @@ -63,7 +61,7 @@ static const char rcsid[] = * * number: factor1 factor1 factor2 factor3 factor3 factor3 ... * - * where factor1 < factor2 < factor3 < ... + * where factor1 <= factor2 <= factor3 <= ... * * If no args are given, the list of numbers are read from stdin. */ @@ -214,7 +212,9 @@ pr_fact(BIGNUM *val) bnfact = BN_new(); BN_set_word(bnfact, *(fact - 1)); BN_sqr(bnfact, bnfact, ctx); - if (BN_cmp(bnfact, val) > 0) + if (BN_cmp(bnfact, val) > 0 || + BN_is_prime(val, PRIME_CHECKS, + NULL, NULL, NULL) == 1) pr_print(val); else pollard_pminus1(val); @@ -257,22 +257,28 @@ usage(void) #ifdef HAVE_OPENSSL -/* pollard rho, algorithm from Jim Gillogly, May 2000 */ +/* pollard p-1, algorithm from Jim Gillogly, May 2000 */ static void pollard_pminus1(BIGNUM *val) { - BIGNUM *base, *num, *i, *x; + BIGNUM *base, *rbase, *num, *i, *x; base = BN_new(); + rbase = BN_new(); num = BN_new(); i = BN_new(); x = BN_new(); + BN_set_word(rbase, 1); +newbase: + BN_add_word(rbase, 1); BN_set_word(i, 2); - BN_set_word(base, 2); + BN_copy(base, rbase); for (;;) { BN_mod_exp(base, base, i, val, ctx); + if (BN_is_one(base)) + goto newbase; BN_copy(x, base); BN_sub_word(x, 1); From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 19:30:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88C79106566B; Wed, 2 Dec 2009 19:30:33 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 774118FC28; Wed, 2 Dec 2009 19:30:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2JUXWq070987; Wed, 2 Dec 2009 19:30:33 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2JUXtL070985; Wed, 2 Dec 2009 19:30:33 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <200912021930.nB2JUXtL070985@svn.freebsd.org> From: Tony Finch Date: Wed, 2 Dec 2009 19:30:33 +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: r200044 - stable/7/games/factor X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 19:30:33 -0000 Author: fanf Date: Wed Dec 2 19:30:33 2009 New Revision: 200044 URL: http://svn.freebsd.org/changeset/base/200044 Log: MFC 199815: Fix performance bugs in factor(6). Modified: stable/7/games/factor/factor.c Directory Properties: stable/7/games/factor/ (props changed) Modified: stable/7/games/factor/factor.c ============================================================================== --- stable/7/games/factor/factor.c Wed Dec 2 19:28:55 2009 (r200043) +++ stable/7/games/factor/factor.c Wed Dec 2 19:30:33 2009 (r200044) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -35,18 +31,20 @@ */ #ifndef lint -static const char copyright[] = -"@(#) Copyright (c) 1989, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)factor.c 8.4 (Berkeley) 5/4/95"; -__RCSID("$NetBSD: factor.c,v 1.13 2002/06/18 23:07:36 simonb Exp $"); +#include +#ifdef __COPYRIGHT +__COPYRIGHT("@(#) Copyright (c) 1989, 1993\ + The Regents of the University of California. All rights reserved."); +#endif +#ifdef __SCCSID +__SCCSID("@(#)factor.c 8.4 (Berkeley) 5/4/95"); +#endif +#ifdef __RCSID +__RCSID("$NetBSD: factor.c,v 1.19 2009/08/12 05:54:31 dholland Exp $"); +#endif +#ifdef __FBSDID +__FBSDID("$FreeBSD$"); #endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ /* @@ -63,7 +61,7 @@ static const char rcsid[] = * * number: factor1 factor1 factor2 factor3 factor3 factor3 ... * - * where factor1 < factor2 < factor3 < ... + * where factor1 <= factor2 <= factor3 <= ... * * If no args are given, the list of numbers are read from stdin. */ @@ -214,7 +212,9 @@ pr_fact(BIGNUM *val) bnfact = BN_new(); BN_set_word(bnfact, *(fact - 1)); BN_sqr(bnfact, bnfact, ctx); - if (BN_cmp(bnfact, val) > 0) + if (BN_cmp(bnfact, val) > 0 || + BN_is_prime(val, PRIME_CHECKS, + NULL, NULL, NULL) == 1) pr_print(val); else pollard_pminus1(val); @@ -257,22 +257,28 @@ usage(void) #ifdef HAVE_OPENSSL -/* pollard rho, algorithm from Jim Gillogly, May 2000 */ +/* pollard p-1, algorithm from Jim Gillogly, May 2000 */ static void pollard_pminus1(BIGNUM *val) { - BIGNUM *base, *num, *i, *x; + BIGNUM *base, *rbase, *num, *i, *x; base = BN_new(); + rbase = BN_new(); num = BN_new(); i = BN_new(); x = BN_new(); + BN_set_word(rbase, 1); +newbase: + BN_add_word(rbase, 1); BN_set_word(i, 2); - BN_set_word(base, 2); + BN_copy(base, rbase); for (;;) { BN_mod_exp(base, base, i, val, ctx); + if (BN_is_one(base)) + goto newbase; BN_copy(x, base); BN_sub_word(x, 1); From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 20:24:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B52D91065672; Wed, 2 Dec 2009 20:24:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46088FC0C; Wed, 2 Dec 2009 20:24:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2KObiY088617; Wed, 2 Dec 2009 20:24:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2KOblx088615; Wed, 2 Dec 2009 20:24:37 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912022024.nB2KOblx088615@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 2 Dec 2009 20:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200045 - head/sys/dev/iir X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 20:24:37 -0000 Author: marcel Date: Wed Dec 2 20:24:37 2009 New Revision: 200045 URL: http://svn.freebsd.org/changeset/base/200045 Log: Include , to get the declarations of ostype and osrelease. Remove the duplicate declarations from this file. Modified: head/sys/dev/iir/iir_ctrl.c Modified: head/sys/dev/iir/iir_ctrl.c ============================================================================== --- head/sys/dev/iir/iir_ctrl.c Wed Dec 2 19:30:33 2009 (r200044) +++ head/sys/dev/iir/iir_ctrl.c Wed Dec 2 20:24:37 2009 (r200045) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,8 +84,6 @@ static int iir_devsw_installed = 0; static int sdev_made = 0; #endif extern int gdt_cnt; -extern char ostype[]; -extern char osrelease[]; extern gdt_statist_t gdt_stat; /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 21:22:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9568106568F; Wed, 2 Dec 2009 21:22:10 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D56458FC17; Wed, 2 Dec 2009 21:22:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2LMAtm013570; Wed, 2 Dec 2009 21:22:10 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2LMAab013567; Wed, 2 Dec 2009 21:22:10 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912022122.nB2LMAab013567@svn.freebsd.org> From: Andrew Thompson Date: Wed, 2 Dec 2009 21:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200046 - in head/sys: i386/conf pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 21:22:11 -0000 Author: thompsa Date: Wed Dec 2 21:22:10 2009 New Revision: 200046 URL: http://svn.freebsd.org/changeset/base/200046 Log: Fix cut'n paste on the AR9280 entry. Submitted by: pluknet Modified: head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Wed Dec 2 20:24:37 2009 (r200045) +++ head/sys/i386/conf/NOTES Wed Dec 2 21:22:10 2009 (r200046) @@ -579,7 +579,7 @@ device ath_hal # pci/cardbus chip supp #device ath_ar5416 # AR5416 chips options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #device ath_ar9160 # AR9160 chips -#device ath_ar9280 # AR9160 chips +#device ath_ar9280 # AR9280 chips device ath_rate_sample # SampleRate tx rate control for ath device ce device cp Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Wed Dec 2 20:24:37 2009 (r200045) +++ head/sys/pc98/conf/NOTES Wed Dec 2 21:22:10 2009 (r200046) @@ -433,7 +433,7 @@ device ath_hal # pci/cardbus chip supp #device ath_ar5416 # AR5416 chips options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #device ath_ar9160 # AR9160 chips -#device ath_ar9280 # AR9160 chips +#device ath_ar9280 # AR9280 chips device ath_rate_sample # SampleRate tx rate control for ath # From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 21:58:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2637F106566B; Wed, 2 Dec 2009 21:58:01 +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 EF5F28FC13; Wed, 2 Dec 2009 21:58:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2Lw08i031722; Wed, 2 Dec 2009 21:58:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2Lw0Ex031720; Wed, 2 Dec 2009 21:58:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912022158.nB2Lw0Ex031720@svn.freebsd.org> From: Xin LI Date: Wed, 2 Dec 2009 21:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200047 - stable/8/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 21:58:01 -0000 Author: delphij Date: Wed Dec 2 21:58:00 2009 New Revision: 200047 URL: http://svn.freebsd.org/changeset/base/200047 Log: MFC r199066 + 199339: Apply a NetBSD fix (revision 1.12) to handle multi-session bzip2 files as created by pbzip2. Modified: stable/8/usr.bin/gzip/unbzip2.c Directory Properties: stable/8/usr.bin/gzip/ (props changed) Modified: stable/8/usr.bin/gzip/unbzip2.c ============================================================================== --- stable/8/usr.bin/gzip/unbzip2.c Wed Dec 2 21:22:10 2009 (r200046) +++ stable/8/usr.bin/gzip/unbzip2.c Wed Dec 2 21:58:00 2009 (r200047) @@ -1,4 +1,4 @@ -/* $NetBSD: unbzip2.c,v 1.11 2008/04/28 20:24:13 martin Exp $ */ +/* $NetBSD: unbzip2.c,v 1.12 2009/10/11 05:17:20 mrg Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ static off_t unbzip2(int in, int out, char *pre, size_t prelen, off_t *bytes_in) { - int ret, end_of_file; + int ret, end_of_file, cold = 0; off_t bytes_out = 0; bz_stream bzs; static char *inbuf, *outbuf; @@ -64,7 +64,7 @@ unbzip2(int in, int out, char *pre, size if (bytes_in) *bytes_in = prelen; - while (ret >= BZ_OK && ret != BZ_STREAM_END) { + while (ret == BZ_OK) { if (bzs.avail_in == 0 && !end_of_file) { ssize_t n; @@ -86,9 +86,19 @@ unbzip2(int in, int out, char *pre, size switch (ret) { case BZ_STREAM_END: case BZ_OK: - if (ret == BZ_OK && end_of_file) - maybe_err("read"); - if (!tflag) { + if (ret == BZ_OK && end_of_file) { + /* + * If we hit this after a stream end, consider + * it as the end of the whole file and don't + * bail out. + */ + if (cold == 1) + ret = BZ_STREAM_END; + else + maybe_errx("truncated file"); + } + cold = 0; + if (!tflag && bzs.avail_out != BUFLEN) { ssize_t n; n = write(out, outbuf, BUFLEN - bzs.avail_out); @@ -96,7 +106,14 @@ unbzip2(int in, int out, char *pre, size maybe_err("write"); bytes_out += n; } - break; + if (ret == BZ_STREAM_END && !end_of_file) { + if (BZ2_bzDecompressEnd(&bzs) != BZ_OK || + BZ2_bzDecompressInit(&bzs, 0, 0) != BZ_OK) + maybe_errx("bzip2 re-init"); + cold = 1; + ret = BZ_OK; + } + break; case BZ_DATA_ERROR: maybe_warnx("bzip2 data integrity error"); @@ -109,7 +126,10 @@ unbzip2(int in, int out, char *pre, size case BZ_MEM_ERROR: maybe_warnx("bzip2 out of memory"); break; - + + default: + maybe_warnx("unknown bzip2 error: %d", ret); + break; } } From owner-svn-src-all@FreeBSD.ORG Wed Dec 2 21:58:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C92A1065695; Wed, 2 Dec 2009 21:58:35 +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 3155F8FC1B; Wed, 2 Dec 2009 21:58:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB2LwZTR032015; Wed, 2 Dec 2009 21:58:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB2LwZJB032013; Wed, 2 Dec 2009 21:58:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912022158.nB2LwZJB032013@svn.freebsd.org> From: Xin LI Date: Wed, 2 Dec 2009 21:58: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: r200048 - stable/7/usr.bin/gzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2009 21:58:35 -0000 Author: delphij Date: Wed Dec 2 21:58:34 2009 New Revision: 200048 URL: http://svn.freebsd.org/changeset/base/200048 Log: MFC r199066 + 199339: Apply a NetBSD fix (revision 1.12) to handle multi-session bzip2 files as created by pbzip2. Modified: stable/7/usr.bin/gzip/unbzip2.c Directory Properties: stable/7/usr.bin/gzip/ (props changed) Modified: stable/7/usr.bin/gzip/unbzip2.c ============================================================================== --- stable/7/usr.bin/gzip/unbzip2.c Wed Dec 2 21:58:00 2009 (r200047) +++ stable/7/usr.bin/gzip/unbzip2.c Wed Dec 2 21:58:34 2009 (r200048) @@ -1,4 +1,4 @@ -/* $NetBSD: unbzip2.c,v 1.11 2008/04/28 20:24:13 martin Exp $ */ +/* $NetBSD: unbzip2.c,v 1.12 2009/10/11 05:17:20 mrg Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ static off_t unbzip2(int in, int out, char *pre, size_t prelen, off_t *bytes_in) { - int ret, end_of_file; + int ret, end_of_file, cold = 0; off_t bytes_out = 0; bz_stream bzs; static char *inbuf, *outbuf; @@ -64,7 +64,7 @@ unbzip2(int in, int out, char *pre, size if (bytes_in) *bytes_in = prelen; - while (ret >= BZ_OK && ret != BZ_STREAM_END) { + while (ret == BZ_OK) { if (bzs.avail_in == 0 && !end_of_file) { ssize_t n; @@ -86,9 +86,19 @@ unbzip2(int in, int out, char *pre, size switch (ret) { case BZ_STREAM_END: case BZ_OK: - if (ret == BZ_OK && end_of_file) - maybe_err("read"); - if (!tflag) { + if (ret == BZ_OK && end_of_file) { + /* + * If we hit this after a stream end, consider + * it as the end of the whole file and don't + * bail out. + */ + if (cold == 1) + ret = BZ_STREAM_END; + else + maybe_errx("truncated file"); + } + cold = 0; + if (!tflag && bzs.avail_out != BUFLEN) { ssize_t n; n = write(out, outbuf, BUFLEN - bzs.avail_out); @@ -96,7 +106,14 @@ unbzip2(int in, int out, char *pre, size maybe_err("write"); bytes_out += n; } - break; + if (ret == BZ_STREAM_END && !end_of_file) { + if (BZ2_bzDecompressEnd(&bzs) != BZ_OK || + BZ2_bzDecompressInit(&bzs, 0, 0) != BZ_OK) + maybe_errx("bzip2 re-init"); + cold = 1; + ret = BZ_OK; + } + break; case BZ_DATA_ERROR: maybe_warnx("bzip2 data integrity error"); @@ -109,7 +126,10 @@ unbzip2(int in, int out, char *pre, size case BZ_MEM_ERROR: maybe_warnx("bzip2 out of memory"); break; - + + default: + maybe_warnx("unknown bzip2 error: %d", ret); + break; } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 04:06:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09728106566B; Thu, 3 Dec 2009 04:06:49 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7C478FC14; Thu, 3 Dec 2009 04:06:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB346mNk074751; Thu, 3 Dec 2009 04:06:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB346maI074746; Thu, 3 Dec 2009 04:06:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912030406.nB346maI074746@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 3 Dec 2009 04:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200051 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 04:06:49 -0000 Author: marcel Date: Thu Dec 3 04:06:48 2009 New Revision: 200051 URL: http://svn.freebsd.org/changeset/base/200051 Log: Make sure bus space accesses use unorder memory loads and stores. Memory accesses are posted in program order by virtue of the uncacheable memory attribute. Since GCC, by default, adds acquire and release semantics to volatile memory loads and stores, we need to use inline assembly to guarantee it. With inline assembly, we don't need volatile pointers anymore. Itanium does not support semaphore instructions to uncacheable memory. Modified: head/sys/ia64/ia64/machdep.c head/sys/ia64/include/bus.h head/sys/ia64/include/cpufunc.h head/sys/ia64/include/ia64_cpu.h Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Thu Dec 3 02:19:12 2009 (r200050) +++ head/sys/ia64/ia64/machdep.c Thu Dec 3 04:06:48 2009 (r200051) @@ -919,14 +919,14 @@ ia64_init(void) return (ret); } -__volatile void * +void * ia64_ioport_address(u_int port) { uint64_t addr; addr = (port > 0xffff) ? IA64_PHYS_TO_RR6((uint64_t)port) : ia64_port_base | ((port & 0xfffc) << 10) | (port & 0xFFF); - return ((__volatile void *)addr); + return ((void *)addr); } uint64_t Modified: head/sys/ia64/include/bus.h ============================================================================== --- head/sys/ia64/include/bus.h Thu Dec 3 02:19:12 2009 (r200050) +++ head/sys/ia64/include/bus.h Thu Dec 3 04:06:48 2009 (r200051) @@ -169,37 +169,37 @@ bus_space_barrier(bus_space_tag_t bst, b static __inline uint8_t bus_space_read_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld1(bsp)); } static __inline uint16_t bus_space_read_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld2(bsp)); } static __inline uint32_t bus_space_read_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld4(bsp)); } static __inline uint64_t bus_space_read_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld8(bsp)); } @@ -212,40 +212,40 @@ static __inline void bus_space_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st1(bsp, val); } static __inline void bus_space_write_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st2(bsp, val); } static __inline void bus_space_write_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st4(bsp, val); } static __inline void bus_space_write_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st8(bsp, val); } @@ -258,44 +258,44 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld1(bsp); } static __inline void bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld2(bsp); } static __inline void bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld4(bsp); } static __inline void bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld8(bsp); } @@ -308,44 +308,44 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st1(bsp, *bufp++); } static __inline void bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st2(bsp, *bufp++); } static __inline void bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st4(bsp, *bufp++); } static __inline void bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st8(bsp, *bufp++); } @@ -359,11 +359,11 @@ static __inline void bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld1(bsp); ofs += 1; } } @@ -372,11 +372,11 @@ static __inline void bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld2(bsp); ofs += 2; } } @@ -385,11 +385,11 @@ static __inline void bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld4(bsp); ofs += 4; } } @@ -398,11 +398,11 @@ static __inline void bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld8(bsp); ofs += 8; } } @@ -418,11 +418,11 @@ static __inline void bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st1(bsp, *bufp++); ofs += 1; } } @@ -431,11 +431,11 @@ static __inline void bus_space_write_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st2(bsp, *bufp++); ofs += 2; } } @@ -444,11 +444,11 @@ static __inline void bus_space_write_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st4(bsp, *bufp++); ofs += 4; } } @@ -457,11 +457,11 @@ static __inline void bus_space_write_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st8(bsp, *bufp++); ofs += 8; } } @@ -476,44 +476,44 @@ static __inline void bus_space_set_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st1(bsp, val); } static __inline void bus_space_set_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st2(bsp, val); } static __inline void bus_space_set_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st4(bsp, val); } static __inline void bus_space_set_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st8(bsp, val); } @@ -527,11 +527,11 @@ static __inline void bus_space_set_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st1(bsp, val); ofs += 1; } } @@ -540,11 +540,11 @@ static __inline void bus_space_set_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st2(bsp, val); ofs += 2; } } @@ -553,11 +553,11 @@ static __inline void bus_space_set_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st4(bsp, val); ofs += 4; } } @@ -566,11 +566,11 @@ static __inline void bus_space_set_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st8(bsp, val); ofs += 8; } } @@ -588,7 +588,7 @@ bus_space_copy_region_1(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint8_t __volatile *dstp, *srcp; + uint8_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -602,7 +602,7 @@ bus_space_copy_region_1(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st1(dstp, ia64_ld1(srcp)); src -= 1; dst -= 1; } @@ -615,7 +615,7 @@ bus_space_copy_region_1(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st1(dstp, ia64_ld1(srcp)); src += 1; dst += 1; } @@ -627,7 +627,7 @@ bus_space_copy_region_2(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint16_t __volatile *dstp, *srcp; + uint16_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -641,7 +641,7 @@ bus_space_copy_region_2(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st2(dstp, ia64_ld2(srcp)); src -= 2; dst -= 2; } @@ -654,7 +654,7 @@ bus_space_copy_region_2(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st2(dstp, ia64_ld2(srcp)); src += 2; dst += 2; } @@ -666,7 +666,7 @@ bus_space_copy_region_4(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint32_t __volatile *dstp, *srcp; + uint32_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -680,7 +680,7 @@ bus_space_copy_region_4(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st4(dstp, ia64_ld4(srcp)); src -= 4; dst -= 4; } @@ -693,7 +693,7 @@ bus_space_copy_region_4(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st4(dstp, ia64_ld4(srcp)); src += 4; dst += 4; } @@ -705,7 +705,7 @@ bus_space_copy_region_8(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint64_t __volatile *dstp, *srcp; + uint64_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -719,7 +719,7 @@ bus_space_copy_region_8(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st8(dstp, ia64_ld8(srcp)); src -= 8; dst -= 8; } @@ -732,7 +732,7 @@ bus_space_copy_region_8(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st8(dstp, ia64_ld8(srcp)); src += 8; dst += 8; } Modified: head/sys/ia64/include/cpufunc.h ============================================================================== --- head/sys/ia64/include/cpufunc.h Thu Dec 3 02:19:12 2009 (r200050) +++ head/sys/ia64/include/cpufunc.h Thu Dec 3 04:06:48 2009 (r200051) @@ -54,8 +54,8 @@ breakpoint(void) #define HAVE_INLINE_FFS #define ffs(x) __builtin_ffs(x) -#define __MEMIO_ADDR(x) (__volatile void*)(IA64_PHYS_TO_RR6(x)) -extern __volatile void *ia64_ioport_address(u_int); +#define __MEMIO_ADDR(x) (void*)(IA64_PHYS_TO_RR6(x)) +extern void *ia64_ioport_address(u_int); #define __PIO_ADDR(x) ia64_ioport_address(x) /* Modified: head/sys/ia64/include/ia64_cpu.h ============================================================================== --- head/sys/ia64/include/ia64_cpu.h Thu Dec 3 02:19:12 2009 (r200050) +++ head/sys/ia64/include/ia64_cpu.h Thu Dec 3 04:06:48 2009 (r200051) @@ -282,6 +282,74 @@ ia64_ptc_l(u_int64_t va, u_int64_t log2s } /* + * Unordered memory load. + */ + +static __inline uint8_t +ia64_ld1(uint8_t *p) +{ + uint8_t v; + + __asm __volatile("ld1 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +static __inline uint16_t +ia64_ld2(uint16_t *p) +{ + uint16_t v; + + __asm __volatile("ld2 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +static __inline uint32_t +ia64_ld4(uint32_t *p) +{ + uint32_t v; + + __asm __volatile("ld4 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +static __inline uint64_t +ia64_ld8(uint64_t *p) +{ + uint64_t v; + + __asm __volatile("ld8 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +/* + * Unordered memory store. + */ + +static __inline void +ia64_st1(uint8_t *p, uint8_t v) +{ + __asm __volatile("st1 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +static __inline void +ia64_st2(uint16_t *p, uint16_t v) +{ + __asm __volatile("st2 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +static __inline void +ia64_st4(uint32_t *p, uint32_t v) +{ + __asm __volatile("st4 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +static __inline void +ia64_st8(uint64_t *p, uint64_t v) +{ + __asm __volatile("st8 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +/* * Read the value of psr. */ static __inline u_int64_t From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 08:01:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D62B91065693; Thu, 3 Dec 2009 08:01:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C61EC8FC1A; Thu, 3 Dec 2009 08:01:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB381TuW043852; Thu, 3 Dec 2009 08:01:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB381Tdf043850; Thu, 3 Dec 2009 08:01:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912030801.nB381Tdf043850@svn.freebsd.org> From: Andriy Gapon Date: Thu, 3 Dec 2009 08:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200052 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 08:01:29 -0000 Author: avg Date: Thu Dec 3 08:01:29 2009 New Revision: 200052 URL: http://svn.freebsd.org/changeset/base/200052 Log: ichsmb: add pci ids for some newer supported hardware Submitted by: Dmitry S. Luhtionov MFC after: 5 days Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Thu Dec 3 04:06:48 2009 (r200051) +++ head/sys/dev/ichsmb/ichsmb_pci.c Thu Dec 3 08:01:29 2009 (r200052) @@ -75,6 +75,9 @@ __FBSDID("$FreeBSD$"); #define ID_82801EB 0x24D38086 #define ID_82801FB 0x266A8086 #define ID_82801GB 0x27da8086 +#define ID_82801H 0x283e8086 +#define ID_82801I 0x29308086 +#define ID_82801JI 0x3a308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -152,6 +155,15 @@ ichsmb_pci_probe(device_t dev) case ID_82801GB: device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); break; + case ID_82801H: + device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); + break; + case ID_82801I: + device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); + break; + case ID_82801JI: + device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 08:11:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C712F106566B; Thu, 3 Dec 2009 08:11:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6CDA8FC0C; Thu, 3 Dec 2009 08:11:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB38BKwS046792; Thu, 3 Dec 2009 08:11:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB38BK0h046790; Thu, 3 Dec 2009 08:11:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912030811.nB38BK0h046790@svn.freebsd.org> From: Andriy Gapon Date: Thu, 3 Dec 2009 08:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200053 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 08:11:20 -0000 Author: avg Date: Thu Dec 3 08:11:20 2009 New Revision: 200053 URL: http://svn.freebsd.org/changeset/base/200053 Log: ichsmb: try attaching only to intel hardware in the default case Ideally we should attempt attaching only to known supported devices. But I am not sure that we have all supported PCI IDs already listed, and I am too young to die, err, I don't want to take the heat from causing a trouble to someone. MFC after: 1 week X-ToDo: drop the default case Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Thu Dec 3 08:01:29 2009 (r200052) +++ head/sys/dev/ichsmb/ichsmb_pci.c Thu Dec 3 08:11:20 2009 (r200053) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ +#define VENDORID_INTEL 0x8086 #define ID_82801AA 0x24138086 #define ID_82801AB 0x24238086 #define ID_82801BA 0x24438086 @@ -171,10 +172,11 @@ ichsmb_pci_probe(device_t dev) device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); break; default: - if (pci_get_class(dev) == PCIC_SERIALBUS + if (pci_get_vendor(dev) == VENDORID_INTEL + && pci_get_class(dev) == PCIC_SERIALBUS && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS && pci_get_progif(dev) == PCIS_SERIALBUS_SMBUS_PROGIF) { - device_set_desc(dev, "SMBus controller"); + device_set_desc(dev, "Intel SMBus controller"); return (BUS_PROBE_DEFAULT); /* XXX */ } return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 09:18:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DD2C1065696; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E73AA8FC18; Thu, 3 Dec 2009 09:18:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB39IeF1061820; Thu, 3 Dec 2009 09:18:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB39IejI061814; Thu, 3 Dec 2009 09:18:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912030918.nB39IejI061814@svn.freebsd.org> From: Colin Percival Date: Thu, 3 Dec 2009 09:18:40 +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: r200054 - head/crypto/openssl/ssl head/etc/mtree head/usr.sbin/freebsd-update releng/6.3 releng/6.3/crypto/openssl/ssl releng/6.3/etc/mtree releng/6.3/usr.sbin/freebsd-update releng/6.4... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 09:18:41 -0000 Author: cperciva Date: Thu Dec 3 09:18:40 2009 New Revision: 200054 URL: http://svn.freebsd.org/changeset/base/200054 Log: Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Correctly handle failures from unsetenv resulting from a corrupt environment in rtld-elf. [09:16] Fix permissions in freebsd-update in order to prevent leakage of sensitive files. [09:17] Approved by: so (cperciva) Security: FreeBSD-SA-09:15.ssl Security: FreeBSD-SA-09:16.rtld Security: FreeBSD-SA-09:17.freebsd-udpate Modified: stable/7/crypto/openssl/ssl/s3_lib.c stable/7/crypto/openssl/ssl/s3_pkt.c stable/7/crypto/openssl/ssl/s3_srvr.c stable/7/etc/mtree/BSD.var.dist stable/7/usr.sbin/freebsd-update/freebsd-update.sh Changes in other areas also in this revision: Modified: head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/etc/mtree/BSD.var.dist head/usr.sbin/freebsd-update/freebsd-update.sh releng/6.3/UPDATING releng/6.3/crypto/openssl/ssl/s3_lib.c releng/6.3/crypto/openssl/ssl/s3_pkt.c releng/6.3/crypto/openssl/ssl/s3_srvr.c releng/6.3/etc/mtree/BSD.var.dist releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh releng/6.4/UPDATING releng/6.4/crypto/openssl/ssl/s3_lib.c releng/6.4/crypto/openssl/ssl/s3_pkt.c releng/6.4/crypto/openssl/ssl/s3_srvr.c releng/6.4/etc/mtree/BSD.var.dist releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh releng/7.1/UPDATING releng/7.1/crypto/openssl/ssl/s3_lib.c releng/7.1/crypto/openssl/ssl/s3_pkt.c releng/7.1/crypto/openssl/ssl/s3_srvr.c releng/7.1/etc/mtree/BSD.var.dist releng/7.1/libexec/rtld-elf/rtld.c releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh releng/7.2/UPDATING releng/7.2/crypto/openssl/ssl/s3_lib.c releng/7.2/crypto/openssl/ssl/s3_pkt.c releng/7.2/crypto/openssl/ssl/s3_srvr.c releng/7.2/etc/mtree/BSD.var.dist releng/7.2/libexec/rtld-elf/rtld.c releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh releng/8.0/UPDATING releng/8.0/crypto/openssl/ssl/s3_lib.c releng/8.0/crypto/openssl/ssl/s3_pkt.c releng/8.0/crypto/openssl/ssl/s3_srvr.c releng/8.0/etc/mtree/BSD.var.dist releng/8.0/libexec/rtld-elf/rtld.c releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh stable/6/crypto/openssl/ssl/s3_lib.c stable/6/crypto/openssl/ssl/s3_pkt.c stable/6/crypto/openssl/ssl/s3_srvr.c stable/6/etc/mtree/BSD.var.dist stable/6/usr.sbin/freebsd-update/freebsd-update.sh stable/8/crypto/openssl/ssl/s3_lib.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/etc/mtree/BSD.var.dist stable/8/usr.sbin/freebsd-update/freebsd-update.sh Modified: stable/7/crypto/openssl/ssl/s3_lib.c ============================================================================== --- stable/7/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/7/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -2375,6 +2375,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: stable/7/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/7/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/7/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -976,9 +976,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1109,8 +1107,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: stable/7/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- stable/7/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/7/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -672,6 +672,13 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: stable/7/etc/mtree/BSD.var.dist ============================================================================== --- stable/7/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ stable/7/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: stable/7/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/7/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ stable/7/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -533,6 +533,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 09:18:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31DFD10656A4; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A618FC1C; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB39Iesu061830; Thu, 3 Dec 2009 09:18:40 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB39IeUQ061824; Thu, 3 Dec 2009 09:18:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912030918.nB39IeUQ061824@svn.freebsd.org> From: Colin Percival Date: Thu, 3 Dec 2009 09:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200054 - head/crypto/openssl/ssl head/etc/mtree head/usr.sbin/freebsd-update releng/6.3 releng/6.3/crypto/openssl/ssl releng/6.3/etc/mtree releng/6.3/usr.sbin/freebsd-update releng/6.4... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 09:18:41 -0000 Author: cperciva Date: Thu Dec 3 09:18:40 2009 New Revision: 200054 URL: http://svn.freebsd.org/changeset/base/200054 Log: Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Correctly handle failures from unsetenv resulting from a corrupt environment in rtld-elf. [09:16] Fix permissions in freebsd-update in order to prevent leakage of sensitive files. [09:17] Approved by: so (cperciva) Security: FreeBSD-SA-09:15.ssl Security: FreeBSD-SA-09:16.rtld Security: FreeBSD-SA-09:17.freebsd-udpate Modified: head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/etc/mtree/BSD.var.dist head/usr.sbin/freebsd-update/freebsd-update.sh Changes in other areas also in this revision: Modified: releng/6.3/UPDATING releng/6.3/crypto/openssl/ssl/s3_lib.c releng/6.3/crypto/openssl/ssl/s3_pkt.c releng/6.3/crypto/openssl/ssl/s3_srvr.c releng/6.3/etc/mtree/BSD.var.dist releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh releng/6.4/UPDATING releng/6.4/crypto/openssl/ssl/s3_lib.c releng/6.4/crypto/openssl/ssl/s3_pkt.c releng/6.4/crypto/openssl/ssl/s3_srvr.c releng/6.4/etc/mtree/BSD.var.dist releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh releng/7.1/UPDATING releng/7.1/crypto/openssl/ssl/s3_lib.c releng/7.1/crypto/openssl/ssl/s3_pkt.c releng/7.1/crypto/openssl/ssl/s3_srvr.c releng/7.1/etc/mtree/BSD.var.dist releng/7.1/libexec/rtld-elf/rtld.c releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh releng/7.2/UPDATING releng/7.2/crypto/openssl/ssl/s3_lib.c releng/7.2/crypto/openssl/ssl/s3_pkt.c releng/7.2/crypto/openssl/ssl/s3_srvr.c releng/7.2/etc/mtree/BSD.var.dist releng/7.2/libexec/rtld-elf/rtld.c releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh releng/8.0/UPDATING releng/8.0/crypto/openssl/ssl/s3_lib.c releng/8.0/crypto/openssl/ssl/s3_pkt.c releng/8.0/crypto/openssl/ssl/s3_srvr.c releng/8.0/etc/mtree/BSD.var.dist releng/8.0/libexec/rtld-elf/rtld.c releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh stable/6/crypto/openssl/ssl/s3_lib.c stable/6/crypto/openssl/ssl/s3_pkt.c stable/6/crypto/openssl/ssl/s3_srvr.c stable/6/etc/mtree/BSD.var.dist stable/6/usr.sbin/freebsd-update/freebsd-update.sh stable/7/crypto/openssl/ssl/s3_lib.c stable/7/crypto/openssl/ssl/s3_pkt.c stable/7/crypto/openssl/ssl/s3_srvr.c stable/7/etc/mtree/BSD.var.dist stable/7/usr.sbin/freebsd-update/freebsd-update.sh stable/8/crypto/openssl/ssl/s3_lib.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/etc/mtree/BSD.var.dist stable/8/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/crypto/openssl/ssl/s3_lib.c ============================================================================== --- head/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ head/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -2592,6 +2592,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: head/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- head/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ head/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -983,9 +983,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1116,8 +1114,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: head/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- head/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ head/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -718,6 +718,13 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: head/etc/mtree/BSD.var.dist ============================================================================== --- head/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ head/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -603,6 +603,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 09:18:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E9AB10656AA; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 698C18FC2E; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB39IfqP061870; Thu, 3 Dec 2009 09:18:41 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB39IeLA061834; Thu, 3 Dec 2009 09:18:40 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912030918.nB39IeLA061834@svn.freebsd.org> From: Colin Percival Date: Thu, 3 Dec 2009 09:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200054 - head/crypto/openssl/ssl head/etc/mtree head/usr.sbin/freebsd-update releng/6.3 releng/6.3/crypto/openssl/ssl releng/6.3/etc/mtree releng/6.3/usr.sbin/freebsd-update releng/6.4... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 09:18:41 -0000 Author: cperciva Date: Thu Dec 3 09:18:40 2009 New Revision: 200054 URL: http://svn.freebsd.org/changeset/base/200054 Log: Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Correctly handle failures from unsetenv resulting from a corrupt environment in rtld-elf. [09:16] Fix permissions in freebsd-update in order to prevent leakage of sensitive files. [09:17] Approved by: so (cperciva) Security: FreeBSD-SA-09:15.ssl Security: FreeBSD-SA-09:16.rtld Security: FreeBSD-SA-09:17.freebsd-udpate Modified: releng/6.3/UPDATING releng/6.3/crypto/openssl/ssl/s3_lib.c releng/6.3/crypto/openssl/ssl/s3_pkt.c releng/6.3/crypto/openssl/ssl/s3_srvr.c releng/6.3/etc/mtree/BSD.var.dist releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh releng/6.4/UPDATING releng/6.4/crypto/openssl/ssl/s3_lib.c releng/6.4/crypto/openssl/ssl/s3_pkt.c releng/6.4/crypto/openssl/ssl/s3_srvr.c releng/6.4/etc/mtree/BSD.var.dist releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh releng/7.1/UPDATING releng/7.1/crypto/openssl/ssl/s3_lib.c releng/7.1/crypto/openssl/ssl/s3_pkt.c releng/7.1/crypto/openssl/ssl/s3_srvr.c releng/7.1/etc/mtree/BSD.var.dist releng/7.1/libexec/rtld-elf/rtld.c releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh releng/7.2/UPDATING releng/7.2/crypto/openssl/ssl/s3_lib.c releng/7.2/crypto/openssl/ssl/s3_pkt.c releng/7.2/crypto/openssl/ssl/s3_srvr.c releng/7.2/etc/mtree/BSD.var.dist releng/7.2/libexec/rtld-elf/rtld.c releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh releng/8.0/UPDATING releng/8.0/crypto/openssl/ssl/s3_lib.c releng/8.0/crypto/openssl/ssl/s3_pkt.c releng/8.0/crypto/openssl/ssl/s3_srvr.c releng/8.0/etc/mtree/BSD.var.dist releng/8.0/libexec/rtld-elf/rtld.c releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh Changes in other areas also in this revision: Modified: head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/etc/mtree/BSD.var.dist head/usr.sbin/freebsd-update/freebsd-update.sh stable/6/crypto/openssl/ssl/s3_lib.c stable/6/crypto/openssl/ssl/s3_pkt.c stable/6/crypto/openssl/ssl/s3_srvr.c stable/6/etc/mtree/BSD.var.dist stable/6/usr.sbin/freebsd-update/freebsd-update.sh stable/7/crypto/openssl/ssl/s3_lib.c stable/7/crypto/openssl/ssl/s3_pkt.c stable/7/crypto/openssl/ssl/s3_srvr.c stable/7/etc/mtree/BSD.var.dist stable/7/usr.sbin/freebsd-update/freebsd-update.sh stable/8/crypto/openssl/ssl/s3_lib.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/etc/mtree/BSD.var.dist stable/8/usr.sbin/freebsd-update/freebsd-update.sh Modified: releng/6.3/UPDATING ============================================================================== --- releng/6.3/UPDATING Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.3/UPDATING Thu Dec 3 09:18:40 2009 (r200054) @@ -8,6 +8,13 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20091203: p14 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:17.freebsd-update + Disable SSL renegotiation in order to protect against a serious + protocol flaw. [09:15] + + Fix permissions in freebsd-update in order to prevent leakage of + sensitive files. [09:17] + 20091002: p13 FreeBSD-SA-09:13.pipe, FreeBSD-SA-09:14.devfs, FreeBSD-EN-09:05.null Fix kqueue pipe race conditions. [SA-09:13] Modified: releng/6.3/crypto/openssl/ssl/s3_lib.c ============================================================================== --- releng/6.3/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.3/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -1768,6 +1768,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: releng/6.3/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- releng/6.3/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.3/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -975,9 +975,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1108,8 +1106,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: releng/6.3/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- releng/6.3/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.3/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -654,6 +654,13 @@ static int ssl3_get_client_hello(SSL *s) SSL_COMP *comp=NULL; STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: releng/6.3/etc/mtree/BSD.var.dist ============================================================================== --- releng/6.3/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.3/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -524,6 +524,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists Modified: releng/6.4/UPDATING ============================================================================== --- releng/6.4/UPDATING Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.4/UPDATING Thu Dec 3 09:18:40 2009 (r200054) @@ -8,6 +8,13 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20091203: p8 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:17.freebsd-update + Disable SSL renegotiation in order to protect against a serious + protocol flaw. [09:15] + + Fix permissions in freebsd-update in order to prevent leakage of + sensitive files. [09:17] + 20091002: p7 FreeBSD-SA-09:13.pipe, FreeBSD-SA-09:14.devfs, FreeBSD-EN-09:05.null Fix kqueue pipe race conditions. [SA-09:13] Modified: releng/6.4/crypto/openssl/ssl/s3_lib.c ============================================================================== --- releng/6.4/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.4/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -1768,6 +1768,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: releng/6.4/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- releng/6.4/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.4/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -975,9 +975,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1108,8 +1106,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: releng/6.4/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- releng/6.4/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.4/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -654,6 +654,13 @@ static int ssl3_get_client_hello(SSL *s) SSL_COMP *comp=NULL; STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: releng/6.4/etc/mtree/BSD.var.dist ============================================================================== --- releng/6.4/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.4/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -533,6 +533,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/UPDATING Thu Dec 3 09:18:40 2009 (r200054) @@ -8,6 +8,17 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20091203: p9 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:16.rtld, + FreeBSD-SA-09:17.freebsd-update + Disable SSL renegotiation in order to protect against a serious + protocol flaw. [09:15] + + Correctly handle failures from unsetenv resulting from a corrupt + environment in rtld-elf. [09:16] + + Fix permissions in freebsd-update in order to prevent leakage of + sensitive files. [09:17] + 20091002: p8 FreeBSD-SA-09:14.devfs, FreeBSD-EN-09:05.null Fix devfs / VFS NULL pointer race condition. [SA-09:14] Modified: releng/7.1/crypto/openssl/ssl/s3_lib.c ============================================================================== --- releng/7.1/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -2375,6 +2375,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: releng/7.1/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- releng/7.1/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -976,9 +976,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1109,8 +1107,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: releng/7.1/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- releng/7.1/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -672,6 +672,13 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: releng/7.1/etc/mtree/BSD.var.dist ============================================================================== --- releng/7.1/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: releng/7.1/libexec/rtld-elf/rtld.c ============================================================================== --- releng/7.1/libexec/rtld-elf/rtld.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/libexec/rtld-elf/rtld.c Thu Dec 3 09:18:40 2009 (r200054) @@ -358,11 +358,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * future processes to honor the potentially un-safe variables. */ if (!trust) { - unsetenv(LD_ "PRELOAD"); - unsetenv(LD_ "LIBMAP"); - unsetenv(LD_ "LIBRARY_PATH"); - unsetenv(LD_ "LIBMAP_DISABLE"); - unsetenv(LD_ "DEBUG"); + if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || + unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || + unsetenv(LD_ "DEBUG")) { + _rtld_error("environment corrupt; aborting"); + die(); + } } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; Modified: releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -533,6 +533,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists Modified: releng/7.2/UPDATING ============================================================================== --- releng/7.2/UPDATING Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/UPDATING Thu Dec 3 09:18:40 2009 (r200054) @@ -8,6 +8,17 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20091203: p5 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:16.rtld, + FreeBSD-SA-09:17.freebsd-update + Disable SSL renegotiation in order to protect against a serious + protocol flaw. [09:15] + + Correctly handle failures from unsetenv resulting from a corrupt + environment in rtld-elf. [09:16] + + Fix permissions in freebsd-update in order to prevent leakage of + sensitive files. [09:17] + 20091002: p4 FreeBSD-SA-09:14.devfs FreeBSD-EN-09:05.null Fix devfs / VFS NULL pointer race condition. [SA-09:14] Modified: releng/7.2/crypto/openssl/ssl/s3_lib.c ============================================================================== --- releng/7.2/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -2375,6 +2375,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: releng/7.2/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- releng/7.2/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -976,9 +976,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1109,8 +1107,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: releng/7.2/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- releng/7.2/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -672,6 +672,13 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: releng/7.2/etc/mtree/BSD.var.dist ============================================================================== --- releng/7.2/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: releng/7.2/libexec/rtld-elf/rtld.c ============================================================================== --- releng/7.2/libexec/rtld-elf/rtld.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/libexec/rtld-elf/rtld.c Thu Dec 3 09:18:40 2009 (r200054) @@ -360,11 +360,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * future processes to honor the potentially un-safe variables. */ if (!trust) { - unsetenv(LD_ "PRELOAD"); - unsetenv(LD_ "LIBMAP"); - unsetenv(LD_ "LIBRARY_PATH"); - unsetenv(LD_ "LIBMAP_DISABLE"); - unsetenv(LD_ "DEBUG"); + if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || + unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || + unsetenv(LD_ "DEBUG")) { + _rtld_error("environment corrupt; aborting"); + die(); + } } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; Modified: releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -533,6 +533,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists Modified: releng/8.0/UPDATING ============================================================================== --- releng/8.0/UPDATING Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/UPDATING Thu Dec 3 09:18:40 2009 (r200054) @@ -15,6 +15,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20091203: p1 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:16.rtld, + FreeBSD-SA-09:17.freebsd-update + Disable SSL renegotiation in order to protect against a serious + protocol flaw. [09:15] + + Correctly handle failures from unsetenv resulting from a corrupt + environment in rtld-elf. [09:16] + + Fix permissions in freebsd-update in order to prevent leakage of + sensitive files. [09:17] + 20091125: 8.0-RELEASE. Modified: releng/8.0/crypto/openssl/ssl/s3_lib.c ============================================================================== --- releng/8.0/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -2592,6 +2592,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: releng/8.0/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- releng/8.0/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -983,9 +983,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1116,8 +1114,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: releng/8.0/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- releng/8.0/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -718,6 +718,13 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: releng/8.0/etc/mtree/BSD.var.dist ============================================================================== --- releng/8.0/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: releng/8.0/libexec/rtld-elf/rtld.c ============================================================================== --- releng/8.0/libexec/rtld-elf/rtld.c Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/libexec/rtld-elf/rtld.c Thu Dec 3 09:18:40 2009 (r200054) @@ -366,12 +366,12 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ * future processes to honor the potentially un-safe variables. */ if (!trust) { - unsetenv(LD_ "PRELOAD"); - unsetenv(LD_ "LIBMAP"); - unsetenv(LD_ "LIBRARY_PATH"); - unsetenv(LD_ "LIBMAP_DISABLE"); - unsetenv(LD_ "DEBUG"); - unsetenv(LD_ "ELF_HINTS_PATH"); + if (unsetenv(LD_ "PRELOAD") || unsetenv(LD_ "LIBMAP") || + unsetenv(LD_ "LIBRARY_PATH") || unsetenv(LD_ "LIBMAP_DISABLE") || + unsetenv(LD_ "DEBUG") || unsetenv(LD_ "ELF_HINTS_PATH")) { + _rtld_error("environment corrupt; aborting"); + die(); + } } ld_debug = getenv(LD_ "DEBUG"); libmap_disable = getenv(LD_ "LIBMAP_DISABLE") != NULL; Modified: releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -600,6 +600,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 09:18:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEDF910656AC; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 999E98FC31; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB39IfY7061881; Thu, 3 Dec 2009 09:18:41 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB39Ifr3061875; Thu, 3 Dec 2009 09:18:41 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912030918.nB39Ifr3061875@svn.freebsd.org> From: Colin Percival Date: Thu, 3 Dec 2009 09:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200054 - head/crypto/openssl/ssl head/etc/mtree head/usr.sbin/freebsd-update releng/6.3 releng/6.3/crypto/openssl/ssl releng/6.3/etc/mtree releng/6.3/usr.sbin/freebsd-update releng/6.4... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 09:18:41 -0000 Author: cperciva Date: Thu Dec 3 09:18:40 2009 New Revision: 200054 URL: http://svn.freebsd.org/changeset/base/200054 Log: Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Correctly handle failures from unsetenv resulting from a corrupt environment in rtld-elf. [09:16] Fix permissions in freebsd-update in order to prevent leakage of sensitive files. [09:17] Approved by: so (cperciva) Security: FreeBSD-SA-09:15.ssl Security: FreeBSD-SA-09:16.rtld Security: FreeBSD-SA-09:17.freebsd-udpate Modified: stable/6/crypto/openssl/ssl/s3_lib.c stable/6/crypto/openssl/ssl/s3_pkt.c stable/6/crypto/openssl/ssl/s3_srvr.c stable/6/etc/mtree/BSD.var.dist stable/6/usr.sbin/freebsd-update/freebsd-update.sh Changes in other areas also in this revision: Modified: head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/etc/mtree/BSD.var.dist head/usr.sbin/freebsd-update/freebsd-update.sh releng/6.3/UPDATING releng/6.3/crypto/openssl/ssl/s3_lib.c releng/6.3/crypto/openssl/ssl/s3_pkt.c releng/6.3/crypto/openssl/ssl/s3_srvr.c releng/6.3/etc/mtree/BSD.var.dist releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh releng/6.4/UPDATING releng/6.4/crypto/openssl/ssl/s3_lib.c releng/6.4/crypto/openssl/ssl/s3_pkt.c releng/6.4/crypto/openssl/ssl/s3_srvr.c releng/6.4/etc/mtree/BSD.var.dist releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh releng/7.1/UPDATING releng/7.1/crypto/openssl/ssl/s3_lib.c releng/7.1/crypto/openssl/ssl/s3_pkt.c releng/7.1/crypto/openssl/ssl/s3_srvr.c releng/7.1/etc/mtree/BSD.var.dist releng/7.1/libexec/rtld-elf/rtld.c releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh releng/7.2/UPDATING releng/7.2/crypto/openssl/ssl/s3_lib.c releng/7.2/crypto/openssl/ssl/s3_pkt.c releng/7.2/crypto/openssl/ssl/s3_srvr.c releng/7.2/etc/mtree/BSD.var.dist releng/7.2/libexec/rtld-elf/rtld.c releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh releng/8.0/UPDATING releng/8.0/crypto/openssl/ssl/s3_lib.c releng/8.0/crypto/openssl/ssl/s3_pkt.c releng/8.0/crypto/openssl/ssl/s3_srvr.c releng/8.0/etc/mtree/BSD.var.dist releng/8.0/libexec/rtld-elf/rtld.c releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh stable/7/crypto/openssl/ssl/s3_lib.c stable/7/crypto/openssl/ssl/s3_pkt.c stable/7/crypto/openssl/ssl/s3_srvr.c stable/7/etc/mtree/BSD.var.dist stable/7/usr.sbin/freebsd-update/freebsd-update.sh stable/8/crypto/openssl/ssl/s3_lib.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/etc/mtree/BSD.var.dist stable/8/usr.sbin/freebsd-update/freebsd-update.sh Modified: stable/6/crypto/openssl/ssl/s3_lib.c ============================================================================== --- stable/6/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/6/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -1768,6 +1768,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: stable/6/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/6/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/6/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -975,9 +975,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1108,8 +1106,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: stable/6/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- stable/6/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/6/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -654,6 +654,13 @@ static int ssl3_get_client_hello(SSL *s) SSL_COMP *comp=NULL; STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: stable/6/etc/mtree/BSD.var.dist ============================================================================== --- stable/6/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ stable/6/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: stable/6/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/6/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ stable/6/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -533,6 +533,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 09:18:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E291A1065692; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C696C8FC33; Thu, 3 Dec 2009 09:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB39If06061891; Thu, 3 Dec 2009 09:18:41 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB39IfXY061885; Thu, 3 Dec 2009 09:18:41 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912030918.nB39IfXY061885@svn.freebsd.org> From: Colin Percival Date: Thu, 3 Dec 2009 09:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200054 - head/crypto/openssl/ssl head/etc/mtree head/usr.sbin/freebsd-update releng/6.3 releng/6.3/crypto/openssl/ssl releng/6.3/etc/mtree releng/6.3/usr.sbin/freebsd-update releng/6.4... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 09:18:42 -0000 Author: cperciva Date: Thu Dec 3 09:18:40 2009 New Revision: 200054 URL: http://svn.freebsd.org/changeset/base/200054 Log: Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Correctly handle failures from unsetenv resulting from a corrupt environment in rtld-elf. [09:16] Fix permissions in freebsd-update in order to prevent leakage of sensitive files. [09:17] Approved by: so (cperciva) Security: FreeBSD-SA-09:15.ssl Security: FreeBSD-SA-09:16.rtld Security: FreeBSD-SA-09:17.freebsd-udpate Modified: stable/8/crypto/openssl/ssl/s3_lib.c stable/8/crypto/openssl/ssl/s3_pkt.c stable/8/crypto/openssl/ssl/s3_srvr.c stable/8/etc/mtree/BSD.var.dist stable/8/usr.sbin/freebsd-update/freebsd-update.sh Changes in other areas also in this revision: Modified: head/crypto/openssl/ssl/s3_lib.c head/crypto/openssl/ssl/s3_pkt.c head/crypto/openssl/ssl/s3_srvr.c head/etc/mtree/BSD.var.dist head/usr.sbin/freebsd-update/freebsd-update.sh releng/6.3/UPDATING releng/6.3/crypto/openssl/ssl/s3_lib.c releng/6.3/crypto/openssl/ssl/s3_pkt.c releng/6.3/crypto/openssl/ssl/s3_srvr.c releng/6.3/etc/mtree/BSD.var.dist releng/6.3/usr.sbin/freebsd-update/freebsd-update.sh releng/6.4/UPDATING releng/6.4/crypto/openssl/ssl/s3_lib.c releng/6.4/crypto/openssl/ssl/s3_pkt.c releng/6.4/crypto/openssl/ssl/s3_srvr.c releng/6.4/etc/mtree/BSD.var.dist releng/6.4/usr.sbin/freebsd-update/freebsd-update.sh releng/7.1/UPDATING releng/7.1/crypto/openssl/ssl/s3_lib.c releng/7.1/crypto/openssl/ssl/s3_pkt.c releng/7.1/crypto/openssl/ssl/s3_srvr.c releng/7.1/etc/mtree/BSD.var.dist releng/7.1/libexec/rtld-elf/rtld.c releng/7.1/usr.sbin/freebsd-update/freebsd-update.sh releng/7.2/UPDATING releng/7.2/crypto/openssl/ssl/s3_lib.c releng/7.2/crypto/openssl/ssl/s3_pkt.c releng/7.2/crypto/openssl/ssl/s3_srvr.c releng/7.2/etc/mtree/BSD.var.dist releng/7.2/libexec/rtld-elf/rtld.c releng/7.2/usr.sbin/freebsd-update/freebsd-update.sh releng/8.0/UPDATING releng/8.0/crypto/openssl/ssl/s3_lib.c releng/8.0/crypto/openssl/ssl/s3_pkt.c releng/8.0/crypto/openssl/ssl/s3_srvr.c releng/8.0/etc/mtree/BSD.var.dist releng/8.0/libexec/rtld-elf/rtld.c releng/8.0/usr.sbin/freebsd-update/freebsd-update.sh stable/6/crypto/openssl/ssl/s3_lib.c stable/6/crypto/openssl/ssl/s3_pkt.c stable/6/crypto/openssl/ssl/s3_srvr.c stable/6/etc/mtree/BSD.var.dist stable/6/usr.sbin/freebsd-update/freebsd-update.sh stable/7/crypto/openssl/ssl/s3_lib.c stable/7/crypto/openssl/ssl/s3_pkt.c stable/7/crypto/openssl/ssl/s3_srvr.c stable/7/etc/mtree/BSD.var.dist stable/7/usr.sbin/freebsd-update/freebsd-update.sh Modified: stable/8/crypto/openssl/ssl/s3_lib.c ============================================================================== --- stable/8/crypto/openssl/ssl/s3_lib.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/8/crypto/openssl/ssl/s3_lib.c Thu Dec 3 09:18:40 2009 (r200054) @@ -2592,6 +2592,9 @@ int ssl3_renegotiate(SSL *s) if (s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) return(0); + if (1) + return(0); + s->s3->renegotiate=1; return(1); } Modified: stable/8/crypto/openssl/ssl/s3_pkt.c ============================================================================== --- stable/8/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/8/crypto/openssl/ssl/s3_pkt.c Thu Dec 3 09:18:40 2009 (r200054) @@ -983,9 +983,7 @@ start: if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->s3->handshake_fragment, 4, s, s->msg_callback_arg); - if (SSL_is_init_finished(s) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS) && - !s->s3->renegotiate) + if (0) { ssl3_renegotiate(s); if (ssl3_renegotiate_check(s)) @@ -1116,8 +1114,7 @@ start: /* Unexpected handshake message (Client Hello, or protocol violation) */ if ((s->s3->handshake_fragment_len >= 4) && !s->in_handshake) { - if (((s->state&SSL_ST_MASK) == SSL_ST_OK) && - !(s->s3->flags & SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS)) + if (0) { #if 0 /* worked only because C operator preferences are not as expected (and * because this is not really needed for clients except for detecting Modified: stable/8/crypto/openssl/ssl/s3_srvr.c ============================================================================== --- stable/8/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 08:11:20 2009 (r200053) +++ stable/8/crypto/openssl/ssl/s3_srvr.c Thu Dec 3 09:18:40 2009 (r200054) @@ -718,6 +718,13 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers=NULL; + if (s->new_session) + { + al=SSL_AD_HANDSHAKE_FAILURE; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + goto f_err; + } + /* We do this so that we will respond with our native type. * If we are TLSv1 and we get SSLv3, we will respond with TLSv1, * This down switching should be handled by a different method. Modified: stable/8/etc/mtree/BSD.var.dist ============================================================================== --- stable/8/etc/mtree/BSD.var.dist Thu Dec 3 08:11:20 2009 (r200053) +++ stable/8/etc/mtree/BSD.var.dist Thu Dec 3 09:18:40 2009 (r200054) @@ -32,7 +32,7 @@ db entropy uname=operator gname=operator mode=0700 .. - freebsd-update + freebsd-update mode=0700 .. ipf mode=0700 .. Modified: stable/8/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- stable/8/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 08:11:20 2009 (r200053) +++ stable/8/usr.sbin/freebsd-update/freebsd-update.sh Thu Dec 3 09:18:40 2009 (r200054) @@ -600,6 +600,7 @@ fetch_check_params () { echo ${WORKDIR} exit 1 fi + chmod 700 ${WORKDIR} cd ${WORKDIR} || exit 1 # Generate release number. The s/SECURITY/RELEASE/ bit exists From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 11:16:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C300106566B; Thu, 3 Dec 2009 11:16:54 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2056F8FC13; Thu, 3 Dec 2009 11:16:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3BGshP091412; Thu, 3 Dec 2009 11:16:54 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3BGsm2091411; Thu, 3 Dec 2009 11:16:54 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912031116.nB3BGsm2091411@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 3 Dec 2009 11:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200055 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 11:16:54 -0000 Author: ume Date: Thu Dec 3 11:16:53 2009 New Revision: 200055 URL: http://svn.freebsd.org/changeset/base/200055 Log: Teach an IPv6 to the debug prints. Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 09:18:40 2009 (r200054) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 11:16:53 2009 (r200055) @@ -1050,6 +1050,28 @@ hash_packet(struct ipfw_flow_id *id) return i; } +static __inline void +unlink_dyn_rule_print(struct ipfw_flow_id *id) +{ + struct in_addr da; + char src[48], dst[48]; + +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) { + ip6_sprintf(src, &id->src_ip6); + ip6_sprintf(dst, &id->dst_ip6); + } else +#endif + { + da.s_addr = htonl(id->src_ip); + inet_ntoa_r(da, src); + da.s_addr = htonl(id->dst_ip); + inet_ntoa_r(da, dst); + } + printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", + src, id->src_port, dst, id->dst_port, V_dyn_count - 1); +} + /** * unlink a dynamic rule from a chain. prev is a pointer to * the previous one, q is a pointer to the rule to delete, @@ -1062,9 +1084,7 @@ hash_packet(struct ipfw_flow_id *id) /* remove a refcount to the parent */ \ if (q->dyn_type == O_LIMIT) \ q->parent->count--; \ - DEB(printf("ipfw: unlink entry 0x%08x %d -> 0x%08x %d, %d left\n",\ - (q->id.src_ip), (q->id.src_port), \ - (q->id.dst_ip), (q->id.dst_port), V_dyn_count-1 ); ) \ + DEB(unlink_dyn_rule_print(&q->id);) \ if (prev != NULL) \ prev->next = q = q->next; \ else \ @@ -1394,11 +1414,26 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ r->next = V_ipfw_dyn_v[i]; V_ipfw_dyn_v[i] = r; V_dyn_count++; - DEB(printf("ipfw: add dyn entry ty %d 0x%08x %d -> 0x%08x %d, total %d\n", - dyn_type, - (r->id.src_ip), (r->id.src_port), - (r->id.dst_ip), (r->id.dst_port), - V_dyn_count ); ) + DEB({ + struct in_addr da; + char src[48]; + char dst[48]; +#ifdef INET6 + if (IS_IP6_FLOW_ID(&(r->id))) { + ip6_sprintf(src, &r->id.src_ip6); + ip6_sprintf(dst, &r->id.dst_ip6); + } else +#endif + { + da.s_addr = htonl(r->id.src_ip); + inet_ntoa_r(da, src); + da.s_addr = htonl(r->id.dst_ip); + inet_ntoa_r(da, dst); + } + printf("ipfw: add dyn entry ty %d %s %d -> %s %d, total %d\n", + dyn_type, src, r->id.src_port, dst, r->id.dst_port, + V_dyn_count); + }) return r; } @@ -1460,15 +1495,28 @@ install_state(struct ip_fw *rule, ipfw_i src[0] = '\0'; dst[0] = '\0'; + IPFW_DYN_LOCK(); + DEB( - printf("ipfw: %s: type %d 0x%08x %u -> 0x%08x %u\n", - __func__, cmd->o.opcode, - (args->f_id.src_ip), (args->f_id.src_port), - (args->f_id.dst_ip), (args->f_id.dst_port)); +#ifdef INET6 + if (IS_IP6_FLOW_ID(&(args->f_id))) { + ip6_sprintf(src, &args->f_id.src_ip6); + ip6_sprintf(dst, &args->f_id.dst_ip6); + } else +#endif + { + da.s_addr = htonl(args->f_id.src_ip); + inet_ntoa_r(da, src); + da.s_addr = htonl(args->f_id.dst_ip); + inet_ntoa_r(da, dst); + } + printf("ipfw: %s: type %d %s %u -> %s %u\n", + __func__, cmd->o.opcode, src, args->f_id.src_port, + dst, args->f_id.dst_port); + src[0] = '\0'; + dst[0] = '\0'; ) - IPFW_DYN_LOCK(); - q = lookup_dyn_rule_locked(&args->f_id, NULL, NULL); if (q != NULL) { /* should never occur */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 12:23:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8EA21065679; Thu, 3 Dec 2009 12:23:48 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B57E48FC15; Thu, 3 Dec 2009 12:23:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3CNmKC007732; Thu, 3 Dec 2009 12:23:48 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3CNmtM007730; Thu, 3 Dec 2009 12:23:48 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912031223.nB3CNmtM007730@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 3 Dec 2009 12:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200056 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 12:23:48 -0000 Author: luigi Date: Thu Dec 3 12:23:48 2009 New Revision: 200056 URL: http://svn.freebsd.org/changeset/base/200056 Log: use qsort_r instead of heapsort; staticize two functions. MFC after: 3 days Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Thu Dec 3 11:16:53 2009 (r200055) +++ head/sbin/ipfw/dummynet.c Thu Dec 3 12:23:48 2009 (r200056) @@ -78,7 +78,7 @@ static struct _s_x dummynet_params[] = { }; static int -sort_q(const void *pa, const void *pb) +sort_q(void *arg, const void *pa, const void *pb) { int rev = (co.do_sort < 0); int field = rev ? -co.do_sort : co.do_sort; @@ -121,7 +121,7 @@ list_queues(struct dn_flow_set *fs, stru return; if (co.do_sort != 0) - heapsort(q, fs->rq_elements, sizeof *q, sort_q); + qsort_r(q, fs->rq_elements, sizeof *q, NULL, sort_q); /* Print IPv4 flows */ index_printed = 0; @@ -486,7 +486,7 @@ is_valid_number(const char *s) * and return the numeric bandwidth value. * set clocking interface or bandwidth value */ -void +static void read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) { if (*bandwidth != -1) @@ -530,7 +530,7 @@ struct point { double delay; }; -int +static int compare_points(const void *vp1, const void *vp2) { const struct point *p1 = vp1; From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 12:59:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9431E1065692; Thu, 3 Dec 2009 12:59:39 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 651DD8FC17; Thu, 3 Dec 2009 12:59:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3Cxd7n014493; Thu, 3 Dec 2009 12:59:39 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Cxd5L014487; Thu, 3 Dec 2009 12:59:39 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200912031259.nB3Cxd5L014487@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 3 Dec 2009 12:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200057 - in releng: 6.3/sys/conf 6.4/sys/conf 7.1/sys/conf 7.2/sys/conf 8.0/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 12:59:39 -0000 Author: simon Date: Thu Dec 3 12:59:39 2009 New Revision: 200057 URL: http://svn.freebsd.org/changeset/base/200057 Log: Bump the patch level in the kernel version number, which was accidentally left out of main commit for SA-09:15, SA-09:15, and SA-09:17 in r200054. Approved by: so (simon) Modified: releng/6.3/sys/conf/newvers.sh releng/6.4/sys/conf/newvers.sh releng/7.1/sys/conf/newvers.sh releng/7.2/sys/conf/newvers.sh releng/8.0/sys/conf/newvers.sh Modified: releng/6.3/sys/conf/newvers.sh ============================================================================== --- releng/6.3/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) +++ releng/6.3/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.3" -BRANCH="RELEASE-p13" +BRANCH="RELEASE-p14" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/6.4/sys/conf/newvers.sh ============================================================================== --- releng/6.4/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) +++ releng/6.4/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.4" -BRANCH="RELEASE-p7" +BRANCH="RELEASE-p8" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/sys/conf/newvers.sh ============================================================================== --- releng/7.1/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) +++ releng/7.1/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.1" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.2/sys/conf/newvers.sh ============================================================================== --- releng/7.2/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) +++ releng/7.2/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.2" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/8.0/sys/conf/newvers.sh ============================================================================== --- releng/8.0/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) +++ releng/8.0/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.0" -BRANCH="RELEASE" +BRANCH="RELEASE-p1" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 13:29:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A84106566B; Thu, 3 Dec 2009 13:29:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 755EF8FC17; Thu, 3 Dec 2009 13:29:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3DTOj7015130; Thu, 3 Dec 2009 13:29:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3DTOk9015128; Thu, 3 Dec 2009 13:29:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912031329.nB3DTOk9015128@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 13:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200058 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 13:29:24 -0000 Author: trasz Date: Thu Dec 3 13:29:24 2009 New Revision: 200058 URL: http://svn.freebsd.org/changeset/base/200058 Log: Add change that was somehow missed in r192586. It could manifest by incorrectly returning EINVAL from acl_valid(3) for applications linked against pre-8.0 libc. Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Thu Dec 3 12:59:39 2009 (r200057) +++ head/sys/kern/vfs_acl.c Thu Dec 3 13:29:24 2009 (r200058) @@ -173,7 +173,7 @@ acl_copyout(struct acl *kernel_acl, void /* * Convert "old" type - ACL_TYPE_{ACCESS,DEFAULT}_OLD - into its "new" - * counterpart. It's required for old (pre-NFS4 ACLs) libc to work + * counterpart. It's required for old (pre-NFSv4 ACLs) libc to work * with new kernel. Fixing 'type' for old binaries with new libc * is being done in lib/libc/posix1e/acl_support.c:_acl_type_unold(). */ @@ -307,7 +307,8 @@ vacl_aclcheck(struct thread *td, struct error = acl_copyin(aclp, inkernelacl, type); if (error != 0) goto out; - error = VOP_ACLCHECK(vp, type, inkernelacl, td->td_ucred, td); + error = VOP_ACLCHECK(vp, acl_type_unold(type), inkernelacl, + td->td_ucred, td); out: acl_free(inkernelacl); return (error); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 13:33:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A5811065679; Thu, 3 Dec 2009 13:33:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1A79F8FC17; Thu, 3 Dec 2009 13:33:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 84B2A46B03; Thu, 3 Dec 2009 08:33:15 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C31828A01D; Thu, 3 Dec 2009 08:33:14 -0500 (EST) From: John Baldwin To: Andriy Gapon Date: Thu, 3 Dec 2009 07:45:28 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912030811.nB38BK0h046790@svn.freebsd.org> In-Reply-To: <200912030811.nB38BK0h046790@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912030745.28650.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 03 Dec 2009 08:33:14 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200053 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 13:33:16 -0000 On Thursday 03 December 2009 3:11:20 am Andriy Gapon wrote: > Author: avg > Date: Thu Dec 3 08:11:20 2009 > New Revision: 200053 > URL: http://svn.freebsd.org/changeset/base/200053 > > Log: > ichsmb: try attaching only to intel hardware in the default case > > Ideally we should attempt attaching only to known supported devices. > But I am not sure that we have all supported PCI IDs already listed, > and I am too young to die, err, I don't want to take the heat from > causing a trouble to someone. > > MFC after: 1 week > X-ToDo: drop the default case Perhaps drop the default case in 8 and 9? I actually think the default case has caused more harm than good in the past, and I suspect that there are actually very few supported devices that we don't already have the PCI IDs for. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 14:22:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36119106566B; Thu, 3 Dec 2009 14:22:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2266E8FC0C; Thu, 3 Dec 2009 14:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3EMFVe016442; Thu, 3 Dec 2009 14:22:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3EMFrS016440; Thu, 3 Dec 2009 14:22:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912031422.nB3EMFrS016440@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 3 Dec 2009 14:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200059 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 14:22:16 -0000 Author: luigi Date: Thu Dec 3 14:22:15 2009 New Revision: 200059 URL: http://svn.freebsd.org/changeset/base/200059 Log: preparation work to replace the monster switch in ipfw_chk() with table of functions. This commit (which is heavily based on work done by Marta Carbone in this year's GSOC project), removes the goto's and explicit return from the inner switch(), so we will have a easier time when putting the blocks into individual functions. MFC after: 3 weeks Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 13:29:24 2009 (r200058) +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 14:22:15 2009 (r200059) @@ -2306,6 +2306,8 @@ ipfw_chk(struct ip_fw_args *args) /* end of ipv6 variables */ int is_ipv4 = 0; + int done = 0; /* flag to exit the outer loop */ + if (m->m_flags & M_SKIP_FIREWALL || (! V_ipfw_vnet_ready)) return (IP_FW_PASS); /* accept */ @@ -2573,7 +2575,14 @@ do { \ * Packet has already been tagged. Look for the next rule * to restart processing. Make sure that args->rule still * exists and not changed. + * If fw_one_pass != 0 then just accept it. + * XXX should not happen here, but optimized out in + * the caller. */ + if (fw_one_pass) { + IPFW_RUNLOCK(chain); + return (IP_FW_PASS); + } if (chain->id != args->chain_id) { for (f = chain->rules; f != NULL; f = f->next) if (f == args->rule && f->id == args->rule_id) @@ -2618,13 +2627,28 @@ do { \ /* * Now scan the rules, and parse microinstructions for each rule. + * We have two nested loops and an inner switch. Sometimes we + * need to break out of one or both loops, or re-enter one of + * the loops with updated variables. Loop variables are: + * + * f (outer loop) points to the current rule. + * On output it points to the matching rule. + * done (outer loop) is used as a flag to break the loop. + * l (inner loop) residual length of current rule. + * cmd points to the current microinstruction. + * + * We break the inner loop by setting l=0 and possibly + * cmdlen=0 if we don't want to advance cmd. + * We break the outer loop by setting done=1 + * We can restart the inner loop by setting l>0 and f, cmd + * as needed. */ for (; f; f = f->next) { ipfw_insn *cmd; uint32_t tablearg = 0; int l, cmdlen, skip_or; /* skip rest of OR block */ -again: +/* again: */ if (V_set_disable & (1 << f->set) ) continue; @@ -2639,7 +2663,7 @@ again: * the target rule. */ -check_body: +/* check_body: */ cmdlen = F_LEN(cmd); /* * An OR block (insn_1 || .. || insn_n) has the @@ -3210,14 +3234,13 @@ check_body: * * In general, here we set retval and terminate the * outer loop (would be a 'break 3' in some language, - * but we need to do a 'goto done'). + * but we need to set l=0, done=1) * * Exceptions: * O_COUNT and O_SKIPTO actions: * instead of terminating, we jump to the next rule - * ('goto next_rule', equivalent to a 'break 2'), - * or to the SKIPTO target ('goto again' after - * having set f, cmd and l), respectively. + * (setting l=0), or to the SKIPTO target (by + * setting f, cmd and l as needed), respectively. * * O_TAG, O_LOG and O_ALTQ action parameters: * perform some action and set match = 1; @@ -3228,25 +3251,28 @@ check_body: * These opcodes try to install an entry in the * state tables; if successful, we continue with * the next opcode (match=1; break;), otherwise - * the packet * must be dropped - * ('goto done' after setting retval); + * the packet must be dropped (set retval, + * break loops with l=0, done=1) * * O_PROBE_STATE and O_CHECK_STATE: these opcodes * cause a lookup of the state table, and a jump * to the 'action' part of the parent rule - * ('goto check_body') if an entry is found, or + * if an entry is found, or * (CHECK_STATE only) a jump to the next rule if - * the entry is not found ('goto next_rule'). - * The result of the lookup is cached to make - * further instances of these opcodes are - * effectively NOPs. + * the entry is not found. + * The result of the lookup is cached so that + * further instances of these opcodes become NOPs. + * The jump to the next rule is done by setting + * l=0, cmdlen=0. */ case O_LIMIT: case O_KEEP_STATE: if (install_state(f, (ipfw_insn_limit *)cmd, args, tablearg)) { + /* error or limit violation */ retval = IP_FW_DENY; - goto done; /* error/limit violation */ + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ } match = 1; break; @@ -3270,7 +3296,8 @@ check_body: /* * Found dynamic entry, update stats * and jump to the 'action' part of - * the parent rule. + * the parent rule by setting + * f, cmd, l and clearing cmdlen. */ q->pcnt++; q->bcnt += pktlen; @@ -3278,7 +3305,9 @@ check_body: cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; IPFW_DYN_UNLOCK(); - goto check_body; + cmdlen = 0; + match = 1; + break; } /* * Dynamic entry not found. If CHECK_STATE, @@ -3286,13 +3315,15 @@ check_body: * ignore and continue with next opcode. */ if (cmd->opcode == O_CHECK_STATE) - goto next_rule; + l = 0; /* exit inner loop */ match = 1; break; case O_ACCEPT: retval = 0; /* accept */ - goto done; + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; case O_PIPE: case O_QUEUE: @@ -3304,43 +3335,45 @@ check_body: else args->cookie = cmd->arg1; retval = IP_FW_DUMMYNET; - goto done; + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; case O_DIVERT: - case O_TEE: { - struct divert_tag *dt; - + case O_TEE: if (args->eh) /* not on layer 2 */ - break; + break; + /* otherwise this is terminal */ + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ mtag = m_tag_get(PACKET_TAG_DIVERT, - sizeof(struct divert_tag), - M_NOWAIT); + sizeof(struct divert_tag), + M_NOWAIT); if (mtag == NULL) { - /* XXX statistic */ - /* drop packet */ - IPFW_RUNLOCK(chain); - if (ucred_cache != NULL) - crfree(ucred_cache); - return (IP_FW_DENY); - } - dt = (struct divert_tag *)(mtag+1); - dt->cookie = f->rulenum; - if (cmd->arg1 == IP_FW_TABLEARG) + retval = IP_FW_DENY; + } else { + struct divert_tag *dt; + dt = (struct divert_tag *)(mtag+1); + dt->cookie = f->rulenum; + if (cmd->arg1 == IP_FW_TABLEARG) dt->info = tablearg; - else + else dt->info = cmd->arg1; - m_tag_prepend(m, mtag); - retval = (cmd->opcode == O_DIVERT) ? - IP_FW_DIVERT : IP_FW_TEE; - goto done; - } + m_tag_prepend(m, mtag); + retval = (cmd->opcode == O_DIVERT) ? + IP_FW_DIVERT : IP_FW_TEE; + } + break; + case O_COUNT: case O_SKIPTO: f->pcnt++; /* update stats */ f->bcnt += pktlen; f->timestamp = time_uptime; - if (cmd->opcode == O_COUNT) - goto next_rule; + if (cmd->opcode == O_COUNT) { + l = 0; /* exit inner loop */ + break; + } /* handle skipto */ if (cmd->arg1 == IP_FW_TABLEARG) { f = lookup_next_rule(f, tablearg); @@ -3349,7 +3382,24 @@ check_body: lookup_next_rule(f, 0); f = f->next_rule; } - goto again; + /* + * Skip disabled rules, and + * re-enter the inner loop + * with the correct f, l and cmd. + * Also clear cmdlen and skip_or + */ + while (f && (V_set_disable & (1 << f->set))) + f = f->next; + if (f) { /* found a valid rule */ + l = f->cmd_len; + cmd = f->cmd; + } else { + l = 0; /* exit inner loop */ + } + match = 1; + cmdlen = 0; + skip_or = 0; + break; case O_REJECT: /* @@ -3383,28 +3433,30 @@ check_body: #endif case O_DENY: retval = IP_FW_DENY; - goto done; + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; - case O_FORWARD_IP: { - struct sockaddr_in *sa; - sa = &(((ipfw_insn_sa *)cmd)->sa); + case O_FORWARD_IP: if (args->eh) /* not valid on layer2 pkts */ break; if (!q || dyn_dir == MATCH_FORWARD) { - if (sa->sin_addr.s_addr == INADDR_ANY) { - bcopy(sa, &args->hopstore, + struct sockaddr_in *sa; + sa = &(((ipfw_insn_sa *)cmd)->sa); + if (sa->sin_addr.s_addr == INADDR_ANY) { + bcopy(sa, &args->hopstore, sizeof(*sa)); - args->hopstore.sin_addr.s_addr = + args->hopstore.sin_addr.s_addr = htonl(tablearg); - args->next_hop = - &args->hopstore; - } else { - args->next_hop = sa; - } + args->next_hop = &args->hopstore; + } else { + args->next_hop = sa; + } } retval = IP_FW_PASS; - } - goto done; + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; case O_NETGRAPH: case O_NGTEE: @@ -3417,7 +3469,9 @@ check_body: args->cookie = cmd->arg1; retval = (cmd->opcode == O_NETGRAPH) ? IP_FW_NETGRAPH : IP_FW_NGTEE; - goto done; + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; case O_SETFIB: f->pcnt++; /* update stats */ @@ -3425,88 +3479,98 @@ check_body: f->timestamp = time_uptime; M_SETFIB(m, cmd->arg1); args->f_id.fib = cmd->arg1; - goto next_rule; + l = 0; /* exit inner loop */ + break; - case O_NAT: { - struct cfg_nat *t; - int nat_id; - - if (IPFW_NAT_LOADED) { - args->rule = f; /* Report matching rule. */ - args->rule_id = f->id; - args->chain_id = chain->id; - t = ((ipfw_insn_nat *)cmd)->nat; + case O_NAT: + if (!IPFW_NAT_LOADED) { + retval = IP_FW_DENY; + } else { + struct cfg_nat *t; + int nat_id; + + args->rule = f; /* Report matching rule. */ + args->rule_id = f->id; + args->chain_id = chain->id; + t = ((ipfw_insn_nat *)cmd)->nat; + if (t == NULL) { + nat_id = (cmd->arg1 == IP_FW_TABLEARG) ? + tablearg : cmd->arg1; + LOOKUP_NAT(V_layer3_chain, nat_id, t); if (t == NULL) { - nat_id = (cmd->arg1 == IP_FW_TABLEARG) ? - tablearg : cmd->arg1; - LOOKUP_NAT(V_layer3_chain, nat_id, t); - if (t == NULL) { - retval = IP_FW_DENY; - goto done; - } - if (cmd->arg1 != IP_FW_TABLEARG) - ((ipfw_insn_nat *)cmd)->nat = t; + retval = IP_FW_DENY; + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; } - retval = ipfw_nat_ptr(args, t, m); - } else - retval = IP_FW_DENY; - goto done; - } + if (cmd->arg1 != IP_FW_TABLEARG) + ((ipfw_insn_nat *)cmd)->nat = t; + } + retval = ipfw_nat_ptr(args, t, m); + } + l = 0; /* exit inner loop */ + done = 1; /* exit outer loop */ + break; case O_REASS: { int ip_off; f->pcnt++; f->bcnt += pktlen; - ip_off = (args->eh != NULL) ? ntohs(ip->ip_off) : ip->ip_off; - if (ip_off & (IP_MF | IP_OFFMASK)) { - /* - * ip_reass() expects len & off in host - * byte order: fix them in case we come - * from layer2. - */ - if (args->eh != NULL) { - ip->ip_len = ntohs(ip->ip_len); - ip->ip_off = ntohs(ip->ip_off); - } + l = 0; /* in any case exit inner loop */ - m = ip_reass(m); - args->m = m; - - /* - * IP header checksum fixup after - * reassembly and leave header - * in network byte order. - */ - if (m != NULL) { - int hlen; - - ip = mtod(m, struct ip *); - hlen = ip->ip_hl << 2; - /* revert len & off for layer2 pkts */ - if (args->eh != NULL) - ip->ip_len = htons(ip->ip_len); - ip->ip_sum = 0; - if (hlen == sizeof(struct ip)) - ip->ip_sum = in_cksum_hdr(ip); - else - ip->ip_sum = in_cksum(m, hlen); - retval = IP_FW_REASS; - args->rule = f; - args->rule_id = f->id; - args->chain_id = chain->id; - goto done; - } else { - retval = IP_FW_DENY; - goto done; - } + ip_off = (args->eh != NULL) ? + ntohs(ip->ip_off) : ip->ip_off; + /* if not fragmented, go to next rule */ + if ((ip_off & (IP_MF | IP_OFFMASK)) == 0) + break; + /* + * ip_reass() expects len & off in host + * byte order: fix them in case we come + * from layer2. + */ + if (args->eh != NULL) { + ip->ip_len = ntohs(ip->ip_len); + ip->ip_off = ntohs(ip->ip_off); + } + + args->m = m = ip_reass(m); + + /* + * IP header checksum fixup after + * reassembly and leave header + * in network byte order. + */ + if (m == NULL) { /* fragment got swallowed */ + retval = IP_FW_DENY; + } else { /* good, packet complete */ + int hlen; + + ip = mtod(m, struct ip *); + hlen = ip->ip_hl << 2; + /* revert len & off for layer2 pkts */ + if (args->eh != NULL) + ip->ip_len = htons(ip->ip_len); + ip->ip_sum = 0; + if (hlen == sizeof(struct ip)) + ip->ip_sum = in_cksum_hdr(ip); + else + ip->ip_sum = in_cksum(m, hlen); + retval = IP_FW_REASS; + args->rule = f; + args->rule_id = f->id; + args->chain_id = chain->id; } - goto next_rule; + done = 1; /* exit outer loop */ + break; } default: panic("-- unknown opcode %d\n", cmd->opcode); } /* end of switch() on opcodes */ + /* + * if we get here with l=0, then match is irrelevant. + */ if (cmd->len & F_NOT) match = !match; @@ -3519,22 +3583,24 @@ check_body: break; /* try next rule */ } - } /* end of inner for, scan opcodes */ + } /* end of inner loop, scan opcodes */ + + if (done) + break; -next_rule:; /* try next rule */ +/* next_rule:; */ /* try next rule */ } /* end of outer for, scan rules */ - printf("ipfw: ouch!, skip past end of rules, denying packet\n"); - IPFW_RUNLOCK(chain); - if (ucred_cache != NULL) - crfree(ucred_cache); - return (IP_FW_DENY); -done: - /* Update statistics */ - f->pcnt++; - f->bcnt += pktlen; - f->timestamp = time_uptime; + if (done) { + /* Update statistics */ + f->pcnt++; + f->bcnt += pktlen; + f->timestamp = time_uptime; + } else { + retval = IP_FW_DENY; + printf("ipfw: ouch!, skip past end of rules, denying packet\n"); + } IPFW_RUNLOCK(chain); if (ucred_cache != NULL) crfree(ucred_cache); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 14:59:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07C58106566B; Thu, 3 Dec 2009 14:59:43 +0000 (UTC) (envelope-from jkoshy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB5268FC14; Thu, 3 Dec 2009 14:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3Exgf2017320; Thu, 3 Dec 2009 14:59:42 GMT (envelope-from jkoshy@svn.freebsd.org) Received: (from jkoshy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3ExgeU017318; Thu, 3 Dec 2009 14:59:42 GMT (envelope-from jkoshy@svn.freebsd.org) Message-Id: <200912031459.nB3ExgeU017318@svn.freebsd.org> From: Joseph Koshy Date: Thu, 3 Dec 2009 14:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200060 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 14:59:43 -0000 Author: jkoshy Date: Thu Dec 3 14:59:42 2009 New Revision: 200060 URL: http://svn.freebsd.org/changeset/base/200060 Log: Use a better check for a valid kernel stack address when capturing kernel call chains. Submitted by: Mark Unangst Tested by: fabient Modified: head/sys/dev/hwpmc/hwpmc_x86.c Modified: head/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_x86.c Thu Dec 3 14:22:15 2009 (r200059) +++ head/sys/dev/hwpmc/hwpmc_x86.c Thu Dec 3 14:59:42 2009 (r200060) @@ -176,7 +176,8 @@ pmc_save_kernel_callchain(uintptr_t *cc, stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; if (PMC_IN_TRAP_HANDLER(pc) || - !PMC_IN_KERNEL(pc) || !PMC_IN_KERNEL(r) || + !PMC_IN_KERNEL(pc) || + !PMC_IN_KERNEL_STACK(r, stackstart, stackend) || !PMC_IN_KERNEL_STACK(sp, stackstart, stackend) || !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) return (1); @@ -221,7 +222,7 @@ pmc_save_kernel_callchain(uintptr_t *cc, r = fp + sizeof(uintptr_t); if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend) || - !PMC_IN_KERNEL(r)) + !PMC_IN_KERNEL_STACK(r, stackstart, stackend)) break; pc = *(uintptr_t *) r; fp = *(uintptr_t *) fp; From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 15:14:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79623106568F; Thu, 3 Dec 2009 15:14:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68EC68FC19; Thu, 3 Dec 2009 15:14:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3FEUof017700; Thu, 3 Dec 2009 15:14:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3FEUHT017698; Thu, 3 Dec 2009 15:14:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912031514.nB3FEUHT017698@svn.freebsd.org> From: John Baldwin Date: Thu, 3 Dec 2009 15:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200061 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 15:14:30 -0000 Author: jhb Date: Thu Dec 3 15:14:30 2009 New Revision: 200061 URL: http://svn.freebsd.org/changeset/base/200061 Log: The fd_mask type is an unsigned long, not an int, so treat the mask as a long instead of an int when examining the results of select() to look for RPC requests. Previously this routine would ignore RPC requests to sockets whose file descriptor mod 64 was greater than 31 on a 64-bit platform. PR: amd64/141130 Submitted by: liujb of array networks MFC after: 3 days Modified: head/lib/libc/rpc/svc.c Modified: head/lib/libc/rpc/svc.c ============================================================================== --- head/lib/libc/rpc/svc.c Thu Dec 3 14:59:42 2009 (r200060) +++ head/lib/libc/rpc/svc.c Thu Dec 3 15:14:30 2009 (r200061) @@ -627,8 +627,8 @@ svc_getreqset(readfds) maskp = readfds->fds_bits; for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) { - for (mask = *maskp++; (bit = ffs(mask)) != 0; - mask ^= (1 << (bit - 1))) { + for (mask = *maskp++; (bit = ffsl(mask)) != 0; + mask ^= (1ul << (bit - 1))) { /* sock has input waiting */ fd = sock + bit - 1; svc_getreq_common(fd); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 15:48:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D7301065679; Thu, 3 Dec 2009 15:48:25 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0258FC15; Thu, 3 Dec 2009 15:48:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3FmP35018538; Thu, 3 Dec 2009 15:48:25 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3FmPp3018525; Thu, 3 Dec 2009 15:48:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912031548.nB3FmPp3018525@svn.freebsd.org> From: Ed Schouten Date: Thu, 3 Dec 2009 15:48:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200062 - in head: contrib/groff/tmac lib lib/libulog libexec libexec/ulog-helper share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 15:48:25 -0000 Author: ed Date: Thu Dec 3 15:48:24 2009 New Revision: 200062 URL: http://svn.freebsd.org/changeset/base/200062 Log: Add a new library: libulog. One of the things I really want to do, is to get rid of the limitations of our current utmp(5) mechanism: - It only allows 8 byte TTY device names. - The hostname only allows 16 bytes of storage. I'm not a big fan of , but I think we should at least try to add parts of it. Unfortunately we cannot implement , because we miss various fields, such as ut_id, ut_pid, etc. The API provided by libulog shares some similarities with , so it shouldn't be too hard to port these applications eventually. In most simple cases, it should just be a matter of removing the ulog_ prefix everywhere. As a bonus, it also implements a function called ulog_login_pseudo(), which allows unprivileged applications to write log entries, provided they have a valid file descriptor to a pseudo-terminal master device. libulog will allow a smoother transition to a new file format by adding a library interface to deal with utmp/wtmp/lastlog files. I initially thought about adding the functionality to libutil, but because I'm not planning on keeping this library around forever, we'd better keep it separated. Next items on the todo list: 1. Port applications in the base system (and ports) to libulog, instead of letting them use . 2. Remove , implement and reimplement this library on top. 3. Port as many applications as possible back to . Added: head/lib/libulog/ head/lib/libulog/Makefile (contents, props changed) head/lib/libulog/Symbol.map (contents, props changed) head/lib/libulog/ulog.h (contents, props changed) head/lib/libulog/ulog_getutxent.3 (contents, props changed) head/lib/libulog/ulog_getutxent.c (contents, props changed) head/lib/libulog/ulog_internal.h (contents, props changed) head/lib/libulog/ulog_login.3 (contents, props changed) head/lib/libulog/ulog_login.c (contents, props changed) head/lib/libulog/ulog_login_pseudo.c (contents, props changed) head/libexec/ulog-helper/ head/libexec/ulog-helper/Makefile (contents, props changed) head/libexec/ulog-helper/ulog-helper.c (contents, props changed) Modified: head/contrib/groff/tmac/doc-syms head/lib/Makefile head/libexec/Makefile head/share/mk/bsd.libnames.mk Modified: head/contrib/groff/tmac/doc-syms ============================================================================== --- head/contrib/groff/tmac/doc-syms Thu Dec 3 15:14:30 2009 (r200061) +++ head/contrib/groff/tmac/doc-syms Thu Dec 3 15:48:24 2009 (r200062) @@ -777,6 +777,7 @@ .ds doc-str-Lb-librt \*[Px] \*[doc-str-Lb]Real-time Library (librt, \-lrt) .ds doc-str-Lb-libtermcap Termcap Access Library (libtermcap, \-ltermcap) .ds doc-str-Lb-libusbhid USB Human Interface Devices Library (libusbhid, \-lusbhid) +.ds doc-str-Lb-libulog User Login Record Library (libulog, \-lulog) .ds doc-str-Lb-libutil System Utilities Library (libutil, \-lutil) .ds doc-str-Lb-libx86_64 x86_64 Architecture Library (libx86_64, \-lx86_64) .ds doc-str-Lb-libz Compression Library (libz, \-lz) Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu Dec 3 15:14:30 2009 (r200061) +++ head/lib/Makefile Thu Dec 3 15:48:24 2009 (r200062) @@ -40,8 +40,8 @@ SUBDIR= ${_csu} libc libbsm libauditd li ${_libpmc} libproc librt ${_libsdp} ${_libsm} ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \ - libugidfw ${_libusbhid} ${_libusb} ${_libvgl} libwrap liby libz \ - ${_bind} + libugidfw libulog ${_libusbhid} ${_libusb} ${_libvgl} libwrap \ + liby libz ${_bind} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf Added: head/lib/libulog/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/Makefile Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +LIB= ulog +SHLIB_MAJOR= 0 +INCS= ulog.h +SRCS= ulog.h ulog_getutxent.c ulog_internal.h \ + ulog_login.c ulog_login_pseudo.c + +MAN= ulog_getutxent.3 ulog_login.3 +MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \ + ulog_getutxent.3 ulog_setutxent.3 \ + ulog_login.3 ulog_login_pseudo.3 \ + ulog_login.3 ulog_logout.3 \ + ulog_login.3 ulog_logout_pseudo.3 + +WARNS?= 6 + +VERSION_DEF= ${.CURDIR}/../libc/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map + +.include Added: head/lib/libulog/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/Symbol.map Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,13 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.2 { + ulog_endutxent; + ulog_getutxent; + ulog_login; + ulog_login_pseudo; + ulog_logout; + ulog_logout_pseudo; + ulog_setutxent; +}; Added: head/lib/libulog/ulog.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog.h Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,87 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ULOG_H_ +#define _ULOG_H_ + +#include +#include + +/* + * libulog. + * + * This library is provided as a migratory tool towards . We + * cannot yet implement , because our on-disk file format lacks + * various fields. also has some shortcomings. Ideally we + * want to allow logging of user login records generated by unprivileged + * processes as well, provided that they hold a file descriptor to a + * pseudo-terminal master device. + * + * Unlike struct utmpx, the buffers containing the strings are not + * stored inside struct ulog_utmpx itself. Processes should never + * handcraft these structures anyway. + * + * This library (or at least parts of it) will hopefully deprecate over + * time, when we provide the API. + */ + +#define _UTX_USERDISPSIZE 16 +#define _UTX_LINEDISPSIZE 8 +#define _UTX_HOSTDISPSIZE 16 + +struct ulog_utmpx { + char *ut_user; +#if 0 + char *ut_id; +#endif + char *ut_line; + char *ut_host; +#if 0 + pid_t ut_pid; + short ut_type; +#endif + struct timeval ut_tv; +}; + +__BEGIN_DECLS +void ulog_endutxent(void); +struct ulog_utmpx *ulog_getutxent(void); +#if 0 +struct ulog_utmpx *ulog_getutxid(const struct ulog_utmpx *id); +struct ulog_utmpx *ulog_getutxline(const struct ulog_utmpx *line); +struct ulog_utmpx *ulog_pututxline(const struct ulog_utmpx *utmpx); +#endif +void ulog_setutxent(void); + +void ulog_login(const char *, const char *, const char *); +void ulog_login_pseudo(int, const char *); +void ulog_logout(const char *); +void ulog_logout_pseudo(int); +__END_DECLS + +#endif /* !_ULOG_H_ */ Added: head/lib/libulog/ulog_getutxent.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_getutxent.3 Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,98 @@ +.\" Copyright (c) 2009 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 2, 2009 +.Os +.Dt ULOG_GETUTXENT 3 +.Sh NAME +.Nm ulog_getutxent , +.Nm ulog_setutxent , +.Nm ulog_endutxent +.Nd read user login records +.Sh LIBRARY +.Lb libulog +.Sh SYNOPSIS +.In ulog.h +.Ft struct ulog_utmpx * +.Fn ulog_getutxent "void" +.Ft void +.Fn ulog_setutxent "void" +.Ft void +.Fn ulog_endutxent "void" +.Sh DESCRIPTION +The +.Fn ulog_getutxent +function returns a pointer to an object, with the following structure, +containing stored information of an active user login session. +.Bd -literal +struct ulog_utmpx { + char *ut_user; /* Username. */ + char *ut_line; /* TTY device. */ + char *ut_host; /* Remote hostname. */ + struct timeval ut_tv; /* Timestamp. */ +}; +.Ed +.Pp +The fields are as follows: +.Bl -tag -width ut_user +.It Fa ut_user +The username of the logged in user. +.It Fa ut_line +The pathname of the TTY device, without the leading +.Pa /dev/ +directory. +.It Fa ut_host +An optional hostname of a remote system, if the login session is +provided through a networked login service. +.It Fa ut_tv +Timestamp indicating when the entry was last modified. +.El +.Pp +The +.Fn ulog_getutxent +function reads the next entry from the utmp file, opening the file if +necessary. +The +.Fn ulog_setutxent +opens the file, closing it first if already opened. +The +.Fn ulog_endutxent +function closes any open files. +.Pp +The +.Fn ulog_getutxent +function reads from the beginning of the file until and EOF is +encountered. +.Sh RETURN VALUES +The +.Fn ulog_getutxent +function returns a null pointer on EOF or error. +.Sh SEE ALSO +.Xr ulog_login 3 , +.Xr utmp 5 +.Sh HISTORY +These functions appeared in +.Fx 9.0 . Added: head/lib/libulog/ulog_getutxent.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_getutxent.c Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "ulog_internal.h" + +static FILE *ufile; + +void +ulog_endutxent(void) +{ + if (ufile != NULL) + fclose(ufile); + ufile = NULL; +} + +struct ulog_utmpx * +ulog_getutxent(void) +{ + struct futmp ut; + static struct ulog_utmpx utx; + + /* Open the utmp file if not already done so. */ + if (ufile == NULL) + ulog_setutxent(); + if (ufile == NULL) + return (NULL); + + if (fread(&ut, sizeof ut, 1, ufile) != 1) + return (NULL); +#define COPY_STRING(field) do { \ + free(utx.ut_ ## field); \ + utx.ut_ ## field = strndup(ut.ut_ ## field, \ + sizeof ut.ut_ ## field); \ + if (utx.ut_ ## field == NULL) \ + utx.ut_ ## field = __DECONST(char *, ""); \ +} while (0) + COPY_STRING(user); + COPY_STRING(line); + COPY_STRING(host); + utx.ut_tv.tv_sec = _time32_to_time(ut.ut_time); + utx.ut_tv.tv_usec = 0; + + return (&utx); +} + +void +ulog_setutxent(void) +{ + + if (ufile != NULL) + fclose(ufile); + ufile = fopen(_PATH_UTMP, "r"); +} Added: head/lib/libulog/ulog_internal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_internal.h Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _ULOG_INTERNAL_H_ +#define _ULOG_INTERNAL_H_ + +#include + +#include "ulog.h" + +/* + * On-disk format. + */ + +#define _PATH_UTMP "/var/run/utmp" +#define _PATH_WTMP "/var/log/wtmp" + +struct futmp { + char ut_line[8]; + char ut_user[16]; + char ut_host[16]; + int32_t ut_time; +}; + +#define _PATH_LASTLOG "/var/log/lastlog" + +struct flastlog { + int32_t ll_time; + char ll_line[8]; + char ll_host[16]; +}; + +#endif /* !_ULOG_INTERNAL_H_ */ Added: head/lib/libulog/ulog_login.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_login.3 Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,102 @@ +.\" Copyright (c) 2009 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 2, 2009 +.Os +.Dt ULOG_LOGIN 3 +.Sh NAME +.Nm ulog_login , +.Nm ulog_login_pseudo , +.Nm ulog_logout , +.Nm ulog_logout_pseudo +.Nd manage user login records +.Sh LIBRARY +.Lb libulog +.Sh SYNOPSIS +.In ulog.h +.Ft void +.Fn ulog_login "const char *line" "const char *user" "const char *host" +.Ft void +.Fn ulog_login_pseudo "int fd" "const char *host" +.Ft void +.Fn ulog_logout "const char *line" +.Ft void +.Fn ulog_logout_pseudo "int fd" +.Sh DESCRIPTION +The +.Fn ulog_login +and +.Fn ulog_login_pseudo +functions register a login session on a TTY. +The +.Fn ulog_login +function adds an entry for TTY +.Fa line +and username +.Fa user . +The +.Fn ulog_login_pseudo +function uses file descriptor to a pseudo-terminal master device +.Fa fd +to determine the TTY name, while using the username belonging to the +real user ID of the calling process. +The optional +.Fa host +argument denotes a remote hostname, in case the login session is +provided by a network service. +.Pp +The +.Fn ulog_logout +and +.Fn ulog_logout_pseudo +functions mark the previously registered login session as being +terminated. +.Pp +Because the +.Fa line +and +.Fa user +arguments of +.Fn ulog_login +and +.Fn ulog_logout +cannot be trusted, these functions require administrative privileges. +The +.Fn ulog_login_pseudo +and +.Fn ulog_logout_pseudo +functions spawn a privileged process to perform the actual logging. +.Sh SEE ALSO +.Xr getuid 3 , +.Xr login 3 , +.Xr logout 3 , +.Xr posix_openpt 2 , +.Xr ptsname 3 , +.Xr ulog_getutxent 3 , +.Xr utmp 5 +.Sh HISTORY +These functions appeared in +.Fx 9.0 . Added: head/lib/libulog/ulog_login.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_login.c Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ulog_internal.h" + +void +ulog_login(const char *line, const char *user, const char *host) +{ + struct futmp fu; + struct flastlog fl; + int fd; + + /* Remove /dev/ component. */ + if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) + line += sizeof _PATH_DEV - 1; + + /* Prepare log entries. */ + memset(&fu, 0, sizeof fu); + strlcpy(fu.ut_line, line, sizeof fu.ut_line); + strlcpy(fu.ut_user, user, sizeof fu.ut_user); + if (host != NULL) + strlcpy(fu.ut_host, host, sizeof fu.ut_host); + fu.ut_time = _time_to_time32(time(NULL)); + + fl.ll_time = fu.ut_time; + memcpy(fl.ll_line, fu.ut_line, sizeof fl.ll_line); + memcpy(fl.ll_host, fu.ut_host, sizeof fl.ll_host); + + /* Update utmp entry. */ + if ((fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { + struct ttyent *ty; + int idx; + + setttyent(); + for (idx = 1; (ty = getttyent()) != NULL; ++idx) { + if (strcmp(ty->ty_name, line) != 0) + continue; + lseek(fd, (off_t)(idx * sizeof fu), L_SET); + write(fd, &fu, sizeof fu); + break; + } + endttyent(); + close(fd); + } + + /* Add wtmp entry. */ + if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) { + write(fd, &fu, sizeof fu); + close(fd); + } + + /* Update lastlog entry. */ + if ((fd = open(_PATH_LASTLOG, O_WRONLY, 0)) >= 0) { + struct passwd *pw; + + pw = getpwnam(user); + if (pw != NULL) { + lseek(fd, (off_t)(pw->pw_uid * sizeof fl), L_SET); + write(fd, &fl, sizeof fl); + } + close(fd); + } +} + +void +ulog_logout(const char *line) +{ + struct futmp ut; + int fd, found; + + /* Remove /dev/ component. */ + if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) + line += sizeof _PATH_DEV - 1; + + /* Mark entry in utmp as logged out. */ + if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) + return; + found = 0; + while (read(fd, &ut, sizeof ut) == sizeof ut) { + if (ut.ut_user[0] == '\0' || + strncmp(ut.ut_line, line, sizeof ut.ut_line) != 0) + continue; + memset(ut.ut_user, 0, sizeof ut.ut_user); + memset(ut.ut_host, 0, sizeof ut.ut_host); + ut.ut_time = _time_to_time32(time(NULL)); + lseek(fd, -(off_t)sizeof ut, L_INCR); + write(fd, &ut, sizeof ut); + found = 1; + } + close(fd); + if (!found) + return; + + /* utmp entry found. Also add logout entry to wtmp. */ + if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) { + write(fd, &ut, sizeof ut); + close(fd); + } +} Added: head/lib/libulog/ulog_login_pseudo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_login_pseudo.c Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include + +#include "ulog_internal.h" + +#define _PATH_ULOG_HELPER "/usr/libexec/ulog-helper" + +/* + * Registering login sessions. + */ + +static void +ulog_exec_helper(int fd, char const * const argv[]) +{ + sigset_t oblock, nblock; + pid_t pid, wpid; + int status; + + /* Block SIGCHLD. */ + sigemptyset(&nblock); + sigaddset(&nblock, SIGCHLD); + sigprocmask(SIG_BLOCK, &nblock, &oblock); + + switch (pid = fork()) { + case -1: + break; + case 0: + /* Execute helper program. */ + if (dup2(fd, STDIN_FILENO) == -1) + exit(EX_UNAVAILABLE); + sigprocmask(SIG_SETMASK, &oblock, NULL); + execv(_PATH_ULOG_HELPER, __DECONST(char * const *, argv)); + exit(EX_UNAVAILABLE); + default: + /* Wait for helper to finish. */ + do { + wpid = waitpid(pid, &status, 0); + } while (wpid == -1 && errno == EINTR); + break; + } + + sigprocmask(SIG_SETMASK, &oblock, NULL); +} + +void +ulog_login_pseudo(int fd, const char *host) +{ + char const * const args[4] = { "ulog-helper", "login", host, NULL }; + + ulog_exec_helper(fd, args); +} + +void +ulog_logout_pseudo(int fd) +{ + char const * const args[3] = { "ulog-helper", "logout", NULL }; + + ulog_exec_helper(fd, args); +} Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Thu Dec 3 15:14:30 2009 (r200061) +++ head/libexec/Makefile Thu Dec 3 15:48:24 2009 (r200062) @@ -29,6 +29,7 @@ SUBDIR= ${_atrun} \ ${_telnetd} \ tftpd \ ${_tftp-proxy} \ + ulog-helper \ ${_ypxfr} .if ${MK_AT} != "no" Added: head/libexec/ulog-helper/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/ulog-helper/Makefile Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +PROG= ulog-helper +BINOWN= root +BINMODE=4555 +NO_MAN= + +DPADD= ${LIBULOG} +LDADD= -lulog + +WARNS?= 6 + +.include Added: head/libexec/ulog-helper/ulog-helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/ulog-helper/ulog-helper.c Thu Dec 3 15:48:24 2009 (r200062) @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +/* + * This setuid helper utility writes user login records to disk. + * Unprivileged processes are not capable of writing records to utmp, + * wtmp and lastlog, but we do want to allow this for pseudo-terminals. + * Because a file descriptor to a pseudo-terminal master device can only + * be obtained by processes using the pseudo-terminal, we expect such a + * descriptor on stdin. + * + * It uses the real user ID of the calling process to determine the + * username. It does allow users to log arbitrary hostnames. + */ + +int +main(int argc, char *argv[]) +{ + const char *line; + + /* Device line name. */ + if ((line = ptsname(STDIN_FILENO)) == NULL) + return (EX_USAGE); + + if ((argc == 2 || argc == 3) && strcmp(argv[1], "login") == 0) { + struct passwd *pwd; + const char *host = NULL; + + /* Username. */ + pwd = getpwuid(getuid()); + if (pwd == NULL) + return (EX_OSERR); + + /* Hostname. */ + if (argc == 3) + host = argv[2]; + + if (ulog_login(line, pwd->pw_name, host) != 0) + return (EX_OSFILE); + return (EX_OK); + } else if (argc == 2 && strcmp(argv[1], "logout") == 0) { + if (ulog_logout(line) != 0) + return (EX_OSFILE); + return (EX_OK); + } + + return (EX_USAGE); +} Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Dec 3 15:14:30 2009 (r200061) +++ head/share/mk/bsd.libnames.mk Thu Dec 3 15:48:24 2009 (r200062) @@ -151,6 +151,7 @@ LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidf LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB20?= ${DESTDIR}${LIBDIR}/libusb20.a +LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 16:02:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A817106568B; Thu, 3 Dec 2009 16:02:04 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 41E3E8FC1C; Thu, 3 Dec 2009 16:02:02 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA27946; Thu, 03 Dec 2009 18:02:01 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4B17E0F8.1040700@freebsd.org> Date: Thu, 03 Dec 2009 18:02:00 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: John Baldwin References: <200912030811.nB38BK0h046790@svn.freebsd.org> <200912030745.28650.jhb@freebsd.org> In-Reply-To: <200912030745.28650.jhb@freebsd.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200053 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 16:02:04 -0000 on 03/12/2009 14:45 John Baldwin said the following: > On Thursday 03 December 2009 3:11:20 am Andriy Gapon wrote: >> Author: avg >> Date: Thu Dec 3 08:11:20 2009 >> New Revision: 200053 >> URL: http://svn.freebsd.org/changeset/base/200053 >> >> Log: >> ichsmb: try attaching only to intel hardware in the default case >> >> Ideally we should attempt attaching only to known supported devices. >> But I am not sure that we have all supported PCI IDs already listed, >> and I am too young to die, err, I don't want to take the heat from >> causing a trouble to someone. >> >> MFC after: 1 week >> X-ToDo: drop the default case > > Perhaps drop the default case in 8 and 9? I actually think the default case > has caused more harm than good in the past, and I suspect that there are > actually very few supported devices that we don't already have the PCI IDs > for. > I can drop it in head now, if no one objects. And MFC to 8 after 2 weeks. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 16:08:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D191106566B; Thu, 3 Dec 2009 16:08:01 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE1A8FC1B; Thu, 3 Dec 2009 16:08:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3G80jF018942; Thu, 3 Dec 2009 16:08:00 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3G80hm018936; Thu, 3 Dec 2009 16:08:00 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912031608.nB3G80hm018936@svn.freebsd.org> From: Shteryana Shopova Date: Thu, 3 Dec 2009 16:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200063 - head/contrib/bsnmp/snmp_mibII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 16:08:01 -0000 Author: syrinx Date: Thu Dec 3 16:08:00 2009 New Revision: 200063 URL: http://svn.freebsd.org/changeset/base/200063 Log: Fix a problem with high CPU consumption (up to 30%) by bsnmpd on a loaded system. Instead of constantly calling the mibII_idle function when the server is not busy call the function only once every 10 seconds to avoid bsnmpd constantly doing gettimeofday syscalls. Make the idle polling interval confugurable via begemotIfDataPoll. Reported and tested by: misho (at) aitbg (dot) com Oked by: harti MFC after: 1 week Modified: head/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt head/contrib/bsnmp/snmp_mibII/mibII.c head/contrib/bsnmp/snmp_mibII/mibII.h head/contrib/bsnmp/snmp_mibII/mibII_begemot.c head/contrib/bsnmp/snmp_mibII/mibII_tree.def Modified: head/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt ============================================================================== --- head/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt Thu Dec 3 15:48:24 2009 (r200062) +++ head/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt Thu Dec 3 16:08:00 2009 (r200063) @@ -39,7 +39,7 @@ IMPORTS FROM BEGEMOT-IP-MIB; begemotMib2 MODULE-IDENTITY - LAST-UPDATED "200602130000Z" + LAST-UPDATED "200908030000Z" ORGANIZATION "German Aerospace Center" CONTACT-INFO " Hartmut Brandt @@ -54,6 +54,12 @@ begemotMib2 MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for private mib2 stuff." + REVISION "200908030000Z" + DESCRIPTION + "Second edition adds begemotIfDataPoll object." + REVISION "200602130000Z" + DESCRIPTION + "Initial revision." ::= { begemotIp 1 } begemotIfMaxspeed OBJECT-TYPE @@ -87,4 +93,14 @@ begemotIfForcePoll OBJECT-TYPE bit rate in its MIB." ::= { begemotMib2 3 } +begemotIfDataPoll OBJECT-TYPE + SYNTAX TimeTicks + UNITS "deciseconds" + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "The rate at which the mib2 module will poll interface data." + DEFVAL { 100 } + ::= { begemotMib2 4 } + END Modified: head/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.c Thu Dec 3 15:48:24 2009 (r200062) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Thu Dec 3 16:08:00 2009 (r200063) @@ -117,6 +117,15 @@ u_int mibif_hc_update_interval; /* HC update timer handle */ static void *hc_update_timer; +/* Idle poll timer */ +static void *mibII_poll_timer; + +/* interfaces' data poll interval */ +u_int mibII_poll_ticks; + +/* Idle poll hook */ +static void mibII_idle(void *arg __unused); + /*****************************/ static const struct asn_oid oid_ifMIB = OIDX_ifMIB; @@ -410,6 +419,20 @@ mibif_reset_hc_timer(void) mibif_hc_update_interval = ticks; } +/** + * Restart the idle poll timer. + */ +void +mibif_restart_mibII_poll_timer(void) +{ + if (mibII_poll_timer != NULL) + timer_stop(mibII_poll_timer); + + if ((mibII_poll_timer = timer_start_repeat(mibII_poll_ticks * 10, + mibII_poll_ticks * 10, mibII_idle, NULL, module)) == NULL) + syslog(LOG_ERR, "timer_start(%u): %m", mibII_poll_ticks); +} + /* * Fetch new MIB data. */ @@ -1553,7 +1576,7 @@ get_cloners(void) * Idle function */ static void -mibII_idle(void) +mibII_idle(void *arg __unused) { struct mibifa *ifa; @@ -1608,6 +1631,10 @@ mibII_start(void) ipForward_reg = or_register(&oid_ipForward, "The MIB module for the display of CIDR multipath IP Routes.", module); + + mibII_poll_timer = NULL; + mibII_poll_ticks = MIBII_POLL_TICKS; + mibif_restart_mibII_poll_timer(); } /* @@ -1651,6 +1678,11 @@ mibII_init(struct lmodule *mod, int argc static int mibII_fini(void) { + if (mibII_poll_timer != NULL ) { + timer_stop(mibII_poll_timer); + mibII_poll_timer = NULL; + } + if (route_fd != NULL) fd_deselect(route_fd); if (route != -1) @@ -1690,7 +1722,7 @@ const struct snmp_module config = { "This module implements the interface and ip groups.", mibII_init, mibII_fini, - mibII_idle, /* idle */ + NULL, /* idle */ NULL, /* dump */ NULL, /* config */ mibII_start, Modified: head/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII.h Thu Dec 3 15:48:24 2009 (r200062) +++ head/contrib/bsnmp/snmp_mibII/mibII.h Thu Dec 3 16:08:00 2009 (r200063) @@ -211,6 +211,14 @@ extern u_int mibif_hc_update_interval; /* re-compute update interval */ void mibif_reset_hc_timer(void); +/* interfaces' data poll interval */ +extern u_int mibII_poll_ticks; + +/* restart the data poll timer */ +void mibif_restart_mibII_poll_timer(void); + +#define MIBII_POLL_TICKS 100 + /* get interfaces and interface addresses. */ void mib_fetch_interfaces(void); Modified: head/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_begemot.c Thu Dec 3 15:48:24 2009 (r200062) +++ head/contrib/bsnmp/snmp_mibII/mibII_begemot.c Thu Dec 3 16:08:00 2009 (r200063) @@ -59,6 +59,11 @@ op_begemot_mibII(struct snmp_context *ct ctx->scratch->int1 = mibif_force_hc_update_interval; mibif_force_hc_update_interval = value->v.uint32; return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + ctx->scratch->int1 = mibII_poll_ticks; + mibII_poll_ticks = value->v.uint32; + return (SNMP_ERR_NOERROR); } abort(); @@ -68,6 +73,10 @@ op_begemot_mibII(struct snmp_context *ct case LEAF_begemotIfForcePoll: mibif_force_hc_update_interval = ctx->scratch->int1; return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + mibII_poll_ticks = ctx->scratch->int1; + return (SNMP_ERR_NOERROR); } abort(); @@ -78,6 +87,10 @@ op_begemot_mibII(struct snmp_context *ct mibif_force_hc_update_interval = ctx->scratch->int1; mibif_reset_hc_timer(); return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + mibif_restart_mibII_poll_timer(); + return (SNMP_ERR_NOERROR); } abort(); } @@ -98,6 +111,10 @@ op_begemot_mibII(struct snmp_context *ct case LEAF_begemotIfForcePoll: value->v.uint32 = mibif_force_hc_update_interval; return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + value->v.uint32 = mibII_poll_ticks; + return (SNMP_ERR_NOERROR); } abort(); } Modified: head/contrib/bsnmp/snmp_mibII/mibII_tree.def ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_tree.def Thu Dec 3 15:48:24 2009 (r200062) +++ head/contrib/bsnmp/snmp_mibII/mibII_tree.def Thu Dec 3 16:08:00 2009 (r200063) @@ -240,6 +240,7 @@ (1 begemotIfMaxspeed COUNTER64 op_begemot_mibII GET) (2 begemotIfPoll TIMETICKS op_begemot_mibII GET) (3 begemotIfForcePoll TIMETICKS op_begemot_mibII GET SET) + (4 begemotIfDataPoll TIMETICKS op_begemot_mibII GET SET) ) ) ) From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 16:10:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF7A0106566C; Thu, 3 Dec 2009 16:10:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEBD28FC1D; Thu, 3 Dec 2009 16:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3GALxv019036; Thu, 3 Dec 2009 16:10:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3GALIc019033; Thu, 3 Dec 2009 16:10:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912031610.nB3GALIc019033@svn.freebsd.org> From: Andriy Gapon Date: Thu, 3 Dec 2009 16:10:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200064 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 16:10:22 -0000 Author: avg Date: Thu Dec 3 16:10:21 2009 New Revision: 200064 URL: http://svn.freebsd.org/changeset/base/200064 Log: mca: small enhancements related to cpu quirks - use utility macros for CPU family/model checking - limit Intel P6 quirk to pre-Nehalem models (taken from OpenSolaris) - add AMD GartTblWkEn quirk for families 0Fh and 10h; I haven't experienced any problems without the quirk but both Linux and OpenSolaris do this - slightly re-arrange quirk code to provide for the future generalization and separation of vendor-specific quirk functions Reviewed by: jhb MFC after: 1 week Modified: head/sys/amd64/amd64/mca.c head/sys/i386/i386/mca.c Modified: head/sys/amd64/amd64/mca.c ============================================================================== --- head/sys/amd64/amd64/mca.c Thu Dec 3 16:08:00 2009 (r200063) +++ head/sys/amd64/amd64/mca.c Thu Dec 3 16:10:21 2009 (r200064) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } Modified: head/sys/i386/i386/mca.c ============================================================================== --- head/sys/i386/i386/mca.c Thu Dec 3 16:08:00 2009 (r200063) +++ head/sys/i386/i386/mca.c Thu Dec 3 16:10:21 2009 (r200064) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void mca_init(void) { uint64_t mcg_cap; + uint64_t ctl; + int skip; int i; /* MCE is required. */ @@ -495,15 +498,26 @@ mca_init(void) wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { - /* - * Enable logging of all errors. For P6 - * processors, MC0_CTL is always enabled. - * - * XXX: Better CPU test needed here? - */ - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); + /* By default enable logging of all errors. */ + ctl = 0xffffffffffffffffUL; + skip = 0; + + if (cpu_vendor_id == CPU_VENDOR_INTEL) { + /* + * For P6 models before Nehalem MC0_CTL is + * always enabled and reserved. + */ + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 + && CPUID_TO_MODEL(cpu_id) < 0x1a) + skip = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { + /* BKDG for Family 10h: unset GartTblWkEn. */ + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) + ctl &= ~(1UL << 10); + } + if (!skip) + wrmsr(MSR_MC_CTL(i), ctl); /* Clear all errors. */ wrmsr(MSR_MC_STATUS(i), 0); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 16:33:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 345381065670; Thu, 3 Dec 2009 16:33:48 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1917E8FC1C; Thu, 3 Dec 2009 16:33:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3GXlZY019592; Thu, 3 Dec 2009 16:33:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3GXlQu019588; Thu, 3 Dec 2009 16:33:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912031633.nB3GXlQu019588@svn.freebsd.org> From: Ed Schouten Date: Thu, 3 Dec 2009 16:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200065 - head/lib/libulog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 16:33:48 -0000 Author: ed Date: Thu Dec 3 16:33:47 2009 New Revision: 200065 URL: http://svn.freebsd.org/changeset/base/200065 Log: Also implement ut_type. I thought we couldn't emulate this field, but we can derive this field by looking at special values for ut_host, ut_line and ut_name. Modified: head/lib/libulog/ulog.h head/lib/libulog/ulog_getutxent.3 head/lib/libulog/ulog_getutxent.c Modified: head/lib/libulog/ulog.h ============================================================================== --- head/lib/libulog/ulog.h Thu Dec 3 16:10:21 2009 (r200064) +++ head/lib/libulog/ulog.h Thu Dec 3 16:33:47 2009 (r200065) @@ -63,8 +63,23 @@ struct ulog_utmpx { char *ut_host; #if 0 pid_t ut_pid; +#endif short ut_type; +#define EMPTY 0 +#if 0 +#define BOOT_TIME 1 #endif +#define OLD_TIME 2 +#define NEW_TIME 3 +#if 0 +#define USER_PROCESS 4 +#define INIT_PROCESS 5 +#endif +#define LOGIN_PROCESS 6 +#define DEAD_PROCESS 7 + +#define SHUTDOWN_TIME 8 +#define REBOOT_TIME 9 struct timeval ut_tv; }; Modified: head/lib/libulog/ulog_getutxent.3 ============================================================================== --- head/lib/libulog/ulog_getutxent.3 Thu Dec 3 16:10:21 2009 (r200064) +++ head/lib/libulog/ulog_getutxent.3 Thu Dec 3 16:33:47 2009 (r200065) @@ -52,6 +52,7 @@ struct ulog_utmpx { char *ut_user; /* Username. */ char *ut_line; /* TTY device. */ char *ut_host; /* Remote hostname. */ + short ut_type; /* Type of entry. */ struct timeval ut_tv; /* Timestamp. */ }; .Ed @@ -67,6 +68,27 @@ directory. .It Fa ut_host An optional hostname of a remote system, if the login session is provided through a networked login service. +.It Fa ut_type +The +.Fa ut_type +field contains the type of the message, which may have one of the +following values: +.Bl -tag -width LOGIN_PROCESS +.It Dv EMPTY +No valid user accounting information. +.It Dv OLD_TIME +Identifies time when system clock changed. +.It Dv NEW_TIME +Identifies time after system clock changed. +.It Dv LOGIN_PROCESS +Identifies the session leader of a logged in user. +.It Dv DEAD_PROCESS +Identifies a session leader who has exited. +.It Dv SHUTDOWN_TIME +Identifies time when system was shut down. +.It Dv REBOOT_TIME +Identifies time when system was rebooted. +.El .It Fa ut_tv Timestamp indicating when the entry was last modified. .El Modified: head/lib/libulog/ulog_getutxent.c ============================================================================== --- head/lib/libulog/ulog_getutxent.c Thu Dec 3 16:10:21 2009 (r200064) +++ head/lib/libulog/ulog_getutxent.c Thu Dec 3 16:33:47 2009 (r200065) @@ -70,6 +70,21 @@ ulog_getutxent(void) COPY_STRING(host); utx.ut_tv.tv_sec = _time32_to_time(ut.ut_time); utx.ut_tv.tv_usec = 0; +#define MATCH(field, value) (strcmp(utx.ut_ ## field, (value)) == 0) + if (MATCH(user, "date") && MATCH(line, "|")) + utx.ut_type = OLD_TIME; + else if (MATCH(user, "date") && MATCH(line, "{")) + utx.ut_type = NEW_TIME; + else if (MATCH(user, "shutdown") && MATCH(line, "~")) + utx.ut_type = SHUTDOWN_TIME; + else if (MATCH(user, "reboot") && MATCH(line, "~")) + utx.ut_type = REBOOT_TIME; + else if (MATCH(user, "") && MATCH(host, "")) + utx.ut_type = DEAD_PROCESS; + else if (!MATCH(user, "")) + utx.ut_type = LOGIN_PROCESS; + else + utx.ut_type = EMPTY; return (&utx); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 16:42:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4343B1065697; Thu, 3 Dec 2009 16:42:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 279CB8FC1E; Thu, 3 Dec 2009 16:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3GgJYe019820; Thu, 3 Dec 2009 16:42:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3GgJHh019817; Thu, 3 Dec 2009 16:42:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912031642.nB3GgJHh019817@svn.freebsd.org> From: Ed Schouten Date: Thu, 3 Dec 2009 16:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200066 - head/usr.bin/users X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 16:42:19 -0000 Author: ed Date: Thu Dec 3 16:42:18 2009 New Revision: 200066 URL: http://svn.freebsd.org/changeset/base/200066 Log: Port users(1) to libulog. Instead of digging through the utmp database by hand, use proper API calls to do so. Instead of parsing entries with a non-empty ut_user, we now look at LOGIN_PROCESS entries. Modified: head/usr.bin/users/Makefile head/usr.bin/users/users.c Modified: head/usr.bin/users/Makefile ============================================================================== --- head/usr.bin/users/Makefile Thu Dec 3 16:33:47 2009 (r200065) +++ head/usr.bin/users/Makefile Thu Dec 3 16:42:18 2009 (r200066) @@ -3,4 +3,7 @@ PROG= users +DPADD= ${LIBULOG} +LDADD= -lulog + .include Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Thu Dec 3 16:33:47 2009 (r200065) +++ head/usr.bin/users/users.c Thu Dec 3 16:42:18 2009 (r200066) @@ -45,15 +45,16 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include #include #include #include #include #include +#include #include -#include -typedef char namebuf[UT_NAMESIZE]; +typedef char namebuf[MAXLOGNAME]; int scmp(const void *, const void *); static void usage(void); @@ -65,7 +66,7 @@ main(int argc, char **argv) int ncnt = 0; int nmax = 0; int cnt; - struct utmp utmp; + struct ulog_utmpx *ut; int ch; while ((ch = getopt(argc, argv, "")) != -1) @@ -77,28 +78,28 @@ main(int argc, char **argv) argc -= optind; argv += optind; - if (!freopen(_PATH_UTMP, "r", stdin)) - errx(1, "can't open %s", _PATH_UTMP); - while (fread((char *)&utmp, sizeof(utmp), 1, stdin) == 1) { - if (*utmp.ut_name) { - if (ncnt >= nmax) { - nmax += 32; - names = realloc(names, sizeof (*names) * nmax); - if (!names) { - errx(1, "realloc"); - /* NOTREACHED */ - } + ulog_setutxent(); + while ((ut = ulog_getutxent()) != NULL) { + if (ut->ut_type != LOGIN_PROCESS) + continue; + if (ncnt >= nmax) { + nmax += 32; + names = realloc(names, sizeof(*names) * nmax); + if (!names) { + errx(1, "realloc"); + /* NOTREACHED */ } - (void)strncpy(names[ncnt], utmp.ut_name, UT_NAMESIZE); - ++ncnt; } + (void)strlcpy(names[ncnt], ut->ut_user, sizeof(*names)); + ++ncnt; } - if (ncnt) { - qsort(names, ncnt, UT_NAMESIZE, scmp); - (void)printf("%.*s", UT_NAMESIZE, names[0]); + ulog_endutxent(); + if (ncnt > 0) { + qsort(names, ncnt, sizeof(namebuf), scmp); + (void)printf("%s", names[0]); for (cnt = 1; cnt < ncnt; ++cnt) - if (strncmp(names[cnt], names[cnt - 1], UT_NAMESIZE)) - (void)printf(" %.*s", UT_NAMESIZE, names[cnt]); + if (strcmp(names[cnt], names[cnt - 1]) != 0) + (void)printf(" %s", names[cnt]); (void)printf("\n"); } exit(0); @@ -114,5 +115,6 @@ usage(void) int scmp(const void *p, const void *q) { - return(strncmp(p, q, UT_NAMESIZE)); + + return (strcmp(p, q)); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 17:05:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 161921065672; Thu, 3 Dec 2009 17:05:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E049A8FC1B; Thu, 3 Dec 2009 17:05:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3H5aP6020337; Thu, 3 Dec 2009 17:05:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3H5amN020332; Thu, 3 Dec 2009 17:05:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912031705.nB3H5amN020332@svn.freebsd.org> From: Ed Schouten Date: Thu, 3 Dec 2009 17:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200067 - in head: lib/libulog usr.bin/users X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 17:05:37 -0000 Author: ed Date: Thu Dec 3 17:05:36 2009 New Revision: 200067 URL: http://svn.freebsd.org/changeset/base/200067 Log: Use USER_PROCESS instead of LOGIN_PROCESS. POSIX isn't clear about how the fields should be used, but according to utmpx(5) on Linux, LOGIN_PROCESS refers to a TTY that's still running a getty. Modified: head/lib/libulog/ulog.h head/lib/libulog/ulog_getutxent.3 head/lib/libulog/ulog_getutxent.c head/usr.bin/users/users.c Modified: head/lib/libulog/ulog.h ============================================================================== --- head/lib/libulog/ulog.h Thu Dec 3 16:42:18 2009 (r200066) +++ head/lib/libulog/ulog.h Thu Dec 3 17:05:36 2009 (r200067) @@ -71,11 +71,11 @@ struct ulog_utmpx { #endif #define OLD_TIME 2 #define NEW_TIME 3 -#if 0 #define USER_PROCESS 4 +#if 0 #define INIT_PROCESS 5 -#endif #define LOGIN_PROCESS 6 +#endif #define DEAD_PROCESS 7 #define SHUTDOWN_TIME 8 Modified: head/lib/libulog/ulog_getutxent.3 ============================================================================== --- head/lib/libulog/ulog_getutxent.3 Thu Dec 3 16:42:18 2009 (r200066) +++ head/lib/libulog/ulog_getutxent.3 Thu Dec 3 17:05:36 2009 (r200067) @@ -73,15 +73,15 @@ The .Fa ut_type field contains the type of the message, which may have one of the following values: -.Bl -tag -width LOGIN_PROCESS +.Bl -tag -width SHUTDOWN_TIME .It Dv EMPTY No valid user accounting information. .It Dv OLD_TIME Identifies time when system clock changed. .It Dv NEW_TIME Identifies time after system clock changed. -.It Dv LOGIN_PROCESS -Identifies the session leader of a logged in user. +.It Dv USER_PROCESS +Identifies a process. .It Dv DEAD_PROCESS Identifies a session leader who has exited. .It Dv SHUTDOWN_TIME Modified: head/lib/libulog/ulog_getutxent.c ============================================================================== --- head/lib/libulog/ulog_getutxent.c Thu Dec 3 16:42:18 2009 (r200066) +++ head/lib/libulog/ulog_getutxent.c Thu Dec 3 17:05:36 2009 (r200067) @@ -82,7 +82,7 @@ ulog_getutxent(void) else if (MATCH(user, "") && MATCH(host, "")) utx.ut_type = DEAD_PROCESS; else if (!MATCH(user, "")) - utx.ut_type = LOGIN_PROCESS; + utx.ut_type = USER_PROCESS; else utx.ut_type = EMPTY; Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Thu Dec 3 16:42:18 2009 (r200066) +++ head/usr.bin/users/users.c Thu Dec 3 17:05:36 2009 (r200067) @@ -80,7 +80,7 @@ main(int argc, char **argv) ulog_setutxent(); while ((ut = ulog_getutxent()) != NULL) { - if (ut->ut_type != LOGIN_PROCESS) + if (ut->ut_type != USER_PROCESS) continue; if (ncnt >= nmax) { nmax += 32; From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:02:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FFE1106566B; Thu, 3 Dec 2009 18:02:56 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F397E8FC1A; Thu, 3 Dec 2009 18:02:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3I2t8Q021474; Thu, 3 Dec 2009 18:02:55 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3I2txS021472; Thu, 3 Dec 2009 18:02:55 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200912031802.nB3I2txS021472@svn.freebsd.org> From: Roman Divacky Date: Thu, 3 Dec 2009 18:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200068 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:02:56 -0000 Author: rdivacky Date: Thu Dec 3 18:02:55 2009 New Revision: 200068 URL: http://svn.freebsd.org/changeset/base/200068 Log: Connect unzip to the build. Approved by: ed (mentor) Approved by: des (unzip author) Tested by: exp ports build (miwi) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Dec 3 17:05:36 2009 (r200067) +++ head/usr.bin/Makefile Thu Dec 3 18:02:55 2009 (r200068) @@ -203,6 +203,7 @@ SUBDIR= alias \ unexpand \ ${_unifdef} \ uniq \ + unzip \ units \ unvis \ ${_usbhidaction} \ From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:03:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC5041065670; Thu, 3 Dec 2009 18:03:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAB8B8FC12; Thu, 3 Dec 2009 18:03:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3I3gJE021538; Thu, 3 Dec 2009 18:03:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3I3gtl021530; Thu, 3 Dec 2009 18:03:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912031803.nB3I3gtl021530@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 18:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200069 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:03:43 -0000 Author: trasz Date: Thu Dec 3 18:03:42 2009 New Revision: 200069 URL: http://svn.freebsd.org/changeset/base/200069 Log: Remove unneeded ifdefs. Reviewed by: rmacklem Modified: head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfs/nfs_commonacl.c Thu Dec 3 18:03:42 2009 (r200069) @@ -37,7 +37,6 @@ extern int nfsrv_useacl; static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, enum vtype type, acl_perm_t *permp); -#if defined(NFS4_ACL_EXTATTR_NAME) /* * Handle xdr for an ace. */ @@ -263,189 +262,7 @@ nfsrv_acemasktoperm(u_int32_t acetype, u *permp = perm; return (0); } -#else -/* - * Handle xdr for an ace. - */ -APPLESTATIC int -nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, - int *aceerrp, int *acesizep, NFSPROC_T *p) -{ - u_int32_t *tl; - int len, gotid = 0, owner = 0, error = 0, aceerr = 0; - u_char *name, namestr[NFSV4_SMALLSTR + 1]; - u_int32_t flag, mask, acetype; - gid_t gid; - uid_t uid; - - *aceerrp = 0; - NFSM_DISSECT(tl, u_int32_t *, 4 * NFSX_UNSIGNED); - acetype = fxdr_unsigned(u_int32_t, *tl++); - flag = fxdr_unsigned(u_int32_t, *tl++); - mask = fxdr_unsigned(u_int32_t, *tl++); - len = fxdr_unsigned(int, *tl); - if (len < 0) { - return (NFSERR_BADXDR); - } else if (len == 0) { - /* Netapp filers return a 0 length who for nil users */ - acep->ae_tag = ACL_UNDEFINED_TAG; - acep->ae_id = ACL_UNDEFINED_ID; - acep->ae_perm = (acl_perm_t)0; - if (acesizep) - *acesizep = 4 * NFSX_UNSIGNED; - return (0); - } - if (len > NFSV4_SMALLSTR) - name = malloc(len + 1, M_NFSSTRING, M_WAITOK); - else - name = namestr; - error = nfsrv_mtostr(nd, name, len); - if (error) { - if (len > NFSV4_SMALLSTR) - free(name, M_NFSSTRING); - return (error); - } - if (len == 6) { - if (!NFSBCMP(name, "OWNER@", 6)) { - acep->ae_tag = ACL_USER_OBJ; - acep->ae_id = ACL_UNDEFINED_ID; - owner = 1; - gotid = 1; - } else if (!NFSBCMP(name, "GROUP@", 6)) { - acep->ae_tag = ACL_GROUP_OBJ; - acep->ae_id = ACL_UNDEFINED_ID; - gotid = 1; - flag &= ~NFSV4ACE_IDENTIFIERGROUP; - } - } else if (len == 9 && !NFSBCMP(name, "EVERYONE@", 9)) { - acep->ae_tag = ACL_OTHER; - acep->ae_id = ACL_UNDEFINED_ID; - gotid = 1; - } - if (!gotid) { - if (flag & NFSV4ACE_IDENTIFIERGROUP) { - flag &= ~NFSV4ACE_IDENTIFIERGROUP; - acep->ae_tag = ACL_GROUP; - aceerr = nfsv4_strtogid(name, len, &gid, p); - if (!aceerr) - acep->ae_id = (uid_t)gid; - } else { - acep->ae_tag = ACL_USER; - aceerr = nfsv4_strtouid(name, len, &uid, p); - if (!aceerr) - acep->ae_id = uid; - } - } - if (len > NFSV4_SMALLSTR) - free(name, M_NFSSTRING); - - /* - * Now, check for unsupported types or flag bits. - */ - if (!aceerr && ((acetype != NFSV4ACE_ALLOWEDTYPE && - acetype != NFSV4ACE_AUDITTYPE && acetype != NFSV4ACE_ALARMTYPE - && acetype != NFSV4ACE_DENIEDTYPE) || flag)) - aceerr = NFSERR_ATTRNOTSUPP; - - /* - * And turn the mask into perm bits. - */ - if (!aceerr) - aceerr = nfsrv_acemasktoperm(acetype, mask, owner, VREG, - &acep->ae_perm); - *aceerrp = aceerr; - if (acesizep) - *acesizep = NFSM_RNDUP(len) + (4 * NFSX_UNSIGNED); - return (0); -nfsmout: - return (error); -} - -/* - * Turn an NFSv4 ace mask into R/W/X flag bits. - */ -static int -nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, - enum vtype type, acl_perm_t *permp) -{ - acl_perm_t perm = 0x0; - - if (acetype != NFSV4ACE_ALLOWEDTYPE && acetype != NFSV4ACE_DENIEDTYPE){ - if (mask & ~NFSV4ACE_AUDITMASK) - return (NFSERR_ATTRNOTSUPP); - } - if (mask & NFSV4ACE_DELETE) { - return (NFSERR_ATTRNOTSUPP); - } - if (acetype == NFSV4ACE_DENIEDTYPE) { - if (mask & NFSV4ACE_ALLFILESMASK) { - return (NFSERR_ATTRNOTSUPP); - } - if (owner) { - if (mask & NFSV4ACE_OWNERMASK) { - return (NFSERR_ATTRNOTSUPP); - } - } else { - if ((mask & NFSV4ACE_OWNERMASK) != NFSV4ACE_OWNERMASK) { - return (NFSERR_ATTRNOTSUPP); - } - mask &= ~NFSV4ACE_OWNERMASK; - } - } else if (acetype == NFSV4ACE_ALLOWEDTYPE) { - if ((mask & NFSV4ACE_ALLFILESMASK) != NFSV4ACE_ALLFILESMASK) { - return (NFSERR_ATTRNOTSUPP); - } - mask &= ~NFSV4ACE_ALLFILESMASK; - if (owner) { - if ((mask & NFSV4ACE_OWNERMASK) != NFSV4ACE_OWNERMASK) { - return (NFSERR_ATTRNOTSUPP); - } - mask &= ~NFSV4ACE_OWNERMASK; - } else if (mask & NFSV4ACE_OWNERMASK) { - return (NFSERR_ATTRNOTSUPP); - } - } - if (type == VDIR) { - if ((mask & NFSV4ACE_DIRREADMASK) == NFSV4ACE_DIRREADMASK) { - perm |= ACL_READ; - mask &= ~NFSV4ACE_DIRREADMASK; - } - if ((mask & NFSV4ACE_DIRWRITEMASK) == NFSV4ACE_DIRWRITEMASK) { - perm |= ACL_WRITE; - mask &= ~NFSV4ACE_DIRWRITEMASK; - } - if ((mask & NFSV4ACE_DIREXECUTEMASK)==NFSV4ACE_DIREXECUTEMASK){ - perm |= ACL_EXECUTE; - mask &= ~NFSV4ACE_DIREXECUTEMASK; - } - } else { - if (acetype == NFSV4ACE_DENIEDTYPE && - (mask & NFSV4ACE_SYNCHRONIZE)) { - return (NFSERR_ATTRNOTSUPP); - } - mask &= ~(NFSV4ACE_SYNCHRONIZE | NFSV4ACE_DELETECHILD); - if ((mask & NFSV4ACE_READMASK) == NFSV4ACE_READMASK) { - perm |= ACL_READ; - mask &= ~NFSV4ACE_READMASK; - } - if ((mask & NFSV4ACE_WRITEMASK) == NFSV4ACE_WRITEMASK) { - perm |= ACL_WRITE; - mask &= ~NFSV4ACE_WRITEMASK; - } - if ((mask & NFSV4ACE_EXECUTEMASK) == NFSV4ACE_EXECUTEMASK) { - perm |= ACL_EXECUTE; - mask &= ~NFSV4ACE_EXECUTEMASK; - } - } - if (mask) { - return (NFSERR_ATTRNOTSUPP); - } - *permp = perm; - return (0); -} -#endif /* !NFS4_ACL_EXTATTR_NAME */ -#ifdef NFS4_ACL_EXTATTR_NAME /* local functions */ static int nfsrv_buildace(struct nfsrv_descript *, u_char *, int, enum vtype, int, int, struct acl_entry *); @@ -742,5 +559,3 @@ nfsrv_compareacl(NFSACL_T *aclp1, NFSACL } return (0); } - -#endif /* NFS4_ACL_EXTATTR_NAME */ Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfs/nfs_commonport.c Thu Dec 3 18:03:42 2009 (r200069) @@ -421,7 +421,6 @@ newnfs_portinit(void) mtx_init(&nfs_state_mutex, "nfs_state_mutex", NULL, MTX_DEF); } -#ifdef NFS4_ACL_EXTATTR_NAME /* * Determine if the file system supports NFSv4 ACLs. * Return 1 if it does, 0 otherwise. @@ -441,7 +440,6 @@ nfs_supportsnfsv4acls(struct mount *mp) } return (0); } -#endif /* NFS4_ACL_EXTATTR_NAME */ extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *); Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfs/nfs_commonsubs.c Thu Dec 3 18:03:42 2009 (r200069) @@ -650,10 +650,8 @@ nfsrv_dissectacl(struct nfsrv_descript * int acecnt, error = 0, aceerr = 0, acesize; *aclerrp = 0; -#ifdef NFS4_ACL_EXTATTR_NAME if (aclp) aclp->acl_cnt = 0; -#endif /* * Parse out the ace entries and expect them to conform to * what can be supported by R/W/X bits. @@ -661,28 +659,22 @@ nfsrv_dissectacl(struct nfsrv_descript * NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); aclsize = NFSX_UNSIGNED; acecnt = fxdr_unsigned(int, *tl); -#ifdef NFS4_ACL_EXTATTR_NAME if (acecnt > ACL_MAX_ENTRIES) aceerr = 1; -#endif if (nfsrv_useacl == 0) aceerr = 1; for (i = 0; i < acecnt; i++) { -#ifdef NFS4_ACL_EXTATTR_NAME if (aclp && !aceerr) error = nfsrv_dissectace(nd, &aclp->acl_entry[i], &aceerr, &acesize, p); else -#endif error = nfsrv_skipace(nd, &acesize); if (error) return (error); aclsize += acesize; } -#ifdef NFS4_ACL_EXTATTR_NAME if (aclp && !aceerr) aclp->acl_cnt = acecnt; -#endif if (aceerr) *aclerrp = aceerr; if (aclsizep) @@ -1014,7 +1006,6 @@ nfsv4_loadattr(struct nfsrv_descript *nd case NFSATTRBIT_ACL: if (compare) { if (!(*retcmpp)) { -#ifdef NFS4_ACL_EXTATTR_NAME if (nfsrv_useacl) { NFSACL_T *naclp; @@ -1028,9 +1019,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd if (aceerr || nfsrv_compareacl(aclp, naclp)) *retcmpp = NFSERR_NOTSAME; acl_free(naclp); - } else -#endif - { + } else { error = nfsrv_dissectacl(nd, NULL, &aceerr, &cnt, p); *retcmpp = NFSERR_ATTRNOTSUPP; @@ -1932,9 +1921,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd aclp = saclp; } else { NFSCLRNOTFILLABLE_ATTRBIT(retbitp); -#ifdef NFS4_ACL_EXTATTR_NAME naclp = acl_alloc(M_WAITOK); -#endif aclp = naclp; } nfsvno_getfs(&fsinf, isdgram); @@ -1957,21 +1944,15 @@ nfsv4_fillattr(struct nfsrv_descript *nd /* * And the NFSv4 ACL... */ - if (NFSISSET_ATTRBIT(retbitp, NFSATTRBIT_ACLSUPPORT) -#ifdef NFS4_ACL_EXTATTR_NAME - && (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && - !NFSHASNFS4ACL(vnode_mount(vp)))) -#endif - ) { + if (NFSISSET_ATTRBIT(retbitp, NFSATTRBIT_ACLSUPPORT) && + (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && + !NFSHASNFS4ACL(vnode_mount(vp))))) { NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACLSUPPORT); } if (NFSISSET_ATTRBIT(retbitp, NFSATTRBIT_ACL)) { -#ifdef NFS4_ACL_EXTATTR_NAME if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) && !NFSHASNFS4ACL(vnode_mount(vp)))) { -#endif NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); -#ifdef NFS4_ACL_EXTATTR_NAME } else if (naclp != NULL) { NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_ACCESS(vp, VREAD_ACL, cred, p); @@ -1987,7 +1968,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd NFSCLRBIT_ATTRBIT(retbitp, NFSATTRBIT_ACL); } } -#endif } /* * Put out the attribute bitmap for the ones being filled in @@ -2005,11 +1985,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd switch (bitpos) { case NFSATTRBIT_SUPPORTEDATTRS: NFSSETSUPP_ATTRBIT(&attrbits); -#ifdef NFS4_ACL_EXTATTR_NAME if (nfsrv_useacl == 0 || ((cred != NULL || p != NULL) - && !NFSHASNFS4ACL(vnode_mount(vp)))) -#endif - { + && !NFSHASNFS4ACL(vnode_mount(vp)))) { NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACLSUPPORT); NFSCLRBIT_ATTRBIT(&attrbits,NFSATTRBIT_ACL); } @@ -2082,7 +2059,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd /* * Recommended Attributes. (Only the supported ones.) */ -#ifdef NFS4_ACL_EXTATTR_NAME case NFSATTRBIT_ACL: retnum += nfsrv_buildacl(nd, aclp, vnode_vtype(vp), p); break; @@ -2091,7 +2067,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd *tl = txdr_unsigned(NFSV4ACE_SUPTYPES); retnum += NFSX_UNSIGNED; break; -#endif case NFSATTRBIT_CANSETTIME: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); if (fsinf.fs_properties & NFSV3FSINFO_CANSETTIME) @@ -2397,10 +2372,8 @@ nfsv4_fillattr(struct nfsrv_descript *nd }; } } -#ifdef NFS4_ACL_EXTATTR_NAME if (naclp != NULL) acl_free(naclp); -#endif *retnump = txdr_unsigned(retnum); return (retnum + prefixnum); } Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfs/nfs_var.h Thu Dec 3 18:03:42 2009 (r200069) @@ -329,7 +329,6 @@ void newnfs_timer(void *); /* nfs_commonacl.c */ int nfsrv_dissectace(struct nfsrv_descript *, struct acl_entry *, int *, int *, NFSPROC_T *); -#ifdef NFS4_ACL_EXTATTR_NAME int nfsrv_buildacl(struct nfsrv_descript *, NFSACL_T *, enum vtype, NFSPROC_T *); int nfsrv_aclaccess(vnode_t, accmode_t, u_int32_t, struct ucred *, @@ -337,7 +336,6 @@ int nfsrv_aclaccess(vnode_t, accmode_t, int nfsrv_setacl(vnode_t, NFSACL_T *, struct ucred *, NFSPROC_T *); int nfsrv_compareacl(NFSACL_T *, NFSACL_T *); -#endif /* nfs_clrpcops.c */ int nfsrpc_null(vnode_t, struct ucred *, NFSPROC_T *); Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfs/nfsport.h Thu Dec 3 18:03:42 2009 (r200069) @@ -125,11 +125,7 @@ #define NFSPROC_T struct thread #define NFSDEV_T dev_t #define NFSSVCARGS nfssvc_args -#ifdef NFS4_ACL_EXTATTR_NAME #define NFSACL_T struct acl -#else -#define NFSACL_T void -#endif /* * These should be defined as the types used for the corresponding VOP's Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Thu Dec 3 18:03:42 2009 (r200069) @@ -81,10 +81,8 @@ static int nfsrpc_createv4(vnode_t , cha static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, struct nfscllockowner *, u_int64_t, u_int64_t, u_int32_t, struct ucred *, NFSPROC_T *, int); -#ifdef NFS4_ACL_EXTATTR_NAME static int nfsrpc_setaclrpc(vnode_t, struct ucred *, NFSPROC_T *, struct acl *, nfsv4stateid_t *, void *); -#endif /* * nfs null call from vfs. @@ -983,14 +981,9 @@ nfsrpc_setattr(vnode_t vp, struct vattr if (vap != NULL) error = nfsrpc_setattrrpc(vp, vap, &stateid, cred, p, rnap, attrflagp, stuff); -#ifdef NFS4_ACL_EXTATTR_NAME else error = nfsrpc_setaclrpc(vp, cred, p, aclp, &stateid, stuff); -#else - else - error = EOPNOTSUPP; -#endif if (error == NFSERR_STALESTATEID) nfscl_initiate_recovery(nmp->nm_clp); if (lckp != NULL) @@ -4094,7 +4087,6 @@ nfsrpc_delegreturn(struct nfscldeleg *dp return (error); } -#ifdef NFS4_ACL_EXTATTR_NAME /* * nfs getacl call. */ @@ -4168,5 +4160,3 @@ nfsrpc_setaclrpc(vnode_t vp, struct ucre mbuf_freem(nd->nd_mrep); return (nd->nd_repstat); } - -#endif /* NFS4_ACL_EXTATTR_NAME */ Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Thu Dec 3 18:02:55 2009 (r200068) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Dec 3 18:03:42 2009 (r200069) @@ -128,10 +128,8 @@ static vop_readlink_t nfs_readlink; static vop_print_t nfs_print; static vop_advlock_t nfs_advlock; static vop_advlockasync_t nfs_advlockasync; -#ifdef NFS4_ACL_EXTATTR_NAME static vop_getacl_t nfs_getacl; static vop_setacl_t nfs_setacl; -#endif /* * Global vfs data structures for nfs @@ -166,10 +164,8 @@ struct vop_vector newnfs_vnodeops = { .vop_strategy = nfs_strategy, .vop_symlink = nfs_symlink, .vop_write = ncl_write, -#ifdef NFS4_ACL_EXTATTR_NAME .vop_getacl = nfs_getacl, .vop_setacl = nfs_setacl, -#endif }; struct vop_vector newnfs_fifoops = { @@ -331,12 +327,9 @@ nfs_access(struct vop_access_args *ap) * unless the file is a socket, fifo, or a block or character * device resident on the filesystem. */ - if ((ap->a_accmode & (VWRITE | VAPPEND -#ifdef NFS4_ACL_EXTATTR_NAME - | VWRITE_NAMED_ATTRS | VDELETE_CHILD | VWRITE_ATTRIBUTES | - VDELETE | VWRITE_ACL | VWRITE_OWNER -#endif - )) != 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { + if ((ap->a_accmode & (VWRITE | VAPPEND | VWRITE_NAMED_ATTRS | + VDELETE_CHILD | VWRITE_ATTRIBUTES | VDELETE | VWRITE_ACL | + VWRITE_OWNER)) != 0 && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) { switch (vp->v_type) { case VREG: case VDIR: @@ -366,10 +359,8 @@ nfs_access(struct vop_access_args *ap) mode |= NFSACCESS_EXTEND; if (ap->a_accmode & VEXEC) mode |= NFSACCESS_EXECUTE; -#ifdef NFS4_ACL_EXTATTR_NAME if (ap->a_accmode & VDELETE) mode |= NFSACCESS_DELETE; -#endif } else { if (ap->a_accmode & VWRITE) mode |= (NFSACCESS_MODIFY | NFSACCESS_EXTEND); @@ -377,12 +368,10 @@ nfs_access(struct vop_access_args *ap) mode |= NFSACCESS_EXTEND; if (ap->a_accmode & VEXEC) mode |= NFSACCESS_LOOKUP; -#ifdef NFS4_ACL_EXTATTR_NAME if (ap->a_accmode & VDELETE) mode |= NFSACCESS_DELETE; if (ap->a_accmode & VDELETE_CHILD) mode |= NFSACCESS_MODIFY; -#endif } /* XXX safety belt, only make blanket request if caching */ if (nfsaccess_cache_timeout > 0) { @@ -3136,7 +3125,6 @@ nfs_lock1(struct vop_lock1_args *ap) ap->a_line)); } -#ifdef NFS4_ACL_EXTATTR_NAME static int nfs_getacl(struct vop_getacl_args *ap) { @@ -3168,5 +3156,3 @@ nfs_setacl(struct vop_setacl_args *ap) } return (error); } - -#endif /* NFS4_ACL_EXTATTR_NAME */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:13:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 325BE1065670; Thu, 3 Dec 2009 18:13:48 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1EC8FC15; Thu, 3 Dec 2009 18:13:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3IDlKt021813; Thu, 3 Dec 2009 18:13:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3IDlkK021806; Thu, 3 Dec 2009 18:13:47 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912031813.nB3IDlkK021806@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 3 Dec 2009 18:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200070 - head/share/man/man4/man4.powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:13:48 -0000 Author: nwhitehorn Date: Thu Dec 3 18:13:47 2009 New Revision: 200070 URL: http://svn.freebsd.org/changeset/base/200070 Log: Add manpages for ams(4), akbd(4), adb(4), and cuda(4), which describe various drivers for Apple Desktop Bus controllers and peripherals. MFC after: 3 days Added: head/share/man/man4/man4.powerpc/adb.4 (contents, props changed) head/share/man/man4/man4.powerpc/akbd.4 (contents, props changed) head/share/man/man4/man4.powerpc/ams.4 (contents, props changed) head/share/man/man4/man4.powerpc/cuda.4 (contents, props changed) Modified: head/share/man/man4/man4.powerpc/Makefile head/share/man/man4/man4.powerpc/pmu.4 Modified: head/share/man/man4/man4.powerpc/Makefile ============================================================================== --- head/share/man/man4/man4.powerpc/Makefile Thu Dec 3 18:03:42 2009 (r200069) +++ head/share/man/man4/man4.powerpc/Makefile Thu Dec 3 18:13:47 2009 (r200070) @@ -1,6 +1,10 @@ # $FreeBSD$ -MAN= bm.4 \ +MAN= adb.4 \ + akbd.4 \ + ams.4 \ + bm.4 \ + cuda.4 \ pmu.4 \ powermac_nvram.4 \ snd_ai2s.4 \ Added: head/share/man/man4/man4.powerpc/adb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/adb.4 Thu Dec 3 18:13:47 2009 (r200070) @@ -0,0 +1,70 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt ADB 4 +.Os +.Sh NAME +.Nm adb +.Nd Apple Desktop Bus +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Apple Desktop Bus, which is a simple +multi-drop bus used in general for input peripherals in older Apple +Macintosh hardware. +.Pp +The Apple Desktop Bus provides attachment for up to 16 devices, +including multiple devices of a single type, but not does support +hot-plugging. +.Sh SEE ALSO +Apple Tech Note HW01: ADB - The Untold Story: Space Aliens Ate My Mouse: +.Pa http://developer.apple.com/legacy/mac/library/technotes/hw/hw_01.html +.Pp +.Xr akbd 4 , +.Xr ams 4 , +.Xr cuda 4 , +.Xr pmu 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Added: head/share/man/man4/man4.powerpc/akbd.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/akbd.4 Thu Dec 3 18:13:47 2009 (r200070) @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt AKBD 4 +.Os +.Sh NAME +.Nm akbd +.Nd ADB Keyboard Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for all keyboards attached to the Apple Desktop +Bus (ADB). +.Sh HARDWARE +Devices supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple Extended Keyboard +.It +Apple Keyboard II +.It +Apple iBook Keyboard +.It +Apple PowerBook Keyboard +.El +.Sh SEE ALSO +.Xr adb 4 , +.Xr cuda 4 , +.Xr pmu 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Added: head/share/man/man4/man4.powerpc/ams.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/ams.4 Thu Dec 3 18:13:47 2009 (r200070) @@ -0,0 +1,87 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt AMS 4 +.Os +.Sh NAME +.Nm ams +.Nd ADB Mouse Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for mice and trackpads attached to the Apple Desktop +Bus (ADB) implementing both the base and extended ADB mouse protocols. +.Sh HARDWARE +Devices supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple Mouse +.It +ADB Extended Mouse +.It +MacAlly 2-Button Mouse +.It +Apple iBook Trackpad +.It +Apple PowerBook Trackpad +.El +.Sh SYSCTL VARIABLES +.Bl -tag -width indent +.It Va dev.ams.%d.tapping +On ADB trackpads, setting this sysctl to 1 causes taps on the trackpad to +be interpreted as button clicks. +.El +.Sh SEE ALSO +Apple Tech Note HW01: ADB - The Untold Story: Space Aliens Ate My Mouse: +.Pa http://developer.apple.com/legacy/mac/library/technotes/hw/hw_01.html +.Pp +.Xr adb 4 , +.Xr cuda 4 , +.Xr pmu 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Added: head/share/man/man4/man4.powerpc/cuda.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/man4.powerpc/cuda.4 Thu Dec 3 18:13:47 2009 (r200070) @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt CUDA 4 +.Os +.Sh NAME +.Nm cuda +.Nd Apple CUDA I/O Controller Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Cd "device cuda" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the CUDA VIA (Versatile Interface Attachment) +chip found in pre-Core99 Apple hardware, such as the Power Macintosh G3. +.Pp +The Apple CUDA controller is a multi-purpose ASIC that provides power +control and an +.Xr adb 4 +interface. +.Sh HARDWARE +Chips supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple CUDA I/O Controller +.El +.Sh SEE ALSO +.Xr adb 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Nx 4.0 , +and then in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Michael Lorenz +.Aq macallan@NetBSD.org +and ported to FreeBSD by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Modified: head/share/man/man4/man4.powerpc/pmu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/pmu.4 Thu Dec 3 18:03:42 2009 (r200069) +++ head/share/man/man4/man4.powerpc/pmu.4 Thu Dec 3 18:13:47 2009 (r200070) @@ -95,7 +95,8 @@ Current fraction of the battery's maximu .El .Sh SEE ALSO .Xr acpi 4 , -.Xr adb 4 +.Xr adb 4 , +.Xr led 4 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:16:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5904F1065670; Thu, 3 Dec 2009 18:16:15 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E9218FC1E; Thu, 3 Dec 2009 18:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3IGF32021913; Thu, 3 Dec 2009 18:16:15 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3IGFb8021911; Thu, 3 Dec 2009 18:16:15 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912031816.nB3IGFb8021911@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 18:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200071 - head/sys/gnu/fs/reiserfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:16:15 -0000 Author: trasz Date: Thu Dec 3 18:16:14 2009 New Revision: 200071 URL: http://svn.freebsd.org/changeset/base/200071 Log: Remove unused code. Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Thu Dec 3 18:13:47 2009 (r200070) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Thu Dec 3 18:16:14 2009 (r200071) @@ -429,40 +429,11 @@ reiserfs_mountfs(struct vnode *devvp, st struct reiserfs_super_block *rs; struct cdev *dev = devvp->v_rdev; -#if (__FreeBSD_version >= 600000) struct g_consumer *cp; struct bufobj *bo; -#endif //ronly = (mp->mnt_flag & MNT_RDONLY) != 0; -#if (__FreeBSD_version < 600000) - /* - * Disallow multiple mounts of the same device. - * Disallow mounting of a device that is currently in use - * (except for root, which might share swap device for miniroot). - * Flush out any old buffers remaining from a previous use. - */ - if ((error = vfs_mountedon(devvp)) != 0) - return (error); - if (vcount(devvp) > 1) - return (EBUSY); - - error = vinvalbuf(devvp, V_SAVE, td->td_ucred, td, 0, 0); - if (error) { - VOP_UNLOCK(devvp, 0); - return (error); - } - - /* - * Open the device in read-only, 'cause we don't support write - * for now - */ - error = VOP_OPEN(devvp, FREAD, FSCRED, td, NULL); - VOP_UNLOCK(devvp, 0); - if (error) - return (error); -#else DROP_GIANT(); g_topology_lock(); error = g_vfs_open(devvp, &cp, "reiserfs", /* read-only */ 0); @@ -475,7 +446,6 @@ reiserfs_mountfs(struct vnode *devvp, st bo = &devvp->v_bufobj; bo->bo_private = cp; bo->bo_ops = g_vfs_bufops; -#endif if (devvp->v_rdev->si_iosize_max != 0) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; @@ -500,10 +470,8 @@ reiserfs_mountfs(struct vnode *devvp, st rmp->rm_mountp = mp; rmp->rm_devvp = devvp; rmp->rm_dev = dev; -#if (__FreeBSD_version >= 600000) rmp->rm_bo = &devvp->v_bufobj; rmp->rm_cp = cp; -#endif /* Set default values for options: non-aggressive tails */ REISERFS_SB(sbi)->s_mount_opt = (1 << REISERFS_SMALLTAIL); @@ -630,9 +598,6 @@ out: } } -#if (__FreeBSD_version < 600000) - (void)VOP_CLOSE(devvp, FREAD, NOCRED, td); -#else if (cp != NULL) { DROP_GIANT(); g_topology_lock(); @@ -640,7 +605,6 @@ out: g_topology_unlock(); PICKUP_GIANT(); } -#endif if (sbi) free(sbi, M_REISERFSMNT); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:42:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AC9B1065692; Thu, 3 Dec 2009 18:42:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 694C28FC24; Thu, 3 Dec 2009 18:42:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3IgKYY022466; Thu, 3 Dec 2009 18:42:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3IgKLE022464; Thu, 3 Dec 2009 18:42:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912031842.nB3IgKLE022464@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 3 Dec 2009 18:42:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200072 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:42:20 -0000 Author: yongari Date: Thu Dec 3 18:42:19 2009 New Revision: 200072 URL: http://svn.freebsd.org/changeset/base/200072 Log: MFC r199564: Minimize interface reinitialization by checking IFF_DRV_RUNNING flag. This fixes unnecessary interface UP/DOWNs during getting an IP address via DHCP. Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Thu Dec 3 18:16:14 2009 (r200071) +++ stable/8/sys/dev/re/if_re.c Thu Dec 3 18:42:19 2009 (r200072) @@ -753,6 +753,7 @@ re_diag(struct rl_softc *sc) ifp->if_flags |= IFF_PROMISC; sc->rl_testmode = 1; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); sc->rl_flags |= RL_FLAG_LINK; if (sc->rl_type == RL_8169) @@ -2145,8 +2146,10 @@ re_poll_locked(struct ifnet *ifp, enum p * XXX check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); + } } return (rx_npkts); } @@ -2222,8 +2225,10 @@ re_int_task(void *arg, int npending) RL_ISR_TX_ERR|RL_ISR_TX_DESC_UNAVAIL)) re_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); + } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2539,6 +2544,9 @@ re_init_locked(struct rl_softc *sc) mii = device_get_softc(sc->rl_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel pending I/O and free all RX/TX buffers. */ @@ -2793,7 +2801,8 @@ re_ioctl(struct ifnet *ifp, u_long comma case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - re_set_rxmode(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + re_set_rxmode(sc); RL_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2862,8 +2871,10 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; } - if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) + if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init(sc); + } VLAN_CAPABILITIES(ifp); } break; @@ -2899,6 +2910,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_oerrors++; re_rxeof(sc, NULL); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:45:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6EA106568F; Thu, 3 Dec 2009 18:45:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 504448FC19; Thu, 3 Dec 2009 18:45:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3Ij1DG022576; Thu, 3 Dec 2009 18:45:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Ij1Qw022574; Thu, 3 Dec 2009 18:45:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912031845.nB3Ij1Qw022574@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 3 Dec 2009 18:45:01 +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: r200073 - stable/7/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:45:01 -0000 Author: yongari Date: Thu Dec 3 18:45:01 2009 New Revision: 200073 URL: http://svn.freebsd.org/changeset/base/200073 Log: MFC r199564: Minimize interface reinitialization by checking IFF_DRV_RUNNING flag. This fixes unnecessary interface UP/DOWNs during getting an IP address via DHCP. Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Thu Dec 3 18:42:19 2009 (r200072) +++ stable/7/sys/dev/re/if_re.c Thu Dec 3 18:45:01 2009 (r200073) @@ -754,6 +754,7 @@ re_diag(struct rl_softc *sc) ifp->if_flags |= IFF_PROMISC; sc->rl_testmode = 1; + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); sc->rl_flags |= RL_FLAG_LINK; if (sc->rl_type == RL_8169) @@ -2140,8 +2141,10 @@ re_poll_locked(struct ifnet *ifp, enum p * XXX check behaviour on receiver stalls. */ - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); + } } } #endif /* DEVICE_POLLING */ @@ -2216,8 +2219,10 @@ re_int_task(void *arg, int npending) RL_ISR_TX_ERR|RL_ISR_TX_DESC_UNAVAIL)) re_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); + } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); @@ -2533,6 +2538,9 @@ re_init_locked(struct rl_softc *sc) mii = device_get_softc(sc->rl_miibus); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + /* * Cancel pending I/O and free all RX/TX buffers. */ @@ -2787,7 +2795,8 @@ re_ioctl(struct ifnet *ifp, u_long comma case SIOCADDMULTI: case SIOCDELMULTI: RL_LOCK(sc); - re_set_rxmode(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + re_set_rxmode(sc); RL_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2856,8 +2865,10 @@ re_ioctl(struct ifnet *ifp, u_long comma if ((mask & IFCAP_WOL_MAGIC) != 0) ifp->if_capenable ^= IFCAP_WOL_MAGIC; } - if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) + if (reinit && ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init(sc); + } VLAN_CAPABILITIES(ifp); } break; @@ -2893,6 +2904,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_oerrors++; re_rxeof(sc); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:48:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53A941065676; Thu, 3 Dec 2009 18:48:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 428508FC14; Thu, 3 Dec 2009 18:48:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3ImXUI022688; Thu, 3 Dec 2009 18:48:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3ImXLx022686; Thu, 3 Dec 2009 18:48:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912031848.nB3ImXLx022686@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 3 Dec 2009 18:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200074 - stable/8/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:48:33 -0000 Author: yongari Date: Thu Dec 3 18:48:32 2009 New Revision: 200074 URL: http://svn.freebsd.org/changeset/base/200074 Log: MFC r199565: Move interface reinitialization down after disabling WOL in resume path. Modified: stable/8/sys/dev/re/if_re.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Thu Dec 3 18:45:01 2009 (r200073) +++ stable/8/sys/dev/re/if_re.c Thu Dec 3 18:48:32 2009 (r200074) @@ -3023,15 +3023,16 @@ re_resume(device_t dev) CSR_READ_1(sc, RL_GPIO) | 0x01); } - /* reinitialize interface if necessary */ - if (ifp->if_flags & IFF_UP) - re_init_locked(sc); - /* * Clear WOL matching such that normal Rx filtering * wouldn't interfere with WOL patterns. */ re_clrwol(sc); + + /* reinitialize interface if necessary */ + if (ifp->if_flags & IFF_UP) + re_init_locked(sc); + sc->suspended = 0; RL_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 18:50:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49E7B106568B; Thu, 3 Dec 2009 18:50:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38EAD8FC08; Thu, 3 Dec 2009 18:50:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3Io5jp022773; Thu, 3 Dec 2009 18:50:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Io5JO022771; Thu, 3 Dec 2009 18:50:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912031850.nB3Io5JO022771@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 3 Dec 2009 18:50:05 +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: r200075 - stable/7/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 18:50:05 -0000 Author: yongari Date: Thu Dec 3 18:50:04 2009 New Revision: 200075 URL: http://svn.freebsd.org/changeset/base/200075 Log: MFC r199565: Move interface reinitialization down after disabling WOL in resume path. Modified: stable/7/sys/dev/re/if_re.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/re/if_re.c ============================================================================== --- stable/7/sys/dev/re/if_re.c Thu Dec 3 18:48:32 2009 (r200074) +++ stable/7/sys/dev/re/if_re.c Thu Dec 3 18:50:04 2009 (r200075) @@ -3017,15 +3017,16 @@ re_resume(device_t dev) CSR_READ_1(sc, RL_GPIO) | 0x01); } - /* reinitialize interface if necessary */ - if (ifp->if_flags & IFF_UP) - re_init_locked(sc); - /* * Clear WOL matching such that normal Rx filtering * wouldn't interfere with WOL patterns. */ re_clrwol(sc); + + /* reinitialize interface if necessary */ + if (ifp->if_flags & IFF_UP) + re_init_locked(sc); + sc->suspended = 0; RL_UNLOCK(sc); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 19:16:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A6F41065676; Thu, 3 Dec 2009 19:16:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 082BE8FC19; Thu, 3 Dec 2009 19:16:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3JGe23023361; Thu, 3 Dec 2009 19:16:40 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3JGe88023359; Thu, 3 Dec 2009 19:16:40 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912031916.nB3JGe88023359@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 19:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200076 - head/usr.sbin/mountd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 19:16:41 -0000 Author: trasz Date: Thu Dec 3 19:16:40 2009 New Revision: 200076 URL: http://svn.freebsd.org/changeset/base/200076 Log: Description of steps required to setup NFSv4 server is in nfsv4(4); add reference to exports(5), since that's the obvious starting point for searching for this. Modified: head/usr.sbin/mountd/exports.5 Modified: head/usr.sbin/mountd/exports.5 ============================================================================== --- head/usr.sbin/mountd/exports.5 Thu Dec 3 18:50:04 2009 (r200075) +++ head/usr.sbin/mountd/exports.5 Thu Dec 3 19:16:40 2009 (r200076) @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd June 30, 2008 +.Dd December 3, 2009 .Dt EXPORTS 5 .Os .Sh NAME @@ -473,6 +473,7 @@ operations on the server, so long as val The machine grumpy.cis.uoguelph.ca is permitted to perform NFSv4 state operations on the server using AUTH_SYS credentials, as well as Kerberos ones. .Sh SEE ALSO +.Xr nfsv4 4 , .Xr netgroup 5 , .Xr mountd 8 , .Xr nfsd 8 , From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 19:27:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAA8A106566C; Thu, 3 Dec 2009 19:27:12 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB8B8FC08; Thu, 3 Dec 2009 19:27:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3JRCdu023607; Thu, 3 Dec 2009 19:27:12 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3JRCgB023605; Thu, 3 Dec 2009 19:27:12 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <200912031927.nB3JRCgB023605@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 3 Dec 2009 19:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200077 - head/lib/libc/nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 19:27:12 -0000 Author: gabor (doc,ports committer) Date: Thu Dec 3 19:27:12 2009 New Revision: 200077 URL: http://svn.freebsd.org/changeset/base/200077 Log: - Update the Spanish NLS catalog Reviewed by: carvay, the.infamous.paul@gmail.com, Joan Picanyol i Puig , Ing . Marcos Luis Ortiz Valmaseda , eskanete@gmail.com, Jose M Rodriguez , Guillermo Hernandez , dani.doni@gmail.com Modified: head/lib/libc/nls/es_ES.ISO8859-1.msg Modified: head/lib/libc/nls/es_ES.ISO8859-1.msg ============================================================================== --- head/lib/libc/nls/es_ES.ISO8859-1.msg Thu Dec 3 19:16:40 2009 (r200076) +++ head/lib/libc/nls/es_ES.ISO8859-1.msg Thu Dec 3 19:27:12 2009 (r200077) @@ -62,7 +62,7 @@ $ EFBIG $ ENOSPC 28 No queda espacio libre en el dispositivo $ ESPIPE -29 Illegal seek +29 Búsqueda ilegal $ EROFS 30 Sistema de ficheros de solo lectura $ EMLINK @@ -88,7 +88,7 @@ $ EMSGSIZE $ EPROTOTYPE 41 Tipo erróneo de protocolo para el socket $ ENOPROTOOPT -42 protocolo no disponible +42 Protocolo no disponible $ EPROTONOSUPPORT 43 Protocolo no contemplado $ ESOCKTNOSUPPORT @@ -176,23 +176,33 @@ $ EOVERFLOW $ ECANCELED 85 Operación cancelada $ EILSEQ -86 Illegal byte sequence +86 Secuencia de bytes ilegal $ ENOATTR 87 Atributo no encontrado $ EDOOFUS 88 Error de programación +$ EBADMSG +89 Mensaje inválido +$ EMULTIHOP +90 Intento de hop multiple +$ ENOLINK +91 El enlace se ha roto +$ EPROTO +92 Fallo de protocolo +$ ENOTCAPABLE +93 Habilidades insuficientes $ $ strsignal() support catalog $ $set 2 $ SIGHUP -1 Fín de línea (Hangup) +1 Fin de línea (Hangup) $ SIGINT 2 Interrumpido $ SIGQUIT 3 Terminado $ SIGILL -4 Illegal instruction +4 Instrucción ilegal $ SIGTRAP 5 Trace/BPT trap $ SIGABRT @@ -247,3 +257,39 @@ $ SIGUSR1 30 Señal definida por el usuario n1 $ SIGUSR2 31 Señal definida por el usuario n2 +$ +$ gai_strerror() support catalog +$ +$set 3 +$ 1 (obsoleto) +1 Tipo de dirección no contemplado +$ EAI_AGAIN +2 Error transitorio en la resolución de nombres +$ EAI_BADFLAGS +3 Valor inválido de ai_flags +$ EAI_FAIL +4 Error no recuperable en la resolución de nombres +$ EAI_FAMILY +5 ai_family no contemplado +$ EAI_MEMORY +6 Error en la asignación de memoria +$ 7 (obsoleto) +7 No hay dirección asociada con el nombre de máquina +$ EAI_NONAME +8 No se dispone nombre de máquina, ni nombre de servicio +$ EAI_SERVICE +9 Nombre de servicio no contemplado en ai_socktype +$ EAI_SOCKTYPE +10 ai_socktype no contemplado +$ EAI_SYSTEM +11 Error de sistema devuelto en errno +$ EAI_BADHINTS +12 Valor inválido de hints +$ EAI_PROTOCOL +13 Protocolo resuelto desconocido +$ EAI_OVERFLOW +14 Búfer de argumentos sobrepasado +$ 0 +32766 Éxito +$ NL_MSGMAX +32767 Error desconocido From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 19:37:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3644106566C; Thu, 3 Dec 2009 19:37:52 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1C648FC08; Thu, 3 Dec 2009 19:37:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3JbqgO023833; Thu, 3 Dec 2009 19:37:52 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Jbq4O023831; Thu, 3 Dec 2009 19:37:52 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912031937.nB3Jbq4O023831@svn.freebsd.org> From: Fabien Thomas Date: Thu, 3 Dec 2009 19:37:52 +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: r200078 - stable/7/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 19:37:53 -0000 Author: fabient Date: Thu Dec 3 19:37:52 2009 New Revision: 200078 URL: http://svn.freebsd.org/changeset/base/200078 Log: MFC 179886: Complete the merge after hwpmc backport. Make preparations for increasing the size of the kernel virtual address space on the amd64 architecture. The amd64 architecture requires kernel code and global variables to reside in the highest 2GB of the 64-bit virtual address space. Thus, KERNBASE cannot change. However, KERNBASE is sometimes used as the start of the kernel virtual address space. Henceforth, VM_MIN_KERNEL_ADDRESS should be used instead. Since KERNBASE and VM_MIN_KERNEL_ADDRESS are still the same address, there should be no visible effect from this change (yet). Modified: stable/7/sys/amd64/include/pmc_mdep.h Modified: stable/7/sys/amd64/include/pmc_mdep.h ============================================================================== --- stable/7/sys/amd64/include/pmc_mdep.h Thu Dec 3 19:27:12 2009 (r200077) +++ stable/7/sys/amd64/include/pmc_mdep.h Thu Dec 3 19:37:52 2009 (r200078) @@ -104,8 +104,8 @@ union pmc_md_pmc { #define PMC_IN_KERNEL_STACK(S,START,END) \ ((S) >= (START) && (S) < (END)) -#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \ - (va) < DMAP_MAX_ADDRESS) || ((va) >= KERNBASE && \ +#define PMC_IN_KERNEL(va) (((va) >= DMAP_MIN_ADDRESS && \ + (va) < DMAP_MAX_ADDRESS) || ((va) >= VM_MIN_KERNEL_ADDRESS && \ (va) < VM_MAX_KERNEL_ADDRESS)) #define PMC_IN_USERSPACE(va) ((va) <= VM_MAXUSER_ADDRESS) From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 19:45:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 832D3106566C; Thu, 3 Dec 2009 19:45:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id ECE268FC0C; Thu, 3 Dec 2009 19:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 92C8341C7A5; Thu, 3 Dec 2009 20:45:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id C6r-82dK-Yxi; Thu, 3 Dec 2009 20:45:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id F41E541C796; Thu, 3 Dec 2009 20:45:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id A65334448EC; Thu, 3 Dec 2009 19:43:33 +0000 (UTC) Date: Thu, 3 Dec 2009 19:43:33 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Hajimu UMEMOTO In-Reply-To: <200912031116.nB3BGsm2091411@svn.freebsd.org> Message-ID: <20091203193619.J83957@maildrop.int.zabbadoz.net> References: <200912031116.nB3BGsm2091411@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200055 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 19:45:08 -0000 On Thu, 3 Dec 2009, Hajimu UMEMOTO wrote: > Author: ume > Date: Thu Dec 3 11:16:53 2009 > New Revision: 200055 > URL: http://svn.freebsd.org/changeset/base/200055 > > Log: > Teach an IPv6 to the debug prints. > > Modified: > head/sys/netinet/ipfw/ip_fw2.c > > Modified: head/sys/netinet/ipfw/ip_fw2.c > ============================================================================== > --- head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 09:18:40 2009 (r200054) > +++ head/sys/netinet/ipfw/ip_fw2.c Thu Dec 3 11:16:53 2009 (r200055) > @@ -1050,6 +1050,28 @@ hash_packet(struct ipfw_flow_id *id) > return i; > } > > +static __inline void > +unlink_dyn_rule_print(struct ipfw_flow_id *id) > +{ > + struct in_addr da; > + char src[48], dst[48]; Does it need to be 48 rather than 46? You do not have the [] here. If not INET6_ADDRSTRLEN is what we use elsewhere. I would actually prefer to only have #ifdef INET6 char src[INET6_ADDRSTRLEN|48], .. #else char src[INET_ADDRSTRLEN|18], .. #endif as it's 60 bytes of stack size for people w/o INET6 support (shame on them;-) Some applies for equivalent code further down. Ideally we would also hide the INET things under INET but that's a longer way to go... /bz > +#ifdef INET6 > + if (IS_IP6_FLOW_ID(id)) { > + ip6_sprintf(src, &id->src_ip6); > + ip6_sprintf(dst, &id->dst_ip6); > + } else > +#endif > + { > + da.s_addr = htonl(id->src_ip); > + inet_ntoa_r(da, src); > + da.s_addr = htonl(id->dst_ip); > + inet_ntoa_r(da, dst); > + } > + printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", > + src, id->src_port, dst, id->dst_port, V_dyn_count - 1); > +} -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 19:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6858F1065692; Thu, 3 Dec 2009 19:59:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56ECD8FC14; Thu, 3 Dec 2009 19:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3JxS0V024299; Thu, 3 Dec 2009 19:59:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3JxSLY024297; Thu, 3 Dec 2009 19:59:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912031959.nB3JxSLY024297@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 19:59:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200079 - head/usr.sbin/nfsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 19:59:28 -0000 Author: trasz Date: Thu Dec 3 19:59:27 2009 New Revision: 200079 URL: http://svn.freebsd.org/changeset/base/200079 Log: Cosmetical fixes. Modified: head/usr.sbin/nfsd/nfsv4.4 Modified: head/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- head/usr.sbin/nfsd/nfsv4.4 Thu Dec 3 19:37:52 2009 (r200078) +++ head/usr.sbin/nfsd/nfsv4.4 Thu Dec 3 19:59:27 2009 (r200079) @@ -24,22 +24,20 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2009 +.Dd December 3, 2009 .Dt NFSV4 4 .Os .Sh NAME -.Nm nfsv4 +.Nm NFSv4 .Nd NFS Version 4 Protocol -.Sh SYNOPSIS -experimental client and server with NFSv4 support .Sh DESCRIPTION -The experimental nfs client and server provides support for the +The experimental NFS client and server provides support for the .Tn NFSv4 specification; see .%T "Network File System (NFS) Version 4 Protocol \\*(tNRFC\\*(sP 3530" . The protocol is somewhat similar to NFS Version 3, but differs in significant ways. -It uses a single Compound RPC that concatenates operations to-gether. +It uses a single compound RPC that concatenates operations to-gether. Each of these operations are similar to the RPCs of NFS Version 3. The operations in the compound are performed in order, until one of them fails (returns an error) and then the RPC terminates at that point. @@ -48,10 +46,10 @@ It has integrated locking support, which implies that the server is no longer stateless. As such, the -.Tn NFSv4 -server remains in recovery mode for a Grace period (always greater than the +.Nm +server remains in recovery mode for a grace period (always greater than the lease duration the server uses) after a reboot. -During this Grace period, clients may recover state but not perform other +During this grace period, clients may recover state but not perform other open/lock state changing operations. To provide for correct recovery semantics, a small file described by .Xr stablerestart 5 @@ -61,14 +59,14 @@ the server will not start. If this file is lost, it should be recovered from backups, since creating an empty .Xr stablerestart 5 -file will result in the server starting without providing a Grace Period +file will result in the server starting without providing a grace period for recovery. Note that recovery only occurs when the server machine is rebooted, not when the .Xr nfsd 8 are just restarted. .Pp -It provides several optional features not in NFS Version 3: +It provides several optional features not present in NFS Version 3: .sp .Bd -literal -offset indent -compact - NFS Version 4 ACLs @@ -78,7 +76,7 @@ It provides several optional features no .Ed .Pp The -.Tn NFSv4 +.Nm protocol does not use a separate mount protocol and assumes that the server provides a single file system tree structure, rooted at the point in the local file system tree specified by one or more @@ -131,7 +129,7 @@ by default. However, this can normally be overridden by a command line option or configuration file for the daemon used to do the name<->number mapping. -On FreeBSD, the mapping daemon is called +Under FreeBSD, the mapping daemon is called .Xr nfsuserd 8 and has a command line option that overrides the domain component of the machine's hostname. @@ -143,7 +141,7 @@ report a lot of ``nobody'' and ``nogroup .Pp Although uid/gid numbers are no longer used in the .Nm -protocol, they will still be in the RPC authentication fields when running +protocol, they will still be in the RPC authentication fields when using AUTH_SYS (sec=sys), which is the default. As such, in this case both the user/group name and number spaces must be consistent between the client and server. @@ -154,8 +152,8 @@ with RPCSEC_GSS (sec=krb5, krb5i, krb5p) will go on the wire. .Sh SERVER SETUP .Pp -To set up the experimental nfs server that supports -.Nm +To set up the experimental NFS server that supports +.Nm , you will need to either build a kernel with: .sp .Bd -literal -offset indent -compact @@ -318,13 +316,13 @@ variables. NFS V4 stable restart file .El .Sh SEE ALSO -.Xr stablerestart 5 -.Xr mountd 8 -.Xr nfscbd 8 -.Xr nfsd 8 -.Xr nfsdumpstate 8 -.Xr nfsrevoke 8 -.Xr nfsuserd 8 +.Xr stablerestart 5 , +.Xr mountd 8 , +.Xr nfscbd 8 , +.Xr nfsd 8 , +.Xr nfsdumpstate 8 , +.Xr nfsrevoke 8 , +.Xr nfsuserd 8 , .Sh BUGS At this time, there is no recall of delegations for local file system operations. From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 20:02:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFBB61065692; Thu, 3 Dec 2009 20:02:26 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857A88FC2F; Thu, 3 Dec 2009 20:02:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3K2Qeo024461; Thu, 3 Dec 2009 20:02:26 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3K2QdG024459; Thu, 3 Dec 2009 20:02:26 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912032002.nB3K2QdG024459@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 20:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200080 - head/usr.sbin/nfsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 20:02:26 -0000 Author: trasz Date: Thu Dec 3 20:02:26 2009 New Revision: 200080 URL: http://svn.freebsd.org/changeset/base/200080 Log: Cosmetical fixes. Modified: head/usr.sbin/nfsd/stablerestart.5 Modified: head/usr.sbin/nfsd/stablerestart.5 ============================================================================== --- head/usr.sbin/nfsd/stablerestart.5 Thu Dec 3 19:59:27 2009 (r200079) +++ head/usr.sbin/nfsd/stablerestart.5 Thu Dec 3 20:02:26 2009 (r200080) @@ -24,23 +24,23 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2007 +.Dd December 3, 2009 .Dt STABLERESTART 5 .Os .Sh NAME .Nm nfs-stablerestart .Nd handles restart edge conditions for the .Tn NFS -V4 server +v4 server .Sh SYNOPSIS .Nm nfs-stablerestart .Sh DESCRIPTION The .Nm file holds information that allows the -.Tn NFS -V4 server to restart without always returning the NFSERR_NOGRACE error, as described in the -.Tn NFS V4 +.Tn NFSv4 +server to restart without always returning the NFSERR_NOGRACE error, as described in the +.Tn NFSv4 server specification; see .%T "Network File System (NFS) Version 4 Protocol \\*(tNRFC\\*(sP 3530, Section 8.6.3" . .Pp @@ -49,11 +49,11 @@ The first record in the file, as defined last incarnation of the server and the number of boot times that follows. Following this are the number of previous boot times listed in the first record. -The lease duration is used to set the Grace Period. +The lease duration is used to set the grace period. The boot times are used to avoid the unlikely occurrence of a boot time being reused, due to a TOD clock going backwards. This record and the previous boot times with this boot time added is re-written at the -end of the Grace Period. +end of the grace period. .Pp The rest of the file are appended records, as defined by struct nfst_rec in /usr/include/fs/nfs/nfsrvstate.h and are used @@ -77,14 +77,14 @@ a local disk drive that holds the file, .Sh FILES .Bl -tag -width /var/db/nfs-stablerestart -compact .It Pa /var/db/nfs-stablerestart -NFS V4 stable restart file +NFSv4 stable restart file .El .Sh SEE ALSO -.Xr nfsv4 4 +.Xr nfsv4 4 , .Xr nfsd 8 .Sh BUGS -If the file is empty, the NFS V4 server has no choice but to return -NFSERR_NOGRACE for all Reclaim requests. Although correct, this is +If the file is empty, the NFSv4 server has no choice but to return +NFSERR_NOGRACE for all reclaim requests. Although correct, this is a highly undesirable occurrence, so the file should not be lost if at all possible. Nfsd will not create the file if it does not exist and will simply log a failure to start, in the hopes that the From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 20:06:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA3A41065672; Thu, 3 Dec 2009 20:06:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B91608FC1A; Thu, 3 Dec 2009 20:06:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3K63NC024620; Thu, 3 Dec 2009 20:06:03 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3K63GV024618; Thu, 3 Dec 2009 20:06:03 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912032006.nB3K63GV024618@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 3 Dec 2009 20:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200081 - head/usr.sbin/nfsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 20:06:03 -0000 Author: trasz Date: Thu Dec 3 20:06:03 2009 New Revision: 200081 URL: http://svn.freebsd.org/changeset/base/200081 Log: Yet another cosmetic fix. Modified: head/usr.sbin/nfsd/stablerestart.5 Modified: head/usr.sbin/nfsd/stablerestart.5 ============================================================================== --- head/usr.sbin/nfsd/stablerestart.5 Thu Dec 3 20:02:26 2009 (r200080) +++ head/usr.sbin/nfsd/stablerestart.5 Thu Dec 3 20:06:03 2009 (r200081) @@ -29,9 +29,9 @@ .Os .Sh NAME .Nm nfs-stablerestart -.Nd handles restart edge conditions for the -.Tn NFS -v4 server +.Nd restart information for the +.Tn NFSv4 +server .Sh SYNOPSIS .Nm nfs-stablerestart .Sh DESCRIPTION From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 20:17:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03D6D106566C; Thu, 3 Dec 2009 20:17:00 +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 E74098FC0C; Thu, 3 Dec 2009 20:16:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3KGxcm025030; Thu, 3 Dec 2009 20:16:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3KGxRj025028; Thu, 3 Dec 2009 20:16:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912032016.nB3KGxRj025028@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 3 Dec 2009 20:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200082 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 20:17:00 -0000 Author: kib Date: Thu Dec 3 20:16:59 2009 New Revision: 200082 URL: http://svn.freebsd.org/changeset/base/200082 Log: Remove wrong assertion. Debugee is allowed to lose a signal. Reported and tested by: jh MFC after: 2 weeks Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Dec 3 20:06:03 2009 (r200081) +++ head/sys/kern/kern_sig.c Thu Dec 3 20:16:59 2009 (r200082) @@ -2492,7 +2492,7 @@ issignal(struct thread *td, int stop_all struct sigacts *ps; struct sigqueue *queue; sigset_t sigpending; - int sig, prop, newsig, signo; + int sig, prop, newsig; p = td->td_proc; ps = p->p_sigacts; @@ -2545,8 +2545,7 @@ issignal(struct thread *td, int stop_all */ if (sigqueue_get(queue, sig, &ksi) == 0) { queue = &p->p_sigqueue; - signo = sigqueue_get(queue, sig, &ksi); - KASSERT(signo == sig, ("signo != sig")); + sigqueue_get(queue, sig, &ksi); } /* From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 20:55:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240551065696; Thu, 3 Dec 2009 20:55:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12BA08FC18; Thu, 3 Dec 2009 20:55:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3Kt9Ev025805; Thu, 3 Dec 2009 20:55:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Kt9EO025803; Thu, 3 Dec 2009 20:55:09 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912032055.nB3Kt9EO025803@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 3 Dec 2009 20:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200083 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 20:55:10 -0000 Author: nwhitehorn Date: Thu Dec 3 20:55:09 2009 New Revision: 200083 URL: http://svn.freebsd.org/changeset/base/200083 Log: The first argument of dcbz interprets r0 as a literal zero, not the second. This worked before by accident. MFC after: 1 week Modified: head/sys/powerpc/aim/machdep.c Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Thu Dec 3 20:16:59 2009 (r200082) +++ head/sys/powerpc/aim/machdep.c Thu Dec 3 20:55:09 2009 (r200083) @@ -374,7 +374,7 @@ powerpc_init(u_int startkernel, u_int en for (cacheline_size = 0; cacheline_size < 0x100; cacheline_size++) cache_check[cacheline_size] = 0xff; - __asm __volatile("dcbz %0,0":: "r" (cache_check) : "memory"); + __asm __volatile("dcbz 0,%0":: "r" (cache_check) : "memory"); /* Find the first byte dcbz did not zero to get the cache line size */ for (cacheline_size = 0; cacheline_size < 0x100 && From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 20:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64583106566C; Thu, 3 Dec 2009 20:59:28 +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 5380F8FC0A; Thu, 3 Dec 2009 20:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3KxS9A026038; Thu, 3 Dec 2009 20:59:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3KxSUa026036; Thu, 3 Dec 2009 20:59:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912032059.nB3KxSUa026036@svn.freebsd.org> From: John Baldwin Date: Thu, 3 Dec 2009 20:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200084 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 20:59:28 -0000 Author: jhb Date: Thu Dec 3 20:59:28 2009 New Revision: 200084 URL: http://svn.freebsd.org/changeset/base/200084 Log: Properly return an error reply if an NFS remove or link operation fails. Previously the failing operation would allocate an mbuf and construct an error reply, but because the function did not return 0, the NFS server assumed it had failed to generate a reply and would leak the reply mbuf as well as not sending the reply to the NFS client. PR: kern/140853 Submitted by: Ted Faber faber at isi edu (remove) Reviewed by: rmacklem (remove) MFC after: 1 week Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c ============================================================================== --- head/sys/nfsserver/nfs_serv.c Thu Dec 3 20:55:09 2009 (r200083) +++ head/sys/nfsserver/nfs_serv.c Thu Dec 3 20:59:28 2009 (r200084) @@ -1810,10 +1810,9 @@ out: } ereply: nfsm_reply(NFSX_WCCDATA(v3)); - if (v3) { + if (v3) nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; - } + error = 0; nfsmout: NDFREE(&nd, NDF_ONLY_PNBUF); if (nd.ni_dvp) { @@ -2187,8 +2186,8 @@ ereply: if (v3) { nfsm_srvpostop_attr(getret, &at); nfsm_srvwcc_data(dirfor_ret, &dirfor, diraft_ret, &diraft); - error = 0; } + error = 0; /* fall through */ nfsmout: From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 21:08:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB6F510656A4 for ; Thu, 3 Dec 2009 21:08:44 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id 4469D8FC13 for ; Thu, 3 Dec 2009 21:08:44 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-066-005-106.pools.arcor-ip.net [88.66.5.106]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M5Kwt-1O2eCj1bHr-00z9GQ; Thu, 03 Dec 2009 22:08:42 +0100 Received: (qmail 17958 invoked from network); 3 Dec 2009 21:08:41 -0000 Received: from desk8.laiers.local (192.168.4.188) by laiers.local with SMTP; 3 Dec 2009 21:08:41 -0000 From: Max Laier Organization: FreeBSD To: "Simon L. Nielsen" Date: Thu, 3 Dec 2009 22:07:58 +0100 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RELEASE; KDE/4.3.1; i386; ; ) References: <200912031259.nB3Cxd5L014487@svn.freebsd.org> In-Reply-To: <200912031259.nB3Cxd5L014487@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912032207.59271.max@love2party.net> X-Provags-ID: V01U2FsdGVkX19cgpwKKsmBRHsmlv3dNKtlhSfoYg+MtYbCwGi ox2TcVMig4/c/y3FsaDsP/X1WtoK7LJkKZbbg6TG3IVJ10sMEc iiu5/TYa7ffr+I447XoPQ== Cc: svn-src-releng@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200057 - in releng: 6.3/sys/conf 6.4/sys/conf 7.1/sys/conf 7.2/sys/conf 8.0/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 21:08:45 -0000 On Thursday 03 December 2009 13:59:39 Simon L. Nielsen wrote: > Author: simon > Date: Thu Dec 3 12:59:39 2009 > New Revision: 200057 > URL: http://svn.freebsd.org/changeset/base/200057 > > Log: > Bump the patch level in the kernel version number, which was > accidentally left out of main commit for SA-09:15, SA-09:15, and > SA-09:17 in r200054. > > Approved by: so (simon) Is freebsd-update going to distribute this, too? > Modified: > releng/6.3/sys/conf/newvers.sh > releng/6.4/sys/conf/newvers.sh > releng/7.1/sys/conf/newvers.sh > releng/7.2/sys/conf/newvers.sh > releng/8.0/sys/conf/newvers.sh > > Modified: releng/6.3/sys/conf/newvers.sh > =========================================================================== > === --- releng/6.3/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) > +++ releng/6.3/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ > -32,7 +32,7 @@ > > TYPE="FreeBSD" > REVISION="6.3" > -BRANCH="RELEASE-p13" > +BRANCH="RELEASE-p14" > if [ "X${BRANCH_OVERRIDE}" != "X" ]; then > BRANCH=${BRANCH_OVERRIDE} > fi > > Modified: releng/6.4/sys/conf/newvers.sh > =========================================================================== > === --- releng/6.4/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) > +++ releng/6.4/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ > -32,7 +32,7 @@ > > TYPE="FreeBSD" > REVISION="6.4" > -BRANCH="RELEASE-p7" > +BRANCH="RELEASE-p8" > if [ "X${BRANCH_OVERRIDE}" != "X" ]; then > BRANCH=${BRANCH_OVERRIDE} > fi > > Modified: releng/7.1/sys/conf/newvers.sh > =========================================================================== > === --- releng/7.1/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) > +++ releng/7.1/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ > -32,7 +32,7 @@ > > TYPE="FreeBSD" > REVISION="7.1" > -BRANCH="RELEASE-p8" > +BRANCH="RELEASE-p9" > if [ "X${BRANCH_OVERRIDE}" != "X" ]; then > BRANCH=${BRANCH_OVERRIDE} > fi > > Modified: releng/7.2/sys/conf/newvers.sh > =========================================================================== > === --- releng/7.2/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) > +++ releng/7.2/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ > -32,7 +32,7 @@ > > TYPE="FreeBSD" > REVISION="7.2" > -BRANCH="RELEASE-p4" > +BRANCH="RELEASE-p5" > if [ "X${BRANCH_OVERRIDE}" != "X" ]; then > BRANCH=${BRANCH_OVERRIDE} > fi > > Modified: releng/8.0/sys/conf/newvers.sh > =========================================================================== > === --- releng/8.0/sys/conf/newvers.sh Thu Dec 3 12:23:48 2009 (r200056) > +++ releng/8.0/sys/conf/newvers.sh Thu Dec 3 12:59:39 2009 (r200057) @@ > -32,7 +32,7 @@ > > TYPE="FreeBSD" > REVISION="8.0" > -BRANCH="RELEASE" > +BRANCH="RELEASE-p1" > if [ "X${BRANCH_OVERRIDE}" != "X" ]; then > BRANCH=${BRANCH_OVERRIDE} > fi > > > !DSPAM:4b17b64d66041928620662! > -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 21:44:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E84F1065670; Thu, 3 Dec 2009 21:44:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F18028FC1F; Thu, 3 Dec 2009 21:44:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3LifOJ026979; Thu, 3 Dec 2009 21:44:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Lifts026977; Thu, 3 Dec 2009 21:44:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912032144.nB3Lifts026977@svn.freebsd.org> From: Ed Schouten Date: Thu, 3 Dec 2009 21:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200085 - head/libexec/ulog-helper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 21:44:42 -0000 Author: ed Date: Thu Dec 3 21:44:41 2009 New Revision: 200085 URL: http://svn.freebsd.org/changeset/base/200085 Log: Repair breakage to last-minute API change. I changed ulog_log{in,out} to return a void, but forgot to change ulog-helper as well. Reported by: stefanf Modified: head/libexec/ulog-helper/ulog-helper.c Modified: head/libexec/ulog-helper/ulog-helper.c ============================================================================== --- head/libexec/ulog-helper/ulog-helper.c Thu Dec 3 20:59:28 2009 (r200084) +++ head/libexec/ulog-helper/ulog-helper.c Thu Dec 3 21:44:41 2009 (r200085) @@ -68,12 +68,10 @@ main(int argc, char *argv[]) if (argc == 3) host = argv[2]; - if (ulog_login(line, pwd->pw_name, host) != 0) - return (EX_OSFILE); + ulog_login(line, pwd->pw_name, host); return (EX_OK); } else if (argc == 2 && strcmp(argv[1], "logout") == 0) { - if (ulog_logout(line) != 0) - return (EX_OSFILE); + ulog_logout(line); return (EX_OK); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 21:47:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89CCB106566C; Thu, 3 Dec 2009 21:47:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 784D28FC15; Thu, 3 Dec 2009 21:47:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3LlpiF027089; Thu, 3 Dec 2009 21:47:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Llph1027086; Thu, 3 Dec 2009 21:47:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912032147.nB3Llph1027086@svn.freebsd.org> From: Alexander Motin Date: Thu, 3 Dec 2009 21:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200086 - head/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 21:47:51 -0000 Author: mav Date: Thu Dec 3 21:47:51 2009 New Revision: 200086 URL: http://svn.freebsd.org/changeset/base/200086 Log: Change 'load' balancing mode algorithm: - Instead of measuring last request execution time for each drive and choosing one with smallest time, use averaged number of requests, running on each drive. This information is more accurate and timely. It allows to distribute load between drives in more even and predictable way. - For each drive track offset of the last submitted request. If new request offset matches previous one or close for some drive, prefer that drive. It allows to significantly speedup simultaneous sequential reads. PR: kern/113885 Reviewed by: sobomax Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Thu Dec 3 21:44:41 2009 (r200085) +++ head/sys/geom/mirror/g_mirror.c Thu Dec 3 21:47:51 2009 (r200086) @@ -451,9 +451,6 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_id = md->md_did; disk->d_state = G_MIRROR_DISK_STATE_NONE; disk->d_priority = md->md_priority; - disk->d_delay.sec = 0; - disk->d_delay.frac = 0; - binuptime(&disk->d_last_used); disk->d_flags = md->md_dflags; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; @@ -863,16 +860,6 @@ bintime_cmp(struct bintime *bt1, struct } static void -g_mirror_update_delay(struct g_mirror_disk *disk, struct bio *bp) -{ - - if (disk->d_softc->sc_balance != G_MIRROR_BALANCE_LOAD) - return; - binuptime(&disk->d_delay); - bintime_sub(&disk->d_delay, &bp->bio_t0); -} - -static void g_mirror_done(struct bio *bp) { struct g_mirror_softc *sc; @@ -904,8 +891,6 @@ g_mirror_regular_request(struct bio *bp) g_topology_lock(); g_mirror_kill_consumer(sc, bp->bio_from); g_topology_unlock(); - } else { - g_mirror_update_delay(disk, bp); } pbp->bio_inbed++; @@ -1465,30 +1450,35 @@ g_mirror_request_round_robin(struct g_mi g_io_request(cbp, cp); } +#define TRACK_SIZE (1 * 1024 * 1024) +#define LOAD_SCALE 256 +#define ABS(x) (((x) >= 0) ? (x) : (-(x))) + static void g_mirror_request_load(struct g_mirror_softc *sc, struct bio *bp) { struct g_mirror_disk *disk, *dp; struct g_consumer *cp; struct bio *cbp; - struct bintime curtime; + int prio, best; - binuptime(&curtime); - /* - * Find a disk which the smallest load. - */ + /* Find a disk with the smallest load. */ disk = NULL; + best = INT_MAX; LIST_FOREACH(dp, &sc->sc_disks, d_next) { if (dp->d_state != G_MIRROR_DISK_STATE_ACTIVE) continue; - /* If disk wasn't used for more than 2 sec, use it. */ - if (curtime.sec - dp->d_last_used.sec >= 2) { - disk = dp; - break; - } - if (disk == NULL || - bintime_cmp(&dp->d_delay, &disk->d_delay) < 0) { + prio = dp->load; + /* If disk head is precisely in position - highly prefer it. */ + if (dp->d_last_offset == bp->bio_offset) + prio -= 2 * LOAD_SCALE; + else + /* If disk head is close to position - prefer it. */ + if (ABS(dp->d_last_offset - bp->bio_offset) < TRACK_SIZE) + prio -= 1 * LOAD_SCALE; + if (prio <= best) { disk = dp; + best = prio; } } KASSERT(disk != NULL, ("NULL disk for %s.", sc->sc_name)); @@ -1505,12 +1495,18 @@ g_mirror_request_load(struct g_mirror_so cp = disk->d_consumer; cbp->bio_done = g_mirror_done; cbp->bio_to = cp->provider; - binuptime(&disk->d_last_used); G_MIRROR_LOGREQ(3, cbp, "Sending request."); KASSERT(cp->acr >= 1 && cp->acw >= 1 && cp->ace >= 1, ("Consumer %s not opened (r%dw%de%d).", cp->provider->name, cp->acr, cp->acw, cp->ace)); cp->index++; + /* Remember last head position */ + disk->d_last_offset = bp->bio_offset + bp->bio_length; + /* Update loads. */ + LIST_FOREACH(dp, &sc->sc_disks, d_next) { + dp->load = (dp->d_consumer->index * LOAD_SCALE + + dp->load * 7) / 8; + } g_io_request(cbp, cp); } Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Thu Dec 3 21:44:41 2009 (r200085) +++ head/sys/geom/mirror/g_mirror.h Thu Dec 3 21:47:51 2009 (r200086) @@ -133,8 +133,8 @@ struct g_mirror_disk { struct g_mirror_softc *d_softc; /* Back-pointer to softc. */ int d_state; /* Disk state. */ u_int d_priority; /* Disk priority. */ - struct bintime d_delay; /* Disk delay. */ - struct bintime d_last_used; /* When disk was last used. */ + u_int load; /* Averaged queue length */ + off_t d_last_offset; /* Last read offset */ uint64_t d_flags; /* Additional flags. */ u_int d_genid; /* Disk's generation ID. */ struct g_mirror_disk_sync d_sync;/* Sync information. */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 21:55:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D1AF106566B; Thu, 3 Dec 2009 21:55:43 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3106C8FC19; Thu, 3 Dec 2009 21:55:42 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id AF48045CAC; Thu, 3 Dec 2009 22:55:39 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 559C445684; Thu, 3 Dec 2009 22:55:33 +0100 (CET) Date: Thu, 3 Dec 2009 22:55:33 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20091203215532.GA2066@garage.freebsd.pl> References: <200912032147.nB3Llph1027086@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: <200912032147.nB3Llph1027086@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Will Andrews Subject: Re: svn commit: r200086 - head/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 21:55:43 -0000 --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 03, 2009 at 09:47:51PM +0000, Alexander Motin wrote: > Author: mav > Date: Thu Dec 3 21:47:51 2009 > New Revision: 200086 > URL: http://svn.freebsd.org/changeset/base/200086 >=20 > Log: > Change 'load' balancing mode algorithm: > - Instead of measuring last request execution time for each drive and > choosing one with smallest time, use averaged number of requests, runni= ng > on each drive. This information is more accurate and timely. It allows = to > distribute load between drives in more even and predictable way. > - For each drive track offset of the last submitted request. If new req= uest > offset matches previous one or close for some drive, prefer that drive. > It allows to significantly speedup simultaneous sequential reads. > =20 > PR: kern/113885 > Reviewed by: sobomax Hmm, Will send me improved patch few days ago related to this functionality. Could you guys compare the patches, select the best one and commit it (or both if they serve different purposes)? I'm pretty occupied currently and it will take probably few weeks before I can join the discussion. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --bp/iNruPH9dso1Pn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLGDPUForvXbEpPzQRArWlAKCv330H/WHYcll/c3QMb1jlMIj06gCgo1J/ TUJc9O747V2BeV6/5NqeQ7k= =qt1X -----END PGP SIGNATURE----- --bp/iNruPH9dso1Pn-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 22:33:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093D01065670; Thu, 3 Dec 2009 22:33:27 +0000 (UTC) (envelope-from will@firepipe.net) Received: from mail-yx0-f171.google.com (mail-yx0-f171.google.com [209.85.210.171]) by mx1.freebsd.org (Postfix) with ESMTP id 936B78FC19; Thu, 3 Dec 2009 22:33:26 +0000 (UTC) Received: by yxe1 with SMTP id 1so1634756yxe.3 for ; Thu, 03 Dec 2009 14:33:25 -0800 (PST) Received: by 10.101.205.23 with SMTP id h23mr3005376anq.34.1259878086011; Thu, 03 Dec 2009 14:08:06 -0800 (PST) Received: from cephei.firepipe.net (c-98-245-40-5.hsd1.co.comcast.net [98.245.40.5]) by mx.google.com with ESMTPS id 7sm1258152yxd.62.2009.12.03.14.08.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 03 Dec 2009 14:08:04 -0800 (PST) Date: Thu, 3 Dec 2009 15:08:59 -0700 From: Will Andrews To: Pawel Jakub Dawidek Message-ID: <20091203220856.GA73255@cephei.firepipe.net> References: <200912032147.nB3Llph1027086@svn.freebsd.org> <20091203215532.GA2066@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline In-Reply-To: <20091203215532.GA2066@garage.freebsd.pl> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200086 - head/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 22:33:27 -0000 --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 03, 2009 at 10:55:33PM +0100, Pawel Jakub Dawidek wrote: > On Thu, Dec 03, 2009 at 09:47:51PM +0000, Alexander Motin wrote: > > Author: mav > > Date: Thu Dec 3 21:47:51 2009 > > New Revision: 200086 > > URL: http://svn.freebsd.org/changeset/base/200086 > >=20 > > Log: > > Change 'load' balancing mode algorithm: > > - Instead of measuring last request execution time for each drive and > > choosing one with smallest time, use averaged number of requests, run= ning > > on each drive. This information is more accurate and timely. It allow= s to > > distribute load between drives in more even and predictable way. > > - For each drive track offset of the last submitted request. If new r= equest > > offset matches previous one or close for some drive, prefer that driv= e. > > It allows to significantly speedup simultaneous sequential reads. > > =20 > > PR: kern/113885 > > Reviewed by: sobomax >=20 > Hmm, Will send me improved patch few days ago related to this > functionality. Could you guys compare the patches, select the best one > and commit it (or both if they serve different purposes)? I'm pretty > occupied currently and it will take probably few weeks before I can join > the discussion. Mine changes the round-robin algorithm instead of the load one. But mav's patch uses a different method for distributing the load on the providers, whereas mine is just a better-written version of the PR's patch. --=20 wca --7JfCtLOvnd9MIVvH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLGDb3F47idPgWcsURAsYQAJwP/0R5Vfw2OHil7iWDxkBdvb721QCfQsrx L/BI25kd0XKQuPqE7rNgAF0= =mPrn -----END PGP SIGNATURE----- --7JfCtLOvnd9MIVvH-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 23:24:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C222106566C; Thu, 3 Dec 2009 23:24:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A9B98FC08; Thu, 3 Dec 2009 23:24:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3NOCTN029115; Thu, 3 Dec 2009 23:24:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3NOCmL029112; Thu, 3 Dec 2009 23:24:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912032324.nB3NOCmL029112@svn.freebsd.org> From: Andrew Thompson Date: Thu, 3 Dec 2009 23:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200087 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 23:24:13 -0000 Author: thompsa Date: Thu Dec 3 23:24:12 2009 New Revision: 200087 URL: http://svn.freebsd.org/changeset/base/200087 Log: Add uhci/ehci controller ids. Submitted by: mitya_cabletv.dp.ua Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Thu Dec 3 21:47:51 2009 (r200086) +++ head/sys/dev/usb/controller/ehci_pci.c Thu Dec 3 23:24:12 2009 (r200087) @@ -193,6 +193,10 @@ ehci_pci_match(device_t self) return "Intel 82801I (ICH9) USB 2.0 controller"; case 0x293c8086: return "Intel 82801I (ICH9) USB 2.0 controller"; + case 0x3a3a8086: + return "Intel 82801IJ (ICH10) USB 2.0 controller USB-A"; + case 0x3a3c8086: + return "Intel 82801IJ (ICH10) USB 2.0 controller USB-B"; case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Thu Dec 3 21:47:51 2009 (r200086) +++ head/sys/dev/usb/controller/uhci_pci.c Thu Dec 3 23:24:12 2009 (r200087) @@ -230,6 +230,18 @@ uhci_pci_match(device_t self) return ("Intel 82801I (ICH9) USB controller"); case 0x29398086: return ("Intel 82801I (ICH9) USB controller"); + case 0x3a348086: + return ("Intel 82801IJ (ICH10) USB controller USB-A"); + case 0x3a358086: + return ("Intel 82801IJ (ICH10) USB controller USB-B"); + case 0x3a368086: + return ("Intel 82801IJ (ICH10) USB controller USB-C"); + case 0x3a378086: + return ("Intel 82801IJ (ICH10) USB controller USB-D"); + case 0x3a388086: + return ("Intel 82801IJ (ICH10) USB controller USB-E"); + case 0x3a398086: + return ("Intel 82801IJ (ICH10) USB controller USB-F"); case 0x719a8086: return ("Intel 82443MX USB controller"); From owner-svn-src-all@FreeBSD.ORG Thu Dec 3 23:57:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE0D010656A9; Thu, 3 Dec 2009 23:57:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC27A8FC21; Thu, 3 Dec 2009 23:57:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB3Nv6I0029774; Thu, 3 Dec 2009 23:57:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB3Nv6dx029772; Thu, 3 Dec 2009 23:57:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912032357.nB3Nv6dx029772@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 3 Dec 2009 23:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200088 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 23:57:07 -0000 Author: yongari Date: Thu Dec 3 23:57:06 2009 New Revision: 200088 URL: http://svn.freebsd.org/changeset/base/200088 Log: Add workaround to overcome hardware limitation which allows only a single outstanding DMA read operation. Most controllers targeted to client with PCIe bus interface(e.g. BCM5761) may have this limitation. All controllers for servers does not have this limitation. Collapsing mbuf chains to reduce number of memory reads before transmitting was most effective way to workaround this. I got about 940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it takes a lot of CPU cycles to collapse mbuf chains so add tunable to control the number of allowed TX buffers before collapsing. The default value is 0 which effectively disables the forced collapsing. For most cases 2 would yield best performance(about 930Mbps) without much sacrificing CPU cycles. Note the collapsing is only activated when the controller is on PCIe bus and the frame does not need TSO operation. TSO does not seem to suffer from the hardware limitation because the payload size is much bigger than normal IP datagram. Thanks to davidch@ who told me the limitation of client controllers and actually gave possible workarounds to mitigate the limitation. Reviewed by: davidch, marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Dec 3 23:24:12 2009 (r200087) +++ head/sys/dev/bge/if_bge.c Thu Dec 3 23:57:06 2009 (r200088) @@ -483,12 +483,29 @@ DRIVER_MODULE(bge, pci, bge_driver, bge_ DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); static int bge_allow_asf = 1; +/* + * A common design characteristic for many Broadcom client controllers + * is that they only support a single outstanding DMA read operation + * on the PCIe bus. This means that it will take twice as long to fetch + * a TX frame that is split into header and payload buffers as it does + * to fetch a single, contiguous TX frame (2 reads vs. 1 read). For + * these controllers, coalescing buffers to reduce the number of memory + * reads is effective way to get maximum performance(about 940Mbps). + * Without collapsing TX buffers the maximum TCP bulk transfer + * performance is about 850Mbps. However forcing coalescing mbufs + * consumes a lot of CPU cycles, so leave it off by default. + */ +static int bge_forced_collapse = 0; TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf); +TUNABLE_INT("hw.bge.forced_collapse", &bge_forced_collapse); SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0, "Allow ASF mode if available"); +SYSCTL_INT(_hw_bge, OID_AUTO, forced_collapse, CTLFLAG_RD, &bge_forced_collapse, + 0, "Number of fragmented TX buffers of a frame allowed before " + "forced collapsing"); #define SPARC64_BLADE_1500_MODEL "SUNW,Sun-Blade-1500" #define SPARC64_BLADE_1500_PATH_BGE "/pci@1f,700000/network@2" @@ -3915,6 +3932,26 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_IP_FRAG; } + if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 && + bge_forced_collapse > 0 && (sc->bge_flags & BGE_FLAG_PCIE) != 0 && + m->m_next != NULL) { + /* + * Forcedly collapse mbuf chains to overcome hardware + * limitation which only support a single outstanding + * DMA read operation. + */ + if (bge_forced_collapse == 1) + m = m_defrag(m, M_DONTWAIT); + else + m = m_collapse(m, M_DONTWAIT, bge_forced_collapse); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOBUFS); + } + *m_head = m; + } + map = sc->bge_cdata.bge_tx_dmamap[idx]; error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 03:34:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50E071065672; Fri, 4 Dec 2009 03:34:13 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EF948FC08; Fri, 4 Dec 2009 03:34:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB43YCis039203; Fri, 4 Dec 2009 03:34:12 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB43YCwO039201; Fri, 4 Dec 2009 03:34:12 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200912040334.nB43YCwO039201@svn.freebsd.org> From: Matt Jacob Date: Fri, 4 Dec 2009 03:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200089 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 03:34:13 -0000 Author: mjacob Date: Fri Dec 4 03:34:12 2009 New Revision: 200089 URL: http://svn.freebsd.org/changeset/base/200089 Log: Fix cases where we've managed to get a Loop UP event prior to initializing the loop down counter, as well as other things. This was brought to my attention with a different fix, more for RELENG_7- this one covers the multiple channel case. PR: 140438 MFC after: 1 month Modified: head/sys/dev/isp/isp_freebsd.c head/sys/dev/isp/isp_freebsd.h Modified: head/sys/dev/isp/isp_freebsd.c ============================================================================== --- head/sys/dev/isp/isp_freebsd.c Thu Dec 3 23:57:06 2009 (r200088) +++ head/sys/dev/isp/isp_freebsd.c Fri Dec 4 03:34:12 2009 (r200089) @@ -133,33 +133,37 @@ isp_attach_chan(ispsoftc_t *isp, struct } #endif } else { + fcparam *fcp = FCPARAM(isp, chan); struct isp_fc *fc = ISP_FC_PC(isp, chan); + ISP_LOCK(isp); fc->sim = sim; fc->path = path; fc->isp = isp; + fc->ready = 1; callout_init_mtx(&fc->ldt, &isp->isp_osinfo.lock, 0); callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0); - - if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { - xpt_free_path(fc->path); - ISP_LOCK(isp); - xpt_bus_deregister(cam_sim_path(fc->sim)); - ISP_UNLOCK(isp); - cam_sim_free(fc->sim, FALSE); - } /* * We start by being "loop down" if we have an initiator role */ - ISP_LOCK(isp); - if ((FCPARAM(isp, chan)->role & ISP_ROLE_INITIATOR) && fc->ldt_running == 0) { + if (fcp->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, chan, "isp_attach"); - fc->ldt_running = 1; callout_reset(&fc->ldt, isp_quickboot_time * hz, isp_ldt, fc); isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Starting Initial Loop Down Timer @ %lu", (unsigned long) time_uptime); } ISP_UNLOCK(isp); + if (THREAD_CREATE(isp_kthread, fc, &fc->kproc, 0, 0, "%s: fc_thrd%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { + xpt_free_path(fc->path); + ISP_LOCK(isp); + if (callout_active(&fc->ldt)) { + callout_stop(&fc->ldt); + } + xpt_bus_deregister(cam_sim_path(fc->sim)); + ISP_UNLOCK(isp); + cam_sim_free(fc->sim, FALSE); + return (ENOMEM); + } #ifdef ISP_INTERNAL_TARGET ISP_SET_PC(isp, chan, proc_active, 1); if (THREAD_CREATE(isp_target_thread_fc, fc, &fc->target_proc, 0, 0, "%s: isp_test_tgt%d", device_get_nameunit(isp->isp_osinfo.dev), chan)) { @@ -3935,12 +3939,12 @@ isp_gdt(void *arg) isp_prt(isp, ISP_LOGCONFIG, prom3, chan, lp->portid, tgt, "Gone Device Timeout"); isp_make_gone(isp, chan, tgt); } - if (more_to_do) { - fc->gdt_running = 1; - callout_reset(&fc->gdt, hz, isp_gdt, fc); - } else { - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); - fc->gdt_running = 0; + if (fc->ready) { + if (more_to_do) { + callout_reset(&fc->gdt, hz, isp_gdt, fc); + } else { + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d stopping Gone Device Timer", chan); + } } } @@ -4017,6 +4021,7 @@ isp_kthread(void *arg) ispsoftc_t *isp = fc->isp; int chan = fc - isp->isp_osinfo.pc.fc; int slp = 0; + mtx_lock(&isp->isp_osinfo.lock); for (;;) { @@ -4802,6 +4807,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm char *msg = NULL; target_id_t tgt; fcportdb_t *lp; + struct isp_fc *fc; struct cam_path *tmppath; va_list ap; @@ -4886,7 +4892,6 @@ isp_async(ispsoftc_t *isp, ispasync_t cm /* FALLTHROUGH */ case ISPASYNC_LOOP_DOWN: { - struct isp_fc *fc; if (msg == NULL) { msg = "LOOP Down"; } @@ -4894,20 +4899,21 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); va_end(ap); - FCPARAM(isp, bus)->link_active = 1; + FCPARAM(isp, bus)->link_active = 0; fc = ISP_FC_PC(isp, bus); - /* - * We don't do any simq freezing if we are only in target mode - */ - if (fc->role & ISP_ROLE_INITIATOR) { - if (fc->path) { - isp_freeze_loopdown(isp, bus, msg); - } - if (fc->ldt_running == 0) { - fc->ldt_running = 1; - callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); - isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + if (cmd == ISPASYNC_LOOP_DOWN && fc->ready) { + /* + * We don't do any simq freezing if we are only in target mode + */ + if (fc->role & ISP_ROLE_INITIATOR) { + if (fc->path) { + isp_freeze_loopdown(isp, bus, msg); + } + if (!callout_active(&fc->ldt)) { + callout_reset(&fc->ldt, fc->loop_down_limit * hz, isp_ldt, fc); + isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "starting Loop Down Timer @ %lu", (unsigned long) time_uptime); + } } } isp_prt(isp, ISP_LOGINFO, "Chan %d: %s", bus, msg); @@ -4917,6 +4923,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm va_start(ap, cmd); bus = va_arg(ap, int); va_end(ap); + fc = ISP_FC_PC(isp, bus); /* * Now we just note that Loop has come up. We don't * actually do anything because we're waiting for a @@ -4924,8 +4931,8 @@ isp_async(ispsoftc_t *isp, ispasync_t cm * thread to look at the state of the loop again. */ FCPARAM(isp, bus)->link_active = 1; - ISP_FC_PC(isp, bus)->loop_dead = 0; - ISP_FC_PC(isp, bus)->loop_down_time = 0; + fc->loop_dead = 0; + fc->loop_down_time = 0; isp_prt(isp, ISP_LOGINFO, "Chan %d Loop UP", bus); break; case ISPASYNC_DEV_ARRIVED: @@ -4933,8 +4940,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); lp->reserved = 0; - if ((ISP_FC_PC(isp, bus)->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { + if ((fc->role & ISP_ROLE_INITIATOR) && (lp->roles & (SVC3_TGT_ROLE >> SVC3_ROLE_SHIFT))) { int dbidx = lp - FCPARAM(isp, bus)->portdb; int i; @@ -4967,6 +4975,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); lp->reserved = 0; if (isp_change_is_bad) { lp->state = FC_PORTDB_STATE_NIL; @@ -5013,6 +5022,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm bus = va_arg(ap, int); lp = va_arg(ap, fcportdb_t *); va_end(ap); + fc = ISP_FC_PC(isp, bus); /* * If this has a virtual target and we haven't marked it * that we're going to have isp_gdt tell the OS it's gone, @@ -5025,10 +5035,9 @@ isp_async(ispsoftc_t *isp, ispasync_t cm lp->reserved = 1; lp->new_reserved = ISP_FC_PC(isp, bus)->gone_device_time; lp->state = FC_PORTDB_STATE_ZOMBIE; - if (ISP_FC_PC(isp, bus)->gdt_running == 0) { + if (fc->ready && !callout_active(&fc->gdt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Chan %d starting Gone Device Timer", bus); - ISP_FC_PC(isp, bus)->gdt_running = 1; - callout_reset(&ISP_FC_PC(isp, bus)->gdt, hz, isp_gdt, ISP_FC_PC(isp, bus)); + callout_reset(&fc->gdt, hz, isp_gdt, fc); } tgt = lp->dev_map_idx - 1; isp_prt(isp, ISP_LOGCONFIG, prom2, bus, lp->portid, lp->handle, roles[lp->roles], "gone zombie at", tgt, (uint32_t) (lp->port_wwn >> 32), (uint32_t) lp->port_wwn); @@ -5053,6 +5062,7 @@ isp_async(ispsoftc_t *isp, ispasync_t cm nlstate = reason = 0; } va_end(ap); + fc = ISP_FC_PC(isp, bus); if (evt == ISPASYNC_CHANGE_PDB) { msg = "Chan %d Port Database Changed"; @@ -5065,16 +5075,15 @@ isp_async(ispsoftc_t *isp, ispasync_t cm /* * If the loop down timer is running, cancel it. */ - if (ISP_FC_PC(isp, bus)->ldt_running) { + if (fc->ready && callout_active(&fc->ldt)) { isp_prt(isp, ISP_LOGSANCFG|ISP_LOGDEBUG0, "Stopping Loop Down Timer @ %lu", (unsigned long) time_uptime); - ISP_FC_PC(isp, bus)->ldt_running = 0; - callout_stop(&ISP_FC_PC(isp, bus)->ldt); + callout_stop(&fc->ldt); } isp_prt(isp, ISP_LOGINFO, msg, bus); - if (ISP_FC_PC(isp, bus)->role & ISP_ROLE_INITIATOR) { + if (fc->role & ISP_ROLE_INITIATOR) { isp_freeze_loopdown(isp, bus, msg); } - wakeup(ISP_FC_PC(isp, bus)); + wakeup(fc); break; } #ifdef ISP_TARGET_MODE Modified: head/sys/dev/isp/isp_freebsd.h ============================================================================== --- head/sys/dev/isp/isp_freebsd.h Thu Dec 3 23:57:06 2009 (r200088) +++ head/sys/dev/isp/isp_freebsd.h Fri Dec 4 03:34:12 2009 (r200089) @@ -177,9 +177,9 @@ struct isp_fc { hysteresis : 8, role : 2, gdt_running : 1, - ldt_running : 1, loop_dead : 1, - fcbsy : 1; + fcbsy : 1, + ready : 1; struct callout ldt; /* loop down timer */ struct callout gdt; /* gone device timer */ #ifdef ISP_TARGET_MODE From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 03:45:17 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70C1E106566C; Fri, 4 Dec 2009 03:45:17 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 29BDC8FC15; Fri, 4 Dec 2009 03:45:16 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:hobJhK6EHgWy8JD0ry1rSFGvQ3tVXTRiqu5bJBZbCpQWUZyy5HXttOup5MElfBSW@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nB43j6GG014512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Dec 2009 12:45:06 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Fri, 04 Dec 2009 12:45:06 +0900 Message-ID: From: Hajimu UMEMOTO To: "Bjoern A. Zeeb" In-Reply-To: <20091203193619.J83957@maildrop.int.zabbadoz.net> References: <200912031116.nB3BGsm2091411@svn.freebsd.org> <20091203193619.J83957@maildrop.int.zabbadoz.net> User-Agent: xcite1.58> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Fri, 04 Dec 2009 12:45:06 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200055 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 03:45:17 -0000 Hi, >>>>> On Thu, 3 Dec 2009 19:43:33 +0000 (UTC) >>>>> "Bjoern A. Zeeb" said: bz> Does it need to be 48 rather than 46? You do not have the [] here. bz> If not INET6_ADDRSTRLEN is what we use elsewhere. I would actually bz> prefer to only have bz> #ifdef INET6 bz> char src[INET6_ADDRSTRLEN|48], .. bz> #else bz> char src[INET_ADDRSTRLEN|18], .. bz> #endif bz> as it's 60 bytes of stack size for people w/o INET6 support (shame on bz> them;-) Some applies for equivalent code further down. Oops, I'll fix it later. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 05:45:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC3D21065670; Fri, 4 Dec 2009 05:45:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBDE98FC14; Fri, 4 Dec 2009 05:45:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB45jko0043951; Fri, 4 Dec 2009 05:45:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB45jkjT043949; Fri, 4 Dec 2009 05:45:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912040545.nB45jkjT043949@svn.freebsd.org> From: Andriy Gapon Date: Fri, 4 Dec 2009 05:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200091 - head/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 05:45:46 -0000 Author: avg Date: Fri Dec 4 05:45:46 2009 New Revision: 200091 URL: http://svn.freebsd.org/changeset/base/200091 Log: ichsmb: drop default attachment to generic smbus hardware Attach only to devices known to be supported. This change overrided and undoes r200053. Suggested by: jhb MFC after: 2 weeks (only to stable/8) Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Fri Dec 4 05:31:40 2009 (r200090) +++ head/sys/dev/ichsmb/ichsmb_pci.c Fri Dec 4 05:45:46 2009 (r200091) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ -#define VENDORID_INTEL 0x8086 #define ID_82801AA 0x24138086 #define ID_82801AB 0x24238086 #define ID_82801BA 0x24438086 @@ -172,13 +171,6 @@ ichsmb_pci_probe(device_t dev) device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); break; default: - if (pci_get_vendor(dev) == VENDORID_INTEL - && pci_get_class(dev) == PCIC_SERIALBUS - && pci_get_subclass(dev) == PCIS_SERIALBUS_SMBUS - && pci_get_progif(dev) == PCIS_SERIALBUS_SMBUS_PROGIF) { - device_set_desc(dev, "Intel SMBus controller"); - return (BUS_PROBE_DEFAULT); /* XXX */ - } return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 07:08:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D117106566B; Fri, 4 Dec 2009 07:08:16 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5588FC16; Fri, 4 Dec 2009 07:08:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB478FG2045677; Fri, 4 Dec 2009 07:08:15 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB478FXo045675; Fri, 4 Dec 2009 07:08:15 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912040708.nB478FXo045675@svn.freebsd.org> From: Christian Brueffer Date: Fri, 4 Dec 2009 07:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200092 - stable/8/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 07:08:16 -0000 Author: brueffer Date: Fri Dec 4 07:08:15 2009 New Revision: 200092 URL: http://svn.freebsd.org/changeset/base/200092 Log: MFC: r199988 Add an .Nm for strncat. Modified: stable/8/lib/libc/string/strcat.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/string/strcat.3 ============================================================================== --- stable/8/lib/libc/string/strcat.3 Fri Dec 4 05:45:46 2009 (r200091) +++ stable/8/lib/libc/string/strcat.3 Fri Dec 4 07:08:15 2009 (r200092) @@ -32,11 +32,12 @@ .\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 1, 2009 .Dt STRCAT 3 .Os .Sh NAME -.Nm strcat +.Nm strcat , +.Nm strncat .Nd concatenate strings .Sh LIBRARY .Lb libc From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 07:09:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7082C106568D; Fri, 4 Dec 2009 07:09:17 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF178FC08; Fri, 4 Dec 2009 07:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB479H5q045742; Fri, 4 Dec 2009 07:09:17 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB479HRj045740; Fri, 4 Dec 2009 07:09:17 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912040709.nB479HRj045740@svn.freebsd.org> From: Christian Brueffer Date: Fri, 4 Dec 2009 07:09:17 +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: r200093 - stable/7/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 07:09:17 -0000 Author: brueffer Date: Fri Dec 4 07:09:17 2009 New Revision: 200093 URL: http://svn.freebsd.org/changeset/base/200093 Log: MFC: r199988 Add an .Nm for strncat. Modified: stable/7/lib/libc/string/strcat.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/string/strcat.3 ============================================================================== --- stable/7/lib/libc/string/strcat.3 Fri Dec 4 07:08:15 2009 (r200092) +++ stable/7/lib/libc/string/strcat.3 Fri Dec 4 07:09:17 2009 (r200093) @@ -32,11 +32,12 @@ .\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 1, 2009 .Dt STRCAT 3 .Os .Sh NAME -.Nm strcat +.Nm strcat , +.Nm strncat .Nd concatenate strings .Sh LIBRARY .Lb libc From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 07:10:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34231065670; Fri, 4 Dec 2009 07:10:18 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91AD88FC08; Fri, 4 Dec 2009 07:10:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB47AIPY045817; Fri, 4 Dec 2009 07:10:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB47AIgf045815; Fri, 4 Dec 2009 07:10:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912040710.nB47AIgf045815@svn.freebsd.org> From: Christian Brueffer Date: Fri, 4 Dec 2009 07:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200094 - stable/6/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 07:10:18 -0000 Author: brueffer Date: Fri Dec 4 07:10:18 2009 New Revision: 200094 URL: http://svn.freebsd.org/changeset/base/200094 Log: MFC: r199988 Add an .Nm for strncat. Modified: stable/6/lib/libc/string/strcat.3 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/string/strcat.3 ============================================================================== --- stable/6/lib/libc/string/strcat.3 Fri Dec 4 07:09:17 2009 (r200093) +++ stable/6/lib/libc/string/strcat.3 Fri Dec 4 07:10:18 2009 (r200094) @@ -36,11 +36,12 @@ .\" @(#)strcat.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd December 1, 2009 .Dt STRCAT 3 .Os .Sh NAME -.Nm strcat +.Nm strcat , +.Nm strncat .Nd concatenate strings .Sh LIBRARY .Lb libc From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 09:20:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB5F6106566C; Fri, 4 Dec 2009 09:20:20 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA1968FC1A; Fri, 4 Dec 2009 09:20:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB49KKog048602; Fri, 4 Dec 2009 09:20:20 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB49KKf7048600; Fri, 4 Dec 2009 09:20:20 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200912040920.nB49KKf7048600@svn.freebsd.org> From: Tom Rhodes Date: Fri, 4 Dec 2009 09:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200095 - head/lib/libc/string X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 09:20:20 -0000 Author: trhodes Date: Fri Dec 4 09:20:20 2009 New Revision: 200095 URL: http://svn.freebsd.org/changeset/base/200095 Log: Add a missing word to a sentence in the return values section. Modified: head/lib/libc/string/strcmp.3 Modified: head/lib/libc/string/strcmp.3 ============================================================================== --- head/lib/libc/string/strcmp.3 Fri Dec 4 07:10:18 2009 (r200094) +++ head/lib/libc/string/strcmp.3 Fri Dec 4 09:20:20 2009 (r200095) @@ -75,7 +75,7 @@ The .Fn strcmp and .Fn strncmp -return an integer greater than, equal to, or less than 0, according +functions return an integer greater than, equal to, or less than 0, according as the string .Fa s1 is greater than, equal to, or less than the string From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 10:16:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 927FE106566C; Fri, 4 Dec 2009 10:16:39 +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 4A6CA8FC0C; Fri, 4 Dec 2009 10:16:38 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 9247E6D41B; Fri, 4 Dec 2009 10:16:37 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 5CF27844E9; Fri, 4 Dec 2009 11:16:37 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Kostik Belousov References: <200911261349.nAQDnco2083469@svn.freebsd.org> <200912021926.02346.fluffy@fluffy.khv.ru> <20091202132904.GH2368@deviant.kiev.zoral.com.ua> Date: Fri, 04 Dec 2009 11:16:37 +0100 In-Reply-To: <20091202132904.GH2368@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Wed, 2 Dec 2009 15:29:04 +0200") Message-ID: <86pr6vvybe.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Dima Panov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: svn commit: r199827 - in head: include lib/libc/compat-43 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 10:16:39 -0000 Kostik Belousov writes: > No. My interpretation of __FreeBSD_version is that the bump indicates > incompatible change in the interfaces. ...or the introduction of a new interface; see for instance r194210, where simon@ bumped it to mark a new OpenSSL version with new features. It is widely used in the ports tree to determine whether a particular patch should be applied. (actually, that's precisely the reason why __FreeBSD_version was introduced, and it lived in userland for a while before eivind@ moved it into the kernel in 1998) > Sometime it is used to mark the point where big changes hit the tree, > possibly not related to interface change. Bumps are cheap, better one too many than one too few. > Also, __FreeBSD_version denotes the kernel "version". No, it has been bumped for libc changes in the past. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 10:57:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03E7E106566B; Fri, 4 Dec 2009 10:57:02 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6C228FC17; Fri, 4 Dec 2009 10:57:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4Av1Jq052923; Fri, 4 Dec 2009 10:57:01 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4Av1PI052922; Fri, 4 Dec 2009 10:57:01 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200912041057.nB4Av1PI052922@svn.freebsd.org> From: Poul-Henning Kamp Date: Fri, 4 Dec 2009 10:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200096 - head/tools/tools/sysbuild X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 10:57:02 -0000 Author: phk Date: Fri Dec 4 10:57:01 2009 New Revision: 200096 URL: http://svn.freebsd.org/changeset/base/200096 Log: Add disk-magic for amd64: same as i386. Pass PORTS_OPTS wherever we invoke ports makefiles Add a logfile where we can see the progress of distfile prefetching Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Fri Dec 4 09:20:20 2009 (r200095) +++ head/tools/tools/sysbuild/sysbuild.sh Fri Dec 4 10:57:01 2009 (r200096) @@ -43,6 +43,18 @@ if [ `uname -m` = "i386" ] ; then # Where our build-bits are to be found FREEBSD_PART=`echo $TARGET_PART | sed 's/s[12]a/s3/'` +elif [ `uname -m` = "amd64" ] ; then + TARGET_PART=`df / | sed ' + 1d + s/[ ].*// + s,/dev/,, + s,s1a,s3a, + s,s2a,s1a, + s,s3a,s2a, + '` + + # Where our build-bits are to be found + FREEBSD_PART=`echo $TARGET_PART | sed 's/s[12]a/s3/'` else TARGET_PART=unknown FREEBSD_PART=unknown @@ -162,7 +174,7 @@ ports_recurse() ( else ( cd $d - ports_recurse `make -V _DEPEND_DIRS` + ports_recurse `make -V _DEPEND_DIRS ${PORTS_OPTS}` ) echo $d >> /tmp/_.plist fi @@ -195,7 +207,7 @@ ports_build() ( cd /usr/ports cd $p set +e - make clean + make clean ${PORTS_OPTS} if make install ${PORTS_OPTS} ; then if [ "x${PKG_DIR}" != "x" ] ; then make package ${PORTS_OPTS} @@ -217,9 +229,11 @@ ports_prefetch() ( true > /tmp/_.plist ports_recurse $PORTS_WE_WANT + true > /mnt/_.prefetch # Now checksump/fetch them for p in `cat /tmp/_.plist` do + echo "Prefetching $p" >> /mnt/_.prefetch b=`echo $p | tr / _` ( cd $p @@ -434,6 +448,7 @@ if [ "x${OBJ_PATH}" != "x" ] ; then fi log_it Wait for ports prefetch +log_it "(Tail /mnt/_.prefetch for progress)" wait log_it Move filesystems From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 11:23:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63CA0106568F; Fri, 4 Dec 2009 11:23:37 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5223B8FC14; Fri, 4 Dec 2009 11:23:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4BNb9v053474; Fri, 4 Dec 2009 11:23:37 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4BNbZp053472; Fri, 4 Dec 2009 11:23:37 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912041123.nB4BNbZp053472@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 4 Dec 2009 11:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200097 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 11:23:37 -0000 Author: jh Date: Fri Dec 4 11:23:37 2009 New Revision: 200097 URL: http://svn.freebsd.org/changeset/base/200097 Log: MFC r199529: Extend ddb(4) "show mount" command to print active string mount options. Note that only option names are printed, not values. Approved by: trasz (mentor) Modified: stable/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Fri Dec 4 10:57:01 2009 (r200096) +++ stable/8/sys/kern/vfs_subr.c Fri Dec 4 11:23:37 2009 (r200097) @@ -2761,6 +2761,7 @@ DB_SHOW_COMMAND(vnode, db_show_vnode) DB_SHOW_COMMAND(mount, db_show_mount) { struct mount *mp; + struct vfsopt *opt; struct statfs *sp; struct vnode *vp; char buf[512]; @@ -2866,6 +2867,18 @@ DB_SHOW_COMMAND(mount, db_show_mount) } db_printf(" mnt_kern_flag = %s\n", buf); + db_printf(" mnt_opt = "); + opt = TAILQ_FIRST(mp->mnt_opt); + if (opt != NULL) { + db_printf("%s", opt->name); + opt = TAILQ_NEXT(opt, link); + while (opt != NULL) { + db_printf(", %s", opt->name); + opt = TAILQ_NEXT(opt, link); + } + } + db_printf("\n"); + sp = &mp->mnt_stat; db_printf(" mnt_stat = { version=%u type=%u flags=0x%016jx " "bsize=%ju iosize=%ju blocks=%ju bfree=%ju bavail=%jd files=%ju " From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 11:26:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1BA8106566C; Fri, 4 Dec 2009 11:26:52 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9017A8FC12; Fri, 4 Dec 2009 11:26:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4BQqbk053576; Fri, 4 Dec 2009 11:26:52 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4BQq84053574; Fri, 4 Dec 2009 11:26:52 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912041126.nB4BQq84053574@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 4 Dec 2009 11:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200098 - stable/8/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 11:26:52 -0000 Author: jh Date: Fri Dec 4 11:26:52 2009 New Revision: 200098 URL: http://svn.freebsd.org/changeset/base/200098 Log: MFC r199843: Clarify that the value of the fts_info field is different in post-order. Approved by: trasz (mentor) Modified: stable/8/lib/libc/gen/fts.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/fts.3 ============================================================================== --- stable/8/lib/libc/gen/fts.3 Fri Dec 4 11:23:37 2009 (r200097) +++ stable/8/lib/libc/gen/fts.3 Fri Dec 4 11:26:52 2009 (r200098) @@ -28,7 +28,7 @@ .\" @(#)fts.3 8.5 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd January 26, 2008 +.Dd November 25, 2009 .Dt FTS 3 .Os .Sh NAME @@ -198,10 +198,9 @@ A directory being visited in post-order. The contents of the .Vt FTSENT structure will be unchanged from when -it was returned in pre-order, i.e., with the +the directory was visited in pre-order, except for the .Fa fts_info -field set to -.Dv FTS_D . +field. .It Dv FTS_ERR This is an error return, and the .Fa fts_errno From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 14:08:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A2D8106566C; Fri, 4 Dec 2009 14:08:57 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 797588FC17; Fri, 4 Dec 2009 14:08:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4E8v8k056838; Fri, 4 Dec 2009 14:08:57 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4E8vZA056836; Fri, 4 Dec 2009 14:08:57 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <200912041408.nB4E8vZA056836@svn.freebsd.org> From: Jun Kuriyama Date: Fri, 4 Dec 2009 14:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200099 - head/usr.sbin/ypserv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 14:08:57 -0000 Author: kuriyama Date: Fri Dec 4 14:08:57 2009 New Revision: 200099 URL: http://svn.freebsd.org/changeset/base/200099 Log: - Replace magic number with YPOLDVERS macro (which may be missed in r14262). Modified: head/usr.sbin/ypserv/yp_main.c Modified: head/usr.sbin/ypserv/yp_main.c ============================================================================== --- head/usr.sbin/ypserv/yp_main.c Fri Dec 4 11:26:52 2009 (r200098) +++ head/usr.sbin/ypserv/yp_main.c Fri Dec 4 14:08:57 2009 (r200099) @@ -295,7 +295,7 @@ main(int argc, char *argv[]) } sock = RPC_ANYSOCK; (void) pmap_unset(YPPROG, YPVERS); - (void) pmap_unset(YPPROG, 1); + (void) pmap_unset(YPPROG, YPOLDVERS); } /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 14:12:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C3EE1065672; Fri, 4 Dec 2009 14:12:38 +0000 (UTC) (envelope-from kuriyama@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BA0C8FC16; Fri, 4 Dec 2009 14:12:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4ECcUN056960; Fri, 4 Dec 2009 14:12:38 GMT (envelope-from kuriyama@svn.freebsd.org) Received: (from kuriyama@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4ECckR056958; Fri, 4 Dec 2009 14:12:38 GMT (envelope-from kuriyama@svn.freebsd.org) Message-Id: <200912041412.nB4ECckR056958@svn.freebsd.org> From: Jun Kuriyama Date: Fri, 4 Dec 2009 14:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200100 - head/usr.sbin/ypserv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 14:12:38 -0000 Author: kuriyama Date: Fri Dec 4 14:12:37 2009 New Revision: 200100 URL: http://svn.freebsd.org/changeset/base/200100 Log: - In ypproc_all_2_svc(), yp_fork() is called only when !debug case. So _exit() in the bottom of this function should be called with the same case. Modified: head/usr.sbin/ypserv/yp_server.c Modified: head/usr.sbin/ypserv/yp_server.c ============================================================================== --- head/usr.sbin/ypserv/yp_server.c Fri Dec 4 14:08:57 2009 (r200099) +++ head/usr.sbin/ypserv/yp_server.c Fri Dec 4 14:12:37 2009 (r200100) @@ -563,7 +563,10 @@ ypproc_all_2_svc(ypreq_nokey *argp, stru * Proper fix for PR #10970: exit here so that we don't risk * having a child spawned from this sub-process. */ - _exit(0); + if (!debug) + _exit(0); + + return &result; } ypresp_master * From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 14:18:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FD6C1065696; Fri, 4 Dec 2009 14:18:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D8CD8FC19; Fri, 4 Dec 2009 14:18:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4EIVas057111; Fri, 4 Dec 2009 14:18:31 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4EIVKp057109; Fri, 4 Dec 2009 14:18:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912041418.nB4EIVKp057109@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 4 Dec 2009 14:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200101 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 14:18:31 -0000 Author: luigi Date: Fri Dec 4 14:18:30 2009 New Revision: 200101 URL: http://svn.freebsd.org/changeset/base/200101 Log: fix argument type in the call to expand_number Submitted by: gcc 4.3 MFC after: 3 days Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Fri Dec 4 14:12:37 2009 (r200100) +++ head/sbin/ipfw/dummynet.c Fri Dec 4 14:18:30 2009 (r200101) @@ -950,7 +950,7 @@ end_mask: errx(EX_DATAERR, "burst only valid for pipes"); NEED1("burst needs argument\n"); errno = 0; - if (expand_number(av[0], &p.burst) < 0) + if (expand_number(av[0], (int64_t *)&p.burst) < 0) if (errno != ERANGE) errx(EX_DATAERR, "burst: invalid argument"); From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 15:39:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 007621065DB6; Fri, 4 Dec 2009 15:39:38 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3E918FC1C; Fri, 4 Dec 2009 15:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4Fdbd4058937; Fri, 4 Dec 2009 15:39:37 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4Fdbhg058935; Fri, 4 Dec 2009 15:39:37 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200912041539.nB4Fdbhg058935@svn.freebsd.org> From: Hajimu UMEMOTO Date: Fri, 4 Dec 2009 15:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200102 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 15:39:38 -0000 Author: ume Date: Fri Dec 4 15:39:37 2009 New Revision: 200102 URL: http://svn.freebsd.org/changeset/base/200102 Log: Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard coded number. Spotted by: bz Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Fri Dec 4 14:18:30 2009 (r200101) +++ head/sys/netinet/ipfw/ip_fw2.c Fri Dec 4 15:39:37 2009 (r200102) @@ -899,7 +899,11 @@ ipfw_log(struct ip_fw *f, u_int hlen, st } else { int len; - char src[48], dst[48]; +#ifdef INET6 + char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; +#else + char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; +#endif struct icmphdr *icmp; struct tcphdr *tcp; struct udphdr *udp; @@ -1054,7 +1058,11 @@ static __inline void unlink_dyn_rule_print(struct ipfw_flow_id *id) { struct in_addr da; - char src[48], dst[48]; +#ifdef INET6 + char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN]; +#else + char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; +#endif #ifdef INET6 if (IS_IP6_FLOW_ID(id)) { @@ -1416,8 +1424,14 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ V_dyn_count++; DEB({ struct in_addr da; - char src[48]; - char dst[48]; +#ifdef INET6 + char src[INET6_ADDRSTRLEN]; + char dst[INET6_ADDRSTRLEN]; +#else + char src[INET_ADDRSTRLEN]; + char dst[INET_ADDRSTRLEN]; +#endif + #ifdef INET6 if (IS_IP6_FLOW_ID(&(r->id))) { ip6_sprintf(src, &r->id.src_ip6); @@ -1490,7 +1504,11 @@ install_state(struct ip_fw *rule, ipfw_i static int last_log; ipfw_dyn_rule *q; struct in_addr da; - char src[48], dst[48]; +#ifdef INET6 + char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; +#else + char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; +#endif src[0] = '\0'; dst[0] = '\0'; From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 18:30:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0830A1065672; Fri, 4 Dec 2009 18:30:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E95068FC1A; Fri, 4 Dec 2009 18:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4ITxGE062191; Fri, 4 Dec 2009 18:29:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4ITxYo062185; Fri, 4 Dec 2009 18:29:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912041829.nB4ITxYo062185@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 4 Dec 2009 18:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200103 - in stable/8/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 18:30:00 -0000 Author: marcel Date: Fri Dec 4 18:29:59 2009 New Revision: 200103 URL: http://svn.freebsd.org/changeset/base/200103 Log: MFC rev 200051: Make sure bus space accesses use unorder memory loads and stores. Modified: stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/support.S stable/8/sys/ia64/include/bus.h stable/8/sys/ia64/include/cpufunc.h stable/8/sys/ia64/include/ia64_cpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Fri Dec 4 15:39:37 2009 (r200102) +++ stable/8/sys/ia64/ia64/machdep.c Fri Dec 4 18:29:59 2009 (r200103) @@ -859,14 +859,14 @@ ia64_init(void) return (ret); } -__volatile void * +void * ia64_ioport_address(u_int port) { uint64_t addr; addr = (port > 0xffff) ? IA64_PHYS_TO_RR6((uint64_t)port) : ia64_port_base | ((port & 0xfffc) << 10) | (port & 0xFFF); - return ((__volatile void *)addr); + return ((void *)addr); } uint64_t Modified: stable/8/sys/ia64/ia64/support.S ============================================================================== --- stable/8/sys/ia64/ia64/support.S Fri Dec 4 15:39:37 2009 (r200102) +++ stable/8/sys/ia64/ia64/support.S Fri Dec 4 18:29:59 2009 (r200103) @@ -775,8 +775,10 @@ ENTRY(copyinstr, 4) ;; br.call.sptk.few rp=copystr // do the copy. st8 [loc2]=r0 // kill the fault handler. + ;; mov ar.pfs=loc0 // restore ar.pfs mov rp=loc1 // restore ra. + ;; br.ret.sptk.few rp // ret0 left over from copystr END(copyinstr) @@ -887,8 +889,10 @@ ENTRY(copyin, 3) ;; br.call.sptk.few rp=bcopy // do the copy. st8 [loc2]=r0 // kill the fault handler. + ;; mov ar.pfs=loc0 // restore ar.pfs mov rp=loc1 // restore ra. + ;; br.ret.sptk.few rp // ret0 left over from bcopy END(copyin) @@ -925,8 +929,10 @@ ENTRY(copyout, 3) ;; br.call.sptk.few rp=bcopy // do the copy. st8 [loc2]=r0 // kill the fault handler. + ;; mov ar.pfs=loc0 // restore ar.pfs mov rp=loc1 // restore ra. + ;; br.ret.sptk.few rp // ret0 left over from bcopy END(copyout) @@ -979,6 +985,7 @@ ENTRY_NOPROFILE(_mcount, 4) ;; 2: mov ar.pfs = r14 + ;; br.sptk b6 ;; END(_mcount) Modified: stable/8/sys/ia64/include/bus.h ============================================================================== --- stable/8/sys/ia64/include/bus.h Fri Dec 4 15:39:37 2009 (r200102) +++ stable/8/sys/ia64/include/bus.h Fri Dec 4 18:29:59 2009 (r200103) @@ -169,37 +169,37 @@ bus_space_barrier(bus_space_tag_t bst, b static __inline uint8_t bus_space_read_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld1(bsp)); } static __inline uint16_t bus_space_read_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld2(bsp)); } static __inline uint32_t bus_space_read_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld4(bsp)); } static __inline uint64_t bus_space_read_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - return (*bsp); + return (ia64_ld8(bsp)); } @@ -212,40 +212,40 @@ static __inline void bus_space_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st1(bsp, val); } static __inline void bus_space_write_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st2(bsp, val); } static __inline void bus_space_write_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st4(bsp, val); } static __inline void bus_space_write_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st8(bsp, val); } @@ -258,44 +258,44 @@ static __inline void bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld1(bsp); } static __inline void bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld2(bsp); } static __inline void bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld4(bsp); } static __inline void bus_space_read_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bufp++ = *bsp; + *bufp++ = ia64_ld8(bsp); } @@ -308,44 +308,44 @@ static __inline void bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st1(bsp, *bufp++); } static __inline void bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st2(bsp, *bufp++); } static __inline void bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st4(bsp, *bufp++); } static __inline void bus_space_write_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = *bufp++; + ia64_st8(bsp, *bufp++); } @@ -359,11 +359,11 @@ static __inline void bus_space_read_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld1(bsp); ofs += 1; } } @@ -372,11 +372,11 @@ static __inline void bus_space_read_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld2(bsp); ofs += 2; } } @@ -385,11 +385,11 @@ static __inline void bus_space_read_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld4(bsp); ofs += 4; } } @@ -398,11 +398,11 @@ static __inline void bus_space_read_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bufp++ = *bsp; + *bufp++ = ia64_ld8(bsp); ofs += 8; } } @@ -418,11 +418,11 @@ static __inline void bus_space_write_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint8_t *bufp, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st1(bsp, *bufp++); ofs += 1; } } @@ -431,11 +431,11 @@ static __inline void bus_space_write_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint16_t *bufp, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st2(bsp, *bufp++); ofs += 2; } } @@ -444,11 +444,11 @@ static __inline void bus_space_write_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint32_t *bufp, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st4(bsp, *bufp++); ofs += 4; } } @@ -457,11 +457,11 @@ static __inline void bus_space_write_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, const uint64_t *bufp, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = *bufp++; + ia64_st8(bsp, *bufp++); ofs += 8; } } @@ -476,44 +476,44 @@ static __inline void bus_space_set_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st1(bsp, val); } static __inline void bus_space_set_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st2(bsp, val); } static __inline void bus_space_set_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st4(bsp, val); } static __inline void bus_space_set_multi_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); while (count-- > 0) - *bsp = val; + ia64_st8(bsp, val); } @@ -527,11 +527,11 @@ static __inline void bus_space_set_region_1(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint8_t val, size_t count) { - uint8_t __volatile *bsp; + uint8_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st1(bsp, val); ofs += 1; } } @@ -540,11 +540,11 @@ static __inline void bus_space_set_region_2(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint16_t val, size_t count) { - uint16_t __volatile *bsp; + uint16_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st2(bsp, val); ofs += 2; } } @@ -553,11 +553,11 @@ static __inline void bus_space_set_region_4(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint32_t val, size_t count) { - uint32_t __volatile *bsp; + uint32_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st4(bsp, val); ofs += 4; } } @@ -566,11 +566,11 @@ static __inline void bus_space_set_region_8(bus_space_tag_t bst, bus_space_handle_t bsh, bus_size_t ofs, uint64_t val, size_t count) { - uint64_t __volatile *bsp; + uint64_t *bsp; while (count-- > 0) { bsp = (bst == IA64_BUS_SPACE_IO) ? __PIO_ADDR(bsh + ofs) : __MEMIO_ADDR(bsh + ofs); - *bsp = val; + ia64_st8(bsp, val); ofs += 8; } } @@ -588,7 +588,7 @@ bus_space_copy_region_1(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint8_t __volatile *dstp, *srcp; + uint8_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -602,7 +602,7 @@ bus_space_copy_region_1(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st1(dstp, ia64_ld1(srcp)); src -= 1; dst -= 1; } @@ -615,7 +615,7 @@ bus_space_copy_region_1(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st1(dstp, ia64_ld1(srcp)); src += 1; dst += 1; } @@ -627,7 +627,7 @@ bus_space_copy_region_2(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint16_t __volatile *dstp, *srcp; + uint16_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -641,7 +641,7 @@ bus_space_copy_region_2(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st2(dstp, ia64_ld2(srcp)); src -= 2; dst -= 2; } @@ -654,7 +654,7 @@ bus_space_copy_region_2(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st2(dstp, ia64_ld2(srcp)); src += 2; dst += 2; } @@ -666,7 +666,7 @@ bus_space_copy_region_4(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint32_t __volatile *dstp, *srcp; + uint32_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -680,7 +680,7 @@ bus_space_copy_region_4(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st4(dstp, ia64_ld4(srcp)); src -= 4; dst -= 4; } @@ -693,7 +693,7 @@ bus_space_copy_region_4(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st4(dstp, ia64_ld4(srcp)); src += 4; dst += 4; } @@ -705,7 +705,7 @@ bus_space_copy_region_8(bus_space_tag_t bus_size_t ofs1, bus_space_handle_t bsh2, bus_size_t ofs2, size_t count) { bus_addr_t dst, src; - uint64_t __volatile *dstp, *srcp; + uint64_t *dstp, *srcp; src = bsh1 + ofs1; dst = bsh2 + ofs2; if (dst > src) { @@ -719,7 +719,7 @@ bus_space_copy_region_8(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st8(dstp, ia64_ld8(srcp)); src -= 8; dst -= 8; } @@ -732,7 +732,7 @@ bus_space_copy_region_8(bus_space_tag_t srcp = __MEMIO_ADDR(src); dstp = __MEMIO_ADDR(dst); } - *dstp = *srcp; + ia64_st8(dstp, ia64_ld8(srcp)); src += 8; dst += 8; } Modified: stable/8/sys/ia64/include/cpufunc.h ============================================================================== --- stable/8/sys/ia64/include/cpufunc.h Fri Dec 4 15:39:37 2009 (r200102) +++ stable/8/sys/ia64/include/cpufunc.h Fri Dec 4 18:29:59 2009 (r200103) @@ -54,8 +54,8 @@ breakpoint(void) #define HAVE_INLINE_FFS #define ffs(x) __builtin_ffs(x) -#define __MEMIO_ADDR(x) (__volatile void*)(IA64_PHYS_TO_RR6(x)) -extern __volatile void *ia64_ioport_address(u_int); +#define __MEMIO_ADDR(x) (void*)(IA64_PHYS_TO_RR6(x)) +extern void *ia64_ioport_address(u_int); #define __PIO_ADDR(x) ia64_ioport_address(x) /* Modified: stable/8/sys/ia64/include/ia64_cpu.h ============================================================================== --- stable/8/sys/ia64/include/ia64_cpu.h Fri Dec 4 15:39:37 2009 (r200102) +++ stable/8/sys/ia64/include/ia64_cpu.h Fri Dec 4 18:29:59 2009 (r200103) @@ -282,6 +282,74 @@ ia64_ptc_l(u_int64_t va, u_int64_t log2s } /* + * Unordered memory load. + */ + +static __inline uint8_t +ia64_ld1(uint8_t *p) +{ + uint8_t v; + + __asm __volatile("ld1 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +static __inline uint16_t +ia64_ld2(uint16_t *p) +{ + uint16_t v; + + __asm __volatile("ld2 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +static __inline uint32_t +ia64_ld4(uint32_t *p) +{ + uint32_t v; + + __asm __volatile("ld4 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +static __inline uint64_t +ia64_ld8(uint64_t *p) +{ + uint64_t v; + + __asm __volatile("ld8 %0=[%1];;" : "=r"(v) : "r"(p)); + return (v); +} + +/* + * Unordered memory store. + */ + +static __inline void +ia64_st1(uint8_t *p, uint8_t v) +{ + __asm __volatile("st1 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +static __inline void +ia64_st2(uint16_t *p, uint16_t v) +{ + __asm __volatile("st2 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +static __inline void +ia64_st4(uint32_t *p, uint32_t v) +{ + __asm __volatile("st4 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +static __inline void +ia64_st8(uint64_t *p, uint64_t v) +{ + __asm __volatile("st8 [%0]=%1;;" :: "r"(p), "r"(v)); +} + +/* * Read the value of psr. */ static __inline u_int64_t From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 18:35:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C84E4106566C; Fri, 4 Dec 2009 18:35:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B685E8FC18; Fri, 4 Dec 2009 18:35:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4IZ2cv062356; Fri, 4 Dec 2009 18:35:02 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4IZ2wx062354; Fri, 4 Dec 2009 18:35:02 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912041835.nB4IZ2wx062354@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 4 Dec 2009 18:35:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200104 - stable/8/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 18:35:02 -0000 Author: marcel Date: Fri Dec 4 18:35:02 2009 New Revision: 200104 URL: http://svn.freebsd.org/changeset/base/200104 Log: Revert unintentional change in revision 200103. Modified: stable/8/sys/ia64/ia64/support.S Modified: stable/8/sys/ia64/ia64/support.S ============================================================================== --- stable/8/sys/ia64/ia64/support.S Fri Dec 4 18:29:59 2009 (r200103) +++ stable/8/sys/ia64/ia64/support.S Fri Dec 4 18:35:02 2009 (r200104) @@ -775,10 +775,8 @@ ENTRY(copyinstr, 4) ;; br.call.sptk.few rp=copystr // do the copy. st8 [loc2]=r0 // kill the fault handler. - ;; mov ar.pfs=loc0 // restore ar.pfs mov rp=loc1 // restore ra. - ;; br.ret.sptk.few rp // ret0 left over from copystr END(copyinstr) @@ -889,10 +887,8 @@ ENTRY(copyin, 3) ;; br.call.sptk.few rp=bcopy // do the copy. st8 [loc2]=r0 // kill the fault handler. - ;; mov ar.pfs=loc0 // restore ar.pfs mov rp=loc1 // restore ra. - ;; br.ret.sptk.few rp // ret0 left over from bcopy END(copyin) @@ -929,10 +925,8 @@ ENTRY(copyout, 3) ;; br.call.sptk.few rp=bcopy // do the copy. st8 [loc2]=r0 // kill the fault handler. - ;; mov ar.pfs=loc0 // restore ar.pfs mov rp=loc1 // restore ra. - ;; br.ret.sptk.few rp // ret0 left over from bcopy END(copyout) @@ -985,7 +979,6 @@ ENTRY_NOPROFILE(_mcount, 4) ;; 2: mov ar.pfs = r14 - ;; br.sptk b6 ;; END(_mcount) From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 20:33:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DFE6106566B; Fri, 4 Dec 2009 20:33:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43C5C8FC14; Fri, 4 Dec 2009 20:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4KXS4r064749; Fri, 4 Dec 2009 20:33:28 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4KXSEM064747; Fri, 4 Dec 2009 20:33:28 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912042033.nB4KXSEM064747@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 4 Dec 2009 20:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200105 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 20:33:28 -0000 Author: netchild Date: Fri Dec 4 20:33:26 2009 New Revision: 200105 URL: http://svn.freebsd.org/changeset/base/200105 Log: Allow acces to vendor/v4l. Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Fri Dec 4 18:35:02 2009 (r200104) +++ svnadmin/conf/paths Fri Dec 4 20:33:26 2009 (r200105) @@ -81,5 +81,6 @@ ^vendor/top ^vendor/tzcode ^vendor/tzdata +^vendor/v4l ^vendor/wpa From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 20:34:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD3071065694; Fri, 4 Dec 2009 20:34:23 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A343F8FC21; Fri, 4 Dec 2009 20:34:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4KYNiU064803; Fri, 4 Dec 2009 20:34:23 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4KYNdk064802; Fri, 4 Dec 2009 20:34:23 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912042034.nB4KYNdk064802@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 4 Dec 2009 20:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200106 - vendor/v4l X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 20:34:23 -0000 Author: netchild Date: Fri Dec 4 20:34:23 2009 New Revision: 200106 URL: http://svn.freebsd.org/changeset/base/200106 Log: Create playground for the upcomming v4l header import. Added: vendor/v4l/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 20:42:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62A2B106566C; Fri, 4 Dec 2009 20:42:09 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FED08FC0C; Fri, 4 Dec 2009 20:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4Kg9dS064973; Fri, 4 Dec 2009 20:42:09 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4Kg9N9064970; Fri, 4 Dec 2009 20:42:09 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912042042.nB4Kg9N9064970@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 4 Dec 2009 20:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200107 - in vendor/v4l: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 20:42:09 -0000 Author: netchild Date: Fri Dec 4 20:42:08 2009 New Revision: 200107 URL: http://svn.freebsd.org/changeset/base/200107 Log: Import the interface description of the video for linux (v4l) subsystem. The header is importet from linux 2.6.17. The header does not come with a license, the author (Alan Cox ) gave his permission to use it (note, X.org has a copy of the header too): ---snip--- > Alan Cox said: > > > On Tue, Apr 12, 2005 at 03:13:15PM -0700, Julian Elischer wrote: > > > How does the licensing of the include files stand? > > Basically you cannot copyright an interface - its a fact rather > than creative expression normally. > > > > Of course there's always the "type it all in again" approach > > > where we define a functionally equivalent but completely > > > differntly spelled API, > > Wouldn't even need to be differently spelled. > > I'm all for this kind of sharing. > > Alan ---snip--- A more complete mail history is provided in the README file. Approved by: core Thanks to: julian (he also has the OK to use the v4l2 header) Added: vendor/v4l/README (contents, props changed) vendor/v4l/dist/ vendor/v4l/dist/videodev.h (contents, props changed) Added: vendor/v4l/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/v4l/README Fri Dec 4 20:42:08 2009 (r200107) @@ -0,0 +1,185 @@ +The video for linux (v4l) interface description (videodev.h) is imported +from linux. The header does not have a license. The author allows the use +of the header, and there is believe that a copy of such an interface +description can not lead to a copyright infringement. The X.org distribution +comes with a copy of videodev.h too. + +Corresponding discussion between julian@ and the authors of v4l and +v4l2 below: +---snip--- +Alan Cox said: + + > On Tue, Apr 12, 2005 at 03:13:15PM -0700, Julian Elischer wrote: + > + > >How does the licensing of the include files stand? + > + > Basically you cannot copyright an interface - its a fact rather + > than creative expression normally. + > + > >Of course there's always the "type it all in again" approach + > >where we define a functionally equivalent but completely + > >differntly spelled API, + > + > Wouldn't even need to be differently spelled. + > + > I'm all for this kind of sharing. + > + > Alan +======================================= + + + +also: +=========== +From: Alan Cox +Precedence: junk +Subject: Re: Implementing V4L(2) on BSD +Cc: Alan Cox , video4linux-list@redhat.com +Date: Fri, 15 Apr 2005 03:57:02 -0400 +To: Julian Elischer +References: <425F025E.4010001@vicor.com> +In-Reply-To: <425F025E.4010001@vicor.com> +Reply-To: Linux and Kernel Video +Message-ID: <20050415075702.GA30470@devserv.devel.redhat.com> +Content-Type: text/plain; charset=us-ascii +MIME-Version: 1.0 +Message: 31 + +On Thu, Apr 14, 2005 at 04:53:02PM -0700, Julian Elischer wrote: + > Anyhow both Alan Cox (who had a big hand in the V4L interface) (see +above) + > and + > Bill Dirks (V4L2) have indicated to me now that they approve + +Xorg btw has a BSD licensed (well X licensed so same thing) copy of the +videodev header I believe. We certainly sorted that out for them +permission +wise too + +Alan + +============ + +AND: + + +Content-Type: message/rfc822; + name="Re: V4L2" +Content-Transfer-Encoding: 7bit +Content-Disposition: inline; + filename="Re: V4L2" + +Return-Path: +X-Original-To: julian@vicor.com +Delivered-To: julian@vicor.com +Received: from localhost (localhost [127.0.0.1]) + by postoffice.vicor-nb.com (Postfix) with ESMTP id 662264CE87D + for ; Tue, 12 Apr 2005 21:02:43 -0700 (PDT) +Received: from postoffice.vicor-nb.com ([127.0.0.1]) + by localhost (postoffice.vicor-nb.com [127.0.0.1]) (amavisd-new, +port 10024) + with ESMTP id 91927-08 for ; + Tue, 12 Apr 2005 21:02:43 -0700 (PDT) +Received: from ylpvm01.prodigy.net (ylpvm01-ext.prodigy.net +[207.115.57.32]) + by postoffice.vicor-nb.com (Postfix) with ESMTP id AF5844CE835 + for ; Tue, 12 Apr 2005 21:02:42 -0700 (PDT) +Received: from [192.168.1.100] +(adsl-63-198-58-131.dsl.snfc21.pacbell.net [63.19 +8.58.131]) + by ylpvm01.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP +id j3D42f4H +014884 + for ; Wed, 13 Apr 2005 00:02:41 -0400 +Message-ID: <425C99F4.70507@pacbell.net> +Date: Tue, 12 Apr 2005 21:03:00 -0700 +From: Bill Dirks +User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) +Gecko/200406 +16 +X-Accept-Language: en-us, en +MIME-Version: 1.0 +To: Julian Elischer +Subject: Re: V4L2 +References: <4254403F.7080300@vicor.com> +<42588158.8040406@pacbell.net> <425C170 +2.1060104@vicor.com> +In-Reply-To: <425C1702.1060104@vicor.com> +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Transfer-Encoding: 7bit +X-Virus-Scanned: by amavisd-new at mail.test.vicor-nb.com +X-Spam-Level: +X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on + postoffice.vicor-nb.com +X-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,PORN_4 + autolearn=no version=2.63 +X-Status: +X-Keywords: +X-UID: 523 + + +Found this with Google + +http://www.fenwick.com/docstore/publications/IP/IP_Articles/Baystate_Holding.pdf + +I don't think you could be charged with copyright infringement. +Especially since the V4L2 spec is publicly available. Go ahead and copy +the file. As the original author, I have no objection. + +Looking at a current version of the file, it has no copyright notice +anyhow. +http://lxr.linux.no/source/include/linux/videodev2.h + +Bill. + + +Julian Elischer wrote: + + > This is a question specifically for you however. + > + > I am considerring implementing the V4L2 interface for BSD. + > Obviously it would be a compatible reimplementation (as the kernel + > is very different). It would however give correct credit to the + > original API design. + > + > The trouble comes in maintaining the compatibility without breaking + > copyright. (BSD obviously uses the BSD copyright and inclusion of a GPL + > component raises all sorts of problems (at least, in the kernel). + > + > Compatibility can best be maintained by using the same include file + > for defininitions. + > The alternative of "typing it all in in a different order" is stupid + > because + > 1/ It's not really "not copying it" + > 2/ it is hard to pick up fixes. + > + > Unfortunatly, to be compatible however, all those values would need to + > be defined.. + > + > What is the situation with the copyright of the include file? + > + > + > Bill Dirks wrote: + > + >> Others have taken over since I haven't had time for this in a while. + >> It's included in 2.6. See http://linux.bytesex.org/ for the latest + >> stuff including 2.4 patches. + >> + >> Bill. + >> + >> + >> Julian Elischer wrote: + >> + >>> not being a Linux type.. (BSD's my game) + >>> is V4L2 in new linux systems by default or did it deadend? + >>> I notice the web page talks mostly abut 2.4 kernels and doesn't have + >>> much new info. + >>> + >>> regards, + >>> + >>> Julian + >>> + >> + > +---snip--- + Added: vendor/v4l/dist/videodev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/v4l/dist/videodev.h Fri Dec 4 20:42:08 2009 (r200107) @@ -0,0 +1,372 @@ +#ifndef __LINUX_VIDEODEV_H +#define __LINUX_VIDEODEV_H + +#include + +#define HAVE_V4L1 1 + +#include + +#ifdef __KERNEL__ + +#include + +extern struct video_device* video_devdata(struct file*); + +#define to_video_device(cd) container_of(cd, struct video_device, class_dev) +static inline void +video_device_create_file(struct video_device *vfd, + struct class_device_attribute *attr) +{ + class_device_create_file(&vfd->class_dev, attr); +} +static inline void +video_device_remove_file(struct video_device *vfd, + struct class_device_attribute *attr) +{ + class_device_remove_file(&vfd->class_dev, attr); +} + +#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ +/* helper functions to access driver private data. */ +static inline void *video_get_drvdata(struct video_device *dev) +{ + return dev->priv; +} + +static inline void video_set_drvdata(struct video_device *dev, void *data) +{ + dev->priv = data; +} +#endif + +extern int video_exclusive_open(struct inode *inode, struct file *file); +extern int video_exclusive_release(struct inode *inode, struct file *file); +#endif /* __KERNEL__ */ + +struct video_capability +{ + char name[32]; + int type; + int channels; /* Num channels */ + int audios; /* Num audio devices */ + int maxwidth; /* Supported width */ + int maxheight; /* And height */ + int minwidth; /* Supported width */ + int minheight; /* And height */ +}; + + +struct video_channel +{ + int channel; + char name[32]; + int tuners; + __u32 flags; +#define VIDEO_VC_TUNER 1 /* Channel has a tuner */ +#define VIDEO_VC_AUDIO 2 /* Channel has audio */ + __u16 type; +#define VIDEO_TYPE_TV 1 +#define VIDEO_TYPE_CAMERA 2 + __u16 norm; /* Norm set by channel */ +}; + +struct video_tuner +{ + int tuner; + char name[32]; + unsigned long rangelow, rangehigh; /* Tuner range */ + __u32 flags; +#define VIDEO_TUNER_PAL 1 +#define VIDEO_TUNER_NTSC 2 +#define VIDEO_TUNER_SECAM 4 +#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ +#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ +#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ +#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ +#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ + __u16 mode; /* PAL/NTSC/SECAM/OTHER */ +#define VIDEO_MODE_PAL 0 +#define VIDEO_MODE_NTSC 1 +#define VIDEO_MODE_SECAM 2 +#define VIDEO_MODE_AUTO 3 + __u16 signal; /* Signal strength 16bit scale */ +}; + +struct video_picture +{ + __u16 brightness; + __u16 hue; + __u16 colour; + __u16 contrast; + __u16 whiteness; /* Black and white only */ + __u16 depth; /* Capture depth */ + __u16 palette; /* Palette in use */ +#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ +#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ +#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ +#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ +#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ +#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ +#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ +#define VIDEO_PALETTE_YUYV 8 +#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ +#define VIDEO_PALETTE_YUV420 10 +#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ +#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ +#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ +#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ +#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ +#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ +#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ +#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ +}; + +struct video_audio +{ + int audio; /* Audio channel */ + __u16 volume; /* If settable */ + __u16 bass, treble; + __u32 flags; +#define VIDEO_AUDIO_MUTE 1 +#define VIDEO_AUDIO_MUTABLE 2 +#define VIDEO_AUDIO_VOLUME 4 +#define VIDEO_AUDIO_BASS 8 +#define VIDEO_AUDIO_TREBLE 16 +#define VIDEO_AUDIO_BALANCE 32 + char name[16]; +#define VIDEO_SOUND_MONO 1 +#define VIDEO_SOUND_STEREO 2 +#define VIDEO_SOUND_LANG1 4 +#define VIDEO_SOUND_LANG2 8 + __u16 mode; + __u16 balance; /* Stereo balance */ + __u16 step; /* Step actual volume uses */ +}; + +struct video_clip +{ + __s32 x,y; + __s32 width, height; + struct video_clip *next; /* For user use/driver use only */ +}; + +struct video_window +{ + __u32 x,y; /* Position of window */ + __u32 width,height; /* Its size */ + __u32 chromakey; + __u32 flags; + struct video_clip __user *clips; /* Set only */ + int clipcount; +#define VIDEO_WINDOW_INTERLACE 1 +#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ +#define VIDEO_CLIP_BITMAP -1 +/* bitmap is 1024x625, a '1' bit represents a clipped pixel */ +#define VIDEO_CLIPMAP_SIZE (128 * 625) +}; + +struct video_capture +{ + __u32 x,y; /* Offsets into image */ + __u32 width, height; /* Area to capture */ + __u16 decimation; /* Decimation divider */ + __u16 flags; /* Flags for capture */ +#define VIDEO_CAPTURE_ODD 0 /* Temporal */ +#define VIDEO_CAPTURE_EVEN 1 +}; + +struct video_buffer +{ + void *base; + int height,width; + int depth; + int bytesperline; +}; + +struct video_mmap +{ + unsigned int frame; /* Frame (0 - n) for double buffer */ + int height,width; + unsigned int format; /* should be VIDEO_PALETTE_* */ +}; + +struct video_key +{ + __u8 key[8]; + __u32 flags; +}; + +struct video_mbuf +{ + int size; /* Total memory to map */ + int frames; /* Frames */ + int offsets[VIDEO_MAX_FRAME]; +}; + +#define VIDEO_NO_UNIT (-1) + +struct video_unit +{ + int video; /* Video minor */ + int vbi; /* VBI minor */ + int radio; /* Radio minor */ + int audio; /* Audio minor */ + int teletext; /* Teletext minor */ +}; + +struct vbi_format { + __u32 sampling_rate; /* in Hz */ + __u32 samples_per_line; + __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ + __s32 start[2]; /* starting line for each frame */ + __u32 count[2]; /* count of lines for each frame */ + __u32 flags; +#define VBI_UNSYNC 1 /* can distingues between top/bottom field */ +#define VBI_INTERLACED 2 /* lines are interlaced */ +}; + +/* video_info is biased towards hardware mpeg encode/decode */ +/* but it could apply generically to any hardware compressor/decompressor */ +struct video_info +{ + __u32 frame_count; /* frames output since decode/encode began */ + __u32 h_size; /* current unscaled horizontal size */ + __u32 v_size; /* current unscaled veritcal size */ + __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */ + __u32 picture_type; /* current picture type */ + __u32 temporal_reference; /* current temporal reference */ + __u8 user_data[256]; /* user data last found in compressed stream */ + /* user_data[0] contains user data flags, user_data[1] has count */ +}; + +/* generic structure for setting playback modes */ +struct video_play_mode +{ + int mode; + int p1; + int p2; +}; + +/* for loading microcode / fpga programming */ +struct video_code +{ + char loadwhat[16]; /* name or tag of file being passed */ + int datasize; + __u8 *data; +}; + +#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ +#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ +#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ +#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ +#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ +#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ +#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ +#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ +#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ +#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ +#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ +#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ +#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ +#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ +#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ +#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ +#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ +#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ +#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ +#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ +#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ +#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ +#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ +#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ +#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ +#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ +#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ +#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ +#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ + + +#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ + +/* VIDIOCSWRITEMODE */ +#define VID_WRITE_MPEG_AUD 0 +#define VID_WRITE_MPEG_VID 1 +#define VID_WRITE_OSD 2 +#define VID_WRITE_TTX 3 +#define VID_WRITE_CC 4 +#define VID_WRITE_MJPEG 5 + +/* VIDIOCSPLAYMODE */ +#define VID_PLAY_VID_OUT_MODE 0 + /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ +#define VID_PLAY_GENLOCK 1 + /* p1: 0 = OFF, 1 = ON */ + /* p2: GENLOCK FINE DELAY value */ +#define VID_PLAY_NORMAL 2 +#define VID_PLAY_PAUSE 3 +#define VID_PLAY_SINGLE_FRAME 4 +#define VID_PLAY_FAST_FORWARD 5 +#define VID_PLAY_SLOW_MOTION 6 +#define VID_PLAY_IMMEDIATE_NORMAL 7 +#define VID_PLAY_SWITCH_CHANNELS 8 +#define VID_PLAY_FREEZE_FRAME 9 +#define VID_PLAY_STILL_MODE 10 +#define VID_PLAY_MASTER_MODE 11 + /* p1: see below */ +#define VID_PLAY_MASTER_NONE 1 +#define VID_PLAY_MASTER_VIDEO 2 +#define VID_PLAY_MASTER_AUDIO 3 +#define VID_PLAY_ACTIVE_SCANLINES 12 + /* p1 = first active; p2 = last active */ +#define VID_PLAY_RESET 13 +#define VID_PLAY_END_MARK 14 + + + +#define VID_HARDWARE_BT848 1 +#define VID_HARDWARE_QCAM_BW 2 +#define VID_HARDWARE_PMS 3 +#define VID_HARDWARE_QCAM_C 4 +#define VID_HARDWARE_PSEUDO 5 +#define VID_HARDWARE_SAA5249 6 +#define VID_HARDWARE_AZTECH 7 +#define VID_HARDWARE_SF16MI 8 +#define VID_HARDWARE_RTRACK 9 +#define VID_HARDWARE_ZOLTRIX 10 +#define VID_HARDWARE_SAA7146 11 +#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */ +#define VID_HARDWARE_RTRACK2 13 +#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */ +#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */ +#define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */ +#define VID_HARDWARE_BROADWAY 17 /* Broadway project */ +#define VID_HARDWARE_GEMTEK 18 +#define VID_HARDWARE_TYPHOON 19 +#define VID_HARDWARE_VINO 20 /* SGI Indy Vino */ +#define VID_HARDWARE_CADET 21 /* Cadet radio */ +#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */ +#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */ +#define VID_HARDWARE_CPIA 24 +#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */ +#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */ +#define VID_HARDWARE_OV511 27 +#define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */ +#define VID_HARDWARE_W9966 29 +#define VID_HARDWARE_SE401 30 /* SE401 USB webcams */ +#define VID_HARDWARE_PWC 31 /* Philips webcams */ +#define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */ +#define VID_HARDWARE_CPIA2 33 +#define VID_HARDWARE_VICAM 34 +#define VID_HARDWARE_SF16FMR2 35 +#define VID_HARDWARE_W9968CF 36 +#define VID_HARDWARE_SAA7114H 37 +#define VID_HARDWARE_SN9C102 38 +#define VID_HARDWARE_ARV 39 +#endif /* __LINUX_VIDEODEV_H */ + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 20:43:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAD401065692; Fri, 4 Dec 2009 20:43:30 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90D0A8FC16; Fri, 4 Dec 2009 20:43:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4KhUjh065032; Fri, 4 Dec 2009 20:43:30 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4KhUti065031; Fri, 4 Dec 2009 20:43:30 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912042043.nB4KhUti065031@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 4 Dec 2009 20:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200108 - vendor/v4l/2.6.17 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 20:43:30 -0000 Author: netchild Date: Fri Dec 4 20:43:30 2009 New Revision: 200108 URL: http://svn.freebsd.org/changeset/base/200108 Log: Tag the current code as comming from linux 2.6.17. Added: vendor/v4l/2.6.17/ - copied from r200107, vendor/v4l/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 20:46:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B937A106568B; Fri, 4 Dec 2009 20:46:45 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A73348FC15; Fri, 4 Dec 2009 20:46:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4Kkj7g065155; Fri, 4 Dec 2009 20:46:45 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4KkjYQ065154; Fri, 4 Dec 2009 20:46:45 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912042046.nB4KkjYQ065154@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 4 Dec 2009 20:46:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200109 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 20:46:45 -0000 Author: netchild Date: Fri Dec 4 20:46:45 2009 New Revision: 200109 URL: http://svn.freebsd.org/changeset/base/200109 Log: Import the unchanged v4l videodev.h from the vendor branch. Added: head/sys/compat/linux/linux_videodev.h - copied unchanged from r200108, vendor/v4l/dist/videodev.h Copied: head/sys/compat/linux/linux_videodev.h (from r200108, vendor/v4l/dist/videodev.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_videodev.h Fri Dec 4 20:46:45 2009 (r200109, copy of r200108, vendor/v4l/dist/videodev.h) @@ -0,0 +1,372 @@ +#ifndef __LINUX_VIDEODEV_H +#define __LINUX_VIDEODEV_H + +#include + +#define HAVE_V4L1 1 + +#include + +#ifdef __KERNEL__ + +#include + +extern struct video_device* video_devdata(struct file*); + +#define to_video_device(cd) container_of(cd, struct video_device, class_dev) +static inline void +video_device_create_file(struct video_device *vfd, + struct class_device_attribute *attr) +{ + class_device_create_file(&vfd->class_dev, attr); +} +static inline void +video_device_remove_file(struct video_device *vfd, + struct class_device_attribute *attr) +{ + class_device_remove_file(&vfd->class_dev, attr); +} + +#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ +/* helper functions to access driver private data. */ +static inline void *video_get_drvdata(struct video_device *dev) +{ + return dev->priv; +} + +static inline void video_set_drvdata(struct video_device *dev, void *data) +{ + dev->priv = data; +} +#endif + +extern int video_exclusive_open(struct inode *inode, struct file *file); +extern int video_exclusive_release(struct inode *inode, struct file *file); +#endif /* __KERNEL__ */ + +struct video_capability +{ + char name[32]; + int type; + int channels; /* Num channels */ + int audios; /* Num audio devices */ + int maxwidth; /* Supported width */ + int maxheight; /* And height */ + int minwidth; /* Supported width */ + int minheight; /* And height */ +}; + + +struct video_channel +{ + int channel; + char name[32]; + int tuners; + __u32 flags; +#define VIDEO_VC_TUNER 1 /* Channel has a tuner */ +#define VIDEO_VC_AUDIO 2 /* Channel has audio */ + __u16 type; +#define VIDEO_TYPE_TV 1 +#define VIDEO_TYPE_CAMERA 2 + __u16 norm; /* Norm set by channel */ +}; + +struct video_tuner +{ + int tuner; + char name[32]; + unsigned long rangelow, rangehigh; /* Tuner range */ + __u32 flags; +#define VIDEO_TUNER_PAL 1 +#define VIDEO_TUNER_NTSC 2 +#define VIDEO_TUNER_SECAM 4 +#define VIDEO_TUNER_LOW 8 /* Uses KHz not MHz */ +#define VIDEO_TUNER_NORM 16 /* Tuner can set norm */ +#define VIDEO_TUNER_STEREO_ON 128 /* Tuner is seeing stereo */ +#define VIDEO_TUNER_RDS_ON 256 /* Tuner is seeing an RDS datastream */ +#define VIDEO_TUNER_MBS_ON 512 /* Tuner is seeing an MBS datastream */ + __u16 mode; /* PAL/NTSC/SECAM/OTHER */ +#define VIDEO_MODE_PAL 0 +#define VIDEO_MODE_NTSC 1 +#define VIDEO_MODE_SECAM 2 +#define VIDEO_MODE_AUTO 3 + __u16 signal; /* Signal strength 16bit scale */ +}; + +struct video_picture +{ + __u16 brightness; + __u16 hue; + __u16 colour; + __u16 contrast; + __u16 whiteness; /* Black and white only */ + __u16 depth; /* Capture depth */ + __u16 palette; /* Palette in use */ +#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */ +#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */ +#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */ +#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */ +#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */ +#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */ +#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */ +#define VIDEO_PALETTE_YUYV 8 +#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */ +#define VIDEO_PALETTE_YUV420 10 +#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */ +#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */ +#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */ +#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */ +#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */ +#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */ +#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */ +#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */ +}; + +struct video_audio +{ + int audio; /* Audio channel */ + __u16 volume; /* If settable */ + __u16 bass, treble; + __u32 flags; +#define VIDEO_AUDIO_MUTE 1 +#define VIDEO_AUDIO_MUTABLE 2 +#define VIDEO_AUDIO_VOLUME 4 +#define VIDEO_AUDIO_BASS 8 +#define VIDEO_AUDIO_TREBLE 16 +#define VIDEO_AUDIO_BALANCE 32 + char name[16]; +#define VIDEO_SOUND_MONO 1 +#define VIDEO_SOUND_STEREO 2 +#define VIDEO_SOUND_LANG1 4 +#define VIDEO_SOUND_LANG2 8 + __u16 mode; + __u16 balance; /* Stereo balance */ + __u16 step; /* Step actual volume uses */ +}; + +struct video_clip +{ + __s32 x,y; + __s32 width, height; + struct video_clip *next; /* For user use/driver use only */ +}; + +struct video_window +{ + __u32 x,y; /* Position of window */ + __u32 width,height; /* Its size */ + __u32 chromakey; + __u32 flags; + struct video_clip __user *clips; /* Set only */ + int clipcount; +#define VIDEO_WINDOW_INTERLACE 1 +#define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ +#define VIDEO_CLIP_BITMAP -1 +/* bitmap is 1024x625, a '1' bit represents a clipped pixel */ +#define VIDEO_CLIPMAP_SIZE (128 * 625) +}; + +struct video_capture +{ + __u32 x,y; /* Offsets into image */ + __u32 width, height; /* Area to capture */ + __u16 decimation; /* Decimation divider */ + __u16 flags; /* Flags for capture */ +#define VIDEO_CAPTURE_ODD 0 /* Temporal */ +#define VIDEO_CAPTURE_EVEN 1 +}; + +struct video_buffer +{ + void *base; + int height,width; + int depth; + int bytesperline; +}; + +struct video_mmap +{ + unsigned int frame; /* Frame (0 - n) for double buffer */ + int height,width; + unsigned int format; /* should be VIDEO_PALETTE_* */ +}; + +struct video_key +{ + __u8 key[8]; + __u32 flags; +}; + +struct video_mbuf +{ + int size; /* Total memory to map */ + int frames; /* Frames */ + int offsets[VIDEO_MAX_FRAME]; +}; + +#define VIDEO_NO_UNIT (-1) + +struct video_unit +{ + int video; /* Video minor */ + int vbi; /* VBI minor */ + int radio; /* Radio minor */ + int audio; /* Audio minor */ + int teletext; /* Teletext minor */ +}; + +struct vbi_format { + __u32 sampling_rate; /* in Hz */ + __u32 samples_per_line; + __u32 sample_format; /* VIDEO_PALETTE_RAW only (1 byte) */ + __s32 start[2]; /* starting line for each frame */ + __u32 count[2]; /* count of lines for each frame */ + __u32 flags; +#define VBI_UNSYNC 1 /* can distingues between top/bottom field */ +#define VBI_INTERLACED 2 /* lines are interlaced */ +}; + +/* video_info is biased towards hardware mpeg encode/decode */ +/* but it could apply generically to any hardware compressor/decompressor */ +struct video_info +{ + __u32 frame_count; /* frames output since decode/encode began */ + __u32 h_size; /* current unscaled horizontal size */ + __u32 v_size; /* current unscaled veritcal size */ + __u32 smpte_timecode; /* current SMPTE timecode (for current GOP) */ + __u32 picture_type; /* current picture type */ + __u32 temporal_reference; /* current temporal reference */ + __u8 user_data[256]; /* user data last found in compressed stream */ + /* user_data[0] contains user data flags, user_data[1] has count */ +}; + +/* generic structure for setting playback modes */ +struct video_play_mode +{ + int mode; + int p1; + int p2; +}; + +/* for loading microcode / fpga programming */ +struct video_code +{ + char loadwhat[16]; /* name or tag of file being passed */ + int datasize; + __u8 *data; +}; + +#define VIDIOCGCAP _IOR('v',1,struct video_capability) /* Get capabilities */ +#define VIDIOCGCHAN _IOWR('v',2,struct video_channel) /* Get channel info (sources) */ +#define VIDIOCSCHAN _IOW('v',3,struct video_channel) /* Set channel */ +#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner) /* Get tuner abilities */ +#define VIDIOCSTUNER _IOW('v',5,struct video_tuner) /* Tune the tuner for the current channel */ +#define VIDIOCGPICT _IOR('v',6,struct video_picture) /* Get picture properties */ +#define VIDIOCSPICT _IOW('v',7,struct video_picture) /* Set picture properties */ +#define VIDIOCCAPTURE _IOW('v',8,int) /* Start, end capture */ +#define VIDIOCGWIN _IOR('v',9, struct video_window) /* Get the video overlay window */ +#define VIDIOCSWIN _IOW('v',10, struct video_window) /* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */ +#define VIDIOCGFBUF _IOR('v',11, struct video_buffer) /* Get frame buffer */ +#define VIDIOCSFBUF _IOW('v',12, struct video_buffer) /* Set frame buffer - root only */ +#define VIDIOCKEY _IOR('v',13, struct video_key) /* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */ +#define VIDIOCGFREQ _IOR('v',14, unsigned long) /* Set tuner */ +#define VIDIOCSFREQ _IOW('v',15, unsigned long) /* Set tuner */ +#define VIDIOCGAUDIO _IOR('v',16, struct video_audio) /* Get audio info */ +#define VIDIOCSAUDIO _IOW('v',17, struct video_audio) /* Audio source, mute etc */ +#define VIDIOCSYNC _IOW('v',18, int) /* Sync with mmap grabbing */ +#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap) /* Grab frames */ +#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf) /* Memory map buffer info */ +#define VIDIOCGUNIT _IOR('v',21, struct video_unit) /* Get attached units */ +#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture) /* Get subcapture */ +#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture) /* Set subcapture */ +#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode) /* Set output video mode/feature */ +#define VIDIOCSWRITEMODE _IOW('v',25, int) /* Set write mode */ +#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info) /* Get current playback info from hardware */ +#define VIDIOCSMICROCODE _IOW('v',27, struct video_code) /* Load microcode into hardware */ +#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format) /* Get VBI information */ +#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format) /* Set VBI information */ + + +#define BASE_VIDIOCPRIVATE 192 /* 192-255 are private */ + +/* VIDIOCSWRITEMODE */ +#define VID_WRITE_MPEG_AUD 0 +#define VID_WRITE_MPEG_VID 1 +#define VID_WRITE_OSD 2 +#define VID_WRITE_TTX 3 +#define VID_WRITE_CC 4 +#define VID_WRITE_MJPEG 5 + +/* VIDIOCSPLAYMODE */ +#define VID_PLAY_VID_OUT_MODE 0 + /* p1: = VIDEO_MODE_PAL, VIDEO_MODE_NTSC, etc ... */ +#define VID_PLAY_GENLOCK 1 + /* p1: 0 = OFF, 1 = ON */ + /* p2: GENLOCK FINE DELAY value */ +#define VID_PLAY_NORMAL 2 +#define VID_PLAY_PAUSE 3 +#define VID_PLAY_SINGLE_FRAME 4 +#define VID_PLAY_FAST_FORWARD 5 +#define VID_PLAY_SLOW_MOTION 6 +#define VID_PLAY_IMMEDIATE_NORMAL 7 +#define VID_PLAY_SWITCH_CHANNELS 8 +#define VID_PLAY_FREEZE_FRAME 9 +#define VID_PLAY_STILL_MODE 10 +#define VID_PLAY_MASTER_MODE 11 + /* p1: see below */ +#define VID_PLAY_MASTER_NONE 1 +#define VID_PLAY_MASTER_VIDEO 2 +#define VID_PLAY_MASTER_AUDIO 3 +#define VID_PLAY_ACTIVE_SCANLINES 12 + /* p1 = first active; p2 = last active */ +#define VID_PLAY_RESET 13 +#define VID_PLAY_END_MARK 14 + + + +#define VID_HARDWARE_BT848 1 +#define VID_HARDWARE_QCAM_BW 2 +#define VID_HARDWARE_PMS 3 +#define VID_HARDWARE_QCAM_C 4 +#define VID_HARDWARE_PSEUDO 5 +#define VID_HARDWARE_SAA5249 6 +#define VID_HARDWARE_AZTECH 7 +#define VID_HARDWARE_SF16MI 8 +#define VID_HARDWARE_RTRACK 9 +#define VID_HARDWARE_ZOLTRIX 10 +#define VID_HARDWARE_SAA7146 11 +#define VID_HARDWARE_VIDEUM 12 /* Reserved for Winnov videum */ +#define VID_HARDWARE_RTRACK2 13 +#define VID_HARDWARE_PERMEDIA2 14 /* Reserved for Permedia2 */ +#define VID_HARDWARE_RIVA128 15 /* Reserved for RIVA 128 */ +#define VID_HARDWARE_PLANB 16 /* PowerMac motherboard video-in */ +#define VID_HARDWARE_BROADWAY 17 /* Broadway project */ +#define VID_HARDWARE_GEMTEK 18 +#define VID_HARDWARE_TYPHOON 19 +#define VID_HARDWARE_VINO 20 /* SGI Indy Vino */ +#define VID_HARDWARE_CADET 21 /* Cadet radio */ +#define VID_HARDWARE_TRUST 22 /* Trust FM Radio */ +#define VID_HARDWARE_TERRATEC 23 /* TerraTec ActiveRadio */ +#define VID_HARDWARE_CPIA 24 +#define VID_HARDWARE_ZR36120 25 /* Zoran ZR36120/ZR36125 */ +#define VID_HARDWARE_ZR36067 26 /* Zoran ZR36067/36060 */ +#define VID_HARDWARE_OV511 27 +#define VID_HARDWARE_ZR356700 28 /* Zoran 36700 series */ +#define VID_HARDWARE_W9966 29 +#define VID_HARDWARE_SE401 30 /* SE401 USB webcams */ +#define VID_HARDWARE_PWC 31 /* Philips webcams */ +#define VID_HARDWARE_MEYE 32 /* Sony Vaio MotionEye cameras */ +#define VID_HARDWARE_CPIA2 33 +#define VID_HARDWARE_VICAM 34 +#define VID_HARDWARE_SF16FMR2 35 +#define VID_HARDWARE_W9968CF 36 +#define VID_HARDWARE_SAA7114H 37 +#define VID_HARDWARE_SN9C102 38 +#define VID_HARDWARE_ARV 39 +#endif /* __LINUX_VIDEODEV_H */ + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 21:06:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CF4C106566C; Fri, 4 Dec 2009 21:06:55 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AA898FC1A; Fri, 4 Dec 2009 21:06:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4L6tIH065546; Fri, 4 Dec 2009 21:06:55 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4L6tsr065541; Fri, 4 Dec 2009 21:06:55 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <200912042106.nB4L6tsr065541@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 4 Dec 2009 21:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200110 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 21:06:55 -0000 Author: netchild Date: Fri Dec 4 21:06:54 2009 New Revision: 200110 URL: http://svn.freebsd.org/changeset/base/200110 Log: This is v4l support for the linuxulator. This allows to access FreeBSD native devices which support the v4l API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver. Not tested is firmware upload, framebuffer stuff and video tuner stuff due to lack of hardware. The clipping part (VIDIOCSWIN) needs a little bit of further work (partly in progress, but can not be tested due to lack of a suitable device). The submitter tested this sucessfully with Skype and flash apps on amd64 and i386 with the multimedia/pwcbsd driver. Submitted by: J.R. Oldroyd Added: head/sys/compat/linux/linux_videodev_compat.h (contents, props changed) Modified: head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h head/sys/compat/linux/linux_videodev.h (contents, props changed) Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Fri Dec 4 20:46:45 2009 (r200109) +++ head/sys/compat/linux/linux_ioctl.c Fri Dec 4 21:06:54 2009 (r200110) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); static linux_ioctl_function_t linux_ioctl_cdrom; @@ -91,6 +94,7 @@ static linux_ioctl_function_t linux_ioct static linux_ioctl_function_t linux_ioctl_private; static linux_ioctl_function_t linux_ioctl_drm; static linux_ioctl_function_t linux_ioctl_sg; +static linux_ioctl_function_t linux_ioctl_v4l; static linux_ioctl_function_t linux_ioctl_special; static struct linux_ioctl_handler cdrom_handler = @@ -115,6 +119,8 @@ static struct linux_ioctl_handler drm_ha { linux_ioctl_drm, LINUX_IOCTL_DRM_MIN, LINUX_IOCTL_DRM_MAX }; static struct linux_ioctl_handler sg_handler = { linux_ioctl_sg, LINUX_IOCTL_SG_MIN, LINUX_IOCTL_SG_MAX }; +static struct linux_ioctl_handler video_handler = +{ linux_ioctl_v4l, LINUX_IOCTL_VIDEO_MIN, LINUX_IOCTL_VIDEO_MAX }; DATA_SET(linux_ioctl_handler_set, cdrom_handler); DATA_SET(linux_ioctl_handler_set, vfat_handler); @@ -127,6 +133,7 @@ DATA_SET(linux_ioctl_handler_set, termio DATA_SET(linux_ioctl_handler_set, private_handler); DATA_SET(linux_ioctl_handler_set, drm_handler); DATA_SET(linux_ioctl_handler_set, sg_handler); +DATA_SET(linux_ioctl_handler_set, video_handler); struct handler_element { @@ -2589,6 +2596,295 @@ linux_ioctl_sg(struct thread *td, struct } /* + * Video4Linux (V4L) ioctl handler + */ +static int +linux_to_bsd_v4l_tuner(struct l_video_tuner *lvt, struct video_tuner *vt) +{ + vt->tuner = lvt->tuner; + strlcpy(vt->name, lvt->name, LINUX_VIDEO_TUNER_NAME_SIZE); + vt->rangelow = lvt->rangelow; /* possible long size conversion */ + vt->rangehigh = lvt->rangehigh; /* possible long size conversion */ + vt->flags = lvt->flags; + vt->mode = lvt->mode; + vt->signal = lvt->signal; + return (0); +} + +static int +bsd_to_linux_v4l_tuner(struct video_tuner *vt, struct l_video_tuner *lvt) +{ + lvt->tuner = vt->tuner; + strlcpy(lvt->name, vt->name, LINUX_VIDEO_TUNER_NAME_SIZE); + lvt->rangelow = vt->rangelow; /* possible long size conversion */ + lvt->rangehigh = vt->rangehigh; /* possible long size conversion */ + lvt->flags = vt->flags; + lvt->mode = vt->mode; + lvt->signal = vt->signal; + return (0); +} + +#if 0 +static int +linux_to_bsd_v4l_clip(struct l_video_clip *lvc, struct video_clip *vc) +{ + vc->x = lvc->x; + vc->y = lvc->y; + vc->width = lvc->width; + vc->height = lvc->height; + vc->next = PTRIN(lvc->next); /* possible pointer size conversion */ + return (0); +} +#endif + +static int +linux_to_bsd_v4l_window(struct l_video_window *lvw, struct video_window *vw) +{ + vw->x = lvw->x; + vw->y = lvw->y; + vw->width = lvw->width; + vw->height = lvw->height; + vw->chromakey = lvw->chromakey; + vw->flags = lvw->flags; + vw->clips = PTRIN(lvw->clips); /* possible pointer size conversion */ + vw->clipcount = lvw->clipcount; + return (0); +} + +static int +bsd_to_linux_v4l_window(struct video_window *vw, struct l_video_window *lvw) +{ + lvw->x = vw->x; + lvw->y = vw->y; + lvw->width = vw->width; + lvw->height = vw->height; + lvw->chromakey = vw->chromakey; + lvw->flags = vw->flags; + lvw->clips = PTROUT(vw->clips); /* possible pointer size conversion */ + lvw->clipcount = vw->clipcount; + return (0); +} + +static int +linux_to_bsd_v4l_buffer(struct l_video_buffer *lvb, struct video_buffer *vb) +{ + vb->base = PTRIN(lvb->base); /* possible pointer size conversion */ + vb->height = lvb->height; + vb->width = lvb->width; + vb->depth = lvb->depth; + vb->bytesperline = lvb->bytesperline; + return (0); +} + +static int +bsd_to_linux_v4l_buffer(struct video_buffer *vb, struct l_video_buffer *lvb) +{ + lvb->base = PTROUT(vb->base); /* possible pointer size conversion */ + lvb->height = vb->height; + lvb->width = vb->width; + lvb->depth = vb->depth; + lvb->bytesperline = vb->bytesperline; + return (0); +} + +static int +linux_to_bsd_v4l_code(struct l_video_code *lvc, struct video_code *vc) +{ + strlcpy(vc->loadwhat, lvc->loadwhat, LINUX_VIDEO_CODE_LOADWHAT_SIZE); + vc->datasize = lvc->datasize; + vc->data = PTRIN(lvc->data); /* possible pointer size conversion */ + return (0); +} + +#if 0 +static int +linux_v4l_cliplist_copy(struct l_video_window *lvw, struct video_window *vw) +{ + struct video_clip vclip; + struct l_video_clip l_vclip; + struct video_clip **ppvc; + struct l_video_clip *plvc; + int error; + + ppvc = &(vw->clips); + for (plvc = (struct l_video_clip *) PTRIN(lvw->clips); + plvc != NULL; + plvc = (struct l_video_clip *) PTRIN(plvc->next)) { + error = copyin((void *) plvc, &l_vclip, sizeof(l_vclip)); + if (error) return (error); + linux_to_bsd_v4l_clip(&l_vclip, &vclip); + /* XXX: If there can be no concurrency: s/M_NOWAIT/M_WAITOK/ */ + if ((*ppvc = malloc(sizeof(**ppvc), M_LINUX, M_NOWAIT)) == NULL) + return (ENOMEM); /* XXX: linux has no ENOMEM here */ + memcpy(&vclip, *ppvc, sizeof(vclip)); + ppvc = &((*ppvc)->next); + } + return (0); +} + +static int +linux_v4l_cliplist_free(struct video_window *vw) +{ + struct video_clip **ppvc; + struct video_clip **ppvc_next; + + for (ppvc = &(vw->clips); *ppvc != NULL; ppvc = ppvc_next) { + ppvc_next = &((*ppvc)->next); + free(*ppvc, M_LINUX); + } + return (0); +} +#endif + +static int +linux_ioctl_v4l(struct thread *td, struct linux_ioctl_args *args) +{ + struct file *fp; + int error; + struct video_tuner vtun; + struct video_window vwin; + struct video_buffer vbuf; + struct video_code vcode; + struct l_video_tuner l_vtun; + struct l_video_window l_vwin; + struct l_video_buffer l_vbuf; + struct l_video_code l_vcode; + + switch (args->cmd & 0xffff) { + case LINUX_VIDIOCGCAP: args->cmd = VIDIOCGCAP; break; + case LINUX_VIDIOCGCHAN: args->cmd = VIDIOCGCHAN; break; + case LINUX_VIDIOCSCHAN: args->cmd = VIDIOCSCHAN; break; + + case LINUX_VIDIOCGTUNER: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = fo_ioctl(fp, VIDIOCGTUNER, &vtun, td->td_ucred, td); + if (!error) { + bsd_to_linux_v4l_tuner(&vtun, &l_vtun); + error = copyout(&l_vtun, (void *) args->arg, + sizeof(l_vtun)); + } + fdrop(fp, td); + return (error); + + case LINUX_VIDIOCSTUNER: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = copyin((void *) args->arg, &l_vtun, sizeof(l_vtun)); + if (error) { + fdrop(fp, td); + return (error); + } + linux_to_bsd_v4l_tuner(&l_vtun, &vtun); + error = fo_ioctl(fp, VIDIOCSMICROCODE, &vtun, td->td_ucred, td); + fdrop(fp, td); + return (error); + + case LINUX_VIDIOCGPICT: args->cmd = VIDIOCGPICT; break; + case LINUX_VIDIOCSPICT: args->cmd = VIDIOCSPICT; break; + case LINUX_VIDIOCCAPTURE: args->cmd = VIDIOCCAPTURE; break; + + case LINUX_VIDIOCGWIN: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = fo_ioctl(fp, VIDIOCGWIN, &vwin, td->td_ucred, td); + if (!error) { + bsd_to_linux_v4l_window(&vwin, &l_vwin); + error = copyout(&l_vwin, (void *) args->arg, + sizeof(l_vwin)); + } + fdrop(fp, td); + return (error); + + case LINUX_VIDIOCSWIN: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = copyin((void *) args->arg, &l_vwin, sizeof(l_vwin)); + if (error) { + fdrop(fp, td); + return (error); + } + linux_to_bsd_v4l_window(&l_vwin, &vwin); +#if 0 + /* + * XXX: some Linux apps call SWIN but do not store valid + * values in clipcount or in the clips pointer. Until + * we have someone calling to support this, the code + * to handle the list of video_clip structures is removed. + */ + error = linux_v4l_cliplist_copy(&l_vwin, &vwin); +#endif + if (!error) + error = fo_ioctl(fp, VIDIOCSWIN, &vwin, td->td_ucred, td); + fdrop(fp, td); +#if 0 + linux_v4l_cliplist_free(&vwin); +#endif + return (error); + + case LINUX_VIDIOCGFBUF: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = fo_ioctl(fp, VIDIOCGFBUF, &vbuf, td->td_ucred, td); + if (!error) { + bsd_to_linux_v4l_buffer(&vbuf, &l_vbuf); + error = copyout(&l_vbuf, (void *) args->arg, + sizeof(l_vbuf)); + } + fdrop(fp, td); + return (error); + + case LINUX_VIDIOCSFBUF: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = copyin((void *) args->arg, &l_vbuf, sizeof(l_vbuf)); + if (error) { + fdrop(fp, td); + return (error); + } + linux_to_bsd_v4l_buffer(&l_vbuf, &vbuf); + error = fo_ioctl(fp, VIDIOCSFBUF, &vbuf, td->td_ucred, td); + fdrop(fp, td); + return (error); + + case LINUX_VIDIOCKEY: args->cmd = VIDIOCKEY; break; + case LINUX_VIDIOCGFREQ: args->cmd = VIDIOCGFREQ; break; + case LINUX_VIDIOCSFREQ: args->cmd = VIDIOCSFREQ; break; + case LINUX_VIDIOCGAUDIO: args->cmd = VIDIOCGAUDIO; break; + case LINUX_VIDIOCSAUDIO: args->cmd = VIDIOCSAUDIO; break; + case LINUX_VIDIOCSYNC: args->cmd = VIDIOCSYNC; break; + case LINUX_VIDIOCMCAPTURE: args->cmd = VIDIOCMCAPTURE; break; + case LINUX_VIDIOCGMBUF: args->cmd = VIDIOCGMBUF; break; + case LINUX_VIDIOCGUNIT: args->cmd = VIDIOCGUNIT; break; + case LINUX_VIDIOCGCAPTURE: args->cmd = VIDIOCGCAPTURE; break; + case LINUX_VIDIOCSCAPTURE: args->cmd = VIDIOCSCAPTURE; break; + case LINUX_VIDIOCSPLAYMODE: args->cmd = VIDIOCSPLAYMODE; break; + case LINUX_VIDIOCSWRITEMODE: args->cmd = VIDIOCSWRITEMODE; break; + case LINUX_VIDIOCGPLAYINFO: args->cmd = VIDIOCGPLAYINFO; break; + + case LINUX_VIDIOCSMICROCODE: + if ((error = fget(td, args->fd, &fp)) != 0) + return (error); + error = copyin((void *) args->arg, &l_vcode, sizeof(l_vcode)); + if (error) { + fdrop(fp, td); + return (error); + } + linux_to_bsd_v4l_code(&l_vcode, &vcode); + error = fo_ioctl(fp, VIDIOCSTUNER, &vcode, td->td_ucred, td); + fdrop(fp, td); + return (error); + + case LINUX_VIDIOCGVBIFMT: args->cmd = VIDIOCGVBIFMT; break; + case LINUX_VIDIOCSVBIFMT: args->cmd = VIDIOCSVBIFMT; break; + default: return (ENOIOCTL); + } + + error = ioctl(td, (struct ioctl_args *)args); + return (error); +} + +/* * Special ioctl handler */ static int Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Fri Dec 4 20:46:45 2009 (r200109) +++ head/sys/compat/linux/linux_ioctl.h Fri Dec 4 21:06:54 2009 (r200110) @@ -575,4 +575,40 @@ struct ifnet; int linux_ifname(struct ifnet *, char *, size_t); +/* + * video + */ +#define LINUX_VIDIOCGCAP 0x7601 +#define LINUX_VIDIOCGCHAN 0x7602 +#define LINUX_VIDIOCSCHAN 0x7603 +#define LINUX_VIDIOCGTUNER 0x7604 +#define LINUX_VIDIOCSTUNER 0x7605 +#define LINUX_VIDIOCGPICT 0x7606 +#define LINUX_VIDIOCSPICT 0x7607 +#define LINUX_VIDIOCCAPTURE 0x7608 +#define LINUX_VIDIOCGWIN 0x7609 +#define LINUX_VIDIOCSWIN 0x760a +#define LINUX_VIDIOCGFBUF 0x760b +#define LINUX_VIDIOCSFBUF 0x760c +#define LINUX_VIDIOCKEY 0x760d +#define LINUX_VIDIOCGFREQ 0x760e +#define LINUX_VIDIOCSFREQ 0x760f +#define LINUX_VIDIOCGAUDIO 0x7610 +#define LINUX_VIDIOCSAUDIO 0x7611 +#define LINUX_VIDIOCSYNC 0x7623 +#define LINUX_VIDIOCMCAPTURE 0x7613 +#define LINUX_VIDIOCGMBUF 0x7614 +#define LINUX_VIDIOCGUNIT 0x7615 +#define LINUX_VIDIOCGCAPTURE 0x7616 +#define LINUX_VIDIOCSCAPTURE 0x7617 +#define LINUX_VIDIOCSPLAYMODE 0x7618 +#define LINUX_VIDIOCSWRITEMODE 0x7619 +#define LINUX_VIDIOCGPLAYINFO 0x761a +#define LINUX_VIDIOCSMICROCODE 0x761b +#define LINUX_VIDIOCGVBIFMT 0x761c +#define LINUX_VIDIOCSVBIFMT 0x761d + +#define LINUX_IOCTL_VIDEO_MIN LINUX_VIDIOCGCAP +#define LINUX_IOCTL_VIDEO_MAX LINUX_VIDIOCSVBIFMT + #endif /* !_LINUX_IOCTL_H_ */ Modified: head/sys/compat/linux/linux_videodev.h ============================================================================== --- head/sys/compat/linux/linux_videodev.h Fri Dec 4 20:46:45 2009 (r200109) +++ head/sys/compat/linux/linux_videodev.h Fri Dec 4 21:06:54 2009 (r200110) @@ -1,48 +1,41 @@ +/* + * This header comes from linux, but it has no license. The author + * (Alan Cox @ Redhat) gave explicit permissions to use it in FreeBSD. + * The freeBSD vendor branch for v4l gives a more detailed description + * about this. + * + * $FreeBSD$ + */ + #ifndef __LINUX_VIDEODEV_H #define __LINUX_VIDEODEV_H -#include +#include +typedef int32_t __s32; +typedef uint32_t __u32; +typedef uint16_t __u16; +typedef uint8_t __u8; +#if 0 #define HAVE_V4L1 1 #include +#endif -#ifdef __KERNEL__ - -#include - -extern struct video_device* video_devdata(struct file*); - -#define to_video_device(cd) container_of(cd, struct video_device, class_dev) -static inline void -video_device_create_file(struct video_device *vfd, - struct class_device_attribute *attr) -{ - class_device_create_file(&vfd->class_dev, attr); -} -static inline void -video_device_remove_file(struct video_device *vfd, - struct class_device_attribute *attr) -{ - class_device_remove_file(&vfd->class_dev, attr); -} - -#if OBSOLETE_OWNER /* to be removed in 2.6.15 */ -/* helper functions to access driver private data. */ -static inline void *video_get_drvdata(struct video_device *dev) -{ - return dev->priv; -} - -static inline void video_set_drvdata(struct video_device *dev, void *data) -{ - dev->priv = data; -} -#endif - -extern int video_exclusive_open(struct inode *inode, struct file *file); -extern int video_exclusive_release(struct inode *inode, struct file *file); -#endif /* __KERNEL__ */ +#define VID_TYPE_CAPTURE 1 /* Can capture */ +#define VID_TYPE_TUNER 2 /* Can tune */ +#define VID_TYPE_TELETEXT 4 /* Does teletext */ +#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */ +#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */ +#define VID_TYPE_CLIPPING 32 /* Can clip */ +#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */ +#define VID_TYPE_SCALES 128 /* Scalable */ +#define VID_TYPE_MONOCHROME 256 /* Monochrome only */ +#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */ +#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */ +#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */ +#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */ +#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */ struct video_capability { @@ -157,7 +150,7 @@ struct video_window __u32 width,height; /* Its size */ __u32 chromakey; __u32 flags; - struct video_clip __user *clips; /* Set only */ + struct video_clip *clips; /* Set only */ int clipcount; #define VIDEO_WINDOW_INTERLACE 1 #define VIDEO_WINDOW_CHROMAKEY 16 /* Overlay by chromakey */ @@ -197,6 +190,8 @@ struct video_key __u32 flags; }; +#define VIDEO_MAX_FRAME 32 + struct video_mbuf { int size; /* Total memory to map */ Added: head/sys/compat/linux/linux_videodev_compat.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linux/linux_videodev_compat.h Fri Dec 4 21:06:54 2009 (r200110) @@ -0,0 +1,59 @@ +/* + * $FreeBSD$ + */ + +/* + * This file defines compatibility versions of several video structures + * defined in the Linux videodev.h header (linux_videodev.h). The + * structures defined in this file are the ones that have been determined + * to have 32- to 64-bit size dependencies. + */ + +#ifndef _LINUX_VIDEODEV_COMPAT_H_ +#define _LINUX_VIDEODEV_COMPAT_H_ + +struct l_video_tuner +{ + l_int tuner; +#define LINUX_VIDEO_TUNER_NAME_SIZE 32 + char name[LINUX_VIDEO_TUNER_NAME_SIZE]; + l_ulong rangelow, rangehigh; + uint32_t flags; + uint16_t mode; + uint16_t signal; +}; + +struct l_video_clip +{ + int32_t x, y; + int32_t width, height; + l_uintptr_t next; +}; + +struct l_video_window +{ + uint32_t x, y; + uint32_t width, height; + uint32_t chromakey; + uint32_t flags; + l_uintptr_t clips; + l_int clipcount; +}; + +struct l_video_buffer +{ + l_uintptr_t base; + l_int height, width; + l_int depth; + l_int bytesperline; +}; + +struct l_video_code +{ +#define LINUX_VIDEO_CODE_LOADWHAT_SIZE 16 + char loadwhat[LINUX_VIDEO_CODE_LOADWHAT_SIZE]; + l_int datasize; + l_uintptr_t data; +}; + +#endif /* !_LINUX_VIDEODEV_COMPAT_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 21:16:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26F851065695; Fri, 4 Dec 2009 21:16:44 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id BAD418FC0A; Fri, 4 Dec 2009 21:16:43 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2F0DA.dip.t-dialin.net [217.226.240.218]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 1A7B4844026; Fri, 4 Dec 2009 22:16:37 +0100 (CET) Received: from unknown (unknown [192.168.2.110]) by outgoing.leidinger.net (Postfix) with ESMTP id C909F2AB669; Fri, 4 Dec 2009 22:16:33 +0100 (CET) Date: Fri, 4 Dec 2009 22:16:31 +0100 From: Alexander Leidinger To: Alexander Leidinger Message-ID: <20091204221631.00000776@unknown> In-Reply-To: <200912042042.nB4Kg9N9064970@svn.freebsd.org> References: <200912042042.nB4Kg9N9064970@svn.freebsd.org> X-Mailer: Claws Mail 3.7.2cvs15 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 1A7B4844026.C343C X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1260566198.70451@iuXHkMI+pusgavvyVO/28Q X-EBL-Spam-Status: No Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r200107 - in vendor/v4l: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 21:16:44 -0000 On Fri, 4 Dec 2009 20:42:09 +0000 (UTC) Alexander Leidinger wrote: > Log: > Import the interface description of the video for linux (v4l) > subsystem. The header is importet from linux 2.6.17. I only importet it into head as a private copy in the linuxulator. I will not import it in a place where it will be installed in the includes directory via installworld. Anyone who wants to add v4l support to in-tree drivers is free to do so, but has to import the videodev.h header into a public place in head himself. The license side is covered, so this person just needs to do some code hacking and experimental port builds (and maybe notify emulation@, as we may want to redo the linuxulator part with the native header then)... Bye, Alexander. From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 21:52:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F59106566B; Fri, 4 Dec 2009 21:52:31 +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 C73108FC18; Fri, 4 Dec 2009 21:52:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4LqVkW066486; Fri, 4 Dec 2009 21:52:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4LqVGp066484; Fri, 4 Dec 2009 21:52:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912042152.nB4LqVGp066484@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 4 Dec 2009 21:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200111 - head/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 21:52:31 -0000 Author: kib Date: Fri Dec 4 21:52:31 2009 New Revision: 200111 URL: http://svn.freebsd.org/changeset/base/200111 Log: Add several syscall compat32 entries for acl manipulation. They do not require translation of the arguments. Tested by: bsam MFC after: 1 week Modified: head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Fri Dec 4 21:06:54 2009 (r200110) +++ head/sys/compat/freebsd32/syscalls.master Fri Dec 4 21:52:31 2009 (r200111) @@ -740,10 +740,14 @@ struct freebsd32_ucontext *oucp, \ const struct freebsd32_ucontext *ucp); } 424 AUE_SWAPOFF UNIMPL swapoff -425 AUE_NULL UNIMPL __acl_get_link -426 AUE_NULL UNIMPL __acl_set_link -427 AUE_NULL UNIMPL __acl_delete_link -428 AUE_NULL UNIMPL __acl_aclcheck_link +425 AUE_NULL NOPROTO { int __acl_get_link(const char *path, \ + acl_type_t type, struct acl *aclp); } +426 AUE_NULL NOPROTO { int __acl_set_link(const char *path, \ + acl_type_t type, struct acl *aclp); } +427 AUE_NULL NOPROTO { int __acl_delete_link(const char *path, \ + acl_type_t type); } +428 AUE_NULL NOPROTO { int __acl_aclcheck_link(const char *path, \ + acl_type_t type, struct acl *aclp); } 429 AUE_SIGWAIT NOPROTO { int sigwait(const sigset_t *set, \ int *sig); } 430 AUE_NULL UNIMPL thr_create; From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 21:53:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20C151065694; Fri, 4 Dec 2009 21:53:21 +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 0F65A8FC1B; Fri, 4 Dec 2009 21:53:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB4LrKGr066542; Fri, 4 Dec 2009 21:53:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB4LrKPs066537; Fri, 4 Dec 2009 21:53:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912042153.nB4LrKPs066537@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 4 Dec 2009 21:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200112 - head/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 21:53:21 -0000 Author: kib Date: Fri Dec 4 21:53:20 2009 New Revision: 200112 URL: http://svn.freebsd.org/changeset/base/200112 Log: Regenerate. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Fri Dec 4 21:52:31 2009 (r200111) +++ head/sys/compat/freebsd32/freebsd32_proto.h Fri Dec 4 21:53:20 2009 (r200112) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 2009-12-04 21:52:31Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Fri Dec 4 21:52:31 2009 (r200111) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Fri Dec 4 21:53:20 2009 (r200112) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 2009-12-04 21:52:31Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -311,6 +311,10 @@ #define FREEBSD32_SYS_freebsd32_getcontext 421 #define FREEBSD32_SYS_freebsd32_setcontext 422 #define FREEBSD32_SYS_freebsd32_swapcontext 423 +#define FREEBSD32_SYS___acl_get_link 425 +#define FREEBSD32_SYS___acl_set_link 426 +#define FREEBSD32_SYS___acl_delete_link 427 +#define FREEBSD32_SYS___acl_aclcheck_link 428 #define FREEBSD32_SYS_sigwait 429 #define FREEBSD32_SYS_thr_exit 431 #define FREEBSD32_SYS_thr_self 432 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Fri Dec 4 21:52:31 2009 (r200111) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Fri Dec 4 21:53:20 2009 (r200112) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 2009-12-04 21:52:31Z kib */ const char *freebsd32_syscallnames[] = { @@ -432,10 +432,10 @@ const char *freebsd32_syscallnames[] = { "freebsd32_setcontext", /* 422 = freebsd32_setcontext */ "freebsd32_swapcontext", /* 423 = freebsd32_swapcontext */ "#424", /* 424 = swapoff */ - "#425", /* 425 = __acl_get_link */ - "#426", /* 426 = __acl_set_link */ - "#427", /* 427 = __acl_delete_link */ - "#428", /* 428 = __acl_aclcheck_link */ + "__acl_get_link", /* 425 = __acl_get_link */ + "__acl_set_link", /* 426 = __acl_set_link */ + "__acl_delete_link", /* 427 = __acl_delete_link */ + "__acl_aclcheck_link", /* 428 = __acl_aclcheck_link */ "sigwait", /* 429 = sigwait */ "#430", /* 430 = thr_create; */ "thr_exit", /* 431 = thr_exit */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Fri Dec 4 21:52:31 2009 (r200111) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Fri Dec 4 21:53:20 2009 (r200112) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 198508 2009-10-27 10:55:34Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 200111 2009-12-04 21:52:31Z kib */ #include "opt_compat.h" @@ -469,10 +469,10 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_setcontext_args), (sy_call_t *)freebsd32_setcontext, AUE_NULL, NULL, 0, 0, 0 }, /* 422 = freebsd32_setcontext */ { AS(freebsd32_swapcontext_args), (sy_call_t *)freebsd32_swapcontext, AUE_NULL, NULL, 0, 0, 0 }, /* 423 = freebsd32_swapcontext */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 424 = swapoff */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 425 = __acl_get_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 426 = __acl_set_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 427 = __acl_delete_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 428 = __acl_aclcheck_link */ + { AS(__acl_get_link_args), (sy_call_t *)__acl_get_link, AUE_NULL, NULL, 0, 0, 0 }, /* 425 = __acl_get_link */ + { AS(__acl_set_link_args), (sy_call_t *)__acl_set_link, AUE_NULL, NULL, 0, 0, 0 }, /* 426 = __acl_set_link */ + { AS(__acl_delete_link_args), (sy_call_t *)__acl_delete_link, AUE_NULL, NULL, 0, 0, 0 }, /* 427 = __acl_delete_link */ + { AS(__acl_aclcheck_link_args), (sy_call_t *)__acl_aclcheck_link, AUE_NULL, NULL, 0, 0, 0 }, /* 428 = __acl_aclcheck_link */ { AS(sigwait_args), (sy_call_t *)sigwait, AUE_SIGWAIT, NULL, 0, 0, 0 }, /* 429 = sigwait */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 430 = thr_create; */ { AS(thr_exit_args), (sy_call_t *)thr_exit, AUE_NULL, NULL, 0, 0, 0 }, /* 431 = thr_exit */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 4 23:11:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4445510656C6; Fri, 4 Dec 2009 23:11:16 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id DBE858FC17; Fri, 4 Dec 2009 23:11:15 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 8615A1CE67; Sat, 5 Dec 2009 00:11:14 +0100 (CET) Date: Sat, 5 Dec 2009 00:11:14 +0100 From: Ed Schouten To: Alexander Leidinger Message-ID: <20091204231114.GT64905@hoeg.nl> References: <200912042042.nB4Kg9N9064970@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jGG2NnQ5Ldsshs2a" Content-Disposition: inline In-Reply-To: <200912042042.nB4Kg9N9064970@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r200107 - in vendor/v4l: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2009 23:11:16 -0000 --jGG2NnQ5Ldsshs2a Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Alexander, Some time ago I visited a talk by hps@ at EuroBSDCon and I remember he has V4L working with USB webcams. How does this work relate to his work? Cheers, --=20 Ed Schouten WWW: http://80386.nl/ --jGG2NnQ5Ldsshs2a Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksZlxIACgkQ52SDGA2eCwUMmwCfTom+qbSaK+/6bdb9nYBAKe45 0CIAnA+A2PA3h8xYMXgkA410QpVALgoU =elWI -----END PGP SIGNATURE----- --jGG2NnQ5Ldsshs2a-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 08:32:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D8671065670; Sat, 5 Dec 2009 08:32:13 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CB2D8FC0C; Sat, 5 Dec 2009 08:32:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB58WCkS078842; Sat, 5 Dec 2009 08:32:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB58WCuI078841; Sat, 5 Dec 2009 08:32:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912050832.nB58WCuI078841@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 5 Dec 2009 08:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200113 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 08:32:13 -0000 Author: luigi Date: Sat Dec 5 08:32:12 2009 New Revision: 200113 URL: http://svn.freebsd.org/changeset/base/200113 Log: fix build with VNET enabled Reported by: David Wolfskill Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Fri Dec 4 21:53:20 2009 (r200112) +++ head/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 08:32:12 2009 (r200113) @@ -2597,7 +2597,7 @@ do { \ * XXX should not happen here, but optimized out in * the caller. */ - if (fw_one_pass) { + if (V_fw_one_pass) { IPFW_RUNLOCK(chain); return (IP_FW_PASS); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 08:44:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2117F1065679; Sat, 5 Dec 2009 08:44:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0D58FC17; Sat, 5 Dec 2009 08:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB58itJ3079308; Sat, 5 Dec 2009 08:44:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB58itIq079304; Sat, 5 Dec 2009 08:44:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912050844.nB58itIq079304@svn.freebsd.org> From: Alexander Motin Date: Sat, 5 Dec 2009 08:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200115 - in stable/8/sys: cam/ata sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 08:44:56 -0000 Author: mav Date: Sat Dec 5 08:44:55 2009 New Revision: 200115 URL: http://svn.freebsd.org/changeset/base/200115 Log: MFC r200008: Add CAM_ATAIO_DMA ATA command flag to mark DMA protocol commands. It is not needed for SATA controllers, but required for PATA. Modified: stable/8/sys/cam/ata/ata_all.c stable/8/sys/cam/ata/ata_all.h stable/8/sys/sys/ata.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Sat Dec 5 08:41:08 2009 (r200114) +++ stable/8/sys/cam/ata/ata_all.c Sat Dec 5 08:44:55 2009 (r200115) @@ -93,8 +93,8 @@ ata_op_string(struct ata_cmd *cmd) case 0x39: return ("WRITE_MUL48"); case 0x3a: return ("WRITE_STREAM_DMA48"); case 0x3b: return ("WRITE_STREAM48"); - case 0x3d: return ("WRITE_DMA_FUA"); - case 0x3e: return ("WRITE_DMA_FUA48"); + case 0x3d: return ("WRITE_DMA_FUA48"); + case 0x3e: return ("WRITE_DMA_QUEUED_FUA48"); case 0x3f: return ("WRITE_LOG_EXT"); case 0x40: return ("READ_VERIFY"); case 0x42: return ("READ_VERIFY48"); @@ -119,7 +119,7 @@ ata_op_string(struct ata_cmd *cmd) case 0xca: return ("WRITE_DMA"); case 0xcc: return ("WRITE_DMA_QUEUED"); case 0xcd: return ("CFA_WRITE_MULTIPLE_WITHOUT_ERASE"); - case 0xce: return ("WRITE_MULTIPLE_FUA48"); + case 0xce: return ("WRITE_MUL_FUA48"); case 0xd1: return ("CHECK_MEDIA_CARD_TYPE"); case 0xda: return ("GET_MEDIA_STATUS"); case 0xde: return ("MEDIA_LOCK"); @@ -309,6 +309,11 @@ ata_28bit_cmd(struct ccb_ataio *ataio, u { bzero(&ataio->cmd, sizeof(ataio->cmd)); ataio->cmd.flags = 0; + if (cmd == ATA_READ_DMA || + cmd == ATA_READ_DMA_QUEUED || + cmd == ATA_WRITE_DMA || + cmd == ATA_WRITE_DMA_QUEUED) + ataio->cmd.flags |= CAM_ATAIO_DMA; ataio->cmd.command = cmd; ataio->cmd.features = features; ataio->cmd.lba_low = lba; @@ -324,6 +329,15 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u { bzero(&ataio->cmd, sizeof(ataio->cmd)); ataio->cmd.flags = CAM_ATAIO_48BIT; + if (cmd == ATA_READ_DMA48 || + cmd == ATA_READ_DMA_QUEUED48 || + cmd == ATA_READ_STREAM_DMA48 || + cmd == ATA_WRITE_DMA48 || + cmd == ATA_WRITE_DMA_FUA48 || + cmd == ATA_WRITE_DMA_QUEUED48 || + cmd == ATA_WRITE_DMA_QUEUED_FUA48 || + cmd == ATA_WRITE_STREAM_DMA48) + ataio->cmd.flags |= CAM_ATAIO_DMA; ataio->cmd.command = cmd; ataio->cmd.features = features; ataio->cmd.lba_low = lba; Modified: stable/8/sys/cam/ata/ata_all.h ============================================================================== --- stable/8/sys/cam/ata/ata_all.h Sat Dec 5 08:41:08 2009 (r200114) +++ stable/8/sys/cam/ata/ata_all.h Sat Dec 5 08:44:55 2009 (r200115) @@ -41,6 +41,7 @@ struct ata_cmd { #define CAM_ATAIO_FPDMA 0x02 /* FPDMA command */ #define CAM_ATAIO_CONTROL 0x04 /* Control, not a command */ #define CAM_ATAIO_NEEDRESULT 0x08 /* Request requires result. */ +#define CAM_ATAIO_DMA 0x10 /* DMA command */ u_int8_t command; u_int8_t features; Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Sat Dec 5 08:41:08 2009 (r200114) +++ stable/8/sys/sys/ata.h Sat Dec 5 08:44:55 2009 (r200115) @@ -291,12 +291,21 @@ struct ata_params { #define ATA_READ_DMA_QUEUED48 0x26 /* read DMA QUEUED 48bit LBA */ #define ATA_READ_NATIVE_MAX_ADDRESS48 0x27 /* read native max addr 48bit */ #define ATA_READ_MUL48 0x29 /* read multi 48bit LBA */ +#define ATA_READ_STREAM_DMA48 0x2a /* read DMA stream 48bit LBA */ +#define ATA_READ_STREAM48 0x2b /* read stream 48bit LBA */ #define ATA_WRITE 0x30 /* write */ #define ATA_WRITE48 0x34 /* write 48bit LBA */ #define ATA_WRITE_DMA48 0x35 /* write DMA 48bit LBA */ #define ATA_WRITE_DMA_QUEUED48 0x36 /* write DMA QUEUED 48bit LBA*/ #define ATA_SET_MAX_ADDRESS48 0x37 /* set max address 48bit */ #define ATA_WRITE_MUL48 0x39 /* write multi 48bit LBA */ +#define ATA_WRITE_STREAM_DMA48 0x3a +#define ATA_WRITE_STREAM48 0x3b +#define ATA_WRITE_DMA_FUA48 0x3d +#define ATA_WRITE_DMA_QUEUED_FUA48 0x3e +#define ATA_WRITE_LOG_EXT 0x3f +#define ATA_READ_VERIFY 0x40 +#define ATA_READ_VERIFY48 0x42 #define ATA_READ_FPDMA_QUEUED 0x60 /* read DMA NCQ */ #define ATA_WRITE_FPDMA_QUEUED 0x61 /* write DMA NCQ */ #define ATA_SEEK 0x70 /* seek */ @@ -312,6 +321,7 @@ struct ata_params { #define ATA_READ_DMA 0xc8 /* read DMA */ #define ATA_WRITE_DMA 0xca /* write DMA */ #define ATA_WRITE_DMA_QUEUED 0xcc /* write DMA QUEUED */ +#define ATA_WRITE_MUL_FUA48 0xce #define ATA_STANDBY_IMMEDIATE 0xe0 /* standby immediate */ #define ATA_IDLE_IMMEDIATE 0xe1 /* idle immediate */ #define ATA_STANDBY_CMD 0xe2 /* standby */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 09:13:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 448E71065693; Sat, 5 Dec 2009 09:13:07 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3358C8FC20; Sat, 5 Dec 2009 09:13:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB59D6HE079883; Sat, 5 Dec 2009 09:13:06 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB59D6eH079881; Sat, 5 Dec 2009 09:13:06 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912050913.nB59D6eH079881@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 5 Dec 2009 09:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200116 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 09:13:07 -0000 Author: luigi Date: Sat Dec 5 09:13:06 2009 New Revision: 200116 URL: http://svn.freebsd.org/changeset/base/200116 Log: remove a dead block of code, document how the ipfw clients are hooked and the difference in handling the 'enable' variable for layer2 and layer3. The latter needs fixing once i figure out how it worked pre-vnet. MFC after: 7 days Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 08:44:55 2009 (r200115) +++ head/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 09:13:06 2009 (r200116) @@ -4915,43 +4915,38 @@ vnet_ipfw_init(const void *unused) ip_fw_default_rule = V_layer3_chain.rules; - if (error) { - IPFW_LOCK_DESTROY(&V_layer3_chain); - printf("leaving ipfw_iattach (2) with error %d\n", error); - return (error); - } -#ifdef VIMAGE /* want a better way to do this */ + /* curvnet is NULL in the !VIMAGE case */ callout_reset(&V_ipfw_timeout, hz, ipfw_tick, curvnet); -#else - callout_reset(&V_ipfw_timeout, hz, ipfw_tick, NULL); -#endif /* First set up some values that are compile time options */ V_ipfw_vnet_ready = 1; /* Open for business */ - /* Hook up the raw inputs */ - V_ip_fw_ctl_ptr = ipfw_ctl; - V_ip_fw_chk_ptr = ipfw_chk; - /* - * Hook us up to pfil. + * Hook the sockopt handler, and the layer2 (V_ip_fw_chk_ptr) + * and pfil hooks for ipv4 and ipv6. Even if the latter two fail + * we still keep the module alive. ipfw[6]_hook return + * either 0 or ENOENT in case of failure, so we can ignore the + * exact return value and just set a flag. + * + * XXX 20091204 note that V_ether_ipfw is checked on each packet, + * whereas V_fw_enable is only checked at vnet load time. + * This must be fixed so that they act in the same way + * (probably hooking the pfil unconditionally, and bypassing + * the processing if V_fw_enable=0). Same for V_fw6_enable */ - if (V_fw_enable) { - if ((error = ipfw_hook()) != 0) { - printf("ipfw_hook() error\n"); - return (error); - } + V_ip_fw_ctl_ptr = ipfw_ctl; + V_ip_fw_chk_ptr = ipfw_chk; + if (V_fw_enable && ipfw_hook() != 0) { + error = ENOENT; /* see ip_fw_pfil.c::ipfw_hook() */ + printf("ipfw_hook() error\n"); } #ifdef INET6 - if (V_fw6_enable) { - if ((error = ipfw6_hook()) != 0) { - printf("ipfw6_hook() error\n"); - /* XXX should we unhook everything else? */ - return (error); - } + if (V_fw6_enable && ipfw6_hook() != 0) { + error = ENOENT; + printf("ipfw6_hook() error\n"); } #endif - return (0); + return (error); } /*********************** @@ -4963,17 +4958,23 @@ vnet_ipfw_uninit(const void *unused) struct ip_fw *reap; V_ipfw_vnet_ready = 0; /* tell new callers to go away */ + /* + * disconnect from ipv4, ipv6, layer2 and sockopt. + * Then grab, release and grab again the WLOCK so we make + * sure the update is propagated and nobody will be in. + */ ipfw_unhook(); #ifdef INET6 ipfw6_unhook(); #endif - /* layer2 and other entrypoints still come in this way. */ V_ip_fw_chk_ptr = NULL; V_ip_fw_ctl_ptr = NULL; + IPFW_WLOCK(&V_layer3_chain); /* We wait on the wlock here until the last user leaves */ IPFW_WUNLOCK(&V_layer3_chain); IPFW_WLOCK(&V_layer3_chain); + callout_drain(&V_ipfw_timeout); flush_tables(&V_layer3_chain); V_layer3_chain.reap = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 09:35:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3365F1065670; Sat, 5 Dec 2009 09:35:49 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (unknown [77.75.165.90]) by mx1.freebsd.org (Postfix) with ESMTP id E971B8FC15; Sat, 5 Dec 2009 09:35:48 +0000 (UTC) Received: from frankie.nitro.dk (unknown [192.168.3.39]) by mx.nitro.dk (Postfix) with ESMTP id EA6622D4892; Sat, 5 Dec 2009 09:35:47 +0000 (UTC) Received: by frankie.nitro.dk (Postfix, from userid 2000) id E001EE0459; Sat, 5 Dec 2009 10:35:47 +0100 (CET) Date: Sat, 5 Dec 2009 10:35:47 +0100 From: "Simon L. Nielsen" To: Hajimu UMEMOTO Message-ID: <20091205093546.GA1311@frankie.nitro.dk> References: <200912021505.nB2F5RIt018936@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912021505.nB2F5RIt018936@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200028 - in head: . etc etc/defaults etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 09:35:49 -0000 On 2009.12.02 15:05:27 +0000, Hajimu UMEMOTO wrote: > Author: ume > Date: Wed Dec 2 15:05:26 2009 > New Revision: 200028 > URL: http://svn.freebsd.org/changeset/base/200028 > > Log: > Unify rc.firewall and rc.firewall6, and obsolete rc.firewall6 > and rc.d/ip6fw. Great, thanks! I recently set up IPv6 on a workstation and was bitten by rc.firewall and rc.firewall6 getting in each-others way. -- Simon L. Nielsen From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 10:07:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D2D2106566B; Sat, 5 Dec 2009 10:07:38 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 421DF8FC0C; Sat, 5 Dec 2009 10:07:38 +0000 (UTC) Received: from outgoing.leidinger.net (pD9E2DEB3.dip.t-dialin.net [217.226.222.179]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id D147384402B; Sat, 5 Dec 2009 11:07:31 +0100 (CET) Received: from unknown (unknown [192.168.2.110]) by outgoing.leidinger.net (Postfix) with ESMTP id B234A292E25; Sat, 5 Dec 2009 11:07:26 +0100 (CET) Date: Sat, 5 Dec 2009 11:07:25 +0100 From: Alexander Leidinger To: Ed Schouten Message-ID: <20091205110725.00002cb8@unknown> In-Reply-To: <20091204231114.GT64905@hoeg.nl> References: <200912042042.nB4Kg9N9064970@svn.freebsd.org> <20091204231114.GT64905@hoeg.nl> X-Mailer: Claws Mail 3.7.2cvs15 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: D147384402B.C1A25 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.363, required 6, autolearn=disabled, ALL_TRUSTED -1.44, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1260612452.73951@VxNytDKerBEGJQvdp6jQ/g X-EBL-Spam-Status: No Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, Alexander Leidinger , svn-src-vendor@freebsd.org Subject: Re: svn commit: r200107 - in vendor/v4l: . dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 10:07:38 -0000 On Sat, 5 Dec 2009 00:11:14 +0100 Ed Schouten wrote: > Hello Alexander, > > Some time ago I visited a talk by hps@ at EuroBSDCon and I remember he > has V4L working with USB webcams. How does this work relate to his > work? I assume he has it working in FreeBSD native. I do not know how he did it, but what the vendor branch provides is the header file directly from linux (no license problems, not GPLed, see the readme in the vendor branch for the full story). We can do the same for the v4l2 header, if there's interest. We already have the OK, but so far there's no code which would use it. If someone is interested to have it in the vendor branch too, just tell me and I import it (or you can do it yourself, the README in the v4l vendor branch covers already the OK for the v4l2 header). This allows us to just copy this file into head and use it. It is the interface description. Any driver which wants to provide this interface, can do it now (after importing it into head). We could for example modify the bt8xx driver to provide a v4l interface and every application which has support vor v4l could use it. This is not an area where I will work in. What my commit to the linuxulator did was to use a copy of the v4l header with modifications for the linuxulator. This allows to access any native FreeBSD device which provices the v4l interface from a linux application. It is "just" the glue code to translate from linux-space to the native device. Bye, Alexander. From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 10:30:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6538106566B; Sat, 5 Dec 2009 10:30:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9552F8FC15; Sat, 5 Dec 2009 10:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5AUs93082595; Sat, 5 Dec 2009 10:30:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5AUsfR082593; Sat, 5 Dec 2009 10:30:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912051030.nB5AUsfR082593@svn.freebsd.org> From: Alexander Motin Date: Sat, 5 Dec 2009 10:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200117 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 10:30:54 -0000 Author: mav Date: Sat Dec 5 10:30:54 2009 New Revision: 200117 URL: http://svn.freebsd.org/changeset/base/200117 Log: On Soft Reset, read device signature from FIS receive area, instead of PxSIG register. It works better for NVidia chipsets. ahci(4) does the same. PR: kern/140472, i386/138668 Modified: head/sys/dev/ata/chipsets/ata-ahci.c Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sat Dec 5 09:13:06 2009 (r200116) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sat Dec 5 10:30:54 2009 (r200117) @@ -824,11 +824,10 @@ ata_ahci_hardreset(device_t dev, int por static u_int32_t ata_ahci_softreset(device_t dev, int port) { - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - int offset = ch->unit << 7; struct ata_ahci_cmd_tab *ctp = (struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET); + u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; if (bootverbose) device_printf(dev, "software reset port %d...\n", port); @@ -865,7 +864,10 @@ ata_ahci_softreset(device_t dev, int por return (-1); } - return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); + return (((u_int32_t)fis[6] << 24) | + ((u_int32_t)fis[5] << 16) | + ((u_int32_t)fis[4] << 8) | + (u_int32_t)fis[12]); } static void From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 11:51:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE754106566C; Sat, 5 Dec 2009 11:51:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9038FC14; Sat, 5 Dec 2009 11:51:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5BpWXG086592; Sat, 5 Dec 2009 11:51:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5BpWvN086590; Sat, 5 Dec 2009 11:51:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912051151.nB5BpWvN086590@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 5 Dec 2009 11:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200118 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 11:51:33 -0000 Author: luigi Date: Sat Dec 5 11:51:32 2009 New Revision: 200118 URL: http://svn.freebsd.org/changeset/base/200118 Log: adjust comment in previous commit after Julian's explanation Modified: head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 10:30:54 2009 (r200117) +++ head/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 11:51:32 2009 (r200118) @@ -4924,15 +4924,16 @@ vnet_ipfw_init(const void *unused) /* * Hook the sockopt handler, and the layer2 (V_ip_fw_chk_ptr) * and pfil hooks for ipv4 and ipv6. Even if the latter two fail - * we still keep the module alive. ipfw[6]_hook return - * either 0 or ENOENT in case of failure, so we can ignore the - * exact return value and just set a flag. + * we still keep the module alive because the sockopt and + * layer2 paths are still useful. + * ipfw[6]_hook return 0 on success, ENOENT on failure, + * so we can ignore the exact return value and just set a flag. * - * XXX 20091204 note that V_ether_ipfw is checked on each packet, - * whereas V_fw_enable is only checked at vnet load time. - * This must be fixed so that they act in the same way - * (probably hooking the pfil unconditionally, and bypassing - * the processing if V_fw_enable=0). Same for V_fw6_enable + * Note that V_fw[6]_enable are manipulated by a SYSCTL_PROC so + * changes in the underlying (per-vnet) variables trigger + * immediate hook()/unhook() calls. + * In layer2 we have the same behaviour, except that V_ether_ipfw + * is checked on each packet because there are no pfil hooks. */ V_ip_fw_ctl_ptr = ipfw_ctl; V_ip_fw_chk_ptr = ipfw_chk; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 12:51:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98359106566C; Sat, 5 Dec 2009 12:51:51 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8632F8FC0C; Sat, 5 Dec 2009 12:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5CppFP088028; Sat, 5 Dec 2009 12:51:51 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5CppHl088023; Sat, 5 Dec 2009 12:51:51 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912051251.nB5CppHl088023@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 5 Dec 2009 12:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200119 - in stable/8/sys/netinet: . ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 12:51:51 -0000 Author: luigi Date: Sat Dec 5 12:51:51 2009 New Revision: 200119 URL: http://svn.freebsd.org/changeset/base/200119 Log: some simple MFC: r200020: change the type of the opcode from enum *:8 to u_int8_t so the size and alignment of the ipfw_insn is not compiler dependent. No changes in the code generated by gcc. r200023: Add new sockopt names for ipfw and dummynet. This commit is just grabbing entries for the new names that will be used in the future, so you don't need to rebuild anything now. r200034 Dispatch sockopt calls to ipfw and dummynet using the new option numbers, IP_FW3 and IP_DUMMYNET3. Right now the modules return an error if called with those arguments so there is no danger of unwanted behaviour. r200040 - initialize src_ip in the main loop to prevent a compiler warning (gcc 4.x under linux, not sure how real is the complaint). - rename a macro argument to prevent name clashes. - add the macro name on a couple of #endif - add a blank line for readability. Modified: stable/8/sys/netinet/in.h stable/8/sys/netinet/ip_fw.h stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/raw_ip.c Modified: stable/8/sys/netinet/in.h ============================================================================== --- stable/8/sys/netinet/in.h Sat Dec 5 11:51:32 2009 (r200118) +++ stable/8/sys/netinet/in.h Sat Dec 5 12:51:51 2009 (r200119) @@ -443,12 +443,20 @@ __END_DECLS #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ #define IP_BINDANY 24 /* bool: allow bind to any address */ +/* + * Options for controlling the firewall and dummynet. + * Historical options (from 40 to 64) will eventually be + * replaced by only two options, IP_FW3 and IP_DUMMYNET3. + */ #define IP_FW_TABLE_ADD 40 /* add entry */ #define IP_FW_TABLE_DEL 41 /* delete entry */ #define IP_FW_TABLE_FLUSH 42 /* flush table */ #define IP_FW_TABLE_GETSIZE 43 /* get table size */ #define IP_FW_TABLE_LIST 44 /* list table contents */ +#define IP_FW3 48 /* generic ipfw v.3 sockopts */ +#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */ + #define IP_FW_ADD 50 /* add a firewall rule to chain */ #define IP_FW_DEL 51 /* delete a firewall rule from chain */ #define IP_FW_FLUSH 52 /* flush firewall rule chain */ Modified: stable/8/sys/netinet/ip_fw.h ============================================================================== --- stable/8/sys/netinet/ip_fw.h Sat Dec 5 11:51:32 2009 (r200118) +++ stable/8/sys/netinet/ip_fw.h Sat Dec 5 12:51:51 2009 (r200119) @@ -237,7 +237,7 @@ enum ipfw_opcodes { /* arguments (4 byt * */ typedef struct _ipfw_insn { /* template for instructions */ - enum ipfw_opcodes opcode:8; + u_int8_t opcode; u_int8_t len; /* number of 32-bit words */ #define F_NOT 0x80 #define F_OR 0x40 Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 11:51:32 2009 (r200118) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Sat Dec 5 12:51:51 2009 (r200119) @@ -185,6 +185,7 @@ SYSCTL_INT(_net_inet_ip_fw, OID_AUTO, de &default_to_accept, 0, "Make the default rule accept all packets."); TUNABLE_INT("net.inet.ip.fw.default_to_accept", &default_to_accept); + #ifdef INET6 SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); @@ -194,8 +195,9 @@ SYSCTL_VNET_PROC(_net_inet6_ip6_fw, OID_ SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, "Deny packets with unknown IPv6 Extension Headers"); -#endif -#endif +#endif /* INET6 */ + +#endif /* SYSCTL_NODE */ /* * Description of dynamic rules. @@ -2243,6 +2245,7 @@ ipfw_chk(struct ip_fw_args *args) return (IP_FW_PASS); /* accept */ dst_ip.s_addr = 0; /* make sure it is initialized */ + src_ip.s_addr = 0; /* make sure it is initialized */ pktlen = m->m_pkthdr.len; args->f_id.fib = M_GETFIB(m); /* note mbuf not altered) */ proto = args->f_id.proto = 0; /* mark f_id invalid */ @@ -2254,15 +2257,15 @@ ipfw_chk(struct ip_fw_args *args) * pointer might become stale after other pullups (but we never use it * this way). */ -#define PULLUP_TO(len, p, T) \ +#define PULLUP_TO(_len, p, T) \ do { \ - int x = (len) + sizeof(T); \ + int x = (_len) + sizeof(T); \ if ((m)->m_len < x) { \ args->m = m = m_pullup(m, x); \ if (m == NULL) \ goto pullup_failed; \ } \ - p = (mtod(m, char *) + (len)); \ + p = (mtod(m, char *) + (_len)); \ } while (0) /* Modified: stable/8/sys/netinet/raw_ip.c ============================================================================== --- stable/8/sys/netinet/raw_ip.c Sat Dec 5 11:51:32 2009 (r200118) +++ stable/8/sys/netinet/raw_ip.c Sat Dec 5 12:51:51 2009 (r200119) @@ -535,6 +535,7 @@ rip_ctloutput(struct socket *so, struct error = sooptcopyout(sopt, &optval, sizeof optval); break; + case IP_FW3: /* generic ipfw v.3 functions */ case IP_FW_ADD: /* ADD actually returns the body... */ case IP_FW_GET: case IP_FW_TABLE_GETSIZE: @@ -547,6 +548,7 @@ rip_ctloutput(struct socket *so, struct error = ENOPROTOOPT; break; + case IP_DUMMYNET3: /* generic dummynet v.3 functions */ case IP_DUMMYNET_GET: if (ip_dn_ctl_ptr != NULL) error = ip_dn_ctl_ptr(sopt); @@ -592,6 +594,7 @@ rip_ctloutput(struct socket *so, struct inp->inp_flags &= ~INP_HDRINCL; break; + case IP_FW3: /* generic ipfw v.3 functions */ case IP_FW_ADD: case IP_FW_DEL: case IP_FW_FLUSH: @@ -608,6 +611,7 @@ rip_ctloutput(struct socket *so, struct error = ENOPROTOOPT; break; + case IP_DUMMYNET3: /* generic dummynet v.3 functions */ case IP_DUMMYNET_CONFIGURE: case IP_DUMMYNET_DEL: case IP_DUMMYNET_FLUSH: From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 13:12:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C37ED106566C; Sat, 5 Dec 2009 13:12:04 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2A1A8FC08; Sat, 5 Dec 2009 13:12:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5DC4KT088535; Sat, 5 Dec 2009 13:12:04 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5DC4kQ088533; Sat, 5 Dec 2009 13:12:04 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200912051312.nB5DC4kQ088533@svn.freebsd.org> From: Stefan Farfeleder Date: Sat, 5 Dec 2009 13:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200120 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 13:12:04 -0000 Author: stefanf Date: Sat Dec 5 13:12:04 2009 New Revision: 200120 URL: http://svn.freebsd.org/changeset/base/200120 Log: Add a missing space to the error message when execvp() failed. Modified: head/usr.bin/make/proc.c Modified: head/usr.bin/make/proc.c ============================================================================== --- head/usr.bin/make/proc.c Sat Dec 5 12:51:51 2009 (r200119) +++ head/usr.bin/make/proc.c Sat Dec 5 13:12:04 2009 (r200120) @@ -116,7 +116,7 @@ Proc_Exec(const ProcStuff *ps) execvp(ps->argv[0], ps->argv); write(STDERR_FILENO, ps->argv[0], strlen(ps->argv[0])); - write(STDERR_FILENO, ":", 1); + write(STDERR_FILENO, ": ", 2); write(STDERR_FILENO, strerror(errno), strlen(strerror(errno))); write(STDERR_FILENO, "\n", 1); } else { From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 13:40:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D81EA106566C; Sat, 5 Dec 2009 13:40:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C79B28FC08; Sat, 5 Dec 2009 13:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5DepNx089080; Sat, 5 Dec 2009 13:40:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5DepkE089078; Sat, 5 Dec 2009 13:40:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912051340.nB5DepkE089078@svn.freebsd.org> From: Alexander Motin Date: Sat, 5 Dec 2009 13:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200121 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 13:40:51 -0000 Author: mav Date: Sat Dec 5 13:40:51 2009 New Revision: 200121 URL: http://svn.freebsd.org/changeset/base/200121 Log: Do not ignore device interrupt if bus mastering is still active. It is normal in case of media read error and some ATAPI cases, when transfer size is unknown beforehand. PCI ATA BM specification tells that in case of such underrun driver should just manually stop DMA engine. DMA engine should same time guarantie that all bus mastering transfers completed at the moment of driver reads interrupt flag asserted. This change should fix interrupt storms and command timeouts in many cases. PR: kern/103602, sparc64/121539, kern/133122, kern/139654 Modified: head/sys/dev/ata/ata-pci.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Sat Dec 5 13:12:04 2009 (r200120) +++ head/sys/dev/ata/ata-pci.c Sat Dec 5 13:40:51 2009 (r200121) @@ -462,8 +462,7 @@ ata_pci_status(device_t dev) (ch->dma.flags & ATA_DMA_ACTIVE))) { int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; - if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) != - ATA_BMSTAT_INTERRUPT) + if ((bmstat & ATA_BMSTAT_INTERRUPT) == 0) return 0; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR); DELAY(1); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 13:45:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DA0F106568B; Sat, 5 Dec 2009 13:45:22 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CC5B8FC12; Sat, 5 Dec 2009 13:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5DjLWG089208; Sat, 5 Dec 2009 13:45:21 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5DjLVW089206; Sat, 5 Dec 2009 13:45:21 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912051345.nB5DjLVW089206@svn.freebsd.org> From: Shteryana Shopova Date: Sat, 5 Dec 2009 13:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200122 - head/usr.sbin/bsnmpd/modules/snmp_pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 13:45:22 -0000 Author: syrinx Date: Sat Dec 5 13:45:21 2009 New Revision: 200122 URL: http://svn.freebsd.org/changeset/base/200122 Log: Make sure enough memory is allocated for a struct pft_entry when refreshing the list of pf tables. OKed by: philip MFC after: 1 week Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Modified: head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 5 13:40:51 2009 (r200121) +++ head/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 5 13:45:21 2009 (r200122) @@ -1104,7 +1104,7 @@ pft_refresh(void) } for (i = 0; i < numtbls; i++) { - e = malloc(sizeof(struct pfr_tstats)); + e = malloc(sizeof(struct pft_entry)); if (e == NULL) goto err1; e->index = i + 1; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 13:53:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523DA106568B; Sat, 5 Dec 2009 13:53:42 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4073F8FC0A; Sat, 5 Dec 2009 13:53:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5DrgQD089420; Sat, 5 Dec 2009 13:53:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5Drg91089416; Sat, 5 Dec 2009 13:53:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912051353.nB5Drg91089416@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 5 Dec 2009 13:53:42 +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: r200123 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 13:53:42 -0000 Author: luigi Date: Sat Dec 5 13:53:41 2009 New Revision: 200123 URL: http://svn.freebsd.org/changeset/base/200123 Log: some MFC: r200020 change the type of the opcode from enum *:8 to u_int8_t so the size and alignment of the ipfw_insn is not compiler dependent. No changes in the code generated by gcc. r200023 Add new sockopt names for ipfw and dummynet. This commit is just grabbing entries for the new names that will be used in the future, so you don't need to rebuild anything now. r200034 Dispatch sockopt calls to ipfw and dummynet using the new option numbers, IP_FW3 and IP_DUMMYNET3. Right now the modules return an error if called with those arguments so there is no danger of unwanted behaviour. The code for r200040 was already in RELENG_7 before the 8.x freeze Modified: stable/7/sys/netinet/in.h stable/7/sys/netinet/ip_fw.h stable/7/sys/netinet/raw_ip.c Modified: stable/7/sys/netinet/in.h ============================================================================== --- stable/7/sys/netinet/in.h Sat Dec 5 13:45:21 2009 (r200122) +++ stable/7/sys/netinet/in.h Sat Dec 5 13:53:41 2009 (r200123) @@ -438,12 +438,20 @@ __END_DECLS #define IP_ONESBCAST 23 /* bool: send all-ones broadcast */ +/* + * Options for controlling the firewall and dummynet. + * Historical options (from 40 to 64) will eventually be + * replaced by only two options, IP_FW3 and IP_DUMMYNET3. + */ #define IP_FW_TABLE_ADD 40 /* add entry */ #define IP_FW_TABLE_DEL 41 /* delete entry */ #define IP_FW_TABLE_FLUSH 42 /* flush table */ #define IP_FW_TABLE_GETSIZE 43 /* get table size */ #define IP_FW_TABLE_LIST 44 /* list table contents */ +#define IP_FW3 48 /* generic ipfw v.3 sockopts */ +#define IP_DUMMYNET3 49 /* generic dummynet v.3 sockopts */ + #define IP_FW_ADD 50 /* add a firewall rule to chain */ #define IP_FW_DEL 51 /* delete a firewall rule from chain */ #define IP_FW_FLUSH 52 /* flush firewall rule chain */ Modified: stable/7/sys/netinet/ip_fw.h ============================================================================== --- stable/7/sys/netinet/ip_fw.h Sat Dec 5 13:45:21 2009 (r200122) +++ stable/7/sys/netinet/ip_fw.h Sat Dec 5 13:53:41 2009 (r200123) @@ -216,7 +216,7 @@ enum ipfw_opcodes { /* arguments (4 byt * */ typedef struct _ipfw_insn { /* template for instructions */ - enum ipfw_opcodes opcode:8; + u_int8_t opcode; u_int8_t len; /* number of 32-bit words */ #define F_NOT 0x80 #define F_OR 0x40 Modified: stable/7/sys/netinet/raw_ip.c ============================================================================== --- stable/7/sys/netinet/raw_ip.c Sat Dec 5 13:45:21 2009 (r200122) +++ stable/7/sys/netinet/raw_ip.c Sat Dec 5 13:53:41 2009 (r200123) @@ -453,6 +453,7 @@ rip_ctloutput(struct socket *so, struct error = sooptcopyout(sopt, &optval, sizeof optval); break; + case IP_FW3: /* generic ipfw v.3 functions */ case IP_FW_ADD: /* ADD actually returns the body... */ case IP_FW_GET: case IP_FW_TABLE_GETSIZE: @@ -465,6 +466,7 @@ rip_ctloutput(struct socket *so, struct error = ENOPROTOOPT; break; + case IP_DUMMYNET3: /* generic dummynet v.3 functions */ case IP_DUMMYNET_GET: if (ip_dn_ctl_ptr != NULL) error = ip_dn_ctl_ptr(sopt); @@ -510,6 +512,7 @@ rip_ctloutput(struct socket *so, struct inp->inp_flags &= ~INP_HDRINCL; break; + case IP_FW3: /* generic ipfw v.3 functions */ case IP_FW_ADD: case IP_FW_DEL: case IP_FW_FLUSH: @@ -526,6 +529,7 @@ rip_ctloutput(struct socket *so, struct error = ENOPROTOOPT; break; + case IP_DUMMYNET3: /* generic dummynet v.3 functions */ case IP_DUMMYNET_CONFIGURE: case IP_DUMMYNET_DEL: case IP_DUMMYNET_FLUSH: From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 14:21:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 747E71065672; Sat, 5 Dec 2009 14:21:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 635E58FC15; Sat, 5 Dec 2009 14:21:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5ELgJm090072; Sat, 5 Dec 2009 14:21:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5ELgQX090070; Sat, 5 Dec 2009 14:21:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200912051421.nB5ELgQX090070@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 5 Dec 2009 14:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200124 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 14:21:42 -0000 Author: pjd Date: Sat Dec 5 14:21:42 2009 New Revision: 200124 URL: http://svn.freebsd.org/changeset/base/200124 Log: Avoid using additional variable for storing an error if we are not going to do anything with it. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 13:53:41 2009 (r200123) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 14:21:42 2009 (r200124) @@ -293,7 +293,7 @@ vdev_geom_read_guid(struct g_consumer *c uint64_t psize; off_t offset, size; uint64_t guid; - int error, l, len; + int l, len; g_topology_assert_not(); @@ -316,8 +316,7 @@ vdev_geom_read_guid(struct g_consumer *c if ((offset % pp->sectorsize) != 0) continue; - error = vdev_geom_io(cp, BIO_READ, label, offset, size); - if (error != 0) + if (vdev_geom_io(cp, BIO_READ, label, offset, size) != 0) continue; buf = label->vl_vdev_phys.vp_nvlist; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 14:24:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D8DD1065676; Sat, 5 Dec 2009 14:24:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9988FC15; Sat, 5 Dec 2009 14:24:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5EOMA2090166; Sat, 5 Dec 2009 14:24:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5EOMj6090164; Sat, 5 Dec 2009 14:24:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200912051424.nB5EOMj6090164@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 5 Dec 2009 14:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200125 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 14:24:22 -0000 Author: pjd Date: Sat Dec 5 14:24:22 2009 New Revision: 200125 URL: http://svn.freebsd.org/changeset/base/200125 Log: Always check guid when opening by path, because we may end up with provider that does have the same name, but only by accident. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 14:21:42 2009 (r200124) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 14:24:22 2009 (r200125) @@ -448,7 +448,7 @@ vdev_geom_open_by_guid(vdev_t *vd) } static struct g_consumer * -vdev_geom_open_by_path(vdev_t *vd, int check_guid) +vdev_geom_open_by_path(vdev_t *vd) { struct g_provider *pp; struct g_consumer *cp; @@ -460,7 +460,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c if (pp != NULL) { ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path); cp = vdev_geom_attach(pp, !!(spa_mode & FWRITE)); - if (cp != NULL && check_guid) { + if (cp != NULL) { g_topology_unlock(); guid = vdev_geom_read_guid(cp); g_topology_lock(); @@ -501,7 +501,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi if ((owned = mtx_owned(&Giant))) mtx_unlock(&Giant); - cp = vdev_geom_open_by_path(vd, 0); + cp = vdev_geom_open_by_path(vd); if (cp == NULL) { /* * The device at vd->vdev_path doesn't have the expected guid. @@ -510,8 +510,6 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi */ cp = vdev_geom_open_by_guid(vd); } - if (cp == NULL) - cp = vdev_geom_open_by_path(vd, 1); if (cp == NULL) { ZFS_LOG(1, "Provider %s not found.", vd->vdev_path); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 14:33:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCF81065672; Sat, 5 Dec 2009 14:33:12 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41E798FC08; Sat, 5 Dec 2009 14:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5EXCYx090563; Sat, 5 Dec 2009 14:33:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5EXCkW090560; Sat, 5 Dec 2009 14:33:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200912051433.nB5EXCkW090560@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 5 Dec 2009 14:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200126 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 14:33:12 -0000 Author: pjd Date: Sat Dec 5 14:33:11 2009 New Revision: 200126 URL: http://svn.freebsd.org/changeset/base/200126 Log: Fix deadlock when ZVOLs are present and we are replacing dead component or calling scrub when pool is in a degraded state. It will try to taste ZVOLs, which will lead to deadlock, as ZVOL will try to acquire the same locks as replace/scrub is holding already. We can't simply skip provider based on their GEOM class, because ZVOL can have providers build on top of it and we need to skip those as well. We do it by asking for ZFS::iszvol attribute. Any ZVOL-based provider will give us positive answer and we have to skip those providers. This way we remove possibility to create ZFS pools on top of ZVOLs, but it is not very useful anyway. I believe deadlock is still possible in some very complex situations like when we have MD provider on top of UFS file on top of ZVOL. When we try to replace dead component in the pool mentioned ZVOL is based on, there might be a deadlock when ZFS will try to taste MD provider. There is no easy way to detect that, but it isn't very common. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 14:24:22 2009 (r200125) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 14:33:11 2009 (r200126) @@ -293,11 +293,16 @@ vdev_geom_read_guid(struct g_consumer *c uint64_t psize; off_t offset, size; uint64_t guid; - int l, len; + int error, l, len, iszvol; g_topology_assert_not(); pp = cp->provider; + ZFS_LOG(1, "Reading guid from %s...", pp->name); + if (g_getattr("ZFS::iszvol", cp, &iszvol) == 0 && iszvol) { + ZFS_LOG(1, "Skipping ZVOL-based provider %s.", pp->name); + return (0); + } psize = pp->mediasize; psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Dec 5 14:24:22 2009 (r200125) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sat Dec 5 14:33:11 2009 (r200126) @@ -335,8 +335,11 @@ zvol_start(struct bio *bp) wakeup_one(&zv->zv_queue); mtx_unlock(&zv->zv_queue_mtx); break; - case BIO_DELETE: case BIO_GETATTR: + if (g_handleattr_int(bp, "ZFS::iszvol", 1)) + break; + /* FALLTHROUGH */ + case BIO_DELETE: default: g_io_deliver(bp, EOPNOTSUPP); break; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 17:07:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7BFA106566C; Sat, 5 Dec 2009 17:07:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B629B8FC1B; Sat, 5 Dec 2009 17:07:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5H7hoB093506; Sat, 5 Dec 2009 17:07:43 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5H7hAq093504; Sat, 5 Dec 2009 17:07:43 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200912051707.nB5H7hAq093504@svn.freebsd.org> From: Ed Maste Date: Sat, 5 Dec 2009 17:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200127 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 17:07:43 -0000 Author: emaste Date: Sat Dec 5 17:07:43 2009 New Revision: 200127 URL: http://svn.freebsd.org/changeset/base/200127 Log: MFC r200001: Fix parenthesis typo -- copy full frame pointer for userland callchain, not just one byte. Submitted by: Ryan Stone rysto32 at gmail dot com Modified: stable/8/sys/dev/hwpmc/hwpmc_x86.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_x86.c Sat Dec 5 14:33:11 2009 (r200126) +++ stable/8/sys/dev/hwpmc/hwpmc_x86.c Sat Dec 5 17:07:43 2009 (r200127) @@ -101,7 +101,7 @@ pmc_save_user_callchain(uintptr_t *cc, i if (copyin((void *) sp, &pc, sizeof(pc)) != 0) return (n); } else if (copyin((void *) r, &pc, sizeof(pc)) != 0 || - copyin((void *) fp, &fp, sizeof(fp) != 0)) + copyin((void *) fp, &fp, sizeof(fp)) != 0) return (n); for (; n < nframes;) { From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 17:08:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 854B01065672; Sat, 5 Dec 2009 17:08:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73E218FC0C; Sat, 5 Dec 2009 17:08:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5H8jku093560; Sat, 5 Dec 2009 17:08:45 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5H8jdC093558; Sat, 5 Dec 2009 17:08:45 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <200912051708.nB5H8jdC093558@svn.freebsd.org> From: Ed Maste Date: Sat, 5 Dec 2009 17:08:45 +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: r200128 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 17:08:45 -0000 Author: emaste Date: Sat Dec 5 17:08:45 2009 New Revision: 200128 URL: http://svn.freebsd.org/changeset/base/200128 Log: MFC r200001: Fix parenthesis typo -- copy full frame pointer for userland callchain, not just one byte. Submitted by: Ryan Stone rysto32 at gmail dot com Modified: stable/7/sys/dev/hwpmc/hwpmc_x86.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_x86.c Sat Dec 5 17:07:43 2009 (r200127) +++ stable/7/sys/dev/hwpmc/hwpmc_x86.c Sat Dec 5 17:08:45 2009 (r200128) @@ -101,7 +101,7 @@ pmc_save_user_callchain(uintptr_t *cc, i if (copyin((void *) sp, &pc, sizeof(pc)) != 0) return (n); } else if (copyin((void *) r, &pc, sizeof(pc)) != 0 || - copyin((void *) fp, &fp, sizeof(fp) != 0)) + copyin((void *) fp, &fp, sizeof(fp)) != 0) return (n); for (; n < nframes;) { From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 17:45:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EA9106568B; Sat, 5 Dec 2009 17:45:57 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0136F8FC19; Sat, 5 Dec 2009 17:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5Hjuxu094290; Sat, 5 Dec 2009 17:45:56 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5HjuAB094288; Sat, 5 Dec 2009 17:45:56 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912051745.nB5HjuAB094288@svn.freebsd.org> From: Antoine Brodin Date: Sat, 5 Dec 2009 17:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200129 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 17:45:57 -0000 Author: antoine Date: Sat Dec 5 17:45:56 2009 New Revision: 200129 URL: http://svn.freebsd.org/changeset/base/200129 Log: Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros. MFC after: 1 month Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sat Dec 5 17:08:45 2009 (r200128) +++ head/sys/vm/uma_int.h Sat Dec 5 17:45:56 2009 (r200129) @@ -144,10 +144,10 @@ #define UMA_HASH_INSERT(h, s, mem) \ SLIST_INSERT_HEAD(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), us_hlink); + (mem))], (s), us_hlink) #define UMA_HASH_REMOVE(h, s, mem) \ SLIST_REMOVE(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), uma_slab, us_hlink); + (mem))], (s), uma_slab, us_hlink) /* Hash table for freed address -> slab translation */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 17:46:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF803106566C; Sat, 5 Dec 2009 17:46:51 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEFF78FC0C; Sat, 5 Dec 2009 17:46:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5HkpqH094342; Sat, 5 Dec 2009 17:46:51 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5HkpdX094340; Sat, 5 Dec 2009 17:46:51 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912051746.nB5HkpdX094340@svn.freebsd.org> From: Antoine Brodin Date: Sat, 5 Dec 2009 17:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200130 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 17:46:52 -0000 Author: antoine Date: Sat Dec 5 17:46:51 2009 New Revision: 200130 URL: http://svn.freebsd.org/changeset/base/200130 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Dec 5 17:45:56 2009 (r200129) +++ head/ObsoleteFiles.inc Sat Dec 5 17:46:51 2009 (r200130) @@ -17,8 +17,11 @@ # 20091202: unify rc.firewall and rc.firewall6. OLD_FILES+=etc/rc.d/ip6fw OLD_FILES+=etc/rc.firewall6 +OLD_FILES+=usr/share/examples/etc/rc.firewall6 # 20091117: removal of rc.early(8) link OLD_FILES+=usr/share/man/man8/rc.early.8.gz +# 20091117: usr/share/zoneinfo/GMT link removed +OLD_FILES+=usr/share/zoneinfo/GMT # 20091027: pselect.3 implemented as syscall OLD_FILES+=usr/share/man/man3/pselect.3.gz # 20091005: fusword.9 and susword.9 removed From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:02:49 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0718E106566B; Sat, 5 Dec 2009 18:02:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5818FC15; Sat, 5 Dec 2009 18:02:48 +0000 (UTC) Received: from c220-239-235-116.carlnfd3.nsw.optusnet.com.au (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nB5I2UrZ024261 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Dec 2009 05:02:45 +1100 Date: Sun, 6 Dec 2009 05:02:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Stefan Farfeleder In-Reply-To: <200912051312.nB5DC4kQ088533@svn.freebsd.org> Message-ID: <20091206034620.C26414@delplex.bde.org> References: <200912051312.nB5DC4kQ088533@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200120 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:02:49 -0000 On Sat, 5 Dec 2009, Stefan Farfeleder wrote: > Log: > Add a missing space to the error message when execvp() failed. > > Modified: > head/usr.bin/make/proc.c > > Modified: head/usr.bin/make/proc.c > ============================================================================== > --- head/usr.bin/make/proc.c Sat Dec 5 12:51:51 2009 (r200119) > +++ head/usr.bin/make/proc.c Sat Dec 5 13:12:04 2009 (r200120) > @@ -116,7 +116,7 @@ Proc_Exec(const ProcStuff *ps) > execvp(ps->argv[0], ps->argv); > Someone broke the formatting by adding this extra blank line. > write(STDERR_FILENO, ps->argv[0], strlen(ps->argv[0])); > - write(STDERR_FILENO, ":", 1); > + write(STDERR_FILENO, ": ", 2); > write(STDERR_FILENO, strerror(errno), strlen(strerror(errno))); > write(STDERR_FILENO, "\n", 1); > } else { > It would be nice if the err() family were not so broken in design and implementation so as to be unusable in signal handlers and other delicate contexts. Then it could just be used here (here we are in vfork context after a failed exec). The err() family uses stdio, so it might flush output stream(s), which would be bad as documented in vfork(2), and probably other things that might be done by stdio would be even worse in vfork() context. (The restructuring that added the above style bug also moved the execvp() far away from the vfork(), so it is unclear even that most things cannot be done in code near here.) Brokenness in the err() family includes not really documenting where the output goes. stdio is not mentioned. [stdio] streams are mentioned, but only in connection with the FreeBSD extension of err_set_file() (without this extension, the err() family could and should always write to the STDERR_FILENO non-stream using code like the above). Output is documented to go "on the standard error output", which should mean to STDERR_FILENO, but output actually goes to err_file (default stderr) using fprintf(). Corresponding brokenness in perror() is to be expected, since perror() is declared in , but perror() is documented to only write to "the standard output file descriptor", and it used to do this very carefully (using local variables), so it was usuable in signal handlers and other delicate contexts including vfork(). But it never documented this safeness, and FreeBSD turned its careful code into nonsense: % RCS file: /home/ncvs/src/lib/libc/stdio/perror.c,v % Working file: perror.c % head: 1.8 % ... % ---------------------------- % revision 1.8 % date: 2002/12/19 09:53:26; author: tjr; state: Exp; lines: +7 -1 % Write the message to stderr, not file descriptor 2, so that perror() % writes to the correct stream if stderr has been redirected with freopen(). The man page still documents writing to fd 2, and writing to stderr defeats not using stdio. The log message and man page are missing mention of the new flushing feature. % ============================================================================= % Index: perror.c % =================================================================== % RCS file: /home/ncvs/src/lib/libc/stdio/perror.c,v % retrieving revision 1.7 % retrieving revision 1.8 % diff -u -2 -r1.7 -r1.8 % --- perror.c 19 Dec 2002 09:50:10 -0000 1.7 % +++ perror.c 19 Dec 2002 09:53:26 -0000 1.8 % @@ -36,5 +36,5 @@ % #endif /* LIBC_SCCS and not lint */ % #include % -__FBSDID("$FreeBSD: src/lib/libc/stdio/perror.c,v 1.7 2002/12/19 09:50:10 tjr Exp $"); % +__FBSDID("$FreeBSD: src/lib/libc/stdio/perror.c,v 1.8 2002/12/19 09:53:26 tjr Exp $"); % % #include "namespace.h" % @@ -47,4 +47,6 @@ % #include % #include "un-namespace.h" % +#include "libc_private.h" % +#include "local.h" % % void % @@ -71,4 +73,8 @@ % v->iov_base = "\n"; % v->iov_len = 1; % - (void)_writev(STDERR_FILENO, iov, (v - iov) + 1); % + FLOCKFILE(stderr); Just locking stderr breaks signal-safeness. % + __sflush(stderr); Flushing also breaks use in [v]fork() after failed exec. Pre-flushing like this might be useful, but the err() family doesn't do any. Here the pre-flush is needed to synchronize with stderr, since the output here (now pointlessly) uses a direct writev. The err() family uses stderr, so it doesn't need to do anything to synchronize with stderr, but it could do more to sync with other streams and it should do more to ensure that its output actually goes out in case stderr is unbuffered (especially since its use of stdio is undocumented, its callers cannot know what synchronization is necessary or possible). % + (void)_writev(stderr->_file, iov, (v - iov) + 1); Maybe stderr->_file can be type-stable or something, so that it can be accessed not too unsafely without locking in signal handlers. The change should have been limited to something like that. % + stderr->_flags &= ~__SOFF; Another state change which must be avoided in delicate contexts. % + FUNLOCKFILE(stderr); The locking is hopefully idempotent, so it is safe in vfork context. % } Both Standard C and POSIX specify perror() to be perfectly broken. They specify it to write to the "standard error stream" (why not just stderr?). Standard C doesn't have STDERR_FILENO, so it cannot do the right thing here except by not really specifying where the output goes. Neither specifies any special synchronization. POSIX (and newer C99?) also specifies that perror() shall not change the orientation of the standard error stream. A non-broken err() would look like the non-broken perror(), except it would have to snprintf() to a local buffer before writev() and thus it could no longer support very long messages. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:17:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96D9E1065679; Sat, 5 Dec 2009 18:17:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856288FC17; Sat, 5 Dec 2009 18:17:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5IHFPr095005; Sat, 5 Dec 2009 18:17:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5IHFHI095003; Sat, 5 Dec 2009 18:17:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051817.nB5IHFHI095003@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 18:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200131 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:17:15 -0000 Author: bz Date: Sat Dec 5 18:17:15 2009 New Revision: 200131 URL: http://svn.freebsd.org/changeset/base/200131 Log: MFC r199894: Correct a typo. Modified: stable/8/sys/netipsec/ipsec_mbuf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/ipsec_mbuf.c ============================================================================== --- stable/8/sys/netipsec/ipsec_mbuf.c Sat Dec 5 17:46:51 2009 (r200130) +++ stable/8/sys/netipsec/ipsec_mbuf.c Sat Dec 5 18:17:15 2009 (r200131) @@ -69,7 +69,7 @@ m_makespace(struct mbuf *m0, int skip, i * At this point skip is the offset into the mbuf m * where the new header should be placed. Figure out * if there's space to insert the new header. If so, - * and copying the remainder makese sense then do so. + * and copying the remainder makes sense then do so. * Otherwise insert a new mbuf in the chain, splitting * the contents of m as needed. */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:51:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AD421065692; Sat, 5 Dec 2009 18:51:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 510418FC0A; Sat, 5 Dec 2009 18:51:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5Ipiam095740; Sat, 5 Dec 2009 18:51:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5IpiFJ095738; Sat, 5 Dec 2009 18:51:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051851.nB5IpiFJ095738@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 18:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200133 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:51:44 -0000 Author: ed Date: Sat Dec 5 18:51:44 2009 New Revision: 200133 URL: http://svn.freebsd.org/changeset/base/200133 Log: Remove (hidden) warning about missing prototypes for fdevname(3). Modified: head/lib/libc/gen/fdevname.c Modified: head/lib/libc/gen/fdevname.c ============================================================================== --- head/lib/libc/gen/fdevname.c Sat Dec 5 18:40:26 2009 (r200132) +++ head/lib/libc/gen/fdevname.c Sat Dec 5 18:51:44 2009 (r200133) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include "un-namespace.h" char * From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:53:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 147A81065672; Sat, 5 Dec 2009 18:53:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE7AA8FC0A; Sat, 5 Dec 2009 18:53:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5Ir4pE095803; Sat, 5 Dec 2009 18:53:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5Ir4eO095801; Sat, 5 Dec 2009 18:53:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051853.nB5Ir4eO095801@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 18:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200134 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:53:05 -0000 Author: ed Date: Sat Dec 5 18:53:04 2009 New Revision: 200134 URL: http://svn.freebsd.org/changeset/base/200134 Log: Use ANSI C prototypes inside termios. While there, add a missing __unused to hide a warning in tcsetbreak(). Modified: head/lib/libc/gen/termios.c Modified: head/lib/libc/gen/termios.c ============================================================================== --- head/lib/libc/gen/termios.c Sat Dec 5 18:51:44 2009 (r200133) +++ head/lib/libc/gen/termios.c Sat Dec 5 18:53:04 2009 (r200134) @@ -45,18 +45,14 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" int -tcgetattr(fd, t) - int fd; - struct termios *t; +tcgetattr(int fd, struct termios *t) { return (_ioctl(fd, TIOCGETA, t)); } int -tcsetattr(fd, opt, t) - int fd, opt; - const struct termios *t; +tcsetattr(int fd, int opt, const struct termios *t) { struct termios localterm; @@ -88,8 +84,7 @@ tcsetpgrp(int fd, pid_t pgrp) } pid_t -tcgetpgrp(fd) - int fd; +tcgetpgrp(int fd) { int s; @@ -123,25 +118,21 @@ tcsetsid(int fd, pid_t pid) } speed_t -cfgetospeed(t) - const struct termios *t; +cfgetospeed(const struct termios *t) { return (t->c_ospeed); } speed_t -cfgetispeed(t) - const struct termios *t; +cfgetispeed(const struct termios *t) { return (t->c_ispeed); } int -cfsetospeed(t, speed) - struct termios *t; - speed_t speed; +cfsetospeed(struct termios *t, speed_t speed) { t->c_ospeed = speed; @@ -149,9 +140,7 @@ cfsetospeed(t, speed) } int -cfsetispeed(t, speed) - struct termios *t; - speed_t speed; +cfsetispeed(struct termios *t, speed_t speed) { t->c_ispeed = speed; @@ -159,9 +148,7 @@ cfsetispeed(t, speed) } int -cfsetspeed(t, speed) - struct termios *t; - speed_t speed; +cfsetspeed(struct termios *t, speed_t speed) { t->c_ispeed = t->c_ospeed = speed; @@ -173,8 +160,7 @@ cfsetspeed(t, speed) * mode with no characters interpreted, 8-bit data path. */ void -cfmakeraw(t) - struct termios *t; +cfmakeraw(struct termios *t) { t->c_iflag &= ~(IMAXBEL|IXOFF|INPCK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON|IGNPAR); @@ -188,8 +174,7 @@ cfmakeraw(t) } int -tcsendbreak(fd, len) - int fd, len; +tcsendbreak(int fd, int len __unused) { struct timeval sleepytime; @@ -204,8 +189,7 @@ tcsendbreak(fd, len) } int -__tcdrain(fd) - int fd; +__tcdrain(int fd) { return (_ioctl(fd, TIOCDRAIN, 0)); } @@ -214,8 +198,7 @@ __weak_reference(__tcdrain, tcdrain); __weak_reference(__tcdrain, _tcdrain); int -tcflush(fd, which) - int fd, which; +tcflush(int fd, int which) { int com; @@ -237,8 +220,7 @@ tcflush(fd, which) } int -tcflow(fd, action) - int fd, action; +tcflow(int fd, int action) { struct termios term; u_char c; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:54:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0FAB1065670; Sat, 5 Dec 2009 18:54:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C61C08FC12; Sat, 5 Dec 2009 18:54:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5IsLaO095859; Sat, 5 Dec 2009 18:54:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5IsLqO095857; Sat, 5 Dec 2009 18:54:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051854.nB5IsLqO095857@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 18:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200135 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:54:22 -0000 Author: bz Date: Sat Dec 5 18:54:21 2009 New Revision: 200135 URL: http://svn.freebsd.org/changeset/base/200135 Log: MFC r199883: Add SDT_PROBE[1-5] in the same way we have SDT_PROBE_DEFINE[1-5] to avoid having to add all the unused trailing arguments as zeros. Modified: stable/8/sys/sys/sdt.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/sdt.h ============================================================================== --- stable/8/sys/sys/sdt.h Sat Dec 5 18:53:04 2009 (r200134) +++ stable/8/sys/sys/sdt.h Sat Dec 5 18:54:21 2009 (r200135) @@ -59,6 +59,12 @@ #define SDT_PROBE_DEFINE4(prov, mod, func, name, arg0, arg1, arg2, arg3) #define SDT_PROBE_DEFINE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) +#define SDT_PROBE1(prov, mod, func, name, arg0) +#define SDT_PROBE2(prov, mod, func, name, arg0, arg1) +#define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) +#define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) +#define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) + #else /* @@ -192,6 +198,17 @@ struct sdt_provider { SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) +#define SDT_PROBE1(prov, mod, func, name, arg0) \ + SDT_PROBE(prov, mod, func, name, arg0, 0, 0, 0, 0) +#define SDT_PROBE2(prov, mod, func, name, arg0, arg1) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, 0, 0, 0) +#define SDT_PROBE3(prov, mod, func, name, arg0, arg1, arg2) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, 0, 0) +#define SDT_PROBE4(prov, mod, func, name, arg0, arg1, arg2, arg3) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, 0) +#define SDT_PROBE5(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) + typedef int (*sdt_argtype_listall_func_t)(struct sdt_argtype *, void *); typedef int (*sdt_probe_listall_func_t)(struct sdt_probe *, void *); typedef int (*sdt_provider_listall_func_t)(struct sdt_provider *, void *); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:55:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03585106568D; Sat, 5 Dec 2009 18:55:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E682A8FC12; Sat, 5 Dec 2009 18:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5ItGUM096006; Sat, 5 Dec 2009 18:55:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5ItGQa096004; Sat, 5 Dec 2009 18:55:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051855.nB5ItGQa096004@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 18:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200136 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:55:17 -0000 Author: ed Date: Sat Dec 5 18:55:16 2009 New Revision: 200136 URL: http://svn.freebsd.org/changeset/base/200136 Log: Remove warnings from exec.c. The entries in the argv array are not const themselves, but sometimes we want to fill in const values. Just make the array const and use __DECONST() to make it const for the execve()-call itself. Also convert the only K&R prototype to ANSI. Modified: head/lib/libc/gen/exec.c Modified: head/lib/libc/gen/exec.c ============================================================================== --- head/lib/libc/gen/exec.c Sat Dec 5 18:54:21 2009 (r200135) +++ head/lib/libc/gen/exec.c Sat Dec 5 18:55:16 2009 (r200136) @@ -54,7 +54,7 @@ int execl(const char *name, const char *arg, ...) { va_list ap; - char **argv; + const char **argv; int n; va_start(ap, arg); @@ -69,18 +69,19 @@ execl(const char *name, const char *arg, } va_start(ap, arg); n = 1; - argv[0] = (char *)arg; + argv[0] = arg; while ((argv[n] = va_arg(ap, char *)) != NULL) n++; va_end(ap); - return (_execve(name, argv, environ)); + return (_execve(name, __DECONST(char **, argv), environ)); } int execle(const char *name, const char *arg, ...) { va_list ap; - char **argv, **envp; + const char **argv; + char **envp; int n; va_start(ap, arg); @@ -95,19 +96,19 @@ execle(const char *name, const char *arg } va_start(ap, arg); n = 1; - argv[0] = (char *)arg; + argv[0] = arg; while ((argv[n] = va_arg(ap, char *)) != NULL) n++; envp = va_arg(ap, char **); va_end(ap); - return (_execve(name, argv, envp)); + return (_execve(name, __DECONST(char **, argv), envp)); } int execlp(const char *name, const char *arg, ...) { va_list ap; - char **argv; + const char **argv; int n; va_start(ap, arg); @@ -122,11 +123,11 @@ execlp(const char *name, const char *arg } va_start(ap, arg); n = 1; - argv[0] = (char *)arg; + argv[0] = arg; while ((argv[n] = va_arg(ap, char *)) != NULL) n++; va_end(ap); - return (execvp(name, argv)); + return (execvp(name, __DECONST(char **, argv))); } int @@ -145,24 +146,21 @@ execvp(const char *name, char * const *a } static int -execvPe(name, path, argv, envp) - const char *name; - const char *path; - char * const *argv; - char * const *envp; +execvPe(const char *name, const char *path, char * const *argv, + char * const *envp) { - char **memp; - int cnt, lp, ln; - char *p; + const char **memp; + size_t cnt, lp, ln; int eacces, save_errno; - char *bp, *cur, buf[MAXPATHLEN]; + char *cur, buf[MAXPATHLEN]; + const char *p, *bp; struct stat sb; eacces = 0; /* If it's an absolute or relative path name, it's easy. */ if (index(name, '/')) { - bp = (char *)name; + bp = name; cur = NULL; goto retry; } @@ -228,7 +226,8 @@ retry: (void)_execve(bp, argv, envp); memp[0] = "sh"; memp[1] = bp; bcopy(argv + 1, memp + 2, cnt * sizeof(char *)); - (void)_execve(_PATH_BSHELL, memp, envp); + (void)_execve(_PATH_BSHELL, + __DECONST(char **, memp), envp); goto done; case ENOMEM: goto done; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:55:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B82CE106568B; Sat, 5 Dec 2009 18:55:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6C738FC14; Sat, 5 Dec 2009 18:55:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5Its9V096051; Sat, 5 Dec 2009 18:55:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5Its3C096049; Sat, 5 Dec 2009 18:55:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051855.nB5Its3C096049@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 18:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200137 - stable/8/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:55:54 -0000 Author: bz Date: Sat Dec 5 18:55:54 2009 New Revision: 200137 URL: http://svn.freebsd.org/changeset/base/200137 Log: MFC r199884: Define an SDT provider for "opencrypto". Modified: stable/8/sys/opencrypto/crypto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/crypto.c ============================================================================== --- stable/8/sys/opencrypto/crypto.c Sat Dec 5 18:55:16 2009 (r200136) +++ stable/8/sys/opencrypto/crypto.c Sat Dec 5 18:55:54 2009 (r200137) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #define CRYPTO_TIMING /* enable timing support */ #include "opt_ddb.h" +#include "opt_kdtrace.h" #include #include @@ -68,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -80,6 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include "cryptodev_if.h" +SDT_PROVIDER_DEFINE(opencrypto); + /* * Crypto drivers register themselves by allocating a slot in the * crypto_drivers table with crypto_get_driverid() and then registering From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:57:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2496F1065670; Sat, 5 Dec 2009 18:57:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 124EA8FC0A; Sat, 5 Dec 2009 18:57:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5IvW8m096139; Sat, 5 Dec 2009 18:57:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5IvW5q096137; Sat, 5 Dec 2009 18:57:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051857.nB5IvW5q096137@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 18:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200138 - stable/8/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:57:33 -0000 Author: bz Date: Sat Dec 5 18:57:32 2009 New Revision: 200138 URL: http://svn.freebsd.org/changeset/base/200138 Log: MFC r199885: Add SDT probes for opencrypto:deflate:deflate_gobal:*. They are not nice but they were helpful. Modified: stable/8/sys/opencrypto/deflate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/deflate.c ============================================================================== --- stable/8/sys/opencrypto/deflate.c Sat Dec 5 18:55:54 2009 (r200137) +++ stable/8/sys/opencrypto/deflate.c Sat Dec 5 18:57:32 2009 (r200138) @@ -35,16 +35,30 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_kdtrace.h" + #include #include #include #include +#include +#include #include #include #include #include +SDT_PROVIDER_DECLARE(opencrypto); +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, + "int", "u_int32_t"); +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, + "int", "u_int32_t"); + int window_inflate = -1 * MAX_WBITS; int window_deflate = -12; @@ -68,6 +82,8 @@ deflate_global(data, size, decomp, out) int error, i = 0, j; struct deflate_buf buf[ZBUF]; + SDT_PROBE2(opencrypto, deflate, deflate_global, entry, decomp, size); + bzero(&zbuf, sizeof(z_stream)); for (j = 0; j < ZBUF; j++) buf[j].flag = 0; @@ -81,8 +97,11 @@ deflate_global(data, size, decomp, out) if (!decomp) { buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (buf[i].out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); goto bad; + } buf[i].size = size; buf[i].flag = 1; i++; @@ -96,8 +115,11 @@ deflate_global(data, size, decomp, out) buf[i].out = malloc((u_long) (size * 4), M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (buf[i].out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); goto bad; + } buf[i].size = size * 4; buf[i].flag = 1; i++; @@ -110,36 +132,67 @@ deflate_global(data, size, decomp, out) deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD, window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY); - if (error != Z_OK) + if (error != Z_OK) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__); goto bad; + } for (;;) { error = decomp ? inflate(&zbuf, Z_PARTIAL_FLUSH) : deflate(&zbuf, Z_PARTIAL_FLUSH); - if (error != Z_OK && error != Z_STREAM_END) + if (error != Z_OK && error != Z_STREAM_END) { + /* + * Unfortunately we are limited to 5 arguments, + * thus use two probes. + */ + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); goto bad; + } else if (zbuf.avail_in == 0 && zbuf.avail_out != 0) goto end; else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { /* we need more output space, allocate size */ buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (buf[i].out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, + bad, decomp, 0, __LINE__); goto bad; + } zbuf.next_out = buf[i].out; buf[i].size = size; buf[i].flag = 1; zbuf.avail_out = buf[i].size; i++; - } else + } else { + /* + * Unfortunately we are limited to 5 arguments, + * thus, again, use two probes. + */ + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); goto bad; + } } end: result = count = zbuf.total_out; *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); - if (*out == NULL) + if (*out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); goto bad; + } if (decomp) inflateEnd(&zbuf); else @@ -160,6 +213,7 @@ end: } } *out = output; + SDT_PROBE2(opencrypto, deflate, deflate_global, return, decomp, result); return result; bad: From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 18:59:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13ABD1065672; Sat, 5 Dec 2009 18:59:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCD268FC13; Sat, 5 Dec 2009 18:59:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5IxwX7096240; Sat, 5 Dec 2009 18:59:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5IxwRD096238; Sat, 5 Dec 2009 18:59:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051859.nB5IxwRD096238@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 18:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200139 - stable/8/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 18:59:59 -0000 Author: bz Date: Sat Dec 5 18:59:58 2009 New Revision: 200139 URL: http://svn.freebsd.org/changeset/base/200139 Log: MFC r199887: Z_PARTIAL_FLUSH is marked deprecated. Z_SYNC_FLUSH is the suggested replacement but only use it for inflate. For deflate use Z_FINISH as Z_SYNC_FLUSH adds a trailing marker in some cases that inflate(), despite the comment in zlib, does npt seem to cope well with, resulting in errors when uncompressing exactly fills the outbut buffer without a Z_STREAM_END and a successive call returns an error. Modified: stable/8/sys/opencrypto/deflate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/deflate.c ============================================================================== --- stable/8/sys/opencrypto/deflate.c Sat Dec 5 18:57:32 2009 (r200138) +++ stable/8/sys/opencrypto/deflate.c Sat Dec 5 18:59:58 2009 (r200139) @@ -138,8 +138,8 @@ deflate_global(data, size, decomp, out) goto bad; } for (;;) { - error = decomp ? inflate(&zbuf, Z_PARTIAL_FLUSH) : - deflate(&zbuf, Z_PARTIAL_FLUSH); + error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) : + deflate(&zbuf, Z_FINISH); if (error != Z_OK && error != Z_STREAM_END) { /* * Unfortunately we are limited to 5 arguments, @@ -153,9 +153,13 @@ deflate_global(data, size, decomp, out) zbuf.state->dummy, zbuf.total_out); goto bad; } - else if (zbuf.avail_in == 0 && zbuf.avail_out != 0) - goto end; - else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { + if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) { + /* Done. */ + break; + } else if (!decomp && error == Z_STREAM_END) { + /* Done. */ + break; + } else if (zbuf.avail_out == 0) { /* we need more output space, allocate size */ buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); @@ -170,6 +174,7 @@ deflate_global(data, size, decomp, out) zbuf.avail_out = buf[i].size; i++; } else { + /* Unexpect result. */ /* * Unfortunately we are limited to 5 arguments, * thus, again, use two probes. @@ -184,7 +189,6 @@ deflate_global(data, size, decomp, out) } } -end: result = count = zbuf.total_out; *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:01:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40FC21065670; Sat, 5 Dec 2009 19:01:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E9F48FC0C; Sat, 5 Dec 2009 19:01:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J1pNp096352; Sat, 5 Dec 2009 19:01:51 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J1p87096349; Sat, 5 Dec 2009 19:01:51 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051901.nB5J1p87096349@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200140 - stable/8/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:01:51 -0000 Author: bz Date: Sat Dec 5 19:01:50 2009 New Revision: 200140 URL: http://svn.freebsd.org/changeset/base/200140 Log: MFC r199895: Change memory managment from a fixed size array to a list. This is needed to avoid running into out of buffer situations where we cannot alloc a new buffer because we hit the array size limit (ZBUF). Use a combined allocation for the struct and the actual data buffer to not increase the number of malloc calls. [1] Defer initialization of zbuf until we actually need it. Make sure the output buffer will be large enough in all cases. Details discussed with: kib [1] Reviewed by: kib [1] Modified: stable/8/sys/opencrypto/deflate.c stable/8/sys/opencrypto/deflate.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/deflate.c ============================================================================== --- stable/8/sys/opencrypto/deflate.c Sat Dec 5 18:59:58 2009 (r200139) +++ stable/8/sys/opencrypto/deflate.c Sat Dec 5 19:01:50 2009 (r200140) @@ -79,64 +79,59 @@ deflate_global(data, size, decomp, out) z_stream zbuf; u_int8_t *output; u_int32_t count, result; - int error, i = 0, j; - struct deflate_buf buf[ZBUF]; + int error, i; + struct deflate_buf *bufh, *bufp; SDT_PROBE2(opencrypto, deflate, deflate_global, entry, decomp, size); - bzero(&zbuf, sizeof(z_stream)); - for (j = 0; j < ZBUF; j++) - buf[j].flag = 0; - - zbuf.next_in = data; /* data that is going to be processed */ - zbuf.zalloc = z_alloc; - zbuf.zfree = z_free; - zbuf.opaque = Z_NULL; - zbuf.avail_in = size; /* Total length of data to be processed */ - + bufh = bufp = NULL; if (!decomp) { - buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, - M_NOWAIT); - if (buf[i].out == NULL) { - SDT_PROBE3(opencrypto, deflate, deflate_global, bad, - decomp, 0, __LINE__); - goto bad; - } - buf[i].size = size; - buf[i].flag = 1; - i++; + i = 1; } else { /* * Choose a buffer with 4x the size of the input buffer * for the size of the output buffer in the case of * decompression. If it's not sufficient, it will need to be - * updated while the decompression is going on + * updated while the decompression is going on. */ - - buf[i].out = malloc((u_long) (size * 4), - M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) { - SDT_PROBE3(opencrypto, deflate, deflate_global, bad, - decomp, 0, __LINE__); - goto bad; - } - buf[i].size = size * 4; - buf[i].flag = 1; + i = 4; + } + /* + * Make sure we do have enough output space. Repeated calls to + * deflate need at least 6 bytes of output buffer space to avoid + * repeated markers. We will always provide at least 16 bytes. + */ + while ((size * i) < 16) i++; + + bufh = bufp = malloc(sizeof(*bufp) + (size_t)(size * i), + M_CRYPTO_DATA, M_NOWAIT); + if (bufp == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); + goto bad2; } + bufp->next = NULL; + bufp->size = size * i; - zbuf.next_out = buf[0].out; - zbuf.avail_out = buf[0].size; + bzero(&zbuf, sizeof(z_stream)); + zbuf.zalloc = z_alloc; + zbuf.zfree = z_free; + zbuf.opaque = Z_NULL; + zbuf.next_in = data; /* Data that is going to be processed. */ + zbuf.avail_in = size; /* Total length of data to be processed. */ + zbuf.next_out = bufp->data; + zbuf.avail_out = bufp->size; error = decomp ? inflateInit2(&zbuf, window_inflate) : deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD, window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY); - if (error != Z_OK) { SDT_PROBE3(opencrypto, deflate, deflate_global, bad, decomp, error, __LINE__); goto bad; } + for (;;) { error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) : deflate(&zbuf, Z_FINISH); @@ -160,19 +155,22 @@ deflate_global(data, size, decomp, out) /* Done. */ break; } else if (zbuf.avail_out == 0) { - /* we need more output space, allocate size */ - buf[i].out = malloc((u_long) size, + struct deflate_buf *p; + + /* We need more output space for another iteration. */ + p = malloc(sizeof(*p) + (size_t)(size * i), M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) { + if (p == NULL) { SDT_PROBE3(opencrypto, deflate, deflate_global, bad, decomp, 0, __LINE__); goto bad; } - zbuf.next_out = buf[i].out; - buf[i].size = size; - buf[i].flag = 1; - zbuf.avail_out = buf[i].size; - i++; + p->next = NULL; + p->size = size * i; + bufp->next = p; + bufp = p; + zbuf.next_out = bufp->data; + zbuf.avail_out = bufp->size; } else { /* Unexpect result. */ /* @@ -191,7 +189,7 @@ deflate_global(data, size, decomp, out) result = count = zbuf.total_out; - *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); + *out = malloc(result, M_CRYPTO_DATA, M_NOWAIT); if (*out == NULL) { SDT_PROBE3(opencrypto, deflate, deflate_global, bad, decomp, 0, __LINE__); @@ -202,17 +200,22 @@ deflate_global(data, size, decomp, out) else deflateEnd(&zbuf); output = *out; - for (j = 0; buf[j].flag != 0; j++) { - if (count > buf[j].size) { - bcopy(buf[j].out, *out, buf[j].size); - *out += buf[j].size; - free(buf[j].out, M_CRYPTO_DATA); - count -= buf[j].size; + for (bufp = bufh; bufp != NULL; ) { + if (count > bufp->size) { + struct deflate_buf *p; + + bcopy(bufp->data, *out, bufp->size); + *out += bufp->size; + count -= bufp->size; + p = bufp; + bufp = bufp->next; + free(p, M_CRYPTO_DATA); } else { - /* it should be the last buffer */ - bcopy(buf[j].out, *out, count); + /* It should be the last buffer. */ + bcopy(bufp->data, *out, count); *out += count; - free(buf[j].out, M_CRYPTO_DATA); + free(bufp, M_CRYPTO_DATA); + bufp = NULL; count = 0; } } @@ -221,13 +224,19 @@ deflate_global(data, size, decomp, out) return result; bad: - *out = NULL; - for (j = 0; buf[j].flag != 0; j++) - free(buf[j].out, M_CRYPTO_DATA); if (decomp) inflateEnd(&zbuf); else deflateEnd(&zbuf); + for (bufp = bufh; bufp != NULL; ) { + struct deflate_buf *p; + + p = bufp; + bufp = bufp->next; + free(p, M_CRYPTO_DATA); + } +bad2: + *out = NULL; return 0; } Modified: stable/8/sys/opencrypto/deflate.h ============================================================================== --- stable/8/sys/opencrypto/deflate.h Sat Dec 5 18:59:58 2009 (r200139) +++ stable/8/sys/opencrypto/deflate.h Sat Dec 5 19:01:50 2009 (r200140) @@ -47,10 +47,14 @@ u_int32_t deflate_global(u_int8_t *, u_i void *z_alloc(void *, u_int, u_int); void z_free(void *, void *); +/* + * We are going to use a combined allocation to hold the metadata + * from the struct immediately followed by the real application data. + */ struct deflate_buf { - u_int8_t *out; - u_int32_t size; - int flag; + struct deflate_buf *next; + uint32_t size; + uint8_t data[]; }; #endif /* _CRYPTO_DEFLATE_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:03:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73E36106566B; Sat, 5 Dec 2009 19:03:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 629258FC17; Sat, 5 Dec 2009 19:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J3KBK096428; Sat, 5 Dec 2009 19:03:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J3KtJ096426; Sat, 5 Dec 2009 19:03:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051903.nB5J3KtJ096426@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200141 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:03:20 -0000 Author: bz Date: Sat Dec 5 19:03:20 2009 New Revision: 200141 URL: http://svn.freebsd.org/changeset/base/200141 Log: MFC r199896: Directly send data uncompressed if the packet payload size is lower than the compression algorithm threshold. Modified: stable/8/sys/netipsec/xform_ipcomp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:01:50 2009 (r200140) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:03:20 2009 (r200141) @@ -343,6 +343,17 @@ ipcomp_output( ipcompx = sav->tdb_compalgxform; IPSEC_ASSERT(ipcompx != NULL, ("null compression xform")); + /* + * Do not touch the packet in case our payload to compress + * is lower than the minimal threshold of the compression + * alogrithm. We will just send out the data uncompressed. + * See RFC 3173, 2.2. Non-Expansion Policy. + */ + if (m->m_pkthdr.len <= ipcompx->minlen) { + /* XXX-BZ V_ipcompstat.threshold++; */ + return ipsec_process_done(m, isr); + } + ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */ hlen = IPCOMP_HLENGTH; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:04:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1641065670; Sat, 5 Dec 2009 19:04:21 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B1B78FC1D; Sat, 5 Dec 2009 19:04:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J4L5F096489; Sat, 5 Dec 2009 19:04:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J4LTp096485; Sat, 5 Dec 2009 19:04:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051904.nB5J4LTp096485@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 19:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200142 - in head/lib/libc: gen posix1e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:04:21 -0000 Author: ed Date: Sat Dec 5 19:04:21 2009 New Revision: 200142 URL: http://svn.freebsd.org/changeset/base/200142 Log: Don't let the C library depend on . The maximum length of a username has nothing to do with the size of the username in the utmp files. Use MAXLOGNAME, which is defined as 17 (UT_USERSIZE + 1). Modified: head/lib/libc/gen/getlogin.c head/lib/libc/gen/pwcache.c head/lib/libc/posix1e/acl_to_text.c Modified: head/lib/libc/gen/getlogin.c ============================================================================== --- head/lib/libc/gen/getlogin.c Sat Dec 5 19:03:20 2009 (r200141) +++ head/lib/libc/gen/getlogin.c Sat Dec 5 19:04:21 2009 (r200142) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/lib/libc/gen/pwcache.c ============================================================================== --- head/lib/libc/gen/pwcache.c Sat Dec 5 19:03:20 2009 (r200141) +++ head/lib/libc/gen/pwcache.c Sat Dec 5 19:04:21 2009 (r200142) @@ -33,13 +33,13 @@ static char sccsid[] = "@(#)pwcache.c 8. #include __FBSDID("$FreeBSD$"); +#include #include #include #include #include #include -#include #define NCACHE 64 /* power of 2 */ #define MASK (NCACHE - 1) /* bits to store with */ @@ -50,7 +50,7 @@ user_from_uid(uid_t uid, int nouser) static struct ncache { uid_t uid; int found; - char name[UT_NAMESIZE + 1]; + char name[MAXLOGNAME]; } c_uid[NCACHE]; static int pwopen; struct passwd *pw; @@ -66,11 +66,11 @@ user_from_uid(uid_t uid, int nouser) cp->uid = uid; if (pw != NULL) { cp->found = 1; - (void)strncpy(cp->name, pw->pw_name, UT_NAMESIZE); - cp->name[UT_NAMESIZE] = '\0'; + (void)strncpy(cp->name, pw->pw_name, MAXLOGNAME - 1); + cp->name[MAXLOGNAME - 1] = '\0'; } else { cp->found = 0; - (void)snprintf(cp->name, UT_NAMESIZE, "%u", uid); + (void)snprintf(cp->name, MAXLOGNAME - 1, "%u", uid); if (nouser) return (NULL); } @@ -84,7 +84,7 @@ group_from_gid(gid_t gid, int nogroup) static struct ncache { gid_t gid; int found; - char name[UT_NAMESIZE + 1]; + char name[MAXLOGNAME]; } c_gid[NCACHE]; static int gropen; struct group *gr; @@ -100,11 +100,11 @@ group_from_gid(gid_t gid, int nogroup) cp->gid = gid; if (gr != NULL) { cp->found = 1; - (void)strncpy(cp->name, gr->gr_name, UT_NAMESIZE); - cp->name[UT_NAMESIZE] = '\0'; + (void)strncpy(cp->name, gr->gr_name, MAXLOGNAME - 1); + cp->name[MAXLOGNAME - 1] = '\0'; } else { cp->found = 0; - (void)snprintf(cp->name, UT_NAMESIZE, "%u", gid); + (void)snprintf(cp->name, MAXLOGNAME - 1, "%u", gid); if (nogroup) return (NULL); } Modified: head/lib/libc/posix1e/acl_to_text.c ============================================================================== --- head/lib/libc/posix1e/acl_to_text.c Sat Dec 5 19:03:20 2009 (r200141) +++ head/lib/libc/posix1e/acl_to_text.c Sat Dec 5 19:04:21 2009 (r200142) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "acl_support.h" @@ -58,7 +57,7 @@ _posix1e_acl_to_text(acl_t acl, ssize_t { struct acl *acl_int; char *buf, *tmpbuf; - char name_buf[UT_NAMESIZE+1]; + char name_buf[MAXLOGNAME]; char perm_buf[_POSIX1E_ACL_STRING_PERM_MAXSIZE+1], effective_perm_buf[_POSIX1E_ACL_STRING_PERM_MAXSIZE+1]; int i, error, len; @@ -103,7 +102,7 @@ _posix1e_acl_to_text(acl_t acl, ssize_t goto error_label; error = _posix1e_acl_id_to_name(ae_tag, ae_id, - UT_NAMESIZE+1, name_buf, flags); + MAXLOGNAME, name_buf, flags); if (error) goto error_label; @@ -163,7 +162,7 @@ _posix1e_acl_to_text(acl_t acl, ssize_t goto error_label; error = _posix1e_acl_id_to_name(ae_tag, ae_id, - UT_NAMESIZE+1, name_buf, flags); + MAXLOGNAME, name_buf, flags); if (error) goto error_label; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:06:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CC21106566C; Sat, 5 Dec 2009 19:06:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B83E8FC13; Sat, 5 Dec 2009 19:06:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J64uB096574; Sat, 5 Dec 2009 19:06:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J63cw096572; Sat, 5 Dec 2009 19:06:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051906.nB5J63cw096572@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200143 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:06:04 -0000 Author: bz Date: Sat Dec 5 19:06:03 2009 New Revision: 200143 URL: http://svn.freebsd.org/changeset/base/200143 Log: MFC r199897: Remove whitespace. Modified: stable/8/sys/netipsec/xform_ipcomp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:04:21 2009 (r200142) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:06:03 2009 (r200143) @@ -363,12 +363,12 @@ ipcomp_output( switch (sav->sah->saidx.dst.sa.sa_family) { #ifdef INET case AF_INET: - maxpacketsize = IP_MAXPACKET; + maxpacketsize = IP_MAXPACKET; break; #endif /* INET */ #ifdef INET6 case AF_INET6: - maxpacketsize = IPV6_MAXPACKET; + maxpacketsize = IPV6_MAXPACKET; break; #endif /* INET6 */ default: @@ -565,7 +565,7 @@ ipcomp_output_cb(struct cryptop *crp) DPRINTF(("%s: unknown/unsupported protocol " "family %d, IPCA %s/%08lx\n", __func__, sav->sah->saidx.dst.sa.sa_family, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); error = EPFNOSUPPORT; goto bad; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:07:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D52591065692; Sat, 5 Dec 2009 19:07:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C360C8FC17; Sat, 5 Dec 2009 19:07:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J7ST5096655; Sat, 5 Dec 2009 19:07:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J7S4j096653; Sat, 5 Dec 2009 19:07:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051907.nB5J7S4j096653@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200144 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:07:29 -0000 Author: bz Date: Sat Dec 5 19:07:28 2009 New Revision: 200144 URL: http://svn.freebsd.org/changeset/base/200144 Log: MFC r199899: Only add the IPcomp header if crypto reported success and we have a lower payload size. Before we had always added the header, no matter if we actually send out compressed data or not. With this, after the opencrypto/deflate changes, IPcomp starts to work apart from edge cases. Leave it disabled by default until those are fixed as well. PR: kern/123587 Modified: stable/8/sys/netipsec/xform_ipcomp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:06:03 2009 (r200143) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:07:28 2009 (r200144) @@ -330,13 +330,10 @@ ipcomp_output( { struct secasvar *sav; struct comp_algo *ipcompx; - int error, ralen, hlen, maxpacketsize, roff; - u_int8_t prot; + int error, ralen, maxpacketsize; struct cryptodesc *crdc; struct cryptop *crp; struct tdb_crypto *tc; - struct mbuf *mo; - struct ipcomp *ipcomp; sav = isr->sav; IPSEC_ASSERT(sav != NULL, ("null SA")); @@ -355,8 +352,6 @@ ipcomp_output( } ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */ - hlen = IPCOMP_HLENGTH; - V_ipcompstat.ipcomps_output++; /* Check for maximum packet size violations. */ @@ -381,13 +376,13 @@ ipcomp_output( error = EPFNOSUPPORT; goto bad; } - if (skip + hlen + ralen > maxpacketsize) { + if (ralen + skip + IPCOMP_HLENGTH > maxpacketsize) { V_ipcompstat.ipcomps_toobig++; DPRINTF(("%s: packet in IPCA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi), - skip + hlen + ralen, maxpacketsize)); + ralen + skip + IPCOMP_HLENGTH, maxpacketsize)); error = EMSGSIZE; goto bad; } @@ -405,40 +400,7 @@ ipcomp_output( goto bad; } - /* Inject IPCOMP header */ - mo = m_makespace(m, skip, hlen, &roff); - if (mo == NULL) { - V_ipcompstat.ipcomps_wrap++; - DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); - error = ENOBUFS; - goto bad; - } - ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff); - - /* Initialize the IPCOMP header */ - /* XXX alignment always correct? */ - switch (sav->sah->saidx.dst.sa.sa_family) { -#ifdef INET - case AF_INET: - ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt; - break; -#endif - } - ipcomp->comp_flags = 0; - ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi)); - - /* Fix Next Protocol in IPv4/IPv6 header */ - prot = IPPROTO_IPCOMP; - m_copyback(m, protoff, sizeof(u_int8_t), (u_char *) &prot); - - /* Ok now, we can pass to the crypto processing */ + /* Ok now, we can pass to the crypto processing. */ /* Get crypto descriptors */ crp = crypto_getreq(1); @@ -451,10 +413,10 @@ ipcomp_output( crdc = crp->crp_desc; /* Compression descriptor */ - crdc->crd_skip = skip + hlen; - crdc->crd_len = m->m_pkthdr.len - (skip + hlen); + crdc->crd_skip = skip; + crdc->crd_len = ralen; crdc->crd_flags = CRD_F_COMP; - crdc->crd_inject = skip + hlen; + crdc->crd_inject = skip; /* Compression operation */ crdc->crd_alg = ipcompx->type; @@ -474,7 +436,8 @@ ipcomp_output( tc->tc_spi = sav->spi; tc->tc_dst = sav->sah->saidx.dst; tc->tc_proto = sav->sah->saidx.proto; - tc->tc_skip = skip + hlen; + tc->tc_protoff = protoff; + tc->tc_skip = skip; /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ @@ -501,13 +464,12 @@ ipcomp_output_cb(struct cryptop *crp) struct ipsecrequest *isr; struct secasvar *sav; struct mbuf *m; - int error, skip, rlen; + int error, skip; tc = (struct tdb_crypto *) crp->crp_opaque; IPSEC_ASSERT(tc != NULL, ("null opaque data area!")); m = (struct mbuf *) crp->crp_buf; skip = tc->tc_skip; - rlen = crp->crp_ilen - skip; isr = tc->tc_isr; IPSECREQUEST_LOCK(isr); @@ -529,8 +491,7 @@ ipcomp_output_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { KEY_FREESAV(&sav); IPSECREQUEST_UNLOCK(isr); - error = crypto_dispatch(crp); - return error; + return crypto_dispatch(crp); } V_ipcompstat.ipcomps_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); @@ -546,7 +507,46 @@ ipcomp_output_cb(struct cryptop *crp) } V_ipcompstat.ipcomps_hist[sav->alg_comp]++; - if (rlen > crp->crp_olen) { + if (crp->crp_ilen - skip > crp->crp_olen) { + struct mbuf *mo; + struct ipcomp *ipcomp; + int roff; + uint8_t prot; + + /* Compression helped, inject IPCOMP header. */ + mo = m_makespace(m, skip, IPCOMP_HLENGTH, &roff); + if (mo == NULL) { + V_ipcompstat.ipcomps_wrap++; + DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", + __func__, ipsec_address(&sav->sah->saidx.dst), + (u_long) ntohl(sav->spi))); + error = ENOBUFS; + goto bad; + } + ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff); + + /* Initialize the IPCOMP header */ + /* XXX alignment always correct? */ + switch (sav->sah->saidx.dst.sa.sa_family) { +#ifdef INET + case AF_INET: + ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt; + break; +#endif + } + ipcomp->comp_flags = 0; + ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi)); + + /* Fix Next Protocol in IPv4/IPv6 header */ + prot = IPPROTO_IPCOMP; + m_copyback(m, tc->tc_protoff, sizeof(u_int8_t), + (u_char *)&prot); + /* Adjust the length in the IP header */ switch (sav->sah->saidx.dst.sa.sa_family) { #ifdef INET @@ -573,6 +573,8 @@ ipcomp_output_cb(struct cryptop *crp) } else { /* compression was useless, we have lost time */ /* XXX add statistic */ + /* XXX remember state to not compress the next couple + * of packets, RFC 3173, 2.2. Non-Expansion Policy */ } /* Release the crypto descriptor */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:09:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38B6A106566C; Sat, 5 Dec 2009 19:09:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2745E8FC12; Sat, 5 Dec 2009 19:09:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5J9RAA096746; Sat, 5 Dec 2009 19:09:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5J9RB3096744; Sat, 5 Dec 2009 19:09:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051909.nB5J9RB3096744@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200145 - stable/8/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:09:27 -0000 Author: bz Date: Sat Dec 5 19:09:26 2009 New Revision: 200145 URL: http://svn.freebsd.org/changeset/base/200145 Log: MFC r199904: Add SDT iter probes forgotten in r199885 (r200138 for stable/8). Modified: stable/8/sys/opencrypto/deflate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/deflate.c ============================================================================== --- stable/8/sys/opencrypto/deflate.c Sat Dec 5 19:07:28 2009 (r200144) +++ stable/8/sys/opencrypto/deflate.c Sat Dec 5 19:09:26 2009 (r200145) @@ -148,6 +148,12 @@ deflate_global(data, size, decomp, out) zbuf.state->dummy, zbuf.total_out); goto bad; } + SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) { /* Done. */ break; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:11:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84CD6106566C; Sat, 5 Dec 2009 19:11:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7365D8FC0A; Sat, 5 Dec 2009 19:11:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JB2DP096851; Sat, 5 Dec 2009 19:11:02 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JB2So096849; Sat, 5 Dec 2009 19:11:02 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051911.nB5JB2So096849@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200146 - stable/8/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:11:02 -0000 Author: bz Date: Sat Dec 5 19:11:02 2009 New Revision: 200146 URL: http://svn.freebsd.org/changeset/base/200146 Log: MFC r199905: Assimilate very similar input and output code paths (no real functional change). Modified: stable/8/sys/netipsec/xform_ipcomp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:09:26 2009 (r200145) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:11:02 2009 (r200146) @@ -249,10 +249,8 @@ ipcomp_input_cb(struct cryptop *crp) if (crp->crp_etype == EAGAIN) { KEY_FREESAV(&sav); - error = crypto_dispatch(crp); - return error; + return crypto_dispatch(crp); } - V_ipcompstat.ipcomps_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; @@ -484,7 +482,7 @@ ipcomp_output_cb(struct cryptop *crp) /* Check for crypto errors */ if (crp->crp_etype) { - /* Reset session ID */ + /* Reset the session ID */ if (sav->tdb_cryptoid != 0) sav->tdb_cryptoid = crp->crp_sid; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:12:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2E31065679; Sat, 5 Dec 2009 19:12:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1CB8FC14; Sat, 5 Dec 2009 19:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JCZcc096931; Sat, 5 Dec 2009 19:12:35 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JCZnn096929; Sat, 5 Dec 2009 19:12:35 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051912.nB5JCZnn096929@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200147 - stable/8/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:12:36 -0000 Author: bz Date: Sat Dec 5 19:12:35 2009 New Revision: 200147 URL: http://svn.freebsd.org/changeset/base/200147 Log: MFC r199906: In case the compression result is the same size as the orignal version, the compression was useless as well. Make sure to not update the data and return, else we would waste resources when decompressing. This also avoids the copyback() changing data other consumers like xform_ipcomp.c would have ignored because of no win and sent out without noting that compression was used, resulting in invalid packets at the receiver. Modified: stable/8/sys/opencrypto/cryptosoft.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/8/sys/opencrypto/cryptosoft.c Sat Dec 5 19:11:02 2009 (r200146) +++ stable/8/sys/opencrypto/cryptosoft.c Sat Dec 5 19:12:35 2009 (r200147) @@ -552,7 +552,7 @@ swcr_compdec(struct cryptodesc *crd, str sw->sw_size = result; /* Check the compressed size when doing compression */ if (crd->crd_flags & CRD_F_COMP) { - if (result > crd->crd_len) { + if (result >= crd->crd_len) { /* Compression was useless, we lost time */ free(out, M_CRYPTO_DATA); return 0; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:21:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22651065670; Sat, 5 Dec 2009 19:21:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F8948FC1A; Sat, 5 Dec 2009 19:21:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JLwJD097160; Sat, 5 Dec 2009 19:21:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JLwbx097156; Sat, 5 Dec 2009 19:21:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051921.nB5JLwbx097156@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200148 - in stable/8: sys/netipsec usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:21:58 -0000 Author: bz Date: Sat Dec 5 19:21:58 2009 New Revision: 200148 URL: http://svn.freebsd.org/changeset/base/200148 Log: MFC r199946: Add more statistics variables for IPcomp. Try to version the struct in a backward compatible way. People asked for the versioning of the stats structs in general before. Note: old netstat binaries, as only consumer, continue to work as they are still using kvm but will not display the new stats. [1] Discussed with: rwatson [1] Modified: stable/8/sys/netipsec/ipcomp_var.h stable/8/sys/netipsec/xform_ipcomp.c stable/8/usr.bin/netstat/ipsec.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/usr.bin/netstat/ (props changed) Modified: stable/8/sys/netipsec/ipcomp_var.h ============================================================================== --- stable/8/sys/netipsec/ipcomp_var.h Sat Dec 5 19:12:35 2009 (r200147) +++ stable/8/sys/netipsec/ipcomp_var.h Sat Dec 5 19:21:58 2009 (r200148) @@ -41,6 +41,7 @@ */ #define IPCOMP_ALG_MAX 8 +#define IPCOMPSTAT_VERSION 1 struct ipcompstat { u_int32_t ipcomps_hdrops; /* Packet shorter than header shows */ u_int32_t ipcomps_nopf; /* Protocol family not supported */ @@ -58,6 +59,9 @@ struct ipcompstat { u_int32_t ipcomps_pdrops; /* Packet blocked due to policy */ u_int32_t ipcomps_crypto; /* "Crypto" processing failure */ u_int32_t ipcomps_hist[IPCOMP_ALG_MAX];/* Per-algorithm op count */ + u_int32_t version; /* Version of this structure. */ + u_int32_t ipcomps_threshold; /* Packet < comp. algo. threshold. */ + u_int32_t ipcomps_uncompr; /* Compression was useles. */ }; #ifdef _KERNEL Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:12:35 2009 (r200147) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:21:58 2009 (r200148) @@ -345,7 +345,7 @@ ipcomp_output( * See RFC 3173, 2.2. Non-Expansion Policy. */ if (m->m_pkthdr.len <= ipcompx->minlen) { - /* XXX-BZ V_ipcompstat.threshold++; */ + V_ipcompstat.ipcomps_threshold++; return ipsec_process_done(m, isr); } @@ -569,8 +569,10 @@ ipcomp_output_cb(struct cryptop *crp) goto bad; } } else { - /* compression was useless, we have lost time */ - /* XXX add statistic */ + /* Compression was useless, we have lost time. */ + V_ipcompstat.ipcomps_uncompr++; + DPRINTF(("%s: compressions was useless %d - %d <= %d\n", + __func__, crp->crp_ilen, skip, crp->crp_olen)); /* XXX remember state to not compress the next couple * of packets, RFC 3173, 2.2. Non-Expansion Policy */ } @@ -609,3 +611,13 @@ ipcomp_attach(void) } SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL); + +static void +vnet_ipcomp_attach(const void *unused __unused) +{ + + V_ipcompstat.version = IPCOMPSTAT_VERSION; +} + +VNET_SYSINIT(vnet_ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, + vnet_ipcomp_attach, NULL); Modified: stable/8/usr.bin/netstat/ipsec.c ============================================================================== --- stable/8/usr.bin/netstat/ipsec.c Sat Dec 5 19:12:35 2009 (r200147) +++ stable/8/usr.bin/netstat/ipsec.c Sat Dec 5 19:21:58 2009 (r200148) @@ -418,6 +418,7 @@ esp_stats(u_long off, const char *name, static void print_ipcompstats(const struct ipcompstat *ipcompstat) { + uint32_t version; #define p32(f, m) if (ipcompstat->f || sflag <= 1) \ printf("\t%u" m, (unsigned int)ipcompstat->f, plural(ipcompstat->f)) #define p64(f, m) if (ipcompstat->f || sflag <= 1) \ @@ -425,6 +426,11 @@ print_ipcompstats(const struct ipcompsta #define hist(f, n, t) \ ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t)); +#ifndef IPCOMPSTAT_VERSION + version = 0; +#else + version = ipcompstat->version; +#endif p32(ipcomps_hdrops, " packet%s shorter than header shows\n"); p32(ipcomps_nopf, " packet%s dropped; protocol family not supported\n"); p32(ipcomps_notdb, " packet%s dropped; no TDB\n"); @@ -441,6 +447,10 @@ print_ipcompstats(const struct ipcompsta p32(ipcomps_pdrops, " packet%s blocked due to policy\n"); p32(ipcomps_crypto, " crypto processing failure%s\n"); hist(ipcompstat->ipcomps_hist, ipsec_compnames, "COMP output"); + if (version >= 1) { + p32(ipcomps_threshold, " packet%s sent uncompressed; size < compr. algo. threshold\n"); + p32(ipcomps_uncompr, " packet%s sent uncompressed; compression was useless\n"); + } #undef p32 #undef p64 From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:25:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F681065676; Sat, 5 Dec 2009 19:25:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D43698FC1D; Sat, 5 Dec 2009 19:25:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JPTWY097311; Sat, 5 Dec 2009 19:25:29 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JPTaS097308; Sat, 5 Dec 2009 19:25:29 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051925.nB5JPTaS097308@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200149 - in stable/8: share/man/man4 sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:25:30 -0000 Author: bz Date: Sat Dec 5 19:25:29 2009 New Revision: 200149 URL: http://svn.freebsd.org/changeset/base/200149 Log: MFC r199947, 199950: Enable IPcomp by default. PR: kern/123587 Modified: stable/8/share/man/man4/ipsec.4 stable/8/sys/netipsec/xform_ipcomp.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/ipsec.4 ============================================================================== --- stable/8/share/man/man4/ipsec.4 Sat Dec 5 19:21:58 2009 (r200148) +++ stable/8/share/man/man4/ipsec.4 Sat Dec 5 19:25:29 2009 (r200149) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2009 +.Dd November 29, 2009 .Dt IPSEC 4 .Os .Sh NAME @@ -215,7 +215,7 @@ To selectively enable/disable protocols, .It Sy "Name Default" .It "net.inet.esp.esp_enable On" .It "net.inet.ah.ah_enable On" -.It "net.inet.ipcomp.ipcomp_enable Off" +.It "net.inet.ipcomp.ipcomp_enable On" .El .Pp In addition the following variables are accessible via @@ -408,6 +408,8 @@ size may alleviate this problem. .Pp The .Tn IPcomp -protocol support is currently broken. +protocol may occasionally error because of +.Xr zlib 3 +problems. .Pp This documentation needs more review. Modified: stable/8/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:21:58 2009 (r200148) +++ stable/8/sys/netipsec/xform_ipcomp.c Sat Dec 5 19:25:29 2009 (r200149) @@ -68,7 +68,7 @@ #include #include -VNET_DEFINE(int, ipcomp_enable) = 0; +VNET_DEFINE(int, ipcomp_enable) = 1; VNET_DEFINE(struct ipcompstat, ipcompstat); SYSCTL_DECL(_net_inet_ipcomp); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:31:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A465F1065670; Sat, 5 Dec 2009 19:31:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9252C8FC17; Sat, 5 Dec 2009 19:31:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JVcs4097457; Sat, 5 Dec 2009 19:31:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JVcHl097444; Sat, 5 Dec 2009 19:31:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051931.nB5JVcHl097444@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 19:31:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200150 - in head/lib/libc: gen gmon stdio stdlib sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:31:38 -0000 Author: ed Date: Sat Dec 5 19:31:38 2009 New Revision: 200150 URL: http://svn.freebsd.org/changeset/base/200150 Log: Fix many "function declaration isn't a prototype" warnings in libc. I've only fixed code that seems to be written by `us'. There are still many warnings like this present in resolv/, rpc/, stdtime/ and yp/. Modified: head/lib/libc/gen/getttyent.c head/lib/libc/gen/nlist.c head/lib/libc/gen/pause.c head/lib/libc/gen/raise.c head/lib/libc/gen/sleep.c head/lib/libc/gen/timezone.c head/lib/libc/gen/usleep.c head/lib/libc/gmon/gmon.c head/lib/libc/stdio/findfp.c head/lib/libc/stdio/funopen.c head/lib/libc/stdlib/system.c head/lib/libc/sys/__error.c Modified: head/lib/libc/gen/getttyent.c ============================================================================== --- head/lib/libc/gen/getttyent.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/getttyent.c Sat Dec 5 19:31:38 2009 (r200150) @@ -55,8 +55,7 @@ static char *skip(char *); static char *value(char *); struct ttyent * -getttynam(tty) - const char *tty; +getttynam(const char *tty) { struct ttyent *t; @@ -71,7 +70,7 @@ getttynam(tty) } struct ttyent * -getttyent() +getttyent(void) { static struct ttyent tty; static char devpts_name[] = "pts/4294967295"; @@ -178,8 +177,7 @@ getttyent() * the next field. */ static char * -skip(p) - char *p; +skip(char *p) { char *t; int c, q; @@ -212,15 +210,14 @@ skip(p) } static char * -value(p) - char *p; +value(char *p) { return ((p = index(p, '=')) ? ++p : NULL); } int -setttyent() +setttyent(void) { DIR *devpts_dir; @@ -254,7 +251,7 @@ setttyent() } int -endttyent() +endttyent(void) { int rval; @@ -272,9 +269,7 @@ endttyent() } static int -isttystat(tty, flag) - const char *tty; - int flag; +isttystat(const char *tty, int flag) { struct ttyent *t; @@ -283,15 +278,14 @@ isttystat(tty, flag) int -isdialuptty(tty) - const char *tty; +isdialuptty(const char *tty) { return isttystat(tty, TTY_DIALUP); } -int isnettty(tty) - const char *tty; +int +isnettty(const char *tty) { return isttystat(tty, TTY_NETWORK); Modified: head/lib/libc/gen/nlist.c ============================================================================== --- head/lib/libc/gen/nlist.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/nlist.c Sat Dec 5 19:31:38 2009 (r200150) @@ -209,8 +209,7 @@ static void elf_sym_to_nlist(struct nlis * as such its use should be restricted. */ int -__elf_is_okay__(ehdr) - Elf_Ehdr *ehdr; +__elf_is_okay__(Elf_Ehdr *ehdr) { int retval = 0; /* Modified: head/lib/libc/gen/pause.c ============================================================================== --- head/lib/libc/gen/pause.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/pause.c Sat Dec 5 19:31:38 2009 (r200150) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); * Backwards compatible pause. */ int -__pause() +__pause(void) { return sigpause(sigblock(0L)); } Modified: head/lib/libc/gen/raise.c ============================================================================== --- head/lib/libc/gen/raise.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/raise.c Sat Dec 5 19:31:38 2009 (r200150) @@ -40,8 +40,7 @@ __weak_reference(__raise, raise); __weak_reference(__raise, _raise); int -__raise(s) - int s; +__raise(int s) { return(kill(getpid(), s)); } Modified: head/lib/libc/gen/sleep.c ============================================================================== --- head/lib/libc/gen/sleep.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/sleep.c Sat Dec 5 19:31:38 2009 (r200150) @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" unsigned int -__sleep(seconds) - unsigned int seconds; +__sleep(unsigned int seconds) { struct timespec time_to_sleep; struct timespec time_remaining; Modified: head/lib/libc/gen/timezone.c ============================================================================== --- head/lib/libc/gen/timezone.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/timezone.c Sat Dec 5 19:31:38 2009 (r200150) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #define TZ_MAX_CHARS 255 -char *_tztab(); +char *_tztab(int, int); /* * timezone -- @@ -53,9 +53,7 @@ char *_tztab(); static char czone[TZ_MAX_CHARS]; /* space for zone name */ char * -timezone(zone, dst) - int zone, - dst; +timezone(int zone, int dst) { char *beg, *end; @@ -106,9 +104,7 @@ static struct zone { * STANDARD LIBRARY. */ char * -_tztab(zone,dst) - int zone; - int dst; +_tztab(int zone, int dst) { struct zone *zp; char sign; Modified: head/lib/libc/gen/usleep.c ============================================================================== --- head/lib/libc/gen/usleep.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gen/usleep.c Sat Dec 5 19:31:38 2009 (r200150) @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" int -__usleep(useconds) - useconds_t useconds; +__usleep(useconds_t useconds) { struct timespec time_to_sleep; Modified: head/lib/libc/gmon/gmon.c ============================================================================== --- head/lib/libc/gmon/gmon.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/gmon/gmon.c Sat Dec 5 19:31:38 2009 (r200150) @@ -132,7 +132,7 @@ monstartup(lowpc, highpc) } void -_mcleanup() +_mcleanup(void) { int fd; int fromindex; Modified: head/lib/libc/stdio/findfp.c ============================================================================== --- head/lib/libc/stdio/findfp.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/stdio/findfp.c Sat Dec 5 19:31:38 2009 (r200150) @@ -168,7 +168,7 @@ __warn_references(f_prealloc, "warning: this program uses f_prealloc(), which is not recommended."); void -f_prealloc() +f_prealloc(void) { struct glue *g; int n; Modified: head/lib/libc/stdio/funopen.c ============================================================================== --- head/lib/libc/stdio/funopen.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/stdio/funopen.c Sat Dec 5 19:31:38 2009 (r200150) @@ -42,11 +42,11 @@ __FBSDID("$FreeBSD$"); #include "local.h" FILE * -funopen(cookie, readfn, writefn, seekfn, closefn) - const void *cookie; - int (*readfn)(), (*writefn)(); - fpos_t (*seekfn)(void *cookie, fpos_t off, int whence); - int (*closefn)(); +funopen(const void *cookie, + int (*readfn)(void *, char *, int), + int (*writefn)(void *, const char *, int), + fpos_t (*seekfn)(void *, fpos_t, int), + int (*closefn)(void *)) { FILE *fp; int flags; Modified: head/lib/libc/stdlib/system.c ============================================================================== --- head/lib/libc/stdlib/system.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/stdlib/system.c Sat Dec 5 19:31:38 2009 (r200150) @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" int -__system(command) - const char *command; +__system(const char *command) { pid_t pid, savedpid; int pstat; Modified: head/lib/libc/sys/__error.c ============================================================================== --- head/lib/libc/sys/__error.c Sat Dec 5 19:25:29 2009 (r200149) +++ head/lib/libc/sys/__error.c Sat Dec 5 19:31:38 2009 (r200150) @@ -39,7 +39,7 @@ extern int errno; __weak_reference(__error_unthreaded, __error); int * -__error_unthreaded() +__error_unthreaded(void) { return(&errno); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:42:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98FE7106566C; Sat, 5 Dec 2009 19:42:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8739E8FC0C; Sat, 5 Dec 2009 19:42:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JghPY097715; Sat, 5 Dec 2009 19:42:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JghY4097713; Sat, 5 Dec 2009 19:42:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051942.nB5JghY4097713@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200151 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:42:44 -0000 Author: bz Date: Sat Dec 5 19:42:42 2009 New Revision: 200151 URL: http://svn.freebsd.org/changeset/base/200151 Log: MFC r198076: Explicitly compare to a return code. Discussed with: philip (after we both misread the logic there the 1st time) Modified: stable/8/sys/netinet6/icmp6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet6/icmp6.c ============================================================================== --- stable/8/sys/netinet6/icmp6.c Sat Dec 5 19:31:38 2009 (r200150) +++ stable/8/sys/netinet6/icmp6.c Sat Dec 5 19:42:42 2009 (r200151) @@ -870,7 +870,7 @@ icmp6_input(struct mbuf **mp, int *offp, break; } deliver: - if (icmp6_notify_error(&m, off, icmp6len, code)) { + if (icmp6_notify_error(&m, off, icmp6len, code) != 0) { /* In this case, m should've been freed. */ return (IPPROTO_DONE); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:44:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F10106566B; Sat, 5 Dec 2009 19:44:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58A9B8FC13; Sat, 5 Dec 2009 19:44:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JiGuX097814; Sat, 5 Dec 2009 19:44:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JiGwu097812; Sat, 5 Dec 2009 19:44:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912051944.nB5JiGwu097812@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 19:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200152 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:44:16 -0000 Author: bz Date: Sat Dec 5 19:44:16 2009 New Revision: 200152 URL: http://svn.freebsd.org/changeset/base/200152 Log: MFC r198050: Compare pointer to NULL rather than 0. Modified: stable/8/sys/netinet/ip_icmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_icmp.c ============================================================================== --- stable/8/sys/netinet/ip_icmp.c Sat Dec 5 19:42:42 2009 (r200151) +++ stable/8/sys/netinet/ip_icmp.c Sat Dec 5 19:44:16 2009 (r200152) @@ -367,7 +367,7 @@ icmp_input(struct mbuf *m, int off) goto freeit; } i = hlen + min(icmplen, ICMP_ADVLENMIN); - if (m->m_len < i && (m = m_pullup(m, i)) == 0) { + if (m->m_len < i && (m = m_pullup(m, i)) == NULL) { ICMPSTAT_INC(icps_tooshort); return; } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:53:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7431065670; Sat, 5 Dec 2009 19:53:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5913B8FC13; Sat, 5 Dec 2009 19:53:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JrTQK098047; Sat, 5 Dec 2009 19:53:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JrTRs098035; Sat, 5 Dec 2009 19:53:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051953.nB5JrTRs098035@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 19:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200153 - head/lib/libulog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:53:29 -0000 Author: ed Date: Sat Dec 5 19:53:29 2009 New Revision: 200153 URL: http://svn.freebsd.org/changeset/base/200153 Log: Massively extend libulog: - Just like struct utmp, store strings inside struct utmpx itself. This is needed to make things like pututxline() work. - Add ut_id and ut_pid fields, even though they have little use in our implementation. - It turns out our "reboot" wtmp entries indicate a system boot, so remove REBOOT_TIME - Implement getutxline() and pututxline - Add getutxuser() and setutxfile(), which allows us to crawl wtmp and lastlog files as well. - Add _ULOG_POSIX_NAMES, so we can already use the POSIX names if we really want to. Added: head/lib/libulog/ulog_pututxline.c (contents, props changed) head/lib/libulog/ulog_setutxfile.3 (contents, props changed) head/lib/libulog/ulog_util.c (contents, props changed) Modified: head/lib/libulog/Makefile head/lib/libulog/Symbol.map head/lib/libulog/ulog.h head/lib/libulog/ulog_getutxent.3 head/lib/libulog/ulog_getutxent.c head/lib/libulog/ulog_internal.h head/lib/libulog/ulog_login.3 head/lib/libulog/ulog_login.c Modified: head/lib/libulog/Makefile ============================================================================== --- head/lib/libulog/Makefile Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/Makefile Sat Dec 5 19:53:29 2009 (r200153) @@ -3,15 +3,25 @@ LIB= ulog SHLIB_MAJOR= 0 INCS= ulog.h -SRCS= ulog.h ulog_getutxent.c ulog_internal.h \ - ulog_login.c ulog_login_pseudo.c +SRCS= ulog.h ulog_getutxent.c ulog_internal.h ulog_login.c \ + ulog_login_pseudo.c ulog_pututxline.c ulog_util.c -MAN= ulog_getutxent.3 ulog_login.3 +MAN= ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \ + ulog_getutxent.3 ulog_getutxline.3 \ + ulog_getutxent.3 ulog_pututxline.3 \ ulog_getutxent.3 ulog_setutxent.3 \ ulog_login.3 ulog_login_pseudo.3 \ ulog_login.3 ulog_logout.3 \ - ulog_login.3 ulog_logout_pseudo.3 + ulog_login.3 ulog_logout_pseudo.3 \ + ulog_setutxfile.3 ulog_getutxuser.3 + +# Add links to -style functions. +MLINKS+=ulog_endutxent.3 endutxent.3 \ + ulog_getutxent.3 getutxent.3 \ + ulog_getutxline.3 getutxline.3 \ + ulog_pututxline.3 pututxline.3 \ + ulog_setutxent.3 setutxent.3 WARNS?= 6 Modified: head/lib/libulog/Symbol.map ============================================================================== --- head/lib/libulog/Symbol.map Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/Symbol.map Sat Dec 5 19:53:29 2009 (r200153) @@ -5,9 +5,13 @@ FBSD_1.2 { ulog_endutxent; ulog_getutxent; + ulog_getutxline; + ulog_getutxuser; ulog_login; ulog_login_pseudo; ulog_logout; ulog_logout_pseudo; + ulog_pututxline; ulog_setutxent; + ulog_setutxfile; }; Modified: head/lib/libulog/ulog.h ============================================================================== --- head/lib/libulog/ulog.h Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/ulog.h Sat Dec 5 19:53:29 2009 (r200153) @@ -31,6 +31,12 @@ #include #include +#include + +#ifndef _PID_T_DECLARED +typedef __pid_t pid_t; +#define _PID_T_DECLARED +#endif /* * libulog. @@ -42,61 +48,61 @@ * processes as well, provided that they hold a file descriptor to a * pseudo-terminal master device. * - * Unlike struct utmpx, the buffers containing the strings are not - * stored inside struct ulog_utmpx itself. Processes should never - * handcraft these structures anyway. - * * This library (or at least parts of it) will hopefully deprecate over * time, when we provide the API. */ -#define _UTX_USERDISPSIZE 16 -#define _UTX_LINEDISPSIZE 8 -#define _UTX_HOSTDISPSIZE 16 - struct ulog_utmpx { - char *ut_user; -#if 0 - char *ut_id; -#endif - char *ut_line; - char *ut_host; -#if 0 - pid_t ut_pid; -#endif - short ut_type; + char ut_user[32]; + char ut_id[8]; /* XXX: unsupported. */ + char ut_line[32]; + char ut_host[256]; + pid_t ut_pid; /* XXX: unsupported. */ + short ut_type; #define EMPTY 0 -#if 0 #define BOOT_TIME 1 -#endif #define OLD_TIME 2 #define NEW_TIME 3 #define USER_PROCESS 4 -#if 0 -#define INIT_PROCESS 5 -#define LOGIN_PROCESS 6 -#endif +#define INIT_PROCESS 5 /* XXX: unsupported. */ +#define LOGIN_PROCESS 6 /* XXX: unsupported. */ #define DEAD_PROCESS 7 - #define SHUTDOWN_TIME 8 -#define REBOOT_TIME 9 - struct timeval ut_tv; + struct timeval ut_tv; }; __BEGIN_DECLS +/* POSIX routines. */ void ulog_endutxent(void); struct ulog_utmpx *ulog_getutxent(void); #if 0 -struct ulog_utmpx *ulog_getutxid(const struct ulog_utmpx *id); -struct ulog_utmpx *ulog_getutxline(const struct ulog_utmpx *line); -struct ulog_utmpx *ulog_pututxline(const struct ulog_utmpx *utmpx); +struct ulog_utmpx *ulog_getutxid(const struct ulog_utmpx *); #endif +struct ulog_utmpx *ulog_getutxline(const struct ulog_utmpx *); +struct ulog_utmpx *ulog_pututxline(const struct ulog_utmpx *); void ulog_setutxent(void); +/* Extensions. */ +struct ulog_utmpx *ulog_getutxuser(const char *); +int ulog_setutxfile(int, const char *); +#define UTXF_UTMP 0 +#define UTXF_WTMP 1 +#define UTXF_LASTLOG 2 + +/* Login/logout utility functions. */ void ulog_login(const char *, const char *, const char *); void ulog_login_pseudo(int, const char *); void ulog_logout(const char *); void ulog_logout_pseudo(int); __END_DECLS +#ifdef _ULOG_POSIX_NAMES +#define utmpx ulog_utmpx +#define endutxent ulog_endutxent +#define getutxent ulog_getutxent +#define getutxline ulog_getutxline +#define pututxline ulog_pututxline +#define setutxent ulog_setutxent +#endif /* _ULOG_POSIX_NAMES */ + #endif /* !_ULOG_H_ */ Modified: head/lib/libulog/ulog_getutxent.3 ============================================================================== --- head/lib/libulog/ulog_getutxent.3 Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/ulog_getutxent.3 Sat Dec 5 19:53:29 2009 (r200153) @@ -24,11 +24,13 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2009 +.Dd December 5, 2009 .Os .Dt ULOG_GETUTXENT 3 .Sh NAME .Nm ulog_getutxent , +.Nm ulog_getutxline , +.Nm ulog_pututxline , .Nm ulog_setutxent , .Nm ulog_endutxent .Nd read user login records @@ -38,6 +40,10 @@ .In ulog.h .Ft struct ulog_utmpx * .Fn ulog_getutxent "void" +.Ft struct ulog_utmpx * +.Fn ulog_getutxline "const struct ulog_utmpx *line" +.Ft struct ulog_utmpx * +.Fn ulog_pututxline "const struct ulog_utmpx *utmpx" .Ft void .Fn ulog_setutxent "void" .Ft void @@ -49,10 +55,12 @@ function returns a pointer to an object, containing stored information of an active user login session. .Bd -literal struct ulog_utmpx { - char *ut_user; /* Username. */ - char *ut_line; /* TTY device. */ - char *ut_host; /* Remote hostname. */ - short ut_type; /* Type of entry. */ + char ut_user[]; /* Username. */ + char ut_id[]; /* Private data. */ + char ut_line[]; /* TTY device. */ + char ut_host[]; /* Remote hostname. */ + pid_t ut_pid; /* Process identifier. */ + short ut_type; /* Type of entry. */ struct timeval ut_tv; /* Timestamp. */ }; .Ed @@ -61,6 +69,9 @@ The fields are as follows: .Bl -tag -width ut_user .It Fa ut_user The username of the logged in user. +.It Fa ut_id +Private data that can be used to later identify the record. +This implementation is not capable of storing this value on disk. .It Fa ut_line The pathname of the TTY device, without the leading .Pa /dev/ @@ -68,6 +79,9 @@ directory. .It Fa ut_host An optional hostname of a remote system, if the login session is provided through a networked login service. +.It Fa ut_pid +Process identifier of the session leader of the login session. +This implementation is not capable of storing this value on disk. .It Fa ut_type The .Fa ut_type @@ -76,28 +90,42 @@ following values: .Bl -tag -width SHUTDOWN_TIME .It Dv EMPTY No valid user accounting information. +.It Dv BOOT_TIME +Identifies time of system boot. .It Dv OLD_TIME Identifies time when system clock changed. .It Dv NEW_TIME Identifies time after system clock changed. .It Dv USER_PROCESS Identifies a process. +.It Dv INIT_PROCESS +Identifies a process spawned by the init process. +.It Dv LOGIN_PROCESS +Identifies the session leader of a logged-in user. .It Dv DEAD_PROCESS Identifies a session leader who has exited. .It Dv SHUTDOWN_TIME Identifies time when system was shut down. -.It Dv REBOOT_TIME -Identifies time when system was rebooted. .El .It Fa ut_tv Timestamp indicating when the entry was last modified. .El .Pp +This implementation guarantees all strings returned in the structure to +be null terminated. +.Pp The .Fn ulog_getutxent function reads the next entry from the utmp file, opening the file if necessary. The +.Fn ulog_getutxline +function reads entries from the utmp file, until finding an entry which +shares the same +.Fa ut_line +as the structure +.Fa line . +The .Fn ulog_setutxent opens the file, closing it first if already opened. The @@ -106,15 +134,50 @@ function closes any open files. .Pp The .Fn ulog_getutxent -function reads from the beginning of the file until and EOF is +and +.Fn ulog_getutxline +functions read from the beginning of the file until and EOF is encountered. +.Pp +The +.Fn ulog_pututxline +function writes a new entry to the file. .Sh RETURN VALUES The .Fn ulog_getutxent -function returns a null pointer on EOF or error. +and +.Fn ulog_getutxline +functions return a null pointer on EOF or error. .Sh SEE ALSO .Xr ulog_login 3 , +.Xr ulog_setutxfile 3 , .Xr utmp 5 +.Sh STANDARDS +This interface is similar to +.In utmpx.h +described in +.St -p1003.1-2008 , +but incompatible. +The underlying file format does not allow a correctly behaving +implementation of the standardized interface. +.Pp +This programming interface has been designed to ease the migration +towards +.In utmpx.h . +If +.Dv _ULOG_POSIX_NAMES +is set before inclusion of +.In ulog.h , +it is also possible to use the +.Vt utmpx +structure and the +.Fn getutxent , +.Fn getutxline , +.Fn pututxline , +.Fn setutxent +and +.Fn endutxent +functions. .Sh HISTORY These functions appeared in .Fx 9.0 . Modified: head/lib/libulog/ulog_getutxent.c ============================================================================== --- head/lib/libulog/ulog_getutxent.c Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/ulog_getutxent.c Sat Dec 5 19:53:29 2009 (r200153) @@ -27,6 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include + +#include #include #include #include @@ -35,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include "ulog_internal.h" static FILE *ufile; +static int ufiletype = -1; void ulog_endutxent(void) @@ -44,56 +48,255 @@ ulog_endutxent(void) ufile = NULL; } -struct ulog_utmpx * -ulog_getutxent(void) -{ - struct futmp ut; - static struct ulog_utmpx utx; +/* + * Conversion from on-disk formats to generic ulog_utmpx structure. + */ - /* Open the utmp file if not already done so. */ - if (ufile == NULL) - ulog_setutxent(); - if (ufile == NULL) - return (NULL); +static void +ulog_futmp_to_utmpx(const struct futmp *ut, struct ulog_utmpx *utx) +{ - if (fread(&ut, sizeof ut, 1, ufile) != 1) - return (NULL); -#define COPY_STRING(field) do { \ - free(utx.ut_ ## field); \ - utx.ut_ ## field = strndup(ut.ut_ ## field, \ - sizeof ut.ut_ ## field); \ - if (utx.ut_ ## field == NULL) \ - utx.ut_ ## field = __DECONST(char *, ""); \ + memset(utx, 0, sizeof *utx); +#define COPY_STRING(field) do { \ + strncpy(utx->ut_ ## field, ut->ut_ ## field, \ + MIN(sizeof utx->ut_ ## field - 1, sizeof ut->ut_ ## field));\ } while (0) COPY_STRING(user); COPY_STRING(line); COPY_STRING(host); - utx.ut_tv.tv_sec = _time32_to_time(ut.ut_time); - utx.ut_tv.tv_usec = 0; -#define MATCH(field, value) (strcmp(utx.ut_ ## field, (value)) == 0) - if (MATCH(user, "date") && MATCH(line, "|")) - utx.ut_type = OLD_TIME; +#undef COPY_STRING +#define MATCH(field, value) (strcmp(utx->ut_ ## field, (value)) == 0) + if (MATCH(user, "reboot") && MATCH(line, "~")) + utx->ut_type = BOOT_TIME; + else if (MATCH(user, "date") && MATCH(line, "|")) + utx->ut_type = OLD_TIME; else if (MATCH(user, "date") && MATCH(line, "{")) - utx.ut_type = NEW_TIME; + utx->ut_type = NEW_TIME; else if (MATCH(user, "shutdown") && MATCH(line, "~")) - utx.ut_type = SHUTDOWN_TIME; - else if (MATCH(user, "reboot") && MATCH(line, "~")) - utx.ut_type = REBOOT_TIME; + utx->ut_type = SHUTDOWN_TIME; else if (MATCH(user, "") && MATCH(host, "")) - utx.ut_type = DEAD_PROCESS; - else if (!MATCH(user, "")) - utx.ut_type = USER_PROCESS; + utx->ut_type = DEAD_PROCESS; + else if (!MATCH(user, "") && !MATCH(line, "") && ut->ut_time != 0) + utx->ut_type = USER_PROCESS; + else + utx->ut_type = EMPTY; + utx->ut_tv.tv_sec = _time32_to_time(ut->ut_time); + utx->ut_tv.tv_usec = 0; +} + +static void +ulog_flastlog_to_utmpx(const struct flastlog *ll, struct ulog_utmpx *utx) +{ + + memset(utx, 0, sizeof *utx); +#define COPY_STRING(field) do { \ + strncpy(utx->ut_ ## field, ll->ll_ ## field, \ + MIN(sizeof utx->ut_ ## field - 1, sizeof ll->ll_ ## field));\ +} while (0) + COPY_STRING(line); + COPY_STRING(host); +#undef COPY_STRING + if (!MATCH(line, "") && ll->ll_time != 0) + utx->ut_type = USER_PROCESS; else - utx.ut_type = EMPTY; - + utx->ut_type = EMPTY; + utx->ut_tv.tv_sec = _time32_to_time(ll->ll_time); + utx->ut_tv.tv_usec = 0; +} + +/* + * File I/O. + */ + +static inline off_t +ulog_tell(void) +{ + + if (ufiletype == UTXF_LASTLOG) + return (ftello(ufile) / sizeof(struct flastlog)); + else + return (ftello(ufile) / sizeof(struct futmp)); +} + +static struct ulog_utmpx * +ulog_read(off_t off, int whence, int resolve_user) +{ + static struct ulog_utmpx utx; + + if (ufile == NULL) + ulog_setutxent(); + if (ufile == NULL) + return (NULL); + + /* Only allow seeking to move forward. */ + if (whence == SEEK_SET && ulog_tell() > off) + return (NULL); + + if (ufiletype == UTXF_LASTLOG) { + struct flastlog ll; + struct passwd *pw = NULL; + uid_t uid; + + if (fseeko(ufile, off * sizeof ll, whence) != 0) + return (NULL); + uid = ulog_tell(); + if (fread(&ll, sizeof ll, 1, ufile) != 1) + return (NULL); + ulog_flastlog_to_utmpx(&ll, &utx); + if (utx.ut_type == USER_PROCESS && resolve_user) + pw = getpwuid(uid); + if (pw != NULL) + strlcpy(utx.ut_user, pw->pw_name, sizeof utx.ut_user); + else + sprintf(utx.ut_user, "%u", (unsigned int)uid); + } else { + struct futmp ut; + + if (fseeko(ufile, off * sizeof(struct futmp), whence) != 0) + return (NULL); + if (fread(&ut, sizeof ut, 1, ufile) != 1) + return (NULL); + ulog_futmp_to_utmpx(&ut, &utx); + } return (&utx); } -void -ulog_setutxent(void) +/* + * getutxent(). + * + * Read the next entry from the file. + */ + +struct ulog_utmpx * +ulog_getutxent(void) +{ + + return ulog_read(0, SEEK_CUR, 1); +} + +/* + * ulog_getutxline(). + * + * Read entries from the file, until reaching an entry which matches the + * provided TTY device name. We can optimize the case for utmp files, + * because they are indexed by TTY device name. + */ + +struct ulog_utmpx * +ulog_getutxline(const struct ulog_utmpx *line) { + struct ulog_utmpx *utx; + + if (ufile == NULL) + ulog_setutxent(); + if (ufile == NULL) + return (NULL); + + if (ufiletype == UTXF_UTMP) { + unsigned int slot; + + slot = ulog_ttyslot(line->ut_line); + if (slot == 0) + return (NULL); + utx = ulog_read(slot, SEEK_SET, 1); + if (utx->ut_type == USER_PROCESS && + strcmp(utx->ut_line, line->ut_line) == 0) + return (utx); + return (NULL); + } else { + for (;;) { + utx = ulog_read(0, SEEK_CUR, 1); + if (utx == NULL) + return (NULL); + if (utx->ut_type == USER_PROCESS && + strcmp(utx->ut_line, line->ut_line) == 0) + return (utx); + } + } +} + +/* + * ulog_getutxuser(). + * + * Read entries from the file, until reaching an entry which matches the + * provided username. We can optimize the case for lastlog files, + * because they are indexed by user ID. + */ + +struct ulog_utmpx * +ulog_getutxuser(const char *user) +{ + struct ulog_utmpx *utx; + + if (ufiletype == UTXF_LASTLOG) { + struct passwd *pw; + + pw = getpwnam(user); + if (pw == NULL) + return (NULL); + utx = ulog_read(pw->pw_uid, SEEK_SET, 0); + if (utx != NULL) + strlcpy(utx->ut_user, user, sizeof utx->ut_user); + return (utx); + } else { + for (;;) { + utx = ulog_read(0, SEEK_CUR, 1); + if (utx == NULL) + return (NULL); + if (utx->ut_type == USER_PROCESS && + strcmp(utx->ut_user, user) == 0) + return (utx); + } + } +} + +/* + * ulog_setutxfile(). + * + * Switch to a different record file. When no filename is provided, the + * system default is opened. + */ + +int +ulog_setutxfile(int type, const char *file) +{ + + /* Supply default files. */ + switch (type) { + case UTXF_UTMP: + if (file == NULL) + file = _PATH_UTMP; + break; + case UTXF_WTMP: + if (file == NULL) + file = _PATH_WTMP; + break; + case UTXF_LASTLOG: + if (file == NULL) + file = _PATH_LASTLOG; + break; + default: + return (-1); + } if (ufile != NULL) fclose(ufile); - ufile = fopen(_PATH_UTMP, "r"); + ufile = fopen(file, "r"); + ufiletype = type; + if (ufile == NULL) + return (-1); + return (0); +} + +/* + * ulog_endutxfile(). + * + * Close any opened files. + */ + +void +ulog_setutxent(void) +{ + + ulog_setutxfile(UTXF_UTMP, NULL); } Modified: head/lib/libulog/ulog_internal.h ============================================================================== --- head/lib/libulog/ulog_internal.h Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/ulog_internal.h Sat Dec 5 19:53:29 2009 (r200153) @@ -33,6 +33,8 @@ #include "ulog.h" +unsigned int ulog_ttyslot(const char *); + /* * On-disk format. */ Modified: head/lib/libulog/ulog_login.3 ============================================================================== --- head/lib/libulog/ulog_login.3 Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/ulog_login.3 Sat Dec 5 19:53:29 2009 (r200153) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 2, 2009 +.Dd December 5, 2009 .Os .Dt ULOG_LOGIN 3 .Sh NAME Modified: head/lib/libulog/ulog_login.c ============================================================================== --- head/lib/libulog/ulog_login.c Sat Dec 5 19:44:16 2009 (r200152) +++ head/lib/libulog/ulog_login.c Sat Dec 5 19:53:29 2009 (r200153) @@ -27,109 +27,48 @@ #include __FBSDID("$FreeBSD$"); -#include -#include +#include #include -#include #include -#include -#include -#include -#include #include "ulog_internal.h" void ulog_login(const char *line, const char *user, const char *host) { - struct futmp fu; - struct flastlog fl; - int fd; + struct ulog_utmpx utx; /* Remove /dev/ component. */ if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) line += sizeof _PATH_DEV - 1; - /* Prepare log entries. */ - memset(&fu, 0, sizeof fu); - strlcpy(fu.ut_line, line, sizeof fu.ut_line); - strlcpy(fu.ut_user, user, sizeof fu.ut_user); - if (host != NULL) - strlcpy(fu.ut_host, host, sizeof fu.ut_host); - fu.ut_time = _time_to_time32(time(NULL)); - - fl.ll_time = fu.ut_time; - memcpy(fl.ll_line, fu.ut_line, sizeof fl.ll_line); - memcpy(fl.ll_host, fu.ut_host, sizeof fl.ll_host); - - /* Update utmp entry. */ - if ((fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { - struct ttyent *ty; - int idx; - - setttyent(); - for (idx = 1; (ty = getttyent()) != NULL; ++idx) { - if (strcmp(ty->ty_name, line) != 0) - continue; - lseek(fd, (off_t)(idx * sizeof fu), L_SET); - write(fd, &fu, sizeof fu); - break; - } - endttyent(); - close(fd); - } - - /* Add wtmp entry. */ - if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) { - write(fd, &fu, sizeof fu); - close(fd); - } - - /* Update lastlog entry. */ - if ((fd = open(_PATH_LASTLOG, O_WRONLY, 0)) >= 0) { - struct passwd *pw; - - pw = getpwnam(user); - if (pw != NULL) { - lseek(fd, (off_t)(pw->pw_uid * sizeof fl), L_SET); - write(fd, &fl, sizeof fl); - } - close(fd); - } + memset(&utx, 0, sizeof utx); + + /* XXX: ut_id, ut_pid missing. */ + utx.ut_type = USER_PROCESS; + strncpy(utx.ut_line, line, sizeof utx.ut_line); + strncpy(utx.ut_user, user, sizeof utx.ut_user); + strncpy(utx.ut_host, host, sizeof utx.ut_host); + gettimeofday(&utx.ut_tv, NULL); + + ulog_pututxline(&utx); } void ulog_logout(const char *line) { - struct futmp ut; - int fd, found; + struct ulog_utmpx utx; /* Remove /dev/ component. */ if (strncmp(line, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) line += sizeof _PATH_DEV - 1; - /* Mark entry in utmp as logged out. */ - if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) - return; - found = 0; - while (read(fd, &ut, sizeof ut) == sizeof ut) { - if (ut.ut_user[0] == '\0' || - strncmp(ut.ut_line, line, sizeof ut.ut_line) != 0) - continue; - memset(ut.ut_user, 0, sizeof ut.ut_user); - memset(ut.ut_host, 0, sizeof ut.ut_host); - ut.ut_time = _time_to_time32(time(NULL)); - lseek(fd, -(off_t)sizeof ut, L_INCR); - write(fd, &ut, sizeof ut); - found = 1; - } - close(fd); - if (!found) - return; - - /* utmp entry found. Also add logout entry to wtmp. */ - if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) { - write(fd, &ut, sizeof ut); - close(fd); - } + memset(&utx, 0, sizeof utx); + + /* XXX: ut_id, ut_pid missing. ut_line not needed */ + utx.ut_type = DEAD_PROCESS; + strncpy(utx.ut_line, line, sizeof utx.ut_line); + gettimeofday(&utx.ut_tv, NULL); + + ulog_pututxline(&utx); } Added: head/lib/libulog/ulog_pututxline.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_pututxline.c Sat Dec 5 19:53:29 2009 (r200153) @@ -0,0 +1,208 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include "ulog_internal.h" + +static void +ulog_utmpx_to_futmp(const struct ulog_utmpx *utx, struct futmp *ut) +{ + + memset(ut, 0, sizeof *ut); +#define COPY_STRING(field) do { \ + strncpy(ut->ut_ ## field, utx->ut_ ## field, \ + MIN(sizeof ut->ut_ ## field, sizeof utx->ut_ ## field)); \ +} while (0) + switch (utx->ut_type) { + case BOOT_TIME: + strcpy(ut->ut_user, "reboot"); + ut->ut_line[0] = '~'; + break; + case OLD_TIME: + strcpy(ut->ut_user, "date"); + ut->ut_line[0] = '|'; + break; + case NEW_TIME: + strcpy(ut->ut_user, "date"); + ut->ut_line[0] = '{'; + break; + case USER_PROCESS: + COPY_STRING(user); + COPY_STRING(line); + COPY_STRING(host); + break; + case DEAD_PROCESS: + COPY_STRING(line); + break; + case SHUTDOWN_TIME: + strcpy(ut->ut_user, "shutdown"); + ut->ut_line[0] = '~'; + break; + } +#undef COPY_STRING + ut->ut_time = _time_to_time32(utx->ut_tv.tv_sec); +} + +static void +ulog_utmpx_to_flastlog(const struct ulog_utmpx *utx, struct flastlog *ll) +{ + + memset(ll, 0, sizeof *ll); +#define COPY_STRING(field) do { \ + strncpy(ll->ll_ ## field, utx->ut_ ## field, \ + MIN(sizeof ll->ll_ ## field, sizeof utx->ut_ ## field)); \ +} while (0) + switch (utx->ut_type) { + case USER_PROCESS: + COPY_STRING(line); + COPY_STRING(host); + break; + } +#undef COPY_STRING + ll->ll_time = _time_to_time32(utx->ut_tv.tv_sec); +} + +static void +ulog_write_utmp_fast(const struct futmp *ut) +{ + unsigned int idx; + char line[sizeof ut->ut_line + 1]; + int fd; + + if ((fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) < 0) + return; + strlcpy(line, ut->ut_line, sizeof line); + idx = ulog_ttyslot(line); + if (idx > 0) { + lseek(fd, (off_t)(idx * sizeof *ut), SEEK_SET); + write(fd, ut, sizeof *ut); + } + close(fd); +} + +static int +ulog_write_utmp_slow(const struct futmp *ut) +{ + struct futmp utf; + int fd, found; + + if ((fd = open(_PATH_UTMP, O_RDWR, 0)) < 0) + return (0); + found = 0; + while (read(fd, &utf, sizeof utf) == sizeof utf) { + if (utf.ut_user[0] == '\0' || + strncmp(utf.ut_line, ut->ut_line, sizeof utf.ut_line) != 0) + continue; + lseek(fd, -(off_t)sizeof utf, SEEK_CUR); + write(fd, &ut, sizeof ut); + found = 1; + } + close(fd); + return (found); +} + +static void +ulog_write_wtmp(const struct futmp *ut) +{ + int fd; + + if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0) + return; + write(fd, ut, sizeof *ut); + close(fd); +} + +static void +ulog_write_lastlog(const struct flastlog *ll, const char *user) +{ + struct passwd *pw; + int fd; + + if ((fd = open(_PATH_LASTLOG, O_WRONLY, 0)) < 0) + return; + pw = getpwnam(user); + if (pw != NULL) { + lseek(fd, (off_t)(pw->pw_uid * sizeof *ll), SEEK_SET); + write(fd, ll, sizeof *ll); + } + close(fd); +} + +struct ulog_utmpx * +ulog_pututxline(const struct ulog_utmpx *utmpx) +{ + static struct ulog_utmpx utx; + struct futmp ut; + struct flastlog ll; + char user[sizeof utmpx->ut_user + 1]; + + switch (utmpx->ut_type) { + case BOOT_TIME: + case OLD_TIME: + case NEW_TIME: + case SHUTDOWN_TIME: + ulog_utmpx_to_futmp(utmpx, &ut); + + /* Only log to wtmp. */ + ulog_write_wtmp(&ut); + break; + case USER_PROCESS: + ulog_utmpx_to_futmp(utmpx, &ut); + ulog_utmpx_to_flastlog(utmpx, &ll); + + /* Log to utmp, wtmp and lastlog. */ + ulog_write_utmp_fast(&ut); + ulog_write_wtmp(&ut); + strlcpy(user, utmpx->ut_user, sizeof user); + ulog_write_lastlog(&ll, user); + break; + case DEAD_PROCESS: + ulog_utmpx_to_futmp(utmpx, &ut); + + /* Only log to wtmp if logged in utmp. */ + if (ulog_write_utmp_slow(&ut)) + ulog_write_wtmp(&ut); + break; + default: + return (NULL); + } + + /* XXX: Can't we just return utmpx itself? */ + memcpy(&utx, utmpx, sizeof utx); + utx.ut_user[sizeof utx.ut_user - 1] = '\0'; + utx.ut_line[sizeof utx.ut_line - 1] = '\0'; + utx.ut_host[sizeof utx.ut_host - 1] = '\0'; + return (&utx); +} Added: head/lib/libulog/ulog_setutxfile.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/ulog_setutxfile.3 Sat Dec 5 19:53:29 2009 (r200153) @@ -0,0 +1,94 @@ +.\" Copyright (c) 2009 Ed Schouten +.\" All rights reserved. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:54:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76FA51065696; Sat, 5 Dec 2009 19:54:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6657A8FC1B; Sat, 5 Dec 2009 19:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5Jsbpl098108; Sat, 5 Dec 2009 19:54:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JsbS5098106; Sat, 5 Dec 2009 19:54:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051954.nB5JsbS5098106@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 19:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200154 - head/usr.bin/users X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:54:37 -0000 Author: ed Date: Sat Dec 5 19:54:37 2009 New Revision: 200154 URL: http://svn.freebsd.org/changeset/base/200154 Log: Use _ULOG_POSIX_NAMES here, to make eventual porting to easier. By the time we gain a real , it's just a matter of changing the include at the top and -lulog from the Makefile. Modified: head/usr.bin/users/users.c Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Sat Dec 5 19:53:29 2009 (r200153) +++ head/usr.bin/users/users.c Sat Dec 5 19:54:37 2009 (r200154) @@ -51,6 +51,7 @@ static const char rcsid[] = #include #include #include +#define _ULOG_POSIX_NAMES #include #include @@ -66,7 +67,7 @@ main(int argc, char **argv) int ncnt = 0; int nmax = 0; int cnt; - struct ulog_utmpx *ut; + struct utmpx *ut; int ch; while ((ch = getopt(argc, argv, "")) != -1) @@ -78,8 +79,8 @@ main(int argc, char **argv) argc -= optind; argv += optind; - ulog_setutxent(); - while ((ut = ulog_getutxent()) != NULL) { + setutxent(); + while ((ut = getutxent()) != NULL) { if (ut->ut_type != USER_PROCESS) continue; if (ncnt >= nmax) { @@ -93,7 +94,7 @@ main(int argc, char **argv) (void)strlcpy(names[ncnt], ut->ut_user, sizeof(*names)); ++ncnt; } - ulog_endutxent(); + endutxent(); if (ncnt > 0) { qsort(names, ncnt, sizeof(namebuf), scmp); (void)printf("%s", names[0]); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 19:55:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 737561065676; Sat, 5 Dec 2009 19:55:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49A2F8FC16; Sat, 5 Dec 2009 19:55:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5JtQ2D098177; Sat, 5 Dec 2009 19:55:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JtQCm098175; Sat, 5 Dec 2009 19:55:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051955.nB5JtQCm098175@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 19:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200155 - head/usr.bin/users X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 19:55:26 -0000 Author: ed Date: Sat Dec 5 19:55:26 2009 New Revision: 200155 URL: http://svn.freebsd.org/changeset/base/200155 Log: Add WARNS?=6, because it seems to build out of the box. Modified: head/usr.bin/users/Makefile Modified: head/usr.bin/users/Makefile ============================================================================== --- head/usr.bin/users/Makefile Sat Dec 5 19:54:37 2009 (r200154) +++ head/usr.bin/users/Makefile Sat Dec 5 19:55:26 2009 (r200155) @@ -3,6 +3,8 @@ PROG= users +WARNS?= 6 + DPADD= ${LIBULOG} LDADD= -lulog From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:05:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC7671065670; Sat, 5 Dec 2009 20:05:25 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C30A38FC0A; Sat, 5 Dec 2009 20:05:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5K5PaN098415; Sat, 5 Dec 2009 20:05:25 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5K5PoZ098412; Sat, 5 Dec 2009 20:05:25 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052005.nB5K5PoZ098412@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 20:05:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200156 - head/usr.bin/wall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:05:26 -0000 Author: ed Date: Sat Dec 5 20:05:25 2009 New Revision: 200156 URL: http://svn.freebsd.org/changeset/base/200156 Log: Let wall(1) use utmpx. Because our implementation guarantees the strings inside struct utmpx to be null terminated, we don't need to copy everything out, which makes the code nicer to read. Also set WARNS to 6 and add $FreeBSD$ to keep SVN silent. Modified: head/usr.bin/wall/Makefile head/usr.bin/wall/wall.c Modified: head/usr.bin/wall/Makefile ============================================================================== --- head/usr.bin/wall/Makefile Sat Dec 5 19:55:26 2009 (r200155) +++ head/usr.bin/wall/Makefile Sat Dec 5 20:05:25 2009 (r200156) @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= wall SRCS= ttymsg.c wall.c BINGRP= tty BINMODE=2555 +WARNS?= 6 + +DPADD= ${LIBULOG} +LDADD= -lulog + .include Modified: head/usr.bin/wall/wall.c ============================================================================== --- head/usr.bin/wall/wall.c Sat Dec 5 19:55:26 2009 (r200155) +++ head/usr.bin/wall/wall.c Sat Dec 5 20:05:25 2009 (r200156) @@ -64,8 +64,9 @@ static const char sccsid[] = "@(#)wall.c #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include "ttymsg.h" @@ -82,12 +83,12 @@ int mbufsize; char *mbuf; static int -ttystat(char *line, int sz) +ttystat(char *line) { struct stat sb; char ttybuf[MAXPATHLEN]; - (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line); + (void)snprintf(ttybuf, sizeof(ttybuf), "%s%s", _PATH_DEV, line); if (stat(ttybuf, &sb) == 0) { return (0); } else @@ -98,17 +99,14 @@ int main(int argc, char *argv[]) { struct iovec iov; - struct utmp utmp; + struct utmpx *utmp; int ch; int ingroup; - FILE *fp; struct wallgroup *g; struct group *grp; char **np; const char *p; struct passwd *pw; - char line[sizeof(utmp.ut_line) + 1]; - char username[sizeof(utmp.ut_name) + 1]; (void)setlocale(LC_CTYPE, ""); @@ -145,20 +143,17 @@ main(int argc, char *argv[]) makemsg(*argv); - if (!(fp = fopen(_PATH_UTMP, "r"))) - err(1, "cannot read %s", _PATH_UTMP); iov.iov_base = mbuf; iov.iov_len = mbufsize; /* NOSTRICT */ - while (fread((char *)&utmp, sizeof(utmp), 1, fp) == 1) { - if (!utmp.ut_name[0]) + while ((utmp = getutxent()) != NULL) { + if (utmp->ut_type != USER_PROCESS) continue; - if (ttystat(utmp.ut_line, UT_LINESIZE) != 0) + if (ttystat(utmp->ut_line) != 0) continue; if (grouplist) { ingroup = 0; - strlcpy(username, utmp.ut_name, sizeof(utmp.ut_name)); - pw = getpwnam(username); + pw = getpwnam(utmp->ut_user); if (!pw) continue; for (g = grouplist; g && ingroup == 0; g = g->next) { @@ -168,7 +163,7 @@ main(int argc, char *argv[]) ingroup = 1; else if ((grp = getgrgid(g->gid)) != NULL) { for (np = grp->gr_mem; *np; np++) { - if (strcmp(*np, username) == 0) { + if (strcmp(*np, utmp->ut_user) == 0) { ingroup = 1; break; } @@ -178,9 +173,7 @@ main(int argc, char *argv[]) if (ingroup == 0) continue; } - strncpy(line, utmp.ut_line, sizeof(utmp.ut_line)); - line[sizeof(utmp.ut_line)] = '\0'; - if ((p = ttymsg(&iov, 1, line, 60*5)) != NULL) + if ((p = ttymsg(&iov, 1, utmp->ut_line, 60*5)) != NULL) warnx("%s", p); } exit(0); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:09:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 847FB106566B; Sat, 5 Dec 2009 20:09:50 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 739538FC14; Sat, 5 Dec 2009 20:09:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5K9oCd098580; Sat, 5 Dec 2009 20:09:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5K9okL098577; Sat, 5 Dec 2009 20:09:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052009.nB5K9okL098577@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 20:09:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:09:50 -0000 Author: ed Date: Sat Dec 5 20:09:50 2009 New Revision: 200157 URL: http://svn.freebsd.org/changeset/base/200157 Log: Let date(1) use utmpx instead of logwtmp(). utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for the same purpose as how we call logwtmp() here. Modified: head/bin/date/Makefile head/bin/date/date.c Modified: head/bin/date/Makefile ============================================================================== --- head/bin/date/Makefile Sat Dec 5 20:05:25 2009 (r200156) +++ head/bin/date/Makefile Sat Dec 5 20:09:50 2009 (r200157) @@ -3,7 +3,7 @@ PROG= date SRCS= date.c netdate.c vary.c -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBULOG} +LDADD= -lulog .include Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Sat Dec 5 20:05:25 2009 (r200156) +++ head/bin/date/date.c Sat Dec 5 20:09:50 2009 (r200157) @@ -48,11 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include +#define _ULOG_POSIX_NAMES +#include #include #include "extern.h" @@ -181,6 +182,7 @@ main(int argc, char *argv[]) static void setthetime(const char *fmt, const char *p, int jflag, int nflag) { + struct utmpx utx; struct tm *lt; struct timeval tv; const char *dot, *t; @@ -271,12 +273,16 @@ setthetime(const char *fmt, const char * if (!jflag) { /* set the time */ if (nflag || netsettime(tval)) { - logwtmp("|", "date", ""); + utx.ut_type = OLD_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); tv.tv_sec = tval; tv.tv_usec = 0; if (settimeofday(&tv, (struct timezone *)NULL)) err(1, "settimeofday (timeval)"); - logwtmp("{", "date", ""); + utx.ut_type = NEW_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); } if ((p = getlogin()) == NULL) From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:16:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D44B8106566B; Sat, 5 Dec 2009 20:16:28 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A946A8FC15; Sat, 5 Dec 2009 20:16:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KGScG098743; Sat, 5 Dec 2009 20:16:28 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KGSqw098741; Sat, 5 Dec 2009 20:16:28 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200912052016.nB5KGSqw098741@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 5 Dec 2009 20:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200158 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:16:28 -0000 Author: pjd Date: Sat Dec 5 20:16:28 2009 New Revision: 200158 URL: http://svn.freebsd.org/changeset/base/200158 Log: We have to eventually look for provider without checking guid as this is need for attaching when there is no metadata yet. Before r200125 the order of looking for providers was wrong. It was: 1. Find provider by name. 2. Find provider by guid. 3. Find provider by name and guid. Where it should have been: 1. Find provider by name and guid. 2. Find provider by guid. 3. Find provider by name. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 20:09:50 2009 (r200157) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Sat Dec 5 20:16:28 2009 (r200158) @@ -453,7 +453,7 @@ vdev_geom_open_by_guid(vdev_t *vd) } static struct g_consumer * -vdev_geom_open_by_path(vdev_t *vd) +vdev_geom_open_by_path(vdev_t *vd, int check_guid) { struct g_provider *pp; struct g_consumer *cp; @@ -465,7 +465,7 @@ vdev_geom_open_by_path(vdev_t *vd) if (pp != NULL) { ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path); cp = vdev_geom_attach(pp, !!(spa_mode & FWRITE)); - if (cp != NULL) { + if (cp != NULL && check_guid) { g_topology_unlock(); guid = vdev_geom_read_guid(cp); g_topology_lock(); @@ -506,7 +506,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi if ((owned = mtx_owned(&Giant))) mtx_unlock(&Giant); - cp = vdev_geom_open_by_path(vd); + cp = vdev_geom_open_by_path(vd, 1); if (cp == NULL) { /* * The device at vd->vdev_path doesn't have the expected guid. @@ -515,6 +515,8 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi */ cp = vdev_geom_open_by_guid(vd); } + if (cp == NULL) + cp = vdev_geom_open_by_path(vd, 0); if (cp == NULL) { ZFS_LOG(1, "Provider %s not found.", vd->vdev_path); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:22:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81A771065670; Sat, 5 Dec 2009 20:22:26 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7055E8FC08; Sat, 5 Dec 2009 20:22:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KMQwR098956; Sat, 5 Dec 2009 20:22:26 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KMQNJ098953; Sat, 5 Dec 2009 20:22:26 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052022.nB5KMQNJ098953@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 20:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200160 - head/usr.bin/write X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:22:26 -0000 Author: ed Date: Sat Dec 5 20:22:26 2009 New Revision: 200160 URL: http://svn.freebsd.org/changeset/base/200160 Log: Let wall(1) use utmpx. Because our implementation guarantees the strings inside struct utmpx to be null terminated, we don't need to copy everything out, which makes the code nicer to read. Also set WARNS to 6 and add $FreeBSD$ to keep SVN happy. Modified: head/usr.bin/write/Makefile head/usr.bin/write/write.c Modified: head/usr.bin/write/Makefile ============================================================================== --- head/usr.bin/write/Makefile Sat Dec 5 20:17:04 2009 (r200159) +++ head/usr.bin/write/Makefile Sat Dec 5 20:22:26 2009 (r200160) @@ -1,7 +1,13 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= write BINMODE=2555 BINGRP= tty +WARNS?= 6 + +DPADD= ${LIBULOG} +LDADD= -lulog + .include Modified: head/usr.bin/write/write.c ============================================================================== --- head/usr.bin/write/write.c Sat Dec 5 20:17:04 2009 (r200159) +++ head/usr.bin/write/write.c Sat Dec 5 20:22:26 2009 (r200160) @@ -62,8 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include void done(int); void do_write(char *, char *, uid_t); @@ -146,20 +147,17 @@ usage(void) int utmp_chk(char *user, char *tty) { - struct utmp u; - int ufd; + struct utmpx lu, *u; - if ((ufd = open(_PATH_UTMP, O_RDONLY)) < 0) - return(0); /* ignore error, shouldn't happen anyway */ - - while (read(ufd, (char *) &u, sizeof(u)) == sizeof(u)) - if (strncmp(user, u.ut_name, sizeof(u.ut_name)) == 0 && - strncmp(tty, u.ut_line, sizeof(u.ut_line)) == 0) { - (void)close(ufd); + strncpy(lu.ut_line, tty, sizeof lu.ut_line); + setutxent(); + while ((u = getutxline(&lu)) != NULL) + if (u->ut_type == USER_PROCESS && + strcmp(user, u->ut_user) == 0) { + endutxent(); return(0); } - - (void)close(ufd); + endutxent(); return(1); } @@ -177,43 +175,40 @@ utmp_chk(char *user, char *tty) void search_utmp(char *user, char *tty, char *mytty, uid_t myuid) { - struct utmp u; + struct utmpx *u; time_t bestatime, atime; - int ufd, nloggedttys, nttys, msgsok, user_is_me; - char atty[UT_LINESIZE + 1]; - - if ((ufd = open(_PATH_UTMP, O_RDONLY)) < 0) - err(1, "utmp"); + int nloggedttys, nttys, msgsok, user_is_me; nloggedttys = nttys = 0; bestatime = 0; user_is_me = 0; - while (read(ufd, (char *) &u, sizeof(u)) == sizeof(u)) - if (strncmp(user, u.ut_name, sizeof(u.ut_name)) == 0) { + + setutxent(); + while ((u = getutxent()) != NULL) + if (u->ut_type == USER_PROCESS && + strcmp(user, u->ut_user) == 0) { ++nloggedttys; - (void)strncpy(atty, u.ut_line, UT_LINESIZE); - atty[UT_LINESIZE] = '\0'; - if (term_chk(atty, &msgsok, &atime, 0)) + if (term_chk(u->ut_line, &msgsok, &atime, 0)) continue; /* bad term? skip */ if (myuid && !msgsok) continue; /* skip ttys with msgs off */ - if (strcmp(atty, mytty) == 0) { + if (strcmp(u->ut_line, mytty) == 0) { user_is_me = 1; continue; /* don't write to yourself */ } ++nttys; if (atime > bestatime) { bestatime = atime; - (void)strcpy(tty, atty); + (void)strlcpy(tty, u->ut_line, MAXPATHLEN); } } + endutxent(); - (void)close(ufd); if (nloggedttys == 0) errx(1, "%s is not logged in", user); if (nttys == 0) { if (user_is_me) { /* ok, so write to yourself! */ - (void)strcpy(tty, mytty); + (void)strlcpy(tty, mytty, MAXPATHLEN); return; } errx(1, "%s has messages disabled", user); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:26:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA63110656AE; Sat, 5 Dec 2009 20:26:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C930F8FC18; Sat, 5 Dec 2009 20:26:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KQtUX099121; Sat, 5 Dec 2009 20:26:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KQtH6099116; Sat, 5 Dec 2009 20:26:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052026.nB5KQtH6099116@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 20:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200161 - in head/sbin: init reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:26:56 -0000 Author: ed Date: Sat Dec 5 20:26:55 2009 New Revision: 200161 URL: http://svn.freebsd.org/changeset/base/200161 Log: Let init(8) and reboot(8) use utmpx to log wtmp entries. logwtmp() gets called with the raw strings that are written to disk. For regular user entries, this isn't too bad, but when booting/shutting down, the contents get rather cryptic. Just call the standardized pututxline(). Modified: head/sbin/init/Makefile head/sbin/init/init.c head/sbin/reboot/Makefile head/sbin/reboot/reboot.c Modified: head/sbin/init/Makefile ============================================================================== --- head/sbin/init/Makefile Sat Dec 5 20:22:26 2009 (r200160) +++ head/sbin/init/Makefile Sat Dec 5 20:26:55 2009 (r200161) @@ -6,8 +6,8 @@ MAN= init.8 PRECIOUSPROG= INSTALLFLAGS=-b -B.bak CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT -DPADD= ${LIBUTIL} ${LIBCRYPT} -LDADD= -lutil -lcrypt +DPADD= ${LIBUTIL} ${LIBULOG} ${LIBCRYPT} +LDADD= -lutil -lulog -lcrypt NO_SHARED?= YES Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sat Dec 5 20:22:26 2009 (r200160) +++ head/sbin/init/init.c Sat Dec 5 20:26:55 2009 (r200161) @@ -65,6 +65,8 @@ static const char rcsid[] = #include #include #include +#define _ULOG_POSIX_NAMES +#include #include #include #include @@ -569,10 +571,8 @@ transition(state_t s) static void clear_session_logs(session_t *sp) { - char *line = sp->se_device + sizeof(_PATH_DEV) - 1; - if (logout(line)) - logwtmp(line, "", ""); + ulog_logout(sp->se_device); } /* @@ -775,6 +775,7 @@ single_user(void) static state_func_t runcom(void) { + struct utmpx utx; state_func_t next_transition; if ((next_transition = run_script(_PATH_RUNCOM)) != 0) @@ -782,7 +783,9 @@ runcom(void) runcom_mode = AUTOBOOT; /* the default */ /* NB: should send a message to the session logger to avoid blocking. */ - logwtmp("~", "reboot", ""); + utx.ut_type = BOOT_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); return (state_func_t) read_ttys; } @@ -1487,13 +1490,16 @@ alrm_handler(int sig) static state_func_t death(void) { + struct utmpx utx; session_t *sp; int i; pid_t pid; static const int death_sigs[2] = { SIGTERM, SIGKILL }; /* NB: should send a message to the session logger to avoid blocking. */ - logwtmp("~", "shutdown", ""); + utx.ut_type = SHUTDOWN_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); /* * Also revoke the TTY here. Because runshutdown() may reopen Modified: head/sbin/reboot/Makefile ============================================================================== --- head/sbin/reboot/Makefile Sat Dec 5 20:22:26 2009 (r200160) +++ head/sbin/reboot/Makefile Sat Dec 5 20:26:55 2009 (r200161) @@ -2,8 +2,8 @@ # $FreeBSD$ PROG= reboot -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBULOG} +LDADD= -lulog MAN= reboot.8 nextboot.8 MLINKS= reboot.8 halt.8 reboot.8 fastboot.8 reboot.8 fasthalt.8 Modified: head/sbin/reboot/reboot.c ============================================================================== --- head/sbin/reboot/reboot.c Sat Dec 5 20:22:26 2009 (r200160) +++ head/sbin/reboot/reboot.c Sat Dec 5 20:26:55 2009 (r200161) @@ -42,18 +42,20 @@ static char sccsid[] = "@(#)reboot.c 8.1 __FBSDID("$FreeBSD$"); #include +#include #include #include #include #include #include #include -#include #include #include #include #include #include +#define _ULOG_POSIX_NAMES +#include #include static void usage(void); @@ -64,6 +66,7 @@ int dohalt; int main(int argc, char *argv[]) { + struct utmpx utx; const struct passwd *pw; int ch, howto, i, fd, lflag, nflag, qflag, sverrno; u_int pageins; @@ -140,7 +143,9 @@ main(int argc, char *argv[]) syslog(LOG_CRIT, "rebooted by %s", user); } } - logwtmp("~", "shutdown", ""); + utx.ut_type = SHUTDOWN_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); /* * Do a sync early on, so disks start transfers while we're off From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:36:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFDBB106566C; Sat, 5 Dec 2009 20:36:42 +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 CE4EA8FC0C; Sat, 5 Dec 2009 20:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KagZ5099371; Sat, 5 Dec 2009 20:36:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5Kaghv099369; Sat, 5 Dec 2009 20:36:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912052036.nB5Kaghv099369@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 5 Dec 2009 20:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200162 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:36:43 -0000 Author: kib Date: Sat Dec 5 20:36:42 2009 New Revision: 200162 URL: http://svn.freebsd.org/changeset/base/200162 Log: Change VOP_FSYNC for zfs vnode from VOP_PANIC to zfs_freebsd_fsync(), both to not panic when fsync(2) is called for fifo on zfs filedescriptor, and to actually fsync fifo inode to permanent storage. PR: kern/141177 Reviewed by: pjd MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 5 20:26:55 2009 (r200161) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 5 20:36:42 2009 (r200162) @@ -5009,7 +5009,7 @@ struct vop_vector zfs_vnodeops = { struct vop_vector zfs_fifoops = { .vop_default = &fifo_specops, - .vop_fsync = VOP_PANIC, + .vop_fsync = zfs_freebsd_fsync, .vop_access = zfs_freebsd_access, .vop_getattr = zfs_freebsd_getattr, .vop_inactive = zfs_freebsd_inactive, From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:37:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9271065670; Sat, 5 Dec 2009 20:37:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9CD38FC0C; Sat, 5 Dec 2009 20:37:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5Kbkn8099440; Sat, 5 Dec 2009 20:37:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KbkrD099429; Sat, 5 Dec 2009 20:37:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912052037.nB5KbkrD099429@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 20:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200163 - in stable/8: share/man/man4 sys/amd64/conf sys/boot/forth sys/conf sys/dev/lindev sys/i386/conf sys/modules sys/modules/lindev sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:37:47 -0000 Author: bz Date: Sat Dec 5 20:37:46 2009 New Revision: 200163 URL: http://svn.freebsd.org/changeset/base/200163 Log: MFC r197518: lindev(4) [1] is supposed to be a collection of linux-specific pseudo devices that we also support, just not by default (thus only LINT or module builds by default). While currently there is only "/dev/full" [2], we are planning to see more in the future. We may decide to change the module/dependency logic in the future should the list grow too long. This is not part of linux.ko as also non-linux binaries like kFreeBSD userland or ports can make use of this as well. Suggested by: rwatson [1] (name) Submitted by: ed [2] Discussed with: markm, ed, rwatson, kib (weeks ago) Reviewed by: rwatson, brueffer (prev. version) PR: kern/68961 Added: stable/8/share/man/man4/lindev.4 - copied unchanged from r197518, head/share/man/man4/lindev.4 stable/8/sys/dev/lindev/ - copied from r197518, head/sys/dev/lindev/ stable/8/sys/modules/lindev/ - copied from r197518, head/sys/modules/lindev/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/amd64/conf/NOTES stable/8/sys/boot/forth/loader.conf stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.pc98 stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile stable/8/sys/pc98/conf/NOTES Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/share/man/man4/Makefile Sat Dec 5 20:37:46 2009 (r200163) @@ -173,6 +173,7 @@ MAN= aac.4 \ le.4 \ led.4 \ lge.4 \ + ${_lindev.4} \ ${_linux.4} \ lmc.4 \ lo.4 \ @@ -624,6 +625,7 @@ _if_urtw.4= if_urtw.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 +_lindev.4= lindev.4 _linux.4= linux.4 _ndis.4= ndis.4 _nfe.4= nfe.4 @@ -635,6 +637,8 @@ _speaker.4= speaker.4 _spkr.4= spkr.4 _urtw.4= urtw.4 _wpi.4= wpi.4 + +MLINKS+=lindev.4 full.4 .endif .if exists(${.CURDIR}/man4.${MACHINE_ARCH}) Copied: stable/8/share/man/man4/lindev.4 (from r197518, head/share/man/man4/lindev.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/lindev.4 Sat Dec 5 20:37:46 2009 (r200163, copy of r197518, head/share/man/man4/lindev.4) @@ -0,0 +1,73 @@ +.\"- +.\" Copyright (c) 2009 "Bjoern A. Zeeb" +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 26, 2009 +.Dt LINDEV 4 +.Os +.Sh NAME +.Nm lindev +.Nd the lindev module +.Sh SYNOPSIS +To compile this collection of linux-specific pseudo devices into the kernel, +place the following line in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device lindev" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, +place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +lindev_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +module provides a collection of linux-specific pseudo devices. +.Sh DEVICES +.Bl -tag -width /dev/full +.It Pa /dev/full +The +.Xr full +device always returns +.Er ENOSPC +on write attempts. +For reads it emulates +.Xr zero 4 . +.El +.Sh FILES +.Bl -tag -width /dev/full +.It Pa /dev/full +.El +.Sh SEE ALSO +.Xr null 4 , +.Xr zero 4 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 9.0 . Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/amd64/conf/NOTES Sat Dec 5 20:37:46 2009 (r200163) @@ -503,3 +503,6 @@ options VM_KMEM_SIZE_SCALE # Enable NDIS binary driver support options NDISAPI device ndis + +# Linux-specific pseudo devices support +device lindev Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/boot/forth/loader.conf Sat Dec 5 20:37:46 2009 (r200163) @@ -179,6 +179,7 @@ screensave_name="green_saver" # Set to t ibcs2_load="NO" # IBCS2 (SCO) emulation ibcs2_coff_load="NO" linux_load="NO" # Linux emulation +lindev_load="NO" # Linux-specific pseudo devices (see lindev(4)) svr4_load="NO" # SystemV R4 emulation streams_load="NO" # System V streams module Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/conf/files.amd64 Sat Dec 5 20:37:46 2009 (r200163) @@ -205,6 +205,8 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/conf/files.i386 Sat Dec 5 20:37:46 2009 (r200163) @@ -198,6 +198,8 @@ dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd dev/le/if_le_isa.c optional le isa +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/conf/files.pc98 Sat Dec 5 20:37:46 2009 (r200163) @@ -107,6 +107,8 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd | sc | ukbd | usb2_input_kbd dev/le/if_le_cbus.c optional le isa +dev/lindev/full.c optional lindev +dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/i386/conf/NOTES Sat Dec 5 20:37:46 2009 (r200163) @@ -876,6 +876,9 @@ device streams # STREAMS network drive options NDISAPI device ndis +# Linux-specific pseudo devices support +device lindev + ##################################################################### # VM OPTIONS Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/modules/Makefile Sat Dec 5 20:37:46 2009 (r200163) @@ -150,6 +150,7 @@ SUBDIR= ${_3dfx} \ libiconv \ libmbpool \ libmchain \ + ${_lindev} \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ @@ -370,6 +371,7 @@ _ie= ie _if_ndis= if_ndis _igb= igb _io= io +_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux @@ -505,6 +507,7 @@ _ipwfw= ipwfw _iwn= iwn _iwnfw= iwnfw _ixgb= ixgb +_lindev= lindev _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux Modified: stable/8/sys/pc98/conf/NOTES ============================================================================== --- stable/8/sys/pc98/conf/NOTES Sat Dec 5 20:36:42 2009 (r200162) +++ stable/8/sys/pc98/conf/NOTES Sat Dec 5 20:37:46 2009 (r200163) @@ -565,6 +565,9 @@ options COMPAT_SVR4 # build emulator st options DEBUG_SVR4 # enable verbose debugging device streams # STREAMS network driver (required for svr4). +# Linux-specific pseudo devices support +device lindev + ##################################################################### # VM OPTIONS From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:40:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F66210656C0; Sat, 5 Dec 2009 20:40:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E1CE8FC1D; Sat, 5 Dec 2009 20:40:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KeS7L099607; Sat, 5 Dec 2009 20:40:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KeS8X099605; Sat, 5 Dec 2009 20:40:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912052040.nB5KeS8X099605@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 20:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200164 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:40:29 -0000 Author: bz Date: Sat Dec 5 20:40:28 2009 New Revision: 200164 URL: http://svn.freebsd.org/changeset/base/200164 Log: MFC r197726: Print a warning in case we cannot add more brandinfo because we would overflow the MAX_BRANDS sized array. Reviewed by: kib Modified: stable/8/sys/kern/imgact_elf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/imgact_elf.c ============================================================================== --- stable/8/sys/kern/imgact_elf.c Sat Dec 5 20:37:46 2009 (r200163) +++ stable/8/sys/kern/imgact_elf.c Sat Dec 5 20:40:28 2009 (r200164) @@ -180,8 +180,11 @@ __elfN(insert_brand_entry)(Elf_Brandinfo break; } } - if (i == MAX_BRANDS) + if (i == MAX_BRANDS) { + printf("WARNING: %s: could not insert brandinfo entry: %p\n", + __func__, entry); return (-1); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:43:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46A841065672; Sat, 5 Dec 2009 20:43:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32A0A8FC0C; Sat, 5 Dec 2009 20:43:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KhFQJ099710; Sat, 5 Dec 2009 20:43:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KhF39099700; Sat, 5 Dec 2009 20:43:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912052043.nB5KhF39099700@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 5 Dec 2009 20:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200165 - in stable/8/sys: amd64/amd64 arm/arm compat/ia32 i386/i386 ia64/ia64 mips/mips powerpc/powerpc sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:43:16 -0000 Author: bz Date: Sat Dec 5 20:43:15 2009 New Revision: 200165 URL: http://svn.freebsd.org/changeset/base/200165 Log: MFC r197729: Make sure that the primary native brandinfo always gets added first and the native ia32 compat as middle (before other things). o(ld)brandinfo as well as third party like linux, kfreebsd, etc. stays on SI_ORDER_ANY coming last. The reason for this is only to make sure that even in case we would overflow the MAX_BRANDS sized array, the native FreeBSD brandinfo would still be there and the system would be operational. Reviewed by: kib Modified: stable/8/sys/amd64/amd64/elf_machdep.c stable/8/sys/arm/arm/elf_machdep.c stable/8/sys/compat/ia32/ia32_sysvec.c stable/8/sys/i386/i386/elf_machdep.c stable/8/sys/ia64/ia64/elf_machdep.c stable/8/sys/mips/mips/elf64_machdep.c stable/8/sys/mips/mips/elf_machdep.c stable/8/sys/powerpc/powerpc/elf_machdep.c stable/8/sys/sparc64/sparc64/elf_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/elf_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/amd64/amd64/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -89,7 +89,7 @@ static Elf64_Brandinfo freebsd_brand_inf .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info); Modified: stable/8/sys/arm/arm/elf_machdep.c ============================================================================== --- stable/8/sys/arm/arm/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/arm/arm/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -88,7 +88,7 @@ static Elf32_Brandinfo freebsd_brand_inf .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_info); Modified: stable/8/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/8/sys/compat/ia32/ia32_sysvec.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/compat/ia32/ia32_sysvec.c Sat Dec 5 20:43:15 2009 (r200165) @@ -152,7 +152,7 @@ static Elf32_Brandinfo ia32_brand_info = .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_MIDDLE, (sysinit_cfunc_t) elf32_insert_brand_entry, &ia32_brand_info); Modified: stable/8/sys/i386/i386/elf_machdep.c ============================================================================== --- stable/8/sys/i386/i386/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/i386/i386/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -88,7 +88,7 @@ static Elf32_Brandinfo freebsd_brand_inf .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_info); Modified: stable/8/sys/ia64/ia64/elf_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/ia64/ia64/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -95,7 +95,7 @@ static Elf64_Brandinfo freebsd_brand_inf .brand_note = &elf64_freebsd_brandnote, .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); static Elf64_Brandinfo freebsd_brand_oinfo = { Modified: stable/8/sys/mips/mips/elf64_machdep.c ============================================================================== --- stable/8/sys/mips/mips/elf64_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/mips/mips/elf64_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -108,7 +108,7 @@ static Elf64_Brandinfo freebsd_brand_inf .flags = BI_BRAND_NOTE }; -SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info64); Modified: stable/8/sys/mips/mips/elf_machdep.c ============================================================================== --- stable/8/sys/mips/mips/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/mips/mips/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -90,7 +90,7 @@ static Elf32_Brandinfo freebsd_brand_inf .flags = BI_BRAND_NOTE }; -SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_info); Modified: stable/8/sys/powerpc/powerpc/elf_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/powerpc/powerpc/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -91,7 +91,7 @@ static Elf32_Brandinfo freebsd_brand_inf .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf32_insert_brand_entry, &freebsd_brand_info); Modified: stable/8/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/elf_machdep.c Sat Dec 5 20:40:28 2009 (r200164) +++ stable/8/sys/sparc64/sparc64/elf_machdep.c Sat Dec 5 20:43:15 2009 (r200165) @@ -103,7 +103,7 @@ static Elf64_Brandinfo freebsd_brand_inf .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; -SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, +SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info); From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:44:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1D8106566B; Sat, 5 Dec 2009 20:44:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB8F58FC22; Sat, 5 Dec 2009 20:44:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KiJBO099795; Sat, 5 Dec 2009 20:44:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KiJPa099792; Sat, 5 Dec 2009 20:44:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052044.nB5KiJPa099792@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 20:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200166 - head/usr.bin/who X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:44:19 -0000 Author: ed Date: Sat Dec 5 20:44:19 2009 New Revision: 200166 URL: http://svn.freebsd.org/changeset/base/200166 Log: Port who(1) to utmpx. (Un)fortunately there is no standardized interface to switch between utmp database files, so we must call ulog_setutxfile() here. I'm also changing the column widths to magic numbers here. Display layout should in this case not be derived from structure fields sizes. Because I don't want struct utmpx ever to become too small, the fields are too big to reserve all the space. Modified: head/usr.bin/who/Makefile head/usr.bin/who/who.c Modified: head/usr.bin/who/Makefile ============================================================================== --- head/usr.bin/who/Makefile Sat Dec 5 20:43:15 2009 (r200165) +++ head/usr.bin/who/Makefile Sat Dec 5 20:44:19 2009 (r200166) @@ -1,5 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= who +WARNS= 6 + +DPADD= ${LIBULOG} +LDADD= -lulog + .include Modified: head/usr.bin/who/who.c ============================================================================== --- head/usr.bin/who/who.c Sat Dec 5 20:43:15 2009 (r200165) +++ head/usr.bin/who/who.c Sat Dec 5 20:44:19 2009 (r200166) @@ -44,16 +44,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include static void heading(void); -static void process_utmp(FILE *); -static void quick(FILE *); -static void row(struct utmp *); +static void process_utmp(void); +static void quick(void); +static void row(struct utmpx *); static int ttywidth(void); static void usage(void); -static void whoami(FILE *); +static void whoami(void); static int Hflag; /* Write column headings */ static int mflag; /* Show info about current terminal */ @@ -66,8 +67,6 @@ int main(int argc, char *argv[]) { int ch; - const char *file; - FILE *fp; setlocale(LC_TIME, ""); @@ -109,27 +108,25 @@ main(int argc, char *argv[]) if (argc > 1) usage(); - if (*argv != NULL) - file = *argv; - else - file = _PATH_UTMP; - if ((fp = fopen(file, "r")) == NULL) - err(1, "%s", file); + if (*argv != NULL) { + if (ulog_setutxfile(UTXF_UTMP, *argv) != 0) + err(1, "%s", *argv); + } if (qflag) - quick(fp); + quick(); else { if (sflag) Tflag = uflag = 0; if (Hflag) heading(); if (mflag) - whoami(fp); + whoami(); else - process_utmp(fp); + process_utmp(); } - fclose(fp); + endutxent(); exit(0); } @@ -146,21 +143,19 @@ static void heading(void) { - printf("%-*s ", UT_NAMESIZE, "NAME"); + printf("%-16s ", "NAME"); if (Tflag) printf("S "); - printf("%-*s ", UT_LINESIZE, "LINE"); - printf("%-*s ", 12, "TIME"); + printf("%-8s %-12s ", "LINE", "TIME"); if (uflag) printf("IDLE "); - printf("%-*s", UT_HOSTSIZE, "FROM"); - putchar('\n'); + printf("%-16s\n", "FROM"); } static void -row(struct utmp *ut) +row(struct utmpx *ut) { - char buf[80], tty[sizeof(_PATH_DEV) + UT_LINESIZE]; + char buf[80], tty[PATH_MAX]; struct stat sb; time_t idle, t; static int d_first = -1; @@ -173,8 +168,7 @@ row(struct utmp *ut) state = '?'; idle = 0; if (Tflag || uflag) { - snprintf(tty, sizeof(tty), "%s%.*s", _PATH_DEV, - UT_LINESIZE, ut->ut_line); + snprintf(tty, sizeof(tty), "%s%s", _PATH_DEV, ut->ut_line); if (stat(tty, &sb) == 0) { state = sb.st_mode & (S_IWOTH|S_IWGRP) ? '+' : '-'; @@ -182,11 +176,11 @@ row(struct utmp *ut) } } - printf("%-*.*s ", UT_NAMESIZE, UT_NAMESIZE, ut->ut_name); + printf("%-16s ", ut->ut_user); if (Tflag) printf("%c ", state); - printf("%-*.*s ", UT_LINESIZE, UT_LINESIZE, ut->ut_line); - t = _time32_to_time(ut->ut_time); + printf("%-8s ", ut->ut_line); + t = ut->ut_tv.tv_sec; tm = localtime(&t); strftime(buf, sizeof(buf), d_first ? "%e %b %R" : "%b %e %R", tm); printf("%-*s ", 12, buf); @@ -200,17 +194,17 @@ row(struct utmp *ut) printf(" old "); } if (*ut->ut_host != '\0') - printf("(%.*s)", UT_HOSTSIZE, ut->ut_host); + printf("(%s)", ut->ut_host); putchar('\n'); } static int -ttystat(char *line, int sz) +ttystat(char *line) { struct stat sb; char ttybuf[MAXPATHLEN]; - (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line); + (void)snprintf(ttybuf, sizeof(ttybuf), "%s%s", _PATH_DEV, line); if (stat(ttybuf, &sb) == 0) { return (0); } else @@ -218,32 +212,32 @@ ttystat(char *line, int sz) } static void -process_utmp(FILE *fp) +process_utmp(void) { - struct utmp ut; + struct utmpx *utx; - while (fread(&ut, sizeof(ut), 1, fp) == 1) { - if (*ut.ut_name == '\0') + while ((utx = getutxent()) != NULL) { + if (utx->ut_type != USER_PROCESS) continue; - if (ttystat(ut.ut_line, UT_LINESIZE) != 0) + if (ttystat(utx->ut_line) != 0) continue; - row(&ut); + row(utx); } } static void -quick(FILE *fp) +quick(void) { - struct utmp ut; + struct utmpx *utx; int col, ncols, num; ncols = ttywidth(); col = num = 0; - while (fread(&ut, sizeof(ut), 1, fp) == 1) { - if (*ut.ut_name == '\0') + while ((utx = getutxent()) != NULL) { + if (utx->ut_type != USER_PROCESS) continue; - printf("%-*.*s", UT_NAMESIZE, UT_NAMESIZE, ut.ut_name); - if (++col < ncols / (UT_NAMESIZE + 1)) + printf("%-16s", utx->ut_user); + if (++col < ncols / (16 + 1)) putchar(' '); else { col = 0; @@ -258,24 +252,23 @@ quick(FILE *fp) } static void -whoami(FILE *fp) +whoami(void) { - struct utmp ut; + struct utmpx ut, *utx; struct passwd *pwd; - const char *name, *p, *tty; + const char *name, *tty; if ((tty = ttyname(STDIN_FILENO)) == NULL) tty = "tty??"; - else if ((p = strrchr(tty, '/')) != NULL) - tty = p + 1; + else if (strncmp(tty, _PATH_DEV, sizeof _PATH_DEV - 1) == 0) + tty += sizeof _PATH_DEV - 1; + strlcpy(ut.ut_line, tty, sizeof ut.ut_line); /* Search utmp for our tty, dump first matching record. */ - while (fread(&ut, sizeof(ut), 1, fp) == 1) - if (*ut.ut_name != '\0' && strncmp(ut.ut_line, tty, - UT_LINESIZE) == 0) { - row(&ut); - return; - } + if ((utx = getutxline(&ut)) != NULL && utx->ut_type == USER_PROCESS) { + row(utx); + return; + } /* Not found; fill the utmp structure with the information we have. */ memset(&ut, 0, sizeof(ut)); @@ -283,9 +276,8 @@ whoami(FILE *fp) name = pwd->pw_name; else name = "?"; - strncpy(ut.ut_name, name, UT_NAMESIZE); - strncpy(ut.ut_line, tty, UT_LINESIZE); - ut.ut_time = _time_to_time32(time(NULL)); + strlcpy(ut.ut_user, name, sizeof ut.ut_user); + gettimeofday(&ut.ut_tv, NULL); row(&ut); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 20:52:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 983EF1065670; Sat, 5 Dec 2009 20:52:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DFF28FC12; Sat, 5 Dec 2009 20:52:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5KqCNa099975; Sat, 5 Dec 2009 20:52:12 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5KqCbZ099972; Sat, 5 Dec 2009 20:52:12 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052052.nB5KqCbZ099972@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 20:52:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200167 - head/usr.bin/systat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 20:52:12 -0000 Author: ed Date: Sat Dec 5 20:52:11 2009 New Revision: 200167 URL: http://svn.freebsd.org/changeset/base/200167 Log: Let systat's vmstat use utmpx. Modified: head/usr.bin/systat/Makefile head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Sat Dec 5 20:44:19 2009 (r200166) +++ head/usr.bin/systat/Makefile Sat Dec 5 20:52:11 2009 (r200167) @@ -14,7 +14,7 @@ SRCS+= icmp6.c ip6.c CFLAGS+= -DINET6 .endif -DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} -LDADD= -lcursesw -lm -ldevstat -lkvm +DPADD= ${LIBCURSES} ${LIBM} ${LIBDEVSTAT} ${LIBKVM} ${LIBULOG} +LDADD= -lcursesw -lm -ldevstat -lkvm -lulog .include Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Sat Dec 5 20:44:19 2009 (r200166) +++ head/usr.bin/systat/vmstat.c Sat Dec 5 20:52:11 2009 (r200167) @@ -65,8 +65,9 @@ static const char sccsid[] = "@(#)vmstat #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include #include "systat.h" #include "extern.h" @@ -141,7 +142,6 @@ static void putlongdouble(long double, i static int ucount(void); static int ncpu; -static int ut; static char buf[26]; static time_t t; static double etime; @@ -150,16 +150,10 @@ static long *intrloc; static char **intrname; static int nextintsrow; -struct utmp utmp; - - WINDOW * openkre(void) { - ut = open(_PATH_UTMP, O_RDONLY); - if (ut < 0) - error("No utmp"); return (stdscr); } @@ -167,7 +161,6 @@ void closekre(WINDOW *w) { - (void) close(ut); if (w == NULL) return; wclear(w); @@ -634,14 +627,14 @@ static int ucount(void) { int nusers = 0; + struct utmpx *ut; - if (ut < 0) - return (0); - while (read(ut, &utmp, sizeof(utmp))) - if (utmp.ut_name[0] != '\0') + setutxent(); + while ((ut = getutxent()) != NULL) + if (ut->ut_type == USER_PROCESS) nusers++; + endutxent(); - lseek(ut, 0L, L_SET); return (nusers); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 23:23:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 750AC1065670; Sat, 5 Dec 2009 23:23:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 645768FC17; Sat, 5 Dec 2009 23:23:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5NNk64003115; Sat, 5 Dec 2009 23:23:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5NNkcC003113; Sat, 5 Dec 2009 23:23:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912052323.nB5NNkcC003113@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 23:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200169 - head/rescue/rescue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 23:23:46 -0000 Author: ed Date: Sat Dec 5 23:23:46 2009 New Revision: 200169 URL: http://svn.freebsd.org/changeset/base/200169 Log: Unbreak rescue(8). We should also link against libulog now. Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sat Dec 5 21:50:06 2009 (r200168) +++ head/rescue/rescue/Makefile Sat Dec 5 23:23:46 2009 (r200169) @@ -72,7 +72,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lulog -lutil # Additional options for specific programs CRUNCH_ALIAS_test= [ From owner-svn-src-all@FreeBSD.ORG Sat Dec 5 23:27:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BEC5106566C; Sat, 5 Dec 2009 23:27:21 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE508FC18; Sat, 5 Dec 2009 23:27:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB5NRLuh003223; Sat, 5 Dec 2009 23:27:21 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5NRLOr003221; Sat, 5 Dec 2009 23:27:21 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <200912052327.nB5NRLOr003221@svn.freebsd.org> From: Oleg Bulyzhin Date: Sat, 5 Dec 2009 23:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200170 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2009 23:27:21 -0000 Author: oleg Date: Sat Dec 5 23:27:21 2009 New Revision: 200170 URL: http://svn.freebsd.org/changeset/base/200170 Log: Fix burst processing for WF2Q pipes - do not increase available burst size unless pipe is idle. This should fix follwing issues: - 'dummynet: OUCH! pipe should have been idle!' log messages. - exceeding configured pipe bandwidth. MFC after: 1 week Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Sat Dec 5 23:23:46 2009 (r200169) +++ head/sys/netinet/ipfw/ip_dummynet.c Sat Dec 5 23:27:21 2009 (r200170) @@ -1447,7 +1447,9 @@ dummynet_io(struct mbuf **m0, int dir, s q->numbytes += pipe->bandwidth; } } else { /* WF2Q. */ - if (pipe->idle_time < curr_time) { + if (pipe->idle_time < curr_time && + pipe->scheduler_heap.elements == 0 && + pipe->not_eligible_heap.elements == 0) { /* Calculate available burst size. */ pipe->numbytes += (curr_time - pipe->idle_time - 1) * pipe->bandwidth;