From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 09:07: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 81EDC106566B; Sun, 4 Oct 2009 09:07:30 +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 6FA728FC19; Sun, 4 Oct 2009 09:07: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 n9497Usp068279; Sun, 4 Oct 2009 09:07:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9497UuL068278; Sun, 4 Oct 2009 09:07:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200910040907.n9497UuL068278@svn.freebsd.org> From: Xin LI Date: Sun, 4 Oct 2009 09:07:30 +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: r197738 - in stable/8/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: Sun, 04 Oct 2009 09:07:30 -0000 Author: delphij Date: Sun Oct 4 09:07:29 2009 New Revision: 197738 URL: http://svn.freebsd.org/changeset/base/197738 Log: MFC revision 197683: Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old format ZFS, as defined in the manual page. Submitted by: pjd (response of my original patch but bugs are mine) Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 3 17:49:44 2009 (r197737) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Oct 4 09:07:29 2009 (r197738) @@ -4172,8 +4172,12 @@ zfs_freebsd_setattr(ap) zflags = VTOZ(vp)->z_phys->zp_flags; if (vap->va_flags != VNOVAL) { + zfsvfs_t *zfsvfs = VTOZ(vp)->z_zfsvfs; int error; + if (zfsvfs->z_use_fuids == B_FALSE) + return (EOPNOTSUPP); + fflags = vap->va_flags; if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_NODUMP)) != 0) return (EOPNOTSUPP); From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 09:57: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 41411106568F; Sun, 4 Oct 2009 09:57:40 +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 2E75D8FC14; Sun, 4 Oct 2009 09:57: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 n949veGQ069458; Sun, 4 Oct 2009 09:57:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n949veVx069457; Sun, 4 Oct 2009 09:57:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200910040957.n949veVx069457@svn.freebsd.org> From: Xin LI Date: Sun, 4 Oct 2009 09:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197739 - in stable/8/sys: amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2009 09:57:40 -0000 Author: delphij Date: Sun Oct 4 09:57:39 2009 New Revision: 197739 URL: http://svn.freebsd.org/changeset/base/197739 Log: This commit adds subdirectory mergeinfo which was intentionally ommitted from previous changeset. Requested by: kib Approved by: re (kib) Modified: 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) From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 10:38: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 346A71065672; Sun, 4 Oct 2009 10:38:05 +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 239F28FC17; Sun, 4 Oct 2009 10:38: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 n94Ac5UP070349; Sun, 4 Oct 2009 10:38:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94Ac5U7070347; Sun, 4 Oct 2009 10:38:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200910041038.n94Ac5U7070347@svn.freebsd.org> From: Xin LI Date: Sun, 4 Oct 2009 10:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197740 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2009 10:38:05 -0000 Author: delphij Date: Sun Oct 4 10:38:04 2009 New Revision: 197740 URL: http://svn.freebsd.org/changeset/base/197740 Log: Fix a bug that causes the fsx test case of mmap'ed page being out of sync of read/write, inspired by ZFS's counterpart. PR: kern/139312 Submitted by: gk@ MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sun Oct 4 09:57:39 2009 (r197739) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sun Oct 4 10:38:04 2009 (r197740) @@ -444,7 +444,8 @@ tmpfs_mappedread(vm_object_t vobj, vm_ob offset = addr & PAGE_MASK; tlen = MIN(PAGE_SIZE - offset, len); - if ((vobj == NULL) || (vobj->resident_page_count == 0)) + if ((vobj == NULL) || + (vobj->resident_page_count == 0 && vobj->cache == NULL)) goto nocache; VM_OBJECT_LOCK(vobj); @@ -555,7 +556,8 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o offset = addr & PAGE_MASK; tlen = MIN(PAGE_SIZE - offset, len); - if ((vobj == NULL) || (vobj->resident_page_count == 0)) { + if ((vobj == NULL) || + (vobj->resident_page_count == 0 && vobj->cache == NULL)) { vpg = NULL; goto nocache; } @@ -573,6 +575,8 @@ lookupvpg: VM_OBJECT_UNLOCK(vobj); error = uiomove_fromphys(&vpg, offset, tlen, uio); } else { + if (__predict_false(vobj->cache != NULL)) + vm_page_cache_free(vobj, idx, idx + 1); VM_OBJECT_UNLOCK(vobj); vpg = NULL; } From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 10:54: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 A1C3D106568F; Sun, 4 Oct 2009 10:54:20 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90F1C8FC08; Sun, 4 Oct 2009 10:54: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 n94AsKvh071709; Sun, 4 Oct 2009 10:54:20 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94AsKTI071707; Sun, 4 Oct 2009 10:54:20 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910041054.n94AsKTI071707@svn.freebsd.org> From: Rui Paulo Date: Sun, 4 Oct 2009 10:54: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: r197741 - head/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2009 10:54:20 -0000 Author: rpaulo Date: Sun Oct 4 10:54:20 2009 New Revision: 197741 URL: http://svn.freebsd.org/changeset/base/197741 Log: Install x86 related man pages on x86 systems only. Reviewed by: jkoshy Modified: head/lib/libpmc/Makefile Modified: head/lib/libpmc/Makefile ============================================================================== --- head/lib/libpmc/Makefile Sun Oct 4 10:38:04 2009 (r197740) +++ head/lib/libpmc/Makefile Sun Oct 4 10:54:20 2009 (r197741) @@ -24,6 +24,7 @@ MAN+= pmc_start.3 MAN+= pmclog.3 # PMC-dependent manual pages +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 @@ -34,6 +35,7 @@ MAN+= pmc.p4.3 MAN+= pmc.p5.3 MAN+= pmc.p6.3 MAN+= pmc.tsc.3 +.endif MLINKS+= \ pmc_allocate.3 pmc_release.3 \ From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 12:11: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 D52421065693; Sun, 4 Oct 2009 12:11:44 +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 C14EC8FC0C; Sun, 4 Oct 2009 12:11: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 n94CBiwj073360; Sun, 4 Oct 2009 12:11:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94CBiNF073358; Sun, 4 Oct 2009 12:11:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910041211.n94CBiNF073358@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Oct 2009 12:11: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: r197742 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2009 12:11:45 -0000 Author: kib Date: Sun Oct 4 12:11:44 2009 New Revision: 197742 URL: http://svn.freebsd.org/changeset/base/197742 Log: MFC r197660: Fix typo. Approved by: re (bz, kensmith) Modified: 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/sys/kern/kern_sig.c Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Sun Oct 4 10:54:20 2009 (r197741) +++ stable/8/sys/kern/kern_sig.c Sun Oct 4 12:11:44 2009 (r197742) @@ -1888,7 +1888,7 @@ sigtd(struct proc *p, int sig, int prop) /* * Check if current thread can handle the signal without - * switching conetxt to another thread. + * switching context to another thread. */ if (curproc == p && !SIGISMEMBER(curthread->td_sigmask, sig)) return (curthread); From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 12:14: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 D46D61065670; Sun, 4 Oct 2009 12:14:49 +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 A7B758FC23; Sun, 4 Oct 2009 12:14: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 n94CEnjt073468; Sun, 4 Oct 2009 12:14:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94CEnMA073466; Sun, 4 Oct 2009 12:14:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910041214.n94CEnMA073466@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Oct 2009 12:14: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: r197743 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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: Sun, 04 Oct 2009 12:14:49 -0000 Author: kib Date: Sun Oct 4 12:14:49 2009 New Revision: 197743 URL: http://svn.freebsd.org/changeset/base/197743 Log: MFC r197661: Move the annotation for vm_map_startup() immediately before the function. Approved by: re (bz, kensmith) Modified: 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/sys/vm/vm_map.c Modified: stable/8/sys/vm/vm_map.c ============================================================================== --- stable/8/sys/vm/vm_map.c Sun Oct 4 12:11:44 2009 (r197742) +++ stable/8/sys/vm/vm_map.c Sun Oct 4 12:14:49 2009 (r197743) @@ -116,22 +116,6 @@ __FBSDID("$FreeBSD$"); * another, and then marking both regions as copy-on-write. */ -/* - * vm_map_startup: - * - * Initialize the vm_map module. Must be called before - * any other vm_map routines. - * - * Map and entry structures are allocated from the general - * purpose memory pool with some exceptions: - * - * - The kernel map and kmem submap are allocated statically. - * - Kernel map entries are allocated out of a static pool. - * - * These restrictions are necessary since malloc() uses the - * maps and requires map entries. - */ - static struct mtx map_sleep_mtx; static uma_zone_t mapentzone; static uma_zone_t kmapentzone; @@ -176,6 +160,22 @@ static void vmspace_zdtor(void *mem, int start = end; \ } +/* + * vm_map_startup: + * + * Initialize the vm_map module. Must be called before + * any other vm_map routines. + * + * Map and entry structures are allocated from the general + * purpose memory pool with some exceptions: + * + * - The kernel map and kmem submap are allocated statically. + * - Kernel map entries are allocated out of a static pool. + * + * These restrictions are necessary since malloc() uses the + * maps and requires map entries. + */ + void vm_map_startup(void) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 12:21: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 3D6931065670; Sun, 4 Oct 2009 12:21: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 0EDDE8FC1A; Sun, 4 Oct 2009 12:21: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 n94CKxe2073642; Sun, 4 Oct 2009 12:20:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94CKxTH073639; Sun, 4 Oct 2009 12:20:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910041220.n94CKxTH073639@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Oct 2009 12:20: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: r197744 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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: Sun, 04 Oct 2009 12:21:00 -0000 Author: kib Date: Sun Oct 4 12:20:59 2009 New Revision: 197744 URL: http://svn.freebsd.org/changeset/base/197744 Log: MFC r197663: As a workaround, for Intel CPUs, do not use CLFLUSH in pmap_invalidate_cache_range() when self-snoop is apparently not reported in cpu features. Approved by: re (bz, kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/amd64/initcpu.c 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/sys/i386/i386/initcpu.c Modified: stable/8/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/initcpu.c Sun Oct 4 12:14:49 2009 (r197743) +++ stable/8/sys/amd64/amd64/initcpu.c Sun Oct 4 12:20:59 2009 (r197744) @@ -165,4 +165,10 @@ initializecpu(void) */ if ((cpu_feature & CPUID_CLFSH) != 0) cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; + /* + * XXXKIB: (temporary) hack to work around traps generated when + * CLFLUSHing APIC registers window. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + cpu_feature &= ~CPUID_CLFSH; } Modified: stable/8/sys/i386/i386/initcpu.c ============================================================================== --- stable/8/sys/i386/i386/initcpu.c Sun Oct 4 12:14:49 2009 (r197743) +++ stable/8/sys/i386/i386/initcpu.c Sun Oct 4 12:20:59 2009 (r197744) @@ -717,6 +717,12 @@ initializecpu(void) */ if ((cpu_feature & CPUID_CLFSH) != 0) cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8; + /* + * XXXKIB: (temporary) hack to work around traps generated when + * CLFLUSHing APIC registers window. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + cpu_feature &= ~CPUID_CLFSH; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) /* From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 13:00: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 E3B2D106566B; Sun, 4 Oct 2009 13:00:27 +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 D19AB8FC13; Sun, 4 Oct 2009 13:00: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 n94D0RA2074542; Sun, 4 Oct 2009 13:00:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94D0Rfj074540; Sun, 4 Oct 2009 13:00:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910041300.n94D0Rfj074540@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Oct 2009 13:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197745 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2009 13:00:28 -0000 Author: kib Date: Sun Oct 4 13:00:27 2009 New Revision: 197745 URL: http://svn.freebsd.org/changeset/base/197745 Log: MFC r197660: Fix typo. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/kern_sig.c Modified: stable/7/sys/kern/kern_sig.c ============================================================================== --- stable/7/sys/kern/kern_sig.c Sun Oct 4 12:20:59 2009 (r197744) +++ stable/7/sys/kern/kern_sig.c Sun Oct 4 13:00:27 2009 (r197745) @@ -1953,7 +1953,7 @@ sigtd(struct proc *p, int sig, int prop) /* * Check if current thread can handle the signal without - * switching conetxt to another thread. + * switching context to another thread. */ if (curproc == p && !SIGISMEMBER(curthread->td_sigmask, sig)) return (curthread); From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 13:03: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 DAC1F106566B; Sun, 4 Oct 2009 13:03:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87048FC13; Sun, 4 Oct 2009 13:03: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 n94D37BI074649; Sun, 4 Oct 2009 13:03:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94D37MK074647; Sun, 4 Oct 2009 13:03:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910041303.n94D37MK074647@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 4 Oct 2009 13:03: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: r197746 - in stable/7/sys: . contrib/pf 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: Sun, 04 Oct 2009 13:03:08 -0000 Author: kib Date: Sun Oct 4 13:03:07 2009 New Revision: 197746 URL: http://svn.freebsd.org/changeset/base/197746 Log: MFC r197661: Move the annotation for vm_map_startup() immediately before the function. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/vm/vm_map.c Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Sun Oct 4 13:00:27 2009 (r197745) +++ stable/7/sys/vm/vm_map.c Sun Oct 4 13:03:07 2009 (r197746) @@ -115,22 +115,6 @@ __FBSDID("$FreeBSD$"); * another, and then marking both regions as copy-on-write. */ -/* - * vm_map_startup: - * - * Initialize the vm_map module. Must be called before - * any other vm_map routines. - * - * Map and entry structures are allocated from the general - * purpose memory pool with some exceptions: - * - * - The kernel map and kmem submap are allocated statically. - * - Kernel map entries are allocated out of a static pool. - * - * These restrictions are necessary since malloc() uses the - * maps and requires map entries. - */ - static struct mtx map_sleep_mtx; static uma_zone_t mapentzone; static uma_zone_t kmapentzone; @@ -171,6 +155,22 @@ static void vmspace_zdtor(void *mem, int start = end; \ } +/* + * vm_map_startup: + * + * Initialize the vm_map module. Must be called before + * any other vm_map routines. + * + * Map and entry structures are allocated from the general + * purpose memory pool with some exceptions: + * + * - The kernel map and kmem submap are allocated statically. + * - Kernel map entries are allocated out of a static pool. + * + * These restrictions are necessary since malloc() uses the + * maps and requires map entries. + */ + void vm_map_startup(void) { From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 16:20: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 C94041065672; Sun, 4 Oct 2009 16:20:42 +0000 (UTC) (envelope-from michio.jinbo@gmail.com) Received: from mail-pz0-f201.google.com (mail-pz0-f201.google.com [209.85.222.201]) by mx1.freebsd.org (Postfix) with ESMTP id 8B24D8FC18; Sun, 4 Oct 2009 16:20:42 +0000 (UTC) Received: by pzk39 with SMTP id 39so392472pzk.15 for ; Sun, 04 Oct 2009 09:20:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject:cc :in-reply-to:references:message-id:mime-version:content-type :content-transfer-encoding:x-mailer; bh=b9aeIWky1+DsRbtvST8aimruDuHJqmBFSLVCtvL+Alk=; b=JSgHo95fotcDjGLAxjM9Mu/FKqkSntq4m7WwxiOUKSAECBii+ua+OKZHHDvquEv168 20mWCTFpq+DFM7E3pUmn0iuPWx6lXNYH7UNdF6N6ztUfsR/QYf45+SVEcOznEC4O5nXQ Zg5fpNFxj3VllPj+OcKLU7aetNJcLDLuXdUTI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:cc:in-reply-to:references:message-id :mime-version:content-type:content-transfer-encoding:x-mailer; b=NL57+SrLa9UrAXGRVBnghDICF057vm3RU0E9xZOiZY28PgOcYm4poxa7x3oj7durqJ yeS3U//q21acdM7AW1Chpl4eMA4rdjq1Zunv/N3jtCSrCmKH2iUjPNPl3gp4+08Ee7c0 S6b2z17mO22/pXNvaALmbRL+1v7s/AEOVo30w= Received: by 10.115.151.5 with SMTP id d5mr7275942wao.204.1254671367032; Sun, 04 Oct 2009 08:49:27 -0700 (PDT) Received: from ?192.168.4.101? (router.jinbo.jp [210.229.61.161]) by mx.google.com with ESMTPS id 23sm2051096pzk.12.2009.10.04.08.49.24 (version=SSLv3 cipher=RC4-MD5); Sun, 04 Oct 2009 08:49:26 -0700 (PDT) Date: Mon, 05 Oct 2009 00:49:27 +0900 From: "Michio \"Karl\" Jinbo" To: src-committers@freebsd.org In-Reply-To: <200910041220.n94CKxTH073639@svn.freebsd.org> References: <200910041220.n94CKxTH073639@svn.freebsd.org> Message-Id: <20091005004923.4086.22FF24F1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.51.07 [ja] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r197744 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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: Sun, 04 Oct 2009 16:20:42 -0000 On Sun, 4 Oct 2009 12:20:59 +0000 (UTC) Konstantin Belousov wrote: > Log: > MFC r197663: > As a workaround, for Intel CPUs, do not use CLFLUSH in > pmap_invalidate_cache_range() when self-snoop is apparently not reported > in cpu features. > > Approved by: re (bz, kensmith) I was tested r197663/r197744, but kernel panic again on Citrix Xen Server. using 8.0-RC1 install cd, results are 1. INTEL SU9400+HYPER-V(Windows2008 R2) -> boot OK. 2. AMD Athlon X2 TK-55+HYPER-V(Windows2008 R2) -> boot NG. 3. AMD PhenomII 940BK+Citrix Xen Server -> boot NG. I think INTEL CPUs are no problem, but AMD CPUs appear the problem. So I tested the following patch, kernel boot was successed on recent 9-CURRENT and environment 3. sorry, poor English. --- sys/i386/i386/initcpu.c.original 2009-10-01 21:52:48.000000000 +0900 +++ sys/i386/i386/initcpu.c 2009-10-05 08:29:45.000000000 +0900 @@ -721,7 +721,7 @@ * XXXKIB: (temporary) hack to work around traps generated when * CLFLUSHing APIC registers window. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + if (cpu_vendor_id == CPU_VENDOR_AMD && !(cpu_feature & CPUID_SS)) cpu_feature &= ~CPUID_CLFSH; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) -- Michio Jinbo From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 16:30: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 22507106568B; Sun, 4 Oct 2009 16:30:34 +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 10FB08FC13; Sun, 4 Oct 2009 16:30: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 n94GUXxw079214; Sun, 4 Oct 2009 16:30:33 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94GUXIn079213; Sun, 4 Oct 2009 16:30:33 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200910041630.n94GUXIn079213@svn.freebsd.org> From: "Simon L. Nielsen" Date: Sun, 4 Oct 2009 16:30: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: r197747 - head/release/doc/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2009 16:30:34 -0000 Author: simon Date: Sun Oct 4 16:30:33 2009 New Revision: 197747 URL: http://svn.freebsd.org/changeset/base/197747 Log: In lists, if there is a Li command remove it. This fixes markup for uath(4). MFC after: 3 days Reported by: Warren Block Modified: head/release/doc/share/misc/man2hwnotes.pl Modified: head/release/doc/share/misc/man2hwnotes.pl ============================================================================== --- head/release/doc/share/misc/man2hwnotes.pl Sun Oct 4 13:03:07 2009 (r197746) +++ head/release/doc/share/misc/man2hwnotes.pl Sun Oct 4 16:30:33 2009 (r197747) @@ -252,6 +252,10 @@ sub parse { $txt =~ s/ Ta /\t/g; $txt =~ s/([^\t]+)\t.*/$1/; } + + # Remove Li commands + $txt =~ s/^Li //g; + parabuf_addline(\%mdocvars, normalize($txt)); } elsif (/^Bl/) { $mdocvars{isin_list} = 1; From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 17:16: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 D98B3106568D; Sun, 4 Oct 2009 17:16:11 +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 C891B8FC0A; Sun, 4 Oct 2009 17:16: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 n94HGBiB080193; Sun, 4 Oct 2009 17:16:11 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94HGBGk080191; Sun, 4 Oct 2009 17:16:11 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910041716.n94HGBGk080191@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 4 Oct 2009 17:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197748 - stable/7/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2009 17:16:12 -0000 Author: jilles Date: Sun Oct 4 17:16:11 2009 New Revision: 197748 URL: http://svn.freebsd.org/changeset/base/197748 Log: MFC r197371: Mention that NUL characters are not allowed in sh(1) input. I do not consider this a bug because POSIX permits it and argument strings and environment variables cannot contain '\0' anyway. PR: bin/25542 Modified: stable/7/bin/sh/ (props changed) stable/7/bin/sh/sh.1 Modified: stable/7/bin/sh/sh.1 ============================================================================== --- stable/7/bin/sh/sh.1 Sun Oct 4 16:30:33 2009 (r197747) +++ stable/7/bin/sh/sh.1 Sun Oct 4 17:16:11 2009 (r197748) @@ -375,6 +375,10 @@ introduces a comment if used at the begi The word starting with .Ql # and the rest of the line are ignored. +.Pp +.Tn ASCII +.Dv NUL +characters (character code 0) are not allowed in shell input. .Ss Quoting Quoting is used to remove the special meaning of certain characters or words to the shell, such as operators, whitespace, keywords, From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 17:22: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 0F8F71065670; Sun, 4 Oct 2009 17:22:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F28018FC13; Sun, 4 Oct 2009 17:22: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 n94HMpFs080380; Sun, 4 Oct 2009 17:22:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94HMpq7080378; Sun, 4 Oct 2009 17:22:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910041722.n94HMpq7080378@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 4 Oct 2009 17:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197749 - stable/7/usr.bin/find X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2009 17:22:52 -0000 Author: jilles Date: Sun Oct 4 17:22:51 2009 New Revision: 197749 URL: http://svn.freebsd.org/changeset/base/197749 Log: MFC r197363: Update find(1) man page for -L/-delete interaction. It is a bit unfortunate that the example to delete broken symlinks now uses rm(1), but allowing this with -delete would require fixing fts(3) to not imply FTS_NOCHDIR if FTS_LOGICAL is given (or hacks in the -delete option). PR: bin/90687 Modified: stable/7/usr.bin/find/ (props changed) stable/7/usr.bin/find/find.1 Modified: stable/7/usr.bin/find/find.1 ============================================================================== --- stable/7/usr.bin/find/find.1 Sun Oct 4 17:16:11 2009 (r197748) +++ stable/7/usr.bin/find/find.1 Sun Oct 4 17:22:51 2009 (r197749) @@ -306,6 +306,7 @@ character in its pathname relative to .Dq Pa \&. for security reasons. Depth-first traversal processing is implied by this option. +Following symlinks is incompatible with this option. .It Ic -depth Always true; same as the @@ -843,7 +844,7 @@ recent than the current time minus one m Use the .Xr echo 1 command to print out a list of all the files. -.It Li "find -L /usr/ports/packages -type l -delete" +.It Li "find -L /usr/ports/packages -type l -exec rm -- {} +" Delete all broken symbolic links in .Pa /usr/ports/packages . .It Li "find /usr/src -name CVS -prune -o -depth +6 -print" From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 18:53: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 A619C1065670; Sun, 4 Oct 2009 18:53:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 966C78FC1C; Sun, 4 Oct 2009 18:53: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 n94IrAdT082341; Sun, 4 Oct 2009 18:53:10 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94IrAf7082338; Sun, 4 Oct 2009 18:53:10 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200910041853.n94IrAf7082338@svn.freebsd.org> From: Alan Cox Date: Sun, 4 Oct 2009 18:53: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: r197750 - 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: Sun, 04 Oct 2009 18:53:10 -0000 Author: alc Date: Sun Oct 4 18:53:10 2009 New Revision: 197750 URL: http://svn.freebsd.org/changeset/base/197750 Log: Align and pad the page queue and free page queue locks so that the linker can't possibly place them together within the same cache line. MFC after: 3 weeks Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Oct 4 17:22:51 2009 (r197749) +++ head/sys/vm/vm_page.c Sun Oct 4 18:53:10 2009 (r197750) @@ -135,8 +135,8 @@ __FBSDID("$FreeBSD$"); */ struct vpgqueues vm_page_queues[PQ_COUNT]; -struct mtx vm_page_queue_mtx; -struct mtx vm_page_queue_free_mtx; +struct vpglocks vm_page_queue_lock; +struct vpglocks vm_page_queue_free_lock; vm_page_t vm_page_array = 0; int vm_page_array_size = 0; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Oct 4 17:22:51 2009 (r197749) +++ head/sys/vm/vm_page.h Sun Oct 4 18:53:10 2009 (r197750) @@ -170,7 +170,15 @@ struct vpgqueues { }; extern struct vpgqueues vm_page_queues[PQ_COUNT]; -extern struct mtx vm_page_queue_free_mtx; + +struct vpglocks { + struct mtx data; + char pad[CACHE_LINE_SIZE - sizeof(struct mtx)]; +} __aligned(CACHE_LINE_SIZE); + +extern struct vpglocks vm_page_queue_free_lock; + +#define vm_page_queue_free_mtx vm_page_queue_free_lock.data /* * These are the flags defined for vm_page. @@ -258,7 +266,9 @@ PHYS_TO_VM_PAGE(vm_paddr_t pa) #endif } -extern struct mtx vm_page_queue_mtx; +extern struct vpglocks vm_page_queue_lock; + +#define vm_page_queue_mtx vm_page_queue_lock.data #define vm_page_lock_queues() mtx_lock(&vm_page_queue_mtx) #define vm_page_unlock_queues() mtx_unlock(&vm_page_queue_mtx) From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 19:03: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 25A2F1065694; Sun, 4 Oct 2009 19:03:33 +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 1297C8FC0C; Sun, 4 Oct 2009 19:03: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 n94J3WZ2082687; Sun, 4 Oct 2009 19:03:32 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94J3Wq8082685; Sun, 4 Oct 2009 19:03:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200910041903.n94J3Wq8082685@svn.freebsd.org> From: Andrew Thompson Date: Sun, 4 Oct 2009 19:03: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: r197751 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/controller dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2009 19:03:33 -0000 Author: thompsa Date: Sun Oct 4 19:03:32 2009 New Revision: 197751 URL: http://svn.freebsd.org/changeset/base/197751 Log: MFC r197682 EHCI Hardware BUG workaround The EHCI HW can use the qtd_next field instead of qtd_altnext when a short packet is received. This contradicts what is stated in the EHCI datasheet. Also the total-bytes field in the status field of the following TD gets corrupted upon reception of a short packet! We work this around in software by not queueing more than one job/TD at a time of up to 16Kbytes! The bug has been seen on multiple INTEL based EHCI chips. Other vendors have not been tested yet. - Applications using /dev/usb/X.Y.Z, where Z is non-zero are affected, but not applications using LibUSB v0.1, v1.2 and v2.0. - Mass Storage (umass) is affected. Approved by: re (kib) Modified: 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/usb/controller/ehci.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Sun Oct 4 18:53:10 2009 (r197750) +++ stable/8/sys/dev/usb/controller/ehci.c Sun Oct 4 19:03:32 2009 (r197751) @@ -131,6 +131,7 @@ struct ehci_std_temp { uint8_t auto_data_toggle; uint8_t setup_alt_next; uint8_t last_frame; + uint8_t can_use_next; }; void @@ -1207,11 +1208,6 @@ ehci_non_isoc_done_sub(struct usb_xfer * xfer->td_transfer_cache = td; - /* update data toggle */ - - xfer->endpoint->toggle_next = - (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0; - #if USB_DEBUG if (status & EHCI_QTD_STATERRS) { DPRINTFN(11, "error, addr=%d, endpt=0x%02x, frame=0x%02x" @@ -1235,6 +1231,9 @@ ehci_non_isoc_done_sub(struct usb_xfer * static void ehci_non_isoc_done(struct usb_xfer *xfer) { + ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); + ehci_qh_t *qh; + uint32_t status; usb_error_t err = 0; DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", @@ -1248,6 +1247,17 @@ ehci_non_isoc_done(struct usb_xfer *xfer } #endif + /* extract data toggle directly from the QH's overlay area */ + + qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; + + usb_pc_cpu_invalidate(qh->page_cache); + + status = hc32toh(sc, qh->qh_qtd.qtd_status); + + xfer->endpoint->toggle_next = + (status & EHCI_QTD_TOGGLE_MASK) ? 1 : 0; + /* reset scanner */ xfer->td_transfer_cache = xfer->td_transfer_first; @@ -1348,6 +1358,7 @@ ehci_check_transfer(struct usb_xfer *xfe } } else { ehci_qtd_t *td; + ehci_qh_t *qh; /* non-isochronous transfer */ @@ -1357,16 +1368,35 @@ ehci_check_transfer(struct usb_xfer *xfe */ td = xfer->td_transfer_cache; + qh = xfer->qh_start[xfer->flags_int.curr_dma_set]; + + usb_pc_cpu_invalidate(qh->page_cache); + + status = hc32toh(sc, qh->qh_qtd.qtd_status); + if (status & EHCI_QTD_ACTIVE) { + /* transfer is pending */ + goto done; + } + while (1) { usb_pc_cpu_invalidate(td->page_cache); status = hc32toh(sc, td->qtd_status); /* - * if there is an active TD the transfer isn't done + * Check if there is an active TD which + * indicates that the transfer isn't done. */ if (status & EHCI_QTD_ACTIVE) { /* update cache */ - xfer->td_transfer_cache = td; + if (xfer->td_transfer_cache != td) { + xfer->td_transfer_cache = td; + if (qh->qh_qtd.qtd_next & + htohc32(sc, EHCI_LINK_TERMINATE)) { + /* XXX - manually advance to next frame */ + qh->qh_qtd.qtd_next = td->qtd_self; + usb_pc_cpu_flush(td->page_cache); + } + } goto done; } /* @@ -1545,7 +1575,6 @@ ehci_setup_standard_chain_sub(struct ehc ehci_qtd_t *td; ehci_qtd_t *td_next; ehci_qtd_t *td_alt_next; - uint32_t qtd_altnext; uint32_t buf_offset; uint32_t average; uint32_t len_old; @@ -1554,7 +1583,6 @@ ehci_setup_standard_chain_sub(struct ehc uint8_t precompute; terminate = htohc32(temp->sc, EHCI_LINK_TERMINATE); - qtd_altnext = terminate; td_alt_next = NULL; buf_offset = 0; shortpkt_old = temp->shortpkt; @@ -1612,7 +1640,8 @@ restart: td->qtd_status = temp->qtd_status | - htohc32(temp->sc, EHCI_QTD_SET_BYTES(average)); + htohc32(temp->sc, EHCI_QTD_IOC | + EHCI_QTD_SET_BYTES(average)); if (average == 0) { @@ -1687,11 +1716,23 @@ restart: td->qtd_buffer_hi[x] = 0; } - if (td_next) { - /* link the current TD with the next one */ - td->qtd_next = td_next->qtd_self; + if (temp->can_use_next) { + if (td_next) { + /* link the current TD with the next one */ + td->qtd_next = td_next->qtd_self; + } + } else { + /* + * BUG WARNING: The EHCI HW can use the + * qtd_next field instead of qtd_altnext when + * a short packet is received! We work this + * around in software by not queueing more + * than one job/TD at a time! + */ + td->qtd_next = terminate; } - td->qtd_altnext = qtd_altnext; + + td->qtd_altnext = terminate; td->alt_next = td_alt_next; usb_pc_cpu_flush(td->page_cache); @@ -1703,15 +1744,9 @@ restart: /* setup alt next pointer, if any */ if (temp->last_frame) { td_alt_next = NULL; - qtd_altnext = terminate; } else { /* we use this field internally */ td_alt_next = td_next; - if (temp->setup_alt_next) { - qtd_altnext = td_next->qtd_self; - } else { - qtd_altnext = terminate; - } } /* restore */ @@ -1756,6 +1791,8 @@ ehci_setup_standard_chain(struct usb_xfe temp.qtd_status = 0; temp.last_frame = 0; temp.setup_alt_next = xfer->flags_int.short_frames_ok; + temp.can_use_next = (xfer->flags_int.control_xfr || + (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT)); if (xfer->flags_int.control_xfr) { if (xfer->endpoint->toggle_next) { @@ -1889,7 +1926,6 @@ ehci_setup_standard_chain(struct usb_xfe /* the last TD terminates the transfer: */ td->qtd_next = htohc32(temp.sc, EHCI_LINK_TERMINATE); td->qtd_altnext = htohc32(temp.sc, EHCI_LINK_TERMINATE); - td->qtd_status |= htohc32(temp.sc, EHCI_QTD_IOC); usb_pc_cpu_flush(td->page_cache); From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 19:43: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 71671106568F; Sun, 4 Oct 2009 19:43:38 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 615B38FC19; Sun, 4 Oct 2009 19:43: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 n94JhaLR083489; Sun, 4 Oct 2009 19:43:36 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94JhaDg083487; Sun, 4 Oct 2009 19:43:36 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200910041943.n94JhaDg083487@svn.freebsd.org> From: David Schultz Date: Sun, 4 Oct 2009 19:43: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: r197752 - 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: Sun, 04 Oct 2009 19:43:38 -0000 Author: das Date: Sun Oct 4 19:43:36 2009 New Revision: 197752 URL: http://svn.freebsd.org/changeset/base/197752 Log: Better glibc compatibility for getline/getdelim: - Tolerate applications that pass a NULL pointer for the buffer and claim that the capacity of the buffer is nonzero. - If an application passes in a non-NULL buffer pointer and claims the buffer has zero capacity, we should free (well, realloc) it anyway. It could have been obtained from malloc(0), so failing to free it would be a small memory leak. MFC After: 2 weeks Reported by: naddy PR: ports/138320 Modified: head/lib/libc/stdio/getdelim.c Modified: head/lib/libc/stdio/getdelim.c ============================================================================== --- head/lib/libc/stdio/getdelim.c Sun Oct 4 19:03:32 2009 (r197751) +++ head/lib/libc/stdio/getdelim.c Sun Oct 4 19:43:36 2009 (r197752) @@ -120,8 +120,8 @@ getdelim(char ** __restrict linep, size_ goto error; } - if (*linecapp == 0) - *linep = NULL; + if (*linep == NULL) + *linecapp = 0; if (fp->_r <= 0 && __srefill(fp)) { /* If fp is at EOF already, we just need space for the NUL. */ From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 19: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 1265F106568D; Sun, 4 Oct 2009 19:44:42 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 021518FC19; Sun, 4 Oct 2009 19:44: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 n94JifMU083559; Sun, 4 Oct 2009 19:44:41 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94JifN8083557; Sun, 4 Oct 2009 19:44:41 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200910041944.n94JifN8083557@svn.freebsd.org> From: David Schultz Date: Sun, 4 Oct 2009 19: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: r197753 - head/tools/regression/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: Sun, 04 Oct 2009 19:44:42 -0000 Author: das Date: Sun Oct 4 19:44:41 2009 New Revision: 197753 URL: http://svn.freebsd.org/changeset/base/197753 Log: Regression tests for r197752 (handling of empty/NULL buffers). Modified: head/tools/regression/lib/libc/stdio/test-getdelim.c Modified: head/tools/regression/lib/libc/stdio/test-getdelim.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-getdelim.c Sun Oct 4 19:43:36 2009 (r197752) +++ head/tools/regression/lib/libc/stdio/test-getdelim.c Sun Oct 4 19:44:41 2009 (r197753) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) srandom(0); - printf("1..5\n"); + printf("1..6\n"); /* * Test multiple times with different buffer sizes @@ -103,6 +103,7 @@ main(int argc, char *argv[]) assert(getline(&line, &linecap, fp) == -1); assert(line[0] == '\0'); free(line); + line = NULL; assert(feof(fp)); assert(!ferror(fp)); fclose(fp); @@ -164,5 +165,23 @@ main(int argc, char *argv[]) fclose(fp); printf("ok 5 - nul\n"); + /* Make sure NULL *linep and zero *linecapp are handled. */ + fp = mkfilebuf(); + free(line); + line = NULL; + linecap = 42; + assert(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); + assert(memcmp(line, apothegm, sizeof(apothegm)) == 0); + fp = mkfilebuf(); + free(line); + line = malloc(100); + linecap = 0; + assert(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); + assert(memcmp(line, apothegm, sizeof(apothegm)) == 0); + free(line); + assert(!ferror(fp)); + fclose(fp); + printf("ok 6 - empty/NULL initial buffer\n"); + exit(0); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 21:46: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 69AF41065672; Sun, 4 Oct 2009 21:46:44 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57EA58FC17; Sun, 4 Oct 2009 21:46: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 n94LkiHo086319; Sun, 4 Oct 2009 21:46:44 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94LkiAH086317; Sun, 4 Oct 2009 21:46:44 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910042146.n94LkiAH086317@svn.freebsd.org> From: Joe Marcus Clarke Date: Sun, 4 Oct 2009 21:46: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: r197758 - 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: Sun, 04 Oct 2009 21:46:44 -0000 Author: marcus (doc,ports committer) Date: Sun Oct 4 21:46:43 2009 New Revision: 197758 URL: http://svn.freebsd.org/changeset/base/197758 Log: MFC: rev. 197681 Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: re (kib) Modified: stable/8/lib/libc/gen/_pthread_stubs.c Modified: stable/8/lib/libc/gen/_pthread_stubs.c ============================================================================== --- stable/8/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:22:19 2009 (r197757) +++ stable/8/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:46:43 2009 (r197758) @@ -222,7 +222,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init, PJT_RWLOCK_INIT, int, void *, void *) From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 21: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 692BF1065672; Sun, 4 Oct 2009 21:48:17 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 579988FC16; Sun, 4 Oct 2009 21:48: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 n94LmHm3086391; Sun, 4 Oct 2009 21:48:17 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94LmHCD086389; Sun, 4 Oct 2009 21:48:17 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910042148.n94LmHCD086389@svn.freebsd.org> From: Joe Marcus Clarke Date: Sun, 4 Oct 2009 21:48: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: r197759 - stable/7/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: Sun, 04 Oct 2009 21:48:17 -0000 Author: marcus (doc,ports committer) Date: Sun Oct 4 21:48:17 2009 New Revision: 197759 URL: http://svn.freebsd.org/changeset/base/197759 Log: MFC: rev. 197681 Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: kib Modified: stable/7/lib/libc/gen/_pthread_stubs.c Modified: stable/7/lib/libc/gen/_pthread_stubs.c ============================================================================== --- stable/7/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:46:43 2009 (r197758) +++ stable/7/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:48:17 2009 (r197759) @@ -222,7 +222,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init, PJT_RWLOCK_INIT, int, void *, void *) From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 21:50: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 8749310657C7; Sun, 4 Oct 2009 21:50:30 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 756978FC15; Sun, 4 Oct 2009 21:50: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 n94LoU5K086491; Sun, 4 Oct 2009 21:50:30 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94LoUtM086489; Sun, 4 Oct 2009 21:50:30 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910042150.n94LoUtM086489@svn.freebsd.org> From: Joe Marcus Clarke Date: Sun, 4 Oct 2009 21:50:30 +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: r197760 - stable/6/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: Sun, 04 Oct 2009 21:50:30 -0000 Author: marcus (doc,ports committer) Date: Sun Oct 4 21:50:29 2009 New Revision: 197760 URL: http://svn.freebsd.org/changeset/base/197760 Log: MFC: rev. 197681 Correct the pthread stub prototype for pthread_mutexattr_settype to allow for the type argument. This is known to fix some pthread_mutexattr_settype() invocations, especially when it comes to pulseaudio. Approved by: kib Modified: stable/6/lib/libc/gen/_pthread_stubs.c Modified: stable/6/lib/libc/gen/_pthread_stubs.c ============================================================================== --- stable/6/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:48:17 2009 (r197759) +++ stable/6/lib/libc/gen/_pthread_stubs.c Sun Oct 4 21:50:29 2009 (r197760) @@ -188,7 +188,7 @@ STUB_FUNC1(pthread_mutex_trylock, PJT_MU STUB_FUNC1(pthread_mutex_unlock, PJT_MUTEX_UNLOCK, int, void *) STUB_FUNC1(pthread_mutexattr_destroy, PJT_MUTEXATTR_DESTROY, int, void *) STUB_FUNC1(pthread_mutexattr_init, PJT_MUTEXATTR_INIT, int, void *) -STUB_FUNC1(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *) +STUB_FUNC2(pthread_mutexattr_settype, PJT_MUTEXATTR_SETTYPE, int, void *, int) STUB_FUNC2(pthread_once, PJT_ONCE, int, void *, void *) STUB_FUNC1(pthread_rwlock_destroy, PJT_RWLOCK_DESTROY, int, void *) STUB_FUNC2(pthread_rwlock_init, PJT_RWLOCK_INIT, int, void *, void *) From owner-svn-src-all@FreeBSD.ORG Sun Oct 4 23:30: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 7A1321065692; Sun, 4 Oct 2009 23:30:08 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 689368FC1E; Sun, 4 Oct 2009 23:30: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 n94NU8kM088630; Sun, 4 Oct 2009 23:30:08 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n94NU8sr088627; Sun, 4 Oct 2009 23:30:08 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200910042330.n94NU8sr088627@svn.freebsd.org> From: Weongyo Jeong Date: Sun, 4 Oct 2009 23:30: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: r197761 - in head/sys/dev/usb: . wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 04 Oct 2009 23:30:08 -0000 Author: weongyo Date: Sun Oct 4 23:30:08 2009 New Revision: 197761 URL: http://svn.freebsd.org/changeset/base/197761 Log: updates device entries supported with the product name not magic numbers and sorts entries. WUSB54GCV2 is added. Obtained from: OpenBSD Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_urtw.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Oct 4 21:50:29 2009 (r197760) +++ head/sys/dev/usb/usbdevs Sun Oct 4 23:30:08 2009 (r197761) @@ -908,6 +908,7 @@ product ASIX AX88772 0x7720 AX88772 product ASUS WL167G 0x1707 WL-167g Wireless Adapter product ASUS WL159G 0x170c WL-159g product ASUS A9T_WIFI 0x171b A9T wireless +product ASUS P5B_WIFI 0x171d P5B wireless product ASUS RT2573_1 0x1723 RT2573 product ASUS RT2573_2 0x1724 RT2573 product ASUS LCM 0x1726 LCM display @@ -975,6 +976,7 @@ product BELKIN F5D7051 0x7051 F5D7051 5 product BELKIN F5D7050A 0x705a F5D7050A Wireless Adapter /* Also sold as 'Ativa 802.11g wireless card' */ product BELKIN F5D7050_V4000 0x705c F5D7050 v4000 Wireless Adapter +product BELKIN F5D7050E 0x705e F5D7050E Wireless Adapter product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter product BELKIN2 F5U002 0x0002 F5U002 Parallel printer @@ -1656,6 +1658,7 @@ product LINKSYS2 WUSB11 0x2219 WUSB11 W product LINKSYS2 USB200M 0x2226 USB 2.0 10/100 Ethernet product LINKSYS3 WUSB11v28 0x2233 WUSB11 v2.8 Wireless Adapter product LINKSYS4 USB1000 0x0039 USB1000 +product LINKSYS4 WUSB54GCV2 0x0073 WUSB54GC v2 /* Logitech products */ product LOGITECH M2452 0x0203 M2452 keyboard @@ -1876,6 +1879,7 @@ product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN +product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U product NETGEAR WG111U_NF 0x4301 WG111U (no firmware) product NETGEAR WG111V2 0x6a00 WG111V2 @@ -2101,6 +2105,9 @@ product RALINK RT2573_2 0x9021 RT2501US /* Green House and CompUSA OEM this part */ product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter +product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter +product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter +product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter /* Ricoh products */ product RICOH VGPVCC2 0x1830 VGP-VCC2 Camera @@ -2270,6 +2277,8 @@ product SITECOM SERIAL 0x2068 USB to se product SITECOM2 WL022 0x182d WL-022 /* Sitecom Europe products */ +product SITECOMEU WL168V1 0x000d WL-168 v1 +product SITECOMEU WL168V4 0x0028 WL-168 v4 product SITECOMEU LN028 0x061c LN-028 product SITECOMEU WL113 0x9071 WL-113 product SITECOMEU ZD1211B 0x9075 ZD1211B @@ -2375,6 +2384,7 @@ product DIAMOND2 RIO600USB 0x5001 Rio 60 product DIAMOND2 RIO800USB 0x5002 Rio 800 USB /* Surecom Technology products */ +product SURECOM EP9001G2A 0x11f2 EP-9001-G rev 2A product SURECOM RT2570 0x11f3 RT2570 product SURECOM RT2573 0x31f3 RT2573 Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sun Oct 4 21:50:29 2009 (r197760) +++ head/sys/dev/usb/wlan/if_urtw.c Sun Oct 4 23:30:08 2009 (r197761) @@ -102,23 +102,24 @@ TUNABLE_INT("hw.usb.urtw.preamble_mode", #define URTW_REV_RTL8187B 0 #define URTW_REV_RTL8187L 1 static const struct usb_device_id urtw_devs[] = { - { USB_VPI(USB_VENDOR_BELKIN, 0x705e, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_REALTEK, 0x8189, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_REALTEK, 0x8197, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_REALTEK, 0x8198, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_NETGEAR, 0x4260, URTW_REV_RTL8187B) }, + URTW_DEV_B(NETGEAR, WG111V3), + URTW_DEV_B(REALTEK, RTL8187B_0), + URTW_DEV_B(REALTEK, RTL8187B_1), + URTW_DEV_B(REALTEK, RTL8187B_2), + URTW_DEV_B(SITECOMEU, WL168V4), + URTW_DEV_L(ASUS, P5B_WIFI), + URTW_DEV_L(BELKIN, F5D7050E), + URTW_DEV_L(LINKSYS4, WUSB54GCV2), + URTW_DEV_L(NETGEAR, WG111V2), + URTW_DEV_L(REALTEK, RTL8187), + URTW_DEV_L(SITECOMEU, WL168V1), + URTW_DEV_L(SURECOM, EP9001G2A), { USB_VPI(0x1b75, 0x8187, URTW_REV_RTL8187L) }, - { USB_VPI(USB_VENDOR_ASUS, 0x171d, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_DICKSMITH, 0x9401, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_HP, 0xca02, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_LOGITEC, 0x010c, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_NETGEAR, 0x6100, URTW_REV_RTL8187L) }, - URTW_DEV_L(NETGEAR, WG111V2), - URTW_DEV_L(REALTEK, RTL8187), - { USB_VPI(USB_VENDOR_SITECOMEU, 0x000d, URTW_REV_RTL8187L) }, - { USB_VPI(USB_VENDOR_SITECOMEU, 0x0028, URTW_REV_RTL8187B) }, { USB_VPI(USB_VENDOR_SPHAIRON, 0x0150, URTW_REV_RTL8187L) }, - { USB_VPI(USB_VENDOR_SURECOM, 0x11f2, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_QCOM, 0x6232, URTW_REV_RTL8187L) }, #undef URTW_DEV_L #undef URTW_DEV_B From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 01:31: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 DA9591065670; Mon, 5 Oct 2009 01:31:16 +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 C98478FC13; Mon, 5 Oct 2009 01:31: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 n951VGmn091210; Mon, 5 Oct 2009 01:31:16 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n951VGW9091208; Mon, 5 Oct 2009 01:31:16 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <200910050131.n951VGW9091208@svn.freebsd.org> From: Matt Jacob Date: Mon, 5 Oct 2009 01:31: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: r197763 - head/sbin/growfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 01:31:16 -0000 Author: mjacob Date: Mon Oct 5 01:31:16 2009 New Revision: 197763 URL: http://svn.freebsd.org/changeset/base/197763 Log: The cylinder group tag cg_initediblk needs to match the number of inodes actually initialized. In the growfs case for UFS2, no inodes were actually being initialized and the number of inodes noted as initialized was the number of inodes per group. This created a filesystem that was deemed corrupted because the inodes thus added were full of garbage. MFC after: 1 month Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Mon Oct 5 00:28:47 2009 (r197762) +++ head/sbin/growfs/growfs.c Mon Oct 5 01:31:16 2009 (r197763) @@ -397,11 +397,17 @@ initcg(int cylno, time_t utime, int fso, dupper += howmany(sblock.fs_cssize, sblock.fs_fsize); cs = &fscs[cylno]; memset(&acg, 0, sblock.fs_cgsize); + /* + * Note that we do not set cg_initediblk at all. + * In this extension of a previous filesystem + * we have no inodes initialized for the cylinder + * group at all. The first access to that cylinder + * group will do the correct initialization. + */ acg.cg_time = utime; acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg; acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -414,7 +420,6 @@ initcg(int cylno, time_t utime, int fso, acg.cg_time = 0; acg.cg_old_niblk = acg.cg_niblk; acg.cg_niblk = 0; - acg.cg_initediblk = 0; acg.cg_old_btotoff = start; acg.cg_old_boff = acg.cg_old_btotoff + sblock.fs_old_cpg * sizeof(int32_t); @@ -2217,6 +2222,7 @@ main(int argc, char **argv) printf("Warning: %jd sector(s) cannot be allocated.\n", (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; + maxino -= sblock.fs_ipg; } /* From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 07: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 28A35106568B; Mon, 5 Oct 2009 07:11:20 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16C148FC1D; Mon, 5 Oct 2009 07: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 n957BJOa003575; Mon, 5 Oct 2009 07:11:19 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n957BJnS003574; Mon, 5 Oct 2009 07:11:19 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910050711.n957BJnS003574@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 5 Oct 2009 07:11: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: r197764 - in head: include usr.bin/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 07:11:20 -0000 Author: edwin Date: Mon Oct 5 07:11:19 2009 New Revision: 197764 URL: http://svn.freebsd.org/changeset/base/197764 Log: Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's. Also modify the "-k list" option to display only fields with a certain prefix. MFC after: 1 week Modified: head/include/langinfo.h head/usr.bin/locale/locale.1 head/usr.bin/locale/locale.c Modified: head/include/langinfo.h ============================================================================== --- head/include/langinfo.h Mon Oct 5 01:31:16 2009 (r197763) +++ head/include/langinfo.h Mon Oct 5 07:11:19 2009 (r197764) @@ -114,6 +114,20 @@ typedef __nl_item nl_item; #define D_MD_ORDER 57 /* month/day order (local extension) */ #endif +/* standalone months forms for %OB */ +#define ALTMON_1 58 +#define ALTMON_2 59 +#define ALTMON_3 60 +#define ALTMON_4 61 +#define ALTMON_5 62 +#define ALTMON_6 63 +#define ALTMON_7 64 +#define ALTMON_8 65 +#define ALTMON_9 66 +#define ALTMON_10 67 +#define ALTMON_11 68 +#define ALTMON_12 69 + __BEGIN_DECLS char *nl_langinfo(nl_item); __END_DECLS Modified: head/usr.bin/locale/locale.1 ============================================================================== --- head/usr.bin/locale/locale.1 Mon Oct 5 01:31:16 2009 (r197763) +++ head/usr.bin/locale/locale.1 Mon Oct 5 07:11:19 2009 (r197764) @@ -35,8 +35,12 @@ .Nm .Op Fl a | m .Nm -.Op Fl ck -.Op Ar keyword ... +.Fl k +.Ic list +.Op Ar prefix +.Nm +.Op Fl ck +.Ar keyword ... .Sh DESCRIPTION The .Nm @@ -79,6 +83,8 @@ The special specific) keyword .Cm list can be used to retrieve the human readable list of all available keywords. +If so, +a prefix string can be defined to limit the amount of keywords returned. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Mon Oct 5 01:31:16 2009 (r197763) +++ head/usr.bin/locale/locale.c Mon Oct 5 07:11:19 2009 (r197764) @@ -55,7 +55,7 @@ const char *lookup_localecat(int); char *kwval_lconv(int); int kwval_lookup(char *, char **, int *, int *); void showdetails(char *); -void showkeywordslist(void); +void showkeywordslist(char *substring); void showlocale(void); void usage(void); @@ -149,6 +149,9 @@ struct _kwinfo { { "d_t_fmt", 1, LC_TIME, D_T_FMT, "" }, { "d_fmt", 1, LC_TIME, D_FMT, "" }, { "t_fmt", 1, LC_TIME, T_FMT, "" }, + { "c_fmt", 1, LC_TIME, C_FMT, "" }, + { "x_fmt", 1, LC_TIME, X_FMT, "" }, + { "X_fmt", 1, LC_TIME, CAPITALX_FMT, "" }, { "am_str", 1, LC_TIME, AM_STR, "" }, { "pm_str", 1, LC_TIME, PM_STR, "" }, { "t_fmt_ampm", 1, LC_TIME, T_FMT_AMPM, "" }, @@ -190,6 +193,18 @@ struct _kwinfo { { "abmon_10", 1, LC_TIME, ABMON_10, "" }, { "abmon_11", 1, LC_TIME, ABMON_11, "" }, { "abmon_12", 1, LC_TIME, ABMON_12, "" }, + { "altmon_1", 1, LC_TIME, ALTMON_1, "" }, + { "altmon_2", 1, LC_TIME, ALTMON_2, "" }, + { "altmon_3", 1, LC_TIME, ALTMON_3, "" }, + { "altmon_4", 1, LC_TIME, ALTMON_4, "" }, + { "altmon_5", 1, LC_TIME, ALTMON_5, "" }, + { "altmon_6", 1, LC_TIME, ALTMON_6, "" }, + { "altmon_7", 1, LC_TIME, ALTMON_7, "" }, + { "altmon_8", 1, LC_TIME, ALTMON_8, "" }, + { "altmon_9", 1, LC_TIME, ALTMON_9, "" }, + { "altmon_10", 1, LC_TIME, ALTMON_10, "" }, + { "altmon_11", 1, LC_TIME, ALTMON_11, "" }, + { "altmon_12", 1, LC_TIME, ALTMON_12, "" }, { "era", 1, LC_TIME, ERA, "(unavailable)" }, { "era_d_fmt", 1, LC_TIME, ERA_D_FMT, "(unavailable)" }, { "era_d_t_fmt", 1, LC_TIME, ERA_D_T_FMT, "(unavailable)" }, @@ -217,7 +232,7 @@ main(int argc, char *argv[]) int ch; int tmp; - while ((ch = getopt(argc, argv, "ackm")) != -1) { + while ((ch = getopt(argc, argv, "ackms:")) != -1) { switch (ch) { case 'a': all_locales = 1; @@ -265,7 +280,7 @@ main(int argc, char *argv[]) if (prt_keywords && argc > 0) while (tmp < argc) if (strcasecmp(argv[tmp++], "list") == 0) { - showkeywordslist(); + showkeywordslist(argv[tmp]); exit(0); } @@ -290,7 +305,8 @@ void usage(void) { printf("Usage: locale [ -a | -m ]\n" - " locale [ -ck ] name ...\n"); + " locale -k list [prefix]\n" + " locale [ -ck ] keyword ...\n"); exit(1); } @@ -594,6 +610,7 @@ showdetails(char *kw) * invalid keyword specified. * XXX: any actions? */ + fprintf(stderr, "Unknown keyword: `%s'\n", kw); return; } @@ -639,16 +656,25 @@ lookup_localecat(int cat) * Show list of keywords */ void -showkeywordslist(void) +showkeywordslist(char *substring) { size_t i; #define FMT "%-20s %-12s %-7s %-20s\n" - printf("List of available keywords\n\n"); + if (substring == NULL) + printf("List of available keywords\n\n"); + else + printf("List of available keywords starting with '%s'\n\n", + substring); printf(FMT, "Keyword", "Category", "Type", "Comment"); printf("-------------------- ------------ ------- --------------------\n"); for (i = 0; i < NKWINFO; i++) { + if (substring != NULL) { + if (strncmp(kwinfo[i].name, substring, + strlen(substring)) != 0) + continue; + } printf(FMT, kwinfo[i].name, lookup_localecat(kwinfo[i].catid), From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 07:13: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 507EE10656A4; Mon, 5 Oct 2009 07:13:16 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 401308FC1B; Mon, 5 Oct 2009 07:13: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 n957DG63003649; Mon, 5 Oct 2009 07:13:16 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n957DGvV003647; Mon, 5 Oct 2009 07:13:16 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910050713.n957DGvV003647@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 5 Oct 2009 07:13: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: r197765 - head/lib/libc/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 07:13:16 -0000 Author: edwin Date: Mon Oct 5 07:13:15 2009 New Revision: 197765 URL: http://svn.freebsd.org/changeset/base/197765 Log: Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's. Also modify the "-k list" option to display only fields with a certain prefix. MFC after: 1 week Modified: head/lib/libc/locale/nl_langinfo.c Modified: head/lib/libc/locale/nl_langinfo.c ============================================================================== --- head/lib/libc/locale/nl_langinfo.c Mon Oct 5 07:11:19 2009 (r197764) +++ head/lib/libc/locale/nl_langinfo.c Mon Oct 5 07:13:15 2009 (r197765) @@ -93,6 +93,12 @@ nl_langinfo(nl_item item) case ABMON_9: case ABMON_10: case ABMON_11: case ABMON_12: ret = (char*) __get_current_time_locale()->mon[_REL(ABMON_1)]; break; + case ALTMON_1: case ALTMON_2: case ALTMON_3: case ALTMON_4: + case ALTMON_5: case ALTMON_6: case ALTMON_7: case ALTMON_8: + case ALTMON_9: case ALTMON_10: case ALTMON_11: case ALTMON_12: + ret = (char*) + __get_current_time_locale()->alt_month[_REL(ALTMON_1)]; + break; case ERA: /* XXX: need to be implemented */ ret = ""; From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 07:21: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 4AA681065670; Mon, 5 Oct 2009 07:21:22 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 397548FC0A; Mon, 5 Oct 2009 07:21: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 n957LMEN003849; Mon, 5 Oct 2009 07:21:22 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n957LMcB003847; Mon, 5 Oct 2009 07:21:22 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910050721.n957LMcB003847@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 5 Oct 2009 07:21: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: r197766 - head/usr.bin/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 07:21:22 -0000 Author: edwin Date: Mon Oct 5 07:21:21 2009 New Revision: 197766 URL: http://svn.freebsd.org/changeset/base/197766 Log: Backout changes for c_fmt, x_fmt and X_fmt, they were coming from the wrong patches. Apologies. Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Mon Oct 5 07:13:15 2009 (r197765) +++ head/usr.bin/locale/locale.c Mon Oct 5 07:21:21 2009 (r197766) @@ -149,9 +149,6 @@ struct _kwinfo { { "d_t_fmt", 1, LC_TIME, D_T_FMT, "" }, { "d_fmt", 1, LC_TIME, D_FMT, "" }, { "t_fmt", 1, LC_TIME, T_FMT, "" }, - { "c_fmt", 1, LC_TIME, C_FMT, "" }, - { "x_fmt", 1, LC_TIME, X_FMT, "" }, - { "X_fmt", 1, LC_TIME, CAPITALX_FMT, "" }, { "am_str", 1, LC_TIME, AM_STR, "" }, { "pm_str", 1, LC_TIME, PM_STR, "" }, { "t_fmt_ampm", 1, LC_TIME, T_FMT_AMPM, "" }, From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 08:44: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 E5BDC106566B; Mon, 5 Oct 2009 08:44:31 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D32278FC1A; Mon, 5 Oct 2009 08:44: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 n958iVf2005569; Mon, 5 Oct 2009 08:44:31 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n958iVWv005562; Mon, 5 Oct 2009 08:44:31 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200910050844.n958iVWv005562@svn.freebsd.org> From: Ulf Lilleengen Date: Mon, 5 Oct 2009 08:44: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: r197767 - head/sys/geom/vinum X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 08:44:32 -0000 Author: lulf Date: Mon Oct 5 08:44:31 2009 New Revision: 197767 URL: http://svn.freebsd.org/changeset/base/197767 Log: - Improve error message consistency and wording. Modified: head/sys/geom/vinum/geom_vinum_create.c head/sys/geom/vinum/geom_vinum_events.c head/sys/geom/vinum/geom_vinum_init.c head/sys/geom/vinum/geom_vinum_move.c head/sys/geom/vinum/geom_vinum_rm.c head/sys/geom/vinum/geom_vinum_subr.c Modified: head/sys/geom/vinum/geom_vinum_create.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_create.c Mon Oct 5 07:21:21 2009 (r197766) +++ head/sys/geom/vinum/geom_vinum_create.c Mon Oct 5 08:44:31 2009 (r197767) @@ -94,7 +94,7 @@ gv_create_drive(struct gv_softc *sc, str if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); g_topology_unlock(); - G_VINUM_DEBUG(0, "create drive '%s': couldn't attach", + G_VINUM_DEBUG(0, "create drive '%s': unable to attach", d->name); g_free(d); return (GV_ERR_CREATE); @@ -135,7 +135,7 @@ gv_create_drive(struct gv_softc *sc, str g_detach(cp); g_destroy_consumer(cp); g_topology_unlock(); - G_VINUM_DEBUG(0, "create drive '%s': couldn't update " + G_VINUM_DEBUG(0, "create drive '%s': unable to update " "access counts", d->name); if (d->hdr != NULL) g_free(d->hdr); @@ -320,7 +320,7 @@ gv_concat(struct g_geom *gp, struct gctl dcount = 0; vol = gctl_get_param(req, "name", NULL); if (vol == NULL) { - gctl_error(req, "volume names not given"); + gctl_error(req, "volume name not given"); return; } @@ -388,7 +388,7 @@ gv_mirror(struct g_geom *gp, struct gctl pcount = 0; vol = gctl_get_param(req, "name", NULL); if (vol == NULL) { - gctl_error(req, "volume's not given"); + gctl_error(req, "volume name not given"); return; } @@ -396,7 +396,7 @@ gv_mirror(struct g_geom *gp, struct gctl drives = gctl_get_paraml(req, "drives", sizeof(*drives)); if (drives == NULL) { - gctl_error(req, "drives not given"); + gctl_error(req, "drive names not given"); return; } @@ -480,7 +480,7 @@ gv_raid5(struct g_geom *gp, struct gctl_ vol = gctl_get_param(req, "name", NULL); if (vol == NULL) { - gctl_error(req, "volume's not given"); + gctl_error(req, "volume name not given"); return; } flags = gctl_get_paraml(req, "flags", sizeof(*flags)); @@ -493,7 +493,7 @@ gv_raid5(struct g_geom *gp, struct gctl_ } if (drives == NULL) { - gctl_error(req, "drives not given"); + gctl_error(req, "drive names not given"); return; } @@ -558,14 +558,14 @@ gv_stripe(struct g_geom *gp, struct gctl pcount = 0; vol = gctl_get_param(req, "name", NULL); if (vol == NULL) { - gctl_error(req, "volume's not given"); + gctl_error(req, "volume name not given"); return; } flags = gctl_get_paraml(req, "flags", sizeof(*flags)); drives = gctl_get_paraml(req, "drives", sizeof(*drives)); if (drives == NULL) { - gctl_error(req, "drives not given"); + gctl_error(req, "drive names not given"); return; } Modified: head/sys/geom/vinum/geom_vinum_events.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_events.c Mon Oct 5 07:21:21 2009 (r197766) +++ head/sys/geom/vinum/geom_vinum_events.c Mon Oct 5 08:44:31 2009 (r197767) @@ -193,7 +193,7 @@ gv_drive_lost(struct gv_softc *sc, struc if (cp != NULL) { if (cp->nstart != cp->nend) { G_VINUM_DEBUG(0, "dead drive '%s' has still active " - "requests, can't detach consumer", d->name); + "requests, unable to detach consumer", d->name); gv_post_event(sc, GV_EVENT_DRIVE_LOST, d, NULL, 0, 0); return; } Modified: head/sys/geom/vinum/geom_vinum_init.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_init.c Mon Oct 5 07:21:21 2009 (r197766) +++ head/sys/geom/vinum/geom_vinum_init.c Mon Oct 5 08:44:31 2009 (r197767) @@ -87,7 +87,7 @@ gv_start_obj(struct g_geom *gp, struct g case GV_TYPE_SD: case GV_TYPE_DRIVE: /* XXX Not implemented, but what is the use? */ - gctl_error(req, "cannot start '%s' - not yet supported", + gctl_error(req, "unable to start '%s' - not yet supported", argv); return; default: @@ -279,8 +279,8 @@ gv_rebuild_plex(struct gv_plex *p) LIST_FOREACH(s, &p->subdisks, in_plex) { d = s->drive_sc; if (d == NULL || (d->flags & GV_DRIVE_REFERENCED)) { - G_VINUM_DEBUG(0, "can't rebuild %s, subdisk(s) have no " - "drives", p->name); + G_VINUM_DEBUG(0, "unable to rebuild %s, subdisk(s) have" + " no drives", p->name); return (ENXIO); } } Modified: head/sys/geom/vinum/geom_vinum_move.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_move.c Mon Oct 5 07:21:21 2009 (r197766) +++ head/sys/geom/vinum/geom_vinum_move.c Mon Oct 5 08:44:31 2009 (r197767) @@ -84,7 +84,7 @@ gv_move(struct g_geom *gp, struct gctl_r type = gv_object_type(sc, object); if (type != GV_TYPE_SD) { gctl_error(req, "you can only move subdisks; " - "'%s' isn't one", object); + "'%s' is not a subdisk", object); return; } @@ -145,7 +145,7 @@ gv_move_sd(struct gv_softc *sc, struct g err = gv_set_sd_state(cursd, GV_SD_STALE, GV_SETSTATE_FORCE | GV_SETSTATE_CONFIG); if (err) { - G_VINUM_DEBUG(0, "could not set the subdisk '%s' to state " + G_VINUM_DEBUG(0, "unable to set the subdisk '%s' to state " "'stale'", cursd->name); return (err); } Modified: head/sys/geom/vinum/geom_vinum_rm.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_rm.c Mon Oct 5 07:21:21 2009 (r197766) +++ head/sys/geom/vinum/geom_vinum_rm.c Mon Oct 5 08:44:31 2009 (r197767) @@ -207,7 +207,7 @@ gv_rm_vol(struct gv_softc *sc, struct gv /* Check if any of our consumers is open. */ if (gv_provider_is_open(pp)) { - G_VINUM_DEBUG(0, "Unable to remove %s: volume still in use", + G_VINUM_DEBUG(0, "unable to remove %s: volume still in use", v->name); return; } @@ -241,7 +241,7 @@ gv_rm_plex(struct gv_softc *sc, struct g /* Check if any of our consumers is open. */ if (v != NULL && gv_provider_is_open(v->provider) && v->plexcount < 2) { - G_VINUM_DEBUG(0, "Unable to remove %s: volume still in use", + G_VINUM_DEBUG(0, "unable to remove %s: volume still in use", p->name); return; } @@ -318,7 +318,7 @@ gv_rm_drive(struct gv_softc *sc, struct g_topology_unlock(); if (err) { - G_VINUM_DEBUG(0, "%s: couldn't access '%s', " + G_VINUM_DEBUG(0, "%s: unable to access '%s', " "errno: %d", __func__, cp->provider->name, err); return; } @@ -327,7 +327,7 @@ gv_rm_drive(struct gv_softc *sc, struct d->hdr->magic = GV_NOMAGIC; err = gv_write_header(cp, d->hdr); if (err) - G_VINUM_DEBUG(0, "gv_rm_drive: couldn't write header to" + G_VINUM_DEBUG(0, "gv_rm_drive: error writing header to" " '%s', errno: %d", cp->provider->name, err); g_topology_lock(); Modified: head/sys/geom/vinum/geom_vinum_subr.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_subr.c Mon Oct 5 07:21:21 2009 (r197766) +++ head/sys/geom/vinum/geom_vinum_subr.c Mon Oct 5 08:44:31 2009 (r197767) @@ -585,7 +585,7 @@ gv_sd_to_drive(struct gv_sd *s, struct g return (0); } } else { - G_VINUM_DEBUG(0, "can't give sd '%s' to '%s' " + G_VINUM_DEBUG(0, "error giving subdisk '%s' to '%s' " "(already on '%s')", s->name, d->name, s->drive_sc->name); return (GV_ERR_ISATTACHED); @@ -612,7 +612,7 @@ gv_sd_to_drive(struct gv_sd *s, struct g /* No good slot found? */ if (s->size == -1) { - G_VINUM_DEBUG(0, "couldn't autosize '%s' on '%s'", + G_VINUM_DEBUG(0, "unable to autosize '%s' on '%s'", s->name, d->name); return (GV_ERR_BADSIZE); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 09:26: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 2C4A210656A4; Mon, 5 Oct 2009 09:26:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 016618FC25; Mon, 5 Oct 2009 09:26: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 n959QMMK006516; Mon, 5 Oct 2009 09:26:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n959QMSG006510; Mon, 5 Oct 2009 09:26:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910050926.n959QMSG006510@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 5 Oct 2009 09:26: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: r197768 - head/etc/pam.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 09:26:23 -0000 Author: des Date: Mon Oct 5 09:26:22 2009 New Revision: 197768 URL: http://svn.freebsd.org/changeset/base/197768 Log: Change the pam_ssh examples: if you use it, you probably want want_agent. MFC after: 3 weeks Modified: head/etc/pam.d/kde head/etc/pam.d/other head/etc/pam.d/sshd head/etc/pam.d/system head/etc/pam.d/telnetd Modified: head/etc/pam.d/kde ============================================================================== --- head/etc/pam.d/kde Mon Oct 5 08:44:31 2009 (r197767) +++ head/etc/pam.d/kde Mon Oct 5 09:26:22 2009 (r197768) @@ -15,5 +15,5 @@ account required pam_nologin.so account required pam_unix.so # session -#session optional pam_ssh.so +#session optional pam_ssh.so want_agent session required pam_permit.so Modified: head/etc/pam.d/other ============================================================================== --- head/etc/pam.d/other Mon Oct 5 08:44:31 2009 (r197767) +++ head/etc/pam.d/other Mon Oct 5 09:26:22 2009 (r197768) @@ -18,7 +18,7 @@ account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so +#session optional pam_ssh.so want_agent session required pam_permit.so # password Modified: head/etc/pam.d/sshd ============================================================================== --- head/etc/pam.d/sshd Mon Oct 5 08:44:31 2009 (r197767) +++ head/etc/pam.d/sshd Mon Oct 5 09:26:22 2009 (r197768) @@ -18,7 +18,7 @@ account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so +#session optional pam_ssh.so want_agent session required pam_permit.so # password Modified: head/etc/pam.d/system ============================================================================== --- head/etc/pam.d/system Mon Oct 5 08:44:31 2009 (r197767) +++ head/etc/pam.d/system Mon Oct 5 09:26:22 2009 (r197768) @@ -17,7 +17,7 @@ account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so +#session optional pam_ssh.so want_agent session required pam_lastlog.so no_fail # password Modified: head/etc/pam.d/telnetd ============================================================================== --- head/etc/pam.d/telnetd Mon Oct 5 08:44:31 2009 (r197767) +++ head/etc/pam.d/telnetd Mon Oct 5 09:26:22 2009 (r197768) @@ -18,7 +18,7 @@ account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so +#session optional pam_ssh.so want_agent session required pam_lastlog.so no_fail # password From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 09:28: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 7F5D61065676; Mon, 5 Oct 2009 09:28:55 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6E88FC19; Mon, 5 Oct 2009 09: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 n959St7C006611; Mon, 5 Oct 2009 09:28:55 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n959StEr006603; Mon, 5 Oct 2009 09:28:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910050928.n959StEr006603@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 5 Oct 2009 09:28: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: r197769 - head/etc/pam.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 09:28:55 -0000 Author: des Date: Mon Oct 5 09:28:54 2009 New Revision: 197769 URL: http://svn.freebsd.org/changeset/base/197769 Log: tabify MFC after: 3 weeks Modified: head/etc/pam.d/ftpd head/etc/pam.d/kde head/etc/pam.d/other head/etc/pam.d/sshd head/etc/pam.d/system head/etc/pam.d/telnetd head/etc/pam.d/xdm Modified: head/etc/pam.d/ftpd ============================================================================== --- head/etc/pam.d/ftpd Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/ftpd Mon Oct 5 09:28:54 2009 (r197769) @@ -8,12 +8,12 @@ auth sufficient pam_opie.so no_warn no_fake_prompts auth requisite pam_opieaccess.so no_warn allow_local #auth sufficient pam_krb5.so no_warn -#auth sufficient pam_ssh.so no_warn try_first_pass +#auth sufficient pam_ssh.so no_warn try_first_pass auth required pam_unix.so no_warn try_first_pass # account account required pam_nologin.so -#account required pam_krb5.so +#account required pam_krb5.so account required pam_unix.so # session Modified: head/etc/pam.d/kde ============================================================================== --- head/etc/pam.d/kde Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/kde Mon Oct 5 09:28:54 2009 (r197769) @@ -11,9 +11,9 @@ auth required pam_unix.so no_warn try_ # account account required pam_nologin.so -#account required pam_krb5.so +#account required pam_krb5.so account required pam_unix.so # session -#session optional pam_ssh.so want_agent +#session optional pam_ssh.so want_agent session required pam_permit.so Modified: head/etc/pam.d/other ============================================================================== --- head/etc/pam.d/other Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/other Mon Oct 5 09:28:54 2009 (r197769) @@ -13,12 +13,12 @@ auth required pam_unix.so no_warn try_ # account account required pam_nologin.so -#account required pam_krb5.so +#account required pam_krb5.so account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so want_agent +#session optional pam_ssh.so want_agent session required pam_permit.so # password Modified: head/etc/pam.d/sshd ============================================================================== --- head/etc/pam.d/sshd Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/sshd Mon Oct 5 09:28:54 2009 (r197769) @@ -13,12 +13,12 @@ auth required pam_unix.so no_warn try_ # account account required pam_nologin.so -#account required pam_krb5.so +#account required pam_krb5.so account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so want_agent +#session optional pam_ssh.so want_agent session required pam_permit.so # password Modified: head/etc/pam.d/system ============================================================================== --- head/etc/pam.d/system Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/system Mon Oct 5 09:28:54 2009 (r197769) @@ -12,12 +12,12 @@ auth requisite pam_opieaccess.so no_war auth required pam_unix.so no_warn try_first_pass nullok # account -#account required pam_krb5.so +#account required pam_krb5.so account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so want_agent +#session optional pam_ssh.so want_agent session required pam_lastlog.so no_fail # password Modified: head/etc/pam.d/telnetd ============================================================================== --- head/etc/pam.d/telnetd Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/telnetd Mon Oct 5 09:28:54 2009 (r197769) @@ -13,12 +13,12 @@ auth required pam_unix.so no_warn try_ # account account required pam_nologin.so -#account required pam_krb5.so +#account required pam_krb5.so account required pam_login_access.so account required pam_unix.so # session -#session optional pam_ssh.so want_agent +#session optional pam_ssh.so want_agent session required pam_lastlog.so no_fail # password Modified: head/etc/pam.d/xdm ============================================================================== --- head/etc/pam.d/xdm Mon Oct 5 09:26:22 2009 (r197768) +++ head/etc/pam.d/xdm Mon Oct 5 09:28:54 2009 (r197769) @@ -11,11 +11,11 @@ auth required pam_unix.so no_warn try_ # account account required pam_nologin.so -#account required pam_krb5.so +#account required pam_krb5.so account required pam_unix.so # session -#session required pam_ssh.so want_agent +#session required pam_ssh.so want_agent session required pam_lastlog.so no_fail # password From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 10:08: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 37A981065672; Mon, 5 Oct 2009 10:08:59 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 262B68FC25; Mon, 5 Oct 2009 10:08: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 n95A8wcj007647; Mon, 5 Oct 2009 10:08:58 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95A8wII007645; Mon, 5 Oct 2009 10:08:58 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200910051008.n95A8wII007645@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 5 Oct 2009 10:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197770 - head/sys/arm/arm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 10:08:59 -0000 Author: stas Date: Mon Oct 5 10:08:58 2009 New Revision: 197770 URL: http://svn.freebsd.org/changeset/base/197770 Log: - Drop unused pmap_use_l1 function and comment out currently unused pmap_dcache_wbinv_all/pmap_copy_page functions which we might want to take advatage of later. This fixes the build with PMAP_DEBUG defined. Discussed with: cognet Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Mon Oct 5 09:28:54 2009 (r197769) +++ head/sys/arm/arm/pmap.c Mon Oct 5 10:08:58 2009 (r197770) @@ -203,7 +203,6 @@ static void pmap_enter_locked(pmap_t, v static void pmap_fix_cache(struct vm_page *, pmap_t, vm_offset_t); static void pmap_alloc_l1(pmap_t); static void pmap_free_l1(pmap_t); -static void pmap_use_l1(pmap_t); static int pmap_clearbit(struct vm_page *, u_int); @@ -829,47 +828,6 @@ pmap_free_l1(pmap_t pm) mtx_unlock(&l1_lru_lock); } -static PMAP_INLINE void -pmap_use_l1(pmap_t pm) -{ - struct l1_ttable *l1; - - /* - * Do nothing if we're in interrupt context. - * Access to an L1 by the kernel pmap must not affect - * the LRU list. - */ - if (pm == pmap_kernel()) - return; - - l1 = pm->pm_l1; - - /* - * If the L1 is not currently on the LRU list, just return - */ - if (l1->l1_domain_use_count == PMAP_DOMAINS) - return; - - mtx_lock(&l1_lru_lock); - - /* - * Check the use count again, now that we've acquired the lock - */ - if (l1->l1_domain_use_count == PMAP_DOMAINS) { - mtx_unlock(&l1_lru_lock); - return; - } - - /* - * Move the L1 to the back of the LRU list - */ - TAILQ_REMOVE(&l1_lru_list, l1, l1_lru); - TAILQ_INSERT_TAIL(&l1_lru_list, l1, l1_lru); - - mtx_unlock(&l1_lru_lock); -} - - /* * Returns a pointer to the L2 bucket associated with the specified pmap * and VA, or NULL if no L2 bucket exists for the address. @@ -1311,6 +1269,7 @@ pmap_idcache_wbinv_all(pmap_t pm) } } +#ifdef notyet static PMAP_INLINE void pmap_dcache_wbinv_all(pmap_t pm) { @@ -1320,6 +1279,7 @@ pmap_dcache_wbinv_all(pmap_t pm) cpu_l2cache_wbinv_all(); } } +#endif /* * PTE_SYNC_CURRENT: @@ -1914,7 +1874,7 @@ pmap_init(void) { int shpgperproc = PMAP_SHPGPERPROC; - PDEBUG(1, printf("pmap_init: phys_start = %08x\n")); + PDEBUG(1, printf("pmap_init: phys_start = %08x\n", PHYSADDR)); /* * init the pv free list @@ -2373,8 +2333,8 @@ pmap_bootstrap(vm_offset_t firstaddr, vm vm_size_t size; int l1idx, l2idx, l2next = 0; - PDEBUG(1, printf("firstaddr = %08x, loadaddr = %08x\n", - firstaddr, loadaddr)); + PDEBUG(1, printf("firstaddr = %08x, lastaddr = %08x\n", + firstaddr, lastaddr)); virtual_avail = firstaddr; kernel_pmap->pm_l1 = l1; @@ -4251,7 +4211,7 @@ pmap_zero_page_idle(vm_page_t m) * pmap_clean_page() * * This is a local function used to work out the best strategy to clean - * a single page referenced by its entry in the PV table. It's used by + * a single page referenced by its entry in the PV table. It should be used by * pmap_copy_page, pmap_zero page and maybe some others later on. * * Its policy is effectively: @@ -4266,6 +4226,8 @@ pmap_zero_page_idle(vm_page_t m) * mapped at 0x00000000 a whole cache clean will be performed rather than * just the 1 page. Since this should not occur in everyday use and if it does * it will just result in not the most efficient clean for the page. + * + * We don't yet use this function but may want to. */ static int pmap_clean_page(struct pv_entry *pv, boolean_t is_src) From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 11:39: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 1536B1065693; Mon, 5 Oct 2009 11:39:24 +0000 (UTC) (envelope-from michio.jinbo@gmail.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id A6BA38FC21; Mon, 5 Oct 2009 11:39:23 +0000 (UTC) Received: by pzk40 with SMTP id 40so2959630pzk.7 for ; Mon, 05 Oct 2009 04:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject:cc :in-reply-to:references:message-id:mime-version:content-type :content-transfer-encoding:x-mailer; bh=61EaWSTH8BcxFKJ8T3sO4fC2OMYKqHj05IJ+BvEbavc=; b=eKKM8kh2wsvSTnP68CjPSXP6JGzJ6D/+GXDqHDGUi1DvdDPtHMSQ8SdLUQQBl2yEnC Gl5RB/EIPdRPbX8wv9Ei/deDVgVcenPG0tQjrprBqxqsBT2BmfHmuSy9qQGm+TgZvCiy K3CrMqF+lmqAxeUshEc1uw1rRugIVD3/a/SLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:cc:in-reply-to:references:message-id :mime-version:content-type:content-transfer-encoding:x-mailer; b=TDXYVFLZ0RvOWXVEa6B8TMM2p6bYI3wy+GCYinO0Os3IaPbae/KcFyKPPo1d7dxeID QRyYAIduVKD9FpV4k6+yA98M/fUDjXlWnWOYp6l/xESOltY1AKjjnxNpx289Ii/TT8uq pAe+c7Iz8i5uKRSA/IXpGGtO6NXy1xo2Q5MGs= Received: by 10.115.85.6 with SMTP id n6mr8890167wal.74.1254742763257; Mon, 05 Oct 2009 04:39:23 -0700 (PDT) Received: from ?192.168.4.100? (router.jinbo.jp [210.229.61.161]) by mx.google.com with ESMTPS id 22sm712946pzk.6.2009.10.05.04.39.21 (version=SSLv3 cipher=RC4-MD5); Mon, 05 Oct 2009 04:39:22 -0700 (PDT) Date: Mon, 05 Oct 2009 20:39:23 +0900 From: "Michio \"Karl\" Jinbo" To: Konstantin Belousov In-Reply-To: <200910041220.n94CKxTH073639@svn.freebsd.org> References: <200910041220.n94CKxTH073639@svn.freebsd.org> Message-Id: <20091005203920.1278.22FF24F1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.51.07 [ja] Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, freebsd-current@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r197744 - in stable/8/sys: . amd64/amd64 amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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: Mon, 05 Oct 2009 11:39:24 -0000 On Sun, 4 Oct 2009 12:20:59 +0000 (UTC) Konstantin Belousov wrote: > Log: > MFC r197663: > As a workaround, for Intel CPUs, do not use CLFLUSH in > pmap_invalidate_cache_range() when self-snoop is apparently not reported > in cpu features. > > Approved by: re (bz, kensmith) I was tested r197663/r197744, but kernel panic again on Citrix Xen Server. using 8.0-RC1 install cd, results are 1. INTEL SU9400+HYPER-V(Windows2008 R2) -> boot OK. 2. AMD Athlon X2 TK-55+HYPER-V(Windows2008 R2) -> boot NG. 3. AMD PhenomII 940BK+Citrix Xen Server -> boot NG. I think INTEL CPUs are no problem, but AMD CPUs appear the problem. So I tested the following patch, kernel boot was successed on recent 9-CURRENT and environment 3. sorry, poor English. --- sys/i386/i386/initcpu.c.original 2009-10-01 21:52:48.000000000 +0900 +++ sys/i386/i386/initcpu.c 2009-10-05 08:29:45.000000000 +0900 @@ -721,7 +721,7 @@ * XXXKIB: (temporary) hack to work around traps generated when * CLFLUSHing APIC registers window. */ - if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS)) + if (cpu_vendor_id == CPU_VENDOR_AMD && !(cpu_feature & CPUID_SS)) cpu_feature &= ~CPUID_CLFSH; #if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE) -- Michio "Karl" Jinbo From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 13:30: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 587C91065693; Mon, 5 Oct 2009 13:30:31 +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 2AA2C8FC0A; Mon, 5 Oct 2009 13:30:31 +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 C2E0D46B06; Mon, 5 Oct 2009 09:30:30 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 69FD08A020; Mon, 5 Oct 2009 09:30:29 -0400 (EDT) Message-ID: <4AC9F4F4.4030008@FreeBSD.org> Date: Mon, 05 Oct 2009 09:30:28 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Alan Cox References: <200910041853.n94IrAf7082338@svn.freebsd.org> In-Reply-To: <200910041853.n94IrAf7082338@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 05 Oct 2009 09:30:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.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: r197750 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 13:30:31 -0000 Alan Cox wrote: > Author: alc > Date: Sun Oct 4 18:53:10 2009 > New Revision: 197750 > URL: http://svn.freebsd.org/changeset/base/197750 > > Log: > Align and pad the page queue and free page queue locks so that the linker > can't possibly place them together within the same cache line. > > MFC after: 3 weeks > > Modified: > head/sys/vm/vm_page.c > head/sys/vm/vm_page.h > > Modified: head/sys/vm/vm_page.c > ============================================================================== > --- head/sys/vm/vm_page.c Sun Oct 4 17:22:51 2009 (r197749) > +++ head/sys/vm/vm_page.c Sun Oct 4 18:53:10 2009 (r197750) > @@ -135,8 +135,8 @@ __FBSDID("$FreeBSD$"); > */ > > struct vpgqueues vm_page_queues[PQ_COUNT]; > -struct mtx vm_page_queue_mtx; > -struct mtx vm_page_queue_free_mtx; > +struct vpglocks vm_page_queue_lock; > +struct vpglocks vm_page_queue_free_lock; I think you can do this by just: struct mtx vm_page_queue_mtx __aligned(CACHE_LINE_SIZE); without the need for a wrapper structure. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 14:03: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 E4BD31065693; Mon, 5 Oct 2009 14:03:26 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B80208FC0C; Mon, 5 Oct 2009 14:03: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 n95E3Qcx014414; Mon, 5 Oct 2009 14:03:26 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95E3QSJ014412; Mon, 5 Oct 2009 14:03:26 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200910051403.n95E3QSJ014412@svn.freebsd.org> From: Takahashi Yoshihiro Date: Mon, 5 Oct 2009 14:03: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: r197771 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris conf contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 14:03:27 -0000 Author: nyan Date: Mon Oct 5 14:03:26 2009 New Revision: 197771 URL: http://svn.freebsd.org/changeset/base/197771 Log: MFC: revision 197709 Fix build nfscl and/or nfsd. Approved by: re (kib) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/conf/files 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/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Oct 5 10:08:58 2009 (r197770) +++ stable/8/sys/conf/files Mon Oct 5 14:03:26 2009 (r197771) @@ -2660,12 +2660,12 @@ vm/vm_reserv.c standard vm/vm_unix.c standard vm/vm_zeroidle.c standard vm/vnode_pager.c standard -xdr/xdr.c optional krpc | nfslockd | nfsclient | nfsserver -xdr/xdr_array.c optional krpc | nfslockd | nfsclient | nfsserver -xdr/xdr_mbuf.c optional krpc | nfslockd | nfsclient | nfsserver -xdr/xdr_mem.c optional krpc | nfslockd | nfsclient | nfsserver -xdr/xdr_reference.c optional krpc | nfslockd | nfsclient | nfsserver -xdr/xdr_sizeof.c optional krpc | nfslockd | nfsclient | nfsserver +xdr/xdr.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd +xdr/xdr_array.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd +xdr/xdr_mbuf.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd +xdr/xdr_mem.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd +xdr/xdr_reference.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd +xdr/xdr_sizeof.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd # gnu/fs/xfs/xfs_alloc.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 14:13: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 4CF19106568F; Mon, 5 Oct 2009 14:13: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 3C3B58FC15; Mon, 5 Oct 2009 14:13: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 n95EDG4d014648; Mon, 5 Oct 2009 14:13:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95EDGXN014646; Mon, 5 Oct 2009 14:13:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910051413.n95EDGXN014646@svn.freebsd.org> From: John Baldwin Date: Mon, 5 Oct 2009 14:13: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: r197772 - head/sys/dev/ppbus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 14:13:17 -0000 Author: jhb Date: Mon Oct 5 14:13:16 2009 New Revision: 197772 URL: http://svn.freebsd.org/changeset/base/197772 Log: When the timeout backoff hits the maximum value, leave it capped at the maximum value rather than setting it to the result of a boolean expression that is always true. Submitted by: Joseph Kong MFC after: 1 month Modified: head/sys/dev/ppbus/lpt.c Modified: head/sys/dev/ppbus/lpt.c ============================================================================== --- head/sys/dev/ppbus/lpt.c Mon Oct 5 14:03:26 2009 (r197771) +++ head/sys/dev/ppbus/lpt.c Mon Oct 5 14:13:16 2009 (r197772) @@ -456,7 +456,7 @@ lptout(void *arg) if (sc->sc_state & OPEN) { sc->sc_backoff++; if (sc->sc_backoff > hz/LPTOUTMAX) - sc->sc_backoff = sc->sc_backoff > hz/LPTOUTMAX; + sc->sc_backoff = hz/LPTOUTMAX; callout_reset(&sc->sc_timer, sc->sc_backoff, lptout, sc); } else sc->sc_state &= ~TOUT; From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 14:17: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 3192A106568D; Mon, 5 Oct 2009 14:17:46 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id E79098FC22; Mon, 5 Oct 2009 14:17:45 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 565332C2CB6; Mon, 5 Oct 2009 09:17:45 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hEZ+jTjmcNlV; Mon, 5 Oct 2009 09:17:37 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 133372C2BF0; Mon, 5 Oct 2009 09:17:37 -0500 (CDT) Message-ID: <4ACA0000.2080005@cs.rice.edu> Date: Mon, 05 Oct 2009 09:17:36 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: John Baldwin References: <200910041853.n94IrAf7082338@svn.freebsd.org> <4AC9F4F4.4030008@FreeBSD.org> In-Reply-To: <4AC9F4F4.4030008@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197750 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 14:17:46 -0000 John Baldwin wrote: > Alan Cox wrote: >> Author: alc >> Date: Sun Oct 4 18:53:10 2009 >> New Revision: 197750 >> URL: http://svn.freebsd.org/changeset/base/197750 >> >> Log: >> Align and pad the page queue and free page queue locks so that the >> linker >> can't possibly place them together within the same cache line. >> MFC after: 3 weeks >> >> Modified: >> head/sys/vm/vm_page.c >> head/sys/vm/vm_page.h >> >> Modified: head/sys/vm/vm_page.c >> ============================================================================== >> >> --- head/sys/vm/vm_page.c Sun Oct 4 17:22:51 2009 (r197749) >> +++ head/sys/vm/vm_page.c Sun Oct 4 18:53:10 2009 (r197750) >> @@ -135,8 +135,8 @@ __FBSDID("$FreeBSD$"); >> */ >> >> struct vpgqueues vm_page_queues[PQ_COUNT]; >> -struct mtx vm_page_queue_mtx; >> -struct mtx vm_page_queue_free_mtx; >> +struct vpglocks vm_page_queue_lock; >> +struct vpglocks vm_page_queue_free_lock; > > I think you can do this by just: > > struct mtx vm_page_queue_mtx __aligned(CACHE_LINE_SIZE); > > without the need for a wrapper structure. > Unfortunately, no. When I compile the following example: int a; int b __attribute__((aligned(16))); int x; int y; int z; int main(void) { return (0); } I get the following: 080495b4 A __bss_start 080495b4 A _edata 080495c0 b completed.4860 080495c4 B environ 080495d0 B b 080495d4 B x 080495d8 B z 080495dc B y 080495e0 B a 080495e4 A _end Thus, "b" is aligned as specified, but not padded to 16 bytes. Alan From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 14:28: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 420BE1065670; Mon, 5 Oct 2009 14:28:24 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13A788FC0C; Mon, 5 Oct 2009 14:28:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n95ESNH0015044; Mon, 5 Oct 2009 14:28:23 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95ESNhM015041; Mon, 5 Oct 2009 14:28:23 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <200910051428.n95ESNhM015041@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 5 Oct 2009 14:28:23 +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: r197773 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/mxge dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 14:28:24 -0000 Author: gallatin Date: Mon Oct 5 14:28:23 2009 New Revision: 197773 URL: http://svn.freebsd.org/changeset/base/197773 Log: MFC:197645 Two more mxge watchdog fixes 1) Restore the PCI Express control register after a watchdog reset. This is required because the device will come out of watchdog reset with the pectl reg at its default state, and important BIOS configuration (like max payload size) could be lost. 2) Call mxge_start_locked() for every tx queue before dropping the lock in the watchdog handler. This is required, as the queue's buf ring may have filled during the reset. Approved by: re (kib) Modified: 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/mxge/if_mxge.c stable/8/sys/dev/mxge/if_mxge_var.h stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/8/sys/dev/mxge/if_mxge.c Mon Oct 5 14:13:16 2009 (r197772) +++ stable/8/sys/dev/mxge/if_mxge.c Mon Oct 5 14:28:23 2009 (r197773) @@ -3653,10 +3653,16 @@ mxge_setup_cfg_space(mxge_softc_t *sc) if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { lnk = pci_read_config(dev, reg + 0x12, 2); sc->link_width = (lnk >> 4) & 0x3f; - - pectl = pci_read_config(dev, reg + 0x8, 2); - pectl = (pectl & ~0x7000) | (5 << 12); - pci_write_config(dev, reg + 0x8, pectl, 2); + + if (sc->pectl == 0) { + pectl = pci_read_config(dev, reg + 0x8, 2); + pectl = (pectl & ~0x7000) | (5 << 12); + pci_write_config(dev, reg + 0x8, pectl, 2); + sc->pectl = pectl; + } else { + /* restore saved pectl after watchdog reset */ + pci_write_config(dev, reg + 0x8, sc->pectl, 2); + } } /* Enable DMA and Memory space access */ @@ -3768,6 +3774,9 @@ mxge_watchdog_reset(mxge_softc_t *sc, in /* release all TX locks */ for (s = 0; s < num_tx_slices; s++) { ss = &sc->ss[s]; +#ifdef IFNET_BUF_RING + mxge_start_locked(ss); +#endif mtx_unlock(&ss->tx.mtx); } } Modified: stable/8/sys/dev/mxge/if_mxge_var.h ============================================================================== --- stable/8/sys/dev/mxge/if_mxge_var.h Mon Oct 5 14:13:16 2009 (r197772) +++ stable/8/sys/dev/mxge/if_mxge_var.h Mon Oct 5 14:28:23 2009 (r197773) @@ -273,6 +273,7 @@ struct mxge_softc { struct sysctl_ctx_list slice_sysctl_ctx; char *mac_addr_string; uint8_t mac_addr[6]; /* eeprom mac address */ + uint16_t pectl; /* save PCIe CTL state */ char product_code_string[64]; char serial_number_string[64]; char cmd_mtx_name[16]; From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 14:49: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 1F50A10656C3; Mon, 5 Oct 2009 14:49:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D5648FC24; Mon, 5 Oct 2009 14:49: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 n95EnG4c015527; Mon, 5 Oct 2009 14:49:16 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95EnGof015525; Mon, 5 Oct 2009 14:49:16 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910051449.n95EnGof015525@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 14:49: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: r197775 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 14:49:17 -0000 Author: rwatson Date: Mon Oct 5 14:49:16 2009 New Revision: 197775 URL: http://svn.freebsd.org/changeset/base/197775 Log: First cut at implementing SOCK_SEQPACKET support for UNIX (local) domain sockets. This allows for reliable bi-directional datagram communication over UNIX domain sockets, in contrast to SOCK_DGRAM (M:N, unreliable) or SOCK_STERAM (bi-directional bytestream). Largely, this reuses existing UNIX domain socket code. This allows applications requiring record- oriented semantics to do so reliably via local IPC. Some implementation notes (also present in XXX comments): - Currently we lack an sbappend variant able to do datagrams and control data without doing addresses, so we mark SOCK_SEQPACKET as PR_ADDR. Adding a new variant will solve this problem. - UNIX domain sockets on FreeBSD provide back-pressure/flow control notification for stream sockets by manipulating the send socket buffer's size during pru_send and pru_rcvd. This trick works less well for SOCK_SEQPACKET as sosend_generic() uses sb_hiwat not just to manage blocking, but also to determine maximum datagram size. Fixing this requires rethinking how back-pressure is done for SOCK_SEQPACKET; in the mean time, it's possible to get EMSGSIZE when buffers fill, instead of blocking. Discussed with: benl Reviewed by: bz, rpaulo MFC after: 3 months Sponsored by: Google Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Oct 5 14:46:56 2009 (r197774) +++ head/sys/kern/uipc_usrreq.c Mon Oct 5 14:49:16 2009 (r197775) @@ -50,7 +50,8 @@ * garbage collector to find and tear down cycles of disconnected sockets. * * TODO: - * SEQPACKET, RDM + * RDM + * distinguish datagram size limits from flow control limits in SEQPACKET * rethink name space problems * need a proper out-of-band */ @@ -112,6 +113,7 @@ static ino_t unp_ino; /* Prototype for static int unp_rights; /* (g) File descriptors in flight. */ static struct unp_head unp_shead; /* (l) List of stream sockets. */ static struct unp_head unp_dhead; /* (l) List of datagram sockets. */ +static struct unp_head unp_sphead; /* (l) List of seqpacket sockets. */ static const struct sockaddr sun_noname = { sizeof(sun_noname), AF_LOCAL }; @@ -139,10 +141,14 @@ static u_long unpst_sendspace = PIPSIZ; static u_long unpst_recvspace = PIPSIZ; static u_long unpdg_sendspace = 2*1024; /* really max datagram size */ static u_long unpdg_recvspace = 4*1024; +static u_long unpsp_sendspace = PIPSIZ; /* really max datagram size */ +static u_long unpsp_recvspace = PIPSIZ; SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW, 0, "Local domain"); SYSCTL_NODE(_net_local, SOCK_STREAM, stream, CTLFLAG_RW, 0, "SOCK_STREAM"); SYSCTL_NODE(_net_local, SOCK_DGRAM, dgram, CTLFLAG_RW, 0, "SOCK_DGRAM"); +SYSCTL_NODE(_net_local, SOCK_SEQPACKET, seqpacket, CTLFLAG_RW, 0, + "SOCK_SEQPACKET"); SYSCTL_ULONG(_net_local_stream, OID_AUTO, sendspace, CTLFLAG_RW, &unpst_sendspace, 0, "Default stream send space."); @@ -152,6 +158,10 @@ SYSCTL_ULONG(_net_local_dgram, OID_AUTO, &unpdg_sendspace, 0, "Default datagram send space."); SYSCTL_ULONG(_net_local_dgram, OID_AUTO, recvspace, CTLFLAG_RW, &unpdg_recvspace, 0, "Default datagram receive space."); +SYSCTL_ULONG(_net_local_seqpacket, OID_AUTO, maxseqpacket, CTLFLAG_RW, + &unpsp_sendspace, 0, "Default seqpacket send space."); +SYSCTL_ULONG(_net_local_seqpacket, OID_AUTO, recvspace, CTLFLAG_RW, + &unpsp_recvspace, 0, "Default seqpacket receive space."); SYSCTL_INT(_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight."); @@ -257,6 +267,7 @@ static struct mbuf *unp_addsockcred(stru */ static struct domain localdomain; static struct pr_usrreqs uipc_usrreqs_dgram, uipc_usrreqs_stream; +static struct pr_usrreqs uipc_usrreqs_seqpacket; static struct protosw localsw[] = { { .pr_type = SOCK_STREAM, @@ -271,6 +282,19 @@ static struct protosw localsw[] = { .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS, .pr_usrreqs = &uipc_usrreqs_dgram }, +{ + .pr_type = SOCK_SEQPACKET, + .pr_domain = &localdomain, + + /* + * XXXRW: For now, PR_ADDR because soreceive will bump into them + * due to our use of sbappendaddr. A new sbappend variants is needed + * that supports both atomic record writes and control data. + */ + .pr_flags = PR_ADDR|PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD| + PR_RIGHTS, + .pr_usrreqs = &uipc_usrreqs_seqpacket, +}, }; static struct domain localdomain = { @@ -353,6 +377,11 @@ uipc_attach(struct socket *so, int proto recvspace = unpdg_recvspace; break; + case SOCK_SEQPACKET: + sendspace = unpsp_sendspace; + recvspace = unpsp_recvspace; + break; + default: panic("uipc_attach"); } @@ -372,8 +401,22 @@ uipc_attach(struct socket *so, int proto UNP_LIST_LOCK(); unp->unp_gencnt = ++unp_gencnt; unp_count++; - LIST_INSERT_HEAD(so->so_type == SOCK_DGRAM ? &unp_dhead : &unp_shead, - unp, unp_link); + switch (so->so_type) { + case SOCK_STREAM: + LIST_INSERT_HEAD(&unp_shead, unp, unp_link); + break; + + case SOCK_DGRAM: + LIST_INSERT_HEAD(&unp_dhead, unp, unp_link); + break; + + case SOCK_SEQPACKET: + LIST_INSERT_HEAD(&unp_sphead, unp, unp_link); + break; + + default: + panic("uipc_attach"); + } UNP_LIST_UNLOCK(); return (0); @@ -705,11 +748,8 @@ uipc_rcvd(struct socket *so, int flags) unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_rcvd: unp == NULL")); - if (so->so_type == SOCK_DGRAM) - panic("uipc_rcvd DGRAM?"); - - if (so->so_type != SOCK_STREAM) - panic("uipc_rcvd unknown socktype"); + if (so->so_type != SOCK_STREAM && so->so_type != SOCK_SEQPACKET) + panic("uipc_rcvd socktype %d", so->so_type); /* * Adjust backpressure on sender and wakeup any waiting to write. @@ -824,6 +864,7 @@ uipc_send(struct socket *so, int flags, break; } + case SOCK_SEQPACKET: case SOCK_STREAM: if ((so->so_state & SS_ISCONNECTED) == 0) { if (nam != NULL) { @@ -875,11 +916,33 @@ uipc_send(struct socket *so, int flags, * Send to paired receive port, and then reduce send buffer * hiwater marks to maintain backpressure. Wake up readers. */ - if (control != NULL) { - if (sbappendcontrol_locked(&so2->so_rcv, m, control)) + switch (so->so_type) { + case SOCK_STREAM: + if (control != NULL) { + if (sbappendcontrol_locked(&so2->so_rcv, m, + control)) + control = NULL; + } else + sbappend_locked(&so2->so_rcv, m); + break; + + case SOCK_SEQPACKET: { + const struct sockaddr *from; + + from = &sun_noname; + if (sbappendaddr_locked(&so2->so_rcv, from, m, + control)) control = NULL; - } else - sbappend_locked(&so2->so_rcv, m); + break; + } + } + + /* + * XXXRW: While fine for SOCK_STREAM, this conflates maximum + * datagram size and back-pressure for SOCK_SEQPACKET, which + * can lead to undesired return of EMSGSIZE on send instead + * of more desirable blocking. + */ mbcnt_delta = so2->so_rcv.sb_mbcnt - unp2->unp_mbcnt; unp2->unp_mbcnt = so2->so_rcv.sb_mbcnt; sbcc = so2->so_rcv.sb_cc; @@ -939,7 +1002,8 @@ uipc_sense(struct socket *so, struct sta UNP_LINK_RLOCK(); UNP_PCB_LOCK(unp); unp2 = unp->unp_conn; - if (so->so_type == SOCK_STREAM && unp2 != NULL) { + if ((so->so_type == SOCK_STREAM || so->so_type == SOCK_SEQPACKET) && + unp2 != NULL) { so2 = unp2->unp_socket; sb->st_blksize += so2->so_rcv.sb_cc; } @@ -1009,6 +1073,26 @@ static struct pr_usrreqs uipc_usrreqs_dg .pru_close = uipc_close, }; +static struct pr_usrreqs uipc_usrreqs_seqpacket = { + .pru_abort = uipc_abort, + .pru_accept = uipc_accept, + .pru_attach = uipc_attach, + .pru_bind = uipc_bind, + .pru_connect = uipc_connect, + .pru_connect2 = uipc_connect2, + .pru_detach = uipc_detach, + .pru_disconnect = uipc_disconnect, + .pru_listen = uipc_listen, + .pru_peeraddr = uipc_peeraddr, + .pru_rcvd = uipc_rcvd, + .pru_send = uipc_send, + .pru_sense = uipc_sense, + .pru_shutdown = uipc_shutdown, + .pru_sockaddr = uipc_sockaddr, + .pru_soreceive = soreceive_generic, /* XXX: or...? */ + .pru_close = uipc_close, +}; + static struct pr_usrreqs uipc_usrreqs_stream = { .pru_abort = uipc_abort, .pru_accept = uipc_accept, @@ -1306,6 +1390,7 @@ unp_connect2(struct socket *so, struct s break; case SOCK_STREAM: + case SOCK_SEQPACKET: unp2->unp_conn = unp; if (req == PRU_CONNECT && ((unp->unp_flags | unp2->unp_flags) & UNP_CONNWAIT)) @@ -1343,6 +1428,7 @@ unp_disconnect(struct unpcb *unp, struct break; case SOCK_STREAM: + case SOCK_SEQPACKET: soisdisconnected(unp->unp_socket); unp2->unp_conn = NULL; soisdisconnected(unp2->unp_socket); @@ -1368,7 +1454,22 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) struct unp_head *head; struct xunpcb *xu; - head = ((intptr_t)arg1 == SOCK_DGRAM ? &unp_dhead : &unp_shead); + switch ((intptr_t)arg1) { + case SOCK_STREAM: + head = &unp_shead; + break; + + case SOCK_DGRAM: + head = &unp_dhead; + break; + + case SOCK_SEQPACKET: + head = &unp_sphead; + break; + + default: + panic("unp_pcblist: arg1 %d", (intptr_t)arg1); + } /* * The process of preparing the PCB list is too time-consuming and @@ -1481,6 +1582,9 @@ SYSCTL_PROC(_net_local_dgram, OID_AUTO, SYSCTL_PROC(_net_local_stream, OID_AUTO, pcblist, CTLFLAG_RD, (caddr_t)(long)SOCK_STREAM, 0, unp_pcblist, "S,xunpcb", "List of active local stream sockets"); +SYSCTL_PROC(_net_local_seqpacket, OID_AUTO, pcblist, CTLFLAG_RD, + (caddr_t)(long)SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb", + "List of active local seqpacket sockets"); static void unp_shutdown(struct unpcb *unp) @@ -1492,7 +1596,8 @@ unp_shutdown(struct unpcb *unp) UNP_PCB_LOCK_ASSERT(unp); unp2 = unp->unp_conn; - if (unp->unp_socket->so_type == SOCK_STREAM && unp2 != NULL) { + if ((unp->unp_socket->so_type == SOCK_STREAM || + (unp->unp_socket->so_type == SOCK_SEQPACKET)) && unp2 != NULL) { so = unp2->unp_socket; if (so != NULL) socantrcvmore(so); @@ -1658,6 +1763,7 @@ unp_init(void) NULL, EVENTHANDLER_PRI_ANY); LIST_INIT(&unp_dhead); LIST_INIT(&unp_shead); + LIST_INIT(&unp_sphead); TASK_INIT(&unp_gc_task, 0, unp_gc, NULL); UNP_LINK_LOCK_INIT(); UNP_LIST_LOCK_INIT(); @@ -1974,7 +2080,8 @@ SYSCTL_INT(_net_local, OID_AUTO, taskcou static void unp_gc(__unused void *arg, int pending) { - struct unp_head *heads[] = { &unp_dhead, &unp_shead, NULL }; + struct unp_head *heads[] = { &unp_dhead, &unp_shead, &unp_sphead, + NULL }; struct unp_head **head; struct file **unref; struct unpcb *unp; From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:05: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 BD8721065692; Mon, 5 Oct 2009 15:05:10 +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 673758FC18; Mon, 5 Oct 2009 15:05:10 +0000 (UTC) Received: from stasss.yandex.ru (dhcp170-227-red.yandex.net [95.108.170.227]) by mx0.deglitch.com (Postfix) with ESMTPSA id 33EBD8FC4E; Mon, 5 Oct 2009 19:05:08 +0400 (MSD) Date: Mon, 5 Oct 2009 19:05:02 +0400 From: Stanislav Sedov To: Rui Paulo Message-Id: <20091005190502.7976ef3e.stas@FreeBSD.org> In-Reply-To: <200910041054.n94AsKTI071707@svn.freebsd.org> References: <200910041054.n94AsKTI071707@svn.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__5_Oct_2009_19_05_02_+0400_LPd1o1UaWem6qN85" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197741 - head/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 15:05:10 -0000 --Signature=_Mon__5_Oct_2009_19_05_02_+0400_LPd1o1UaWem6qN85 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, 4 Oct 2009 10:54:20 +0000 (UTC) Rui Paulo mentioned: > Author: rpaulo > Date: Sun Oct 4 10:54:20 2009 > New Revision: 197741 > URL: http://svn.freebsd.org/changeset/base/197741 >=20 > Log: > Install x86 related man pages on x86 systems only. > =20 > Reviewed by: jkoshy >=20 > Modified: > head/lib/libpmc/Makefile >=20 > Modified: head/lib/libpmc/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libpmc/Makefile Sun Oct 4 10:38:04 2009 (r197740) > +++ head/lib/libpmc/Makefile Sun Oct 4 10:54:20 2009 (r197741) > @@ -24,6 +24,7 @@ MAN+=3D pmc_start.3 > MAN+=3D pmclog.3 > =20 > # PMC-dependent manual pages > +.if ${MACHINE_ARCH} =3D=3D "i386" || ${MACHINE_ARCH} =3D=3D "amd64" > MAN+=3D pmc.atom.3 > MAN+=3D pmc.core.3 > MAN+=3D pmc.core2.3 > @@ -34,6 +35,7 @@ MAN+=3D pmc.p4.3 > MAN+=3D pmc.p5.3 > MAN+=3D pmc.p6.3 > MAN+=3D pmc.tsc.3 > +.endif > =20 You probably don't want to install i386-only man pages on amd64 as well (pmc.atom, pmc.k7, pmc.p5). --=20 Stanislav Sedov ST4096-RIPE --Signature=_Mon__5_Oct_2009_19_05_02_+0400_LPd1o1UaWem6qN85 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKygskAAoJEKN82nOYvCd0vdMP/1noilX1DD3JPYH6izrFgfoN /mA/ciL/tGbS3vTCCnmkMnNB6+bKivGK80WUCy3n5X5jqpt2GajO8t9glCR5zaFF jfyUx9AmWH7eR0xndt+380bAtAj3zYdgCP+ZousUhGmI36KJiXAooAkLe4tIVaKR NsZHMfRzGz093TSVHuke7Ebq3vsjXwgWkviLjrkTyT9ljuHYyZLsCTVuaZvaPHIY tW0KkUUhrOL/5D4cV7+VQK3xx4O8N8j8BDy8WzNAaAHtilmyb8/RZu3z0E+qCn48 OuOFXMubq2L9bAbLC1CZefcywiMXYx/mQReiE1qqE4locQ3jn70IUXLk5NtkI4EM ud/nHJkq+/hIyM8mdT32l5MJjHduvkU9a/EFRrRXsru86xtoqVkNNaQ+54NGifs1 klkgnmd9mhMGbAQOd3cw1QhZmoj7DpKGsmcTs40h/oKkecI08DXIhi6jvL1S/Pxa ehEqVgrfUIdAk0pBD/lp7rRfAkL3kDBtqyTbdwHS8nFGhKqSHhInA/ALRPFOe0jc Pn330n6wk0lUhkBLk6qeMTN/wFJqFyxv/Q2OUJ6rI61ODk/FNr9n9yuYQLJLT+XW c8dK5LBmpVHJjUw86duMdeKsOheXAN9PDRkRAcjZpWLV4asWzIcBUrfCc8gysQOX 8GqBfC33mgHwDSOO/h3n =HPAM -----END PGP SIGNATURE----- --Signature=_Mon__5_Oct_2009_19_05_02_+0400_LPd1o1UaWem6qN85-- From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:05: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 2F0F01065679; Mon, 5 Oct 2009 15:05:44 +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 1E7678FC1A; Mon, 5 Oct 2009 15:05: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 n95F5i1B015900; Mon, 5 Oct 2009 15:05:44 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95F5iQH015898; Mon, 5 Oct 2009 15:05:44 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200910051505.n95F5iQH015898@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 5 Oct 2009 15:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197776 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 15:05:44 -0000 Author: jh Date: Mon Oct 5 15:05:43 2009 New Revision: 197776 URL: http://svn.freebsd.org/changeset/base/197776 Log: Add myself. Approved by: trasz (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Mon Oct 5 14:49:16 2009 (r197775) +++ head/share/misc/committers-src.dot Mon Oct 5 15:05:43 2009 (r197776) @@ -106,6 +106,7 @@ ivoras [label="Ivan Voras\nivoras@FreeBS jake [label="Jake Burkholder\njake@FreeBSD.org\n2000/05/16"] jamie [label="Jamie Gritton\njamie@FreeBSD.org\n2009/01/28"] jayanth [label="Jayanth Vijayaraghavan\njayanth@FreeBSD.org\n2000/05/08"] +jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] jilles [label="Jilles Tjoelker\njilles@FreeBSD.org\n2009/05/22"] jinmei [label="JINMEI Tatuya\njinmei@FreeBSD.org\n2007/03/17"] jdp [label="John Polstra\njdp@FreeBSD.org\n????/??/??"] @@ -406,6 +407,7 @@ rwatson -> bz rwatson -> cperciva rwatson -> emaste rwatson -> gnn +rwatson -> jh rwatson -> kensmith rwatson -> kmacy rwatson -> linimon @@ -435,6 +437,8 @@ sos -> marcel thompsa -> weongyo thompsa -> eri +trasz -> jh + ume -> jinmei ume -> suz ume -> tshiozak From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:06: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 3A40010656A4; Mon, 5 Oct 2009 15:06:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 292C58FC0C; Mon, 5 Oct 2009 15:06: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 n95F6Fq4015952; Mon, 5 Oct 2009 15:06:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95F6FWb015948; Mon, 5 Oct 2009 15:06:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910051506.n95F6FWb015948@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 15:06: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: r197777 - 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: Mon, 05 Oct 2009 15:06:15 -0000 Author: rwatson Date: Mon Oct 5 15:06:14 2009 New Revision: 197777 URL: http://svn.freebsd.org/changeset/base/197777 Log: netstat(1) support for UNIX SOCK_SEQPACKET sockets -- changes were required only for the kvm case, as we supported SOCK_SEQPACKET via sysctl already. Sponsored by: Google MFC after: 3 months Modified: head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/unix.c Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Mon Oct 5 15:05:43 2009 (r197776) +++ head/usr.bin/netstat/main.c Mon Oct 5 15:06:14 2009 (r197777) @@ -186,6 +186,8 @@ static struct nlist nl[] = { { .n_name = "_mfctablesize" }, #define N_ARPSTAT 55 { .n_name = "_arpstat" }, +#define N_UNP_SPHEAD 56 + { .n_name = "unp_sphead" }, { .n_name = NULL }, }; @@ -601,7 +603,8 @@ main(int argc, char *argv[]) #endif /* NETGRAPH */ if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag) unixpr(nl[N_UNP_COUNT].n_value, nl[N_UNP_GENCNT].n_value, - nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value); + nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value, + nl[N_UNP_SPHEAD].n_value); exit(0); } Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Mon Oct 5 15:05:43 2009 (r197776) +++ head/usr.bin/netstat/netstat.h Mon Oct 5 15:06:14 2009 (r197777) @@ -150,7 +150,7 @@ void ddp_stats(u_long, const char *, int void netgraphprotopr(u_long, const char *, int, int); #endif -void unixpr(u_long, u_long, u_long, u_long); +void unixpr(u_long, u_long, u_long, u_long, u_long); void esis_stats(u_long, const char *, int, int); void clnp_stats(u_long, const char *, int, int); Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Mon Oct 5 15:05:43 2009 (r197776) +++ head/usr.bin/netstat/unix.c Mon Oct 5 15:06:14 2009 (r197777) @@ -193,21 +193,37 @@ fail: } void -unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off) +unixpr(u_long count_off, u_long gencnt_off, u_long dhead_off, u_long shead_off, + u_long sphead_off) { char *buf; int ret, type; struct xsocket *so; struct xunpgen *xug, *oxug; struct xunpcb *xunp; + u_long head_off; for (type = SOCK_STREAM; type <= SOCK_SEQPACKET; type++) { if (live) ret = pcblist_sysctl(type, &buf); - else - ret = pcblist_kvm(count_off, gencnt_off, - type == SOCK_STREAM ? shead_off : - (type == SOCK_DGRAM ? dhead_off : 0), &buf); + else { + head_off = 0; + switch (type) { + case SOCK_STREAM: + head_off = shead_off; + break; + + case SOCK_DGRAM: + head_off = dhead_off; + break; + + case SOCK_SEQPACKET: + head_off = sphead_off; + break; + } + ret = pcblist_kvm(count_off, gencnt_off, head_off, + &buf); + } if (ret == -1) continue; if (ret < 0) From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:07: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 BE789106568F; Mon, 5 Oct 2009 15:07:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADD038FC15; Mon, 5 Oct 2009 15:07: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 n95F7iTx016018; Mon, 5 Oct 2009 15:07:44 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95F7isb016016; Mon, 5 Oct 2009 15:07:44 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910051507.n95F7isb016016@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 15:07: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: r197778 - 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: Mon, 05 Oct 2009 15:07:44 -0000 Author: rwatson Date: Mon Oct 5 15:07:44 2009 New Revision: 197778 URL: http://svn.freebsd.org/changeset/base/197778 Log: SOCK_SEQPACKET is now supported on UNIX domain sockets. Sponsored by: Google MFC after: 3 months Modified: head/share/man/man4/unix.4 Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Mon Oct 5 15:06:14 2009 (r197777) +++ head/share/man/man4/unix.4 Mon Oct 5 15:07:44 2009 (r197778) @@ -52,7 +52,8 @@ mechanisms. The .Ux Ns -domain family supports the -.Dv SOCK_STREAM +.Dv SOCK_STREAM , +.Dv SOCK_SEQPACKET , and .Dv SOCK_DGRAM socket types and uses @@ -127,11 +128,14 @@ The .Ux Ns -domain protocol family is comprised of simple transport protocols that support the -.Dv SOCK_STREAM +.Dv SOCK_STREAM , +.Dv SOCK_SEQPACKET , and .Dv SOCK_DGRAM abstractions. .Dv SOCK_STREAM +and +.Dv SOCK_SEQPACKET sockets also support the communication of .Ux file descriptors through the use of the @@ -206,8 +210,9 @@ and tested with .Xr getsockopt 2 : .Bl -tag -width ".Dv LOCAL_CONNWAIT" .It Dv LOCAL_CREDS -This option may be enabled on a -.Dv SOCK_DGRAM +This option may be enabled on +.Dv SOCK_DGRAM , +.Dv SOCK_SEQPACKET , or a .Dv SOCK_STREAM socket. From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:15: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 E17F01065693; Mon, 5 Oct 2009 15:15:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D098B8FC1D; Mon, 5 Oct 2009 15:15: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 n95FFDM6016211; Mon, 5 Oct 2009 15:15:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95FFDub016209; Mon, 5 Oct 2009 15:15:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910051515.n95FFDub016209@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 15:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197779 - 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: Mon, 05 Oct 2009 15:15:14 -0000 Author: rwatson Date: Mon Oct 5 15:15:13 2009 New Revision: 197779 URL: http://svn.freebsd.org/changeset/base/197779 Log: Bump unix(4) man page date for SOCK_SEQPACKET. Suggested by: bz MFC after: 3 months Modified: head/share/man/man4/unix.4 Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Mon Oct 5 15:07:44 2009 (r197778) +++ head/share/man/man4/unix.4 Mon Oct 5 15:15:13 2009 (r197779) @@ -32,7 +32,7 @@ .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd July 15, 2001 +.Dd October 5, 2009 .Dt UNIX 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15: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 993AD1065693; Mon, 5 Oct 2009 15:16: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 87D9C8FC1E; Mon, 5 Oct 2009 15: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 n95FGSxN016274; Mon, 5 Oct 2009 15:16:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95FGS6p016270; Mon, 5 Oct 2009 15:16:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200910051516.n95FGS6p016270@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 5 Oct 2009 15: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: r197780 - 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: Mon, 05 Oct 2009 15:16:28 -0000 Author: trasz Date: Mon Oct 5 15:16:28 2009 New Revision: 197780 URL: http://svn.freebsd.org/changeset/base/197780 Log: Make fetch(9) and store(9) manual pages closer to reality. Modified: head/share/man/man9/Makefile head/share/man/man9/fetch.9 head/share/man/man9/store.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Oct 5 15:15:13 2009 (r197779) +++ head/share/man/man9/Makefile Mon Oct 5 15:16:28 2009 (r197780) @@ -606,8 +606,10 @@ MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECL EVENTHANDLER.9 eventhandler_register.9 MLINKS+=fetch.9 fubyte.9 \ fetch.9 fuswintr.9 \ - fetch.9 fusword.9 \ - fetch.9 fuword.9 + fetch.9 fuword.9 \ + fetch.9 fuword16.9 \ + fetch.9 fuword32.9 \ + fetch.9 fuword64.9 MLINKS+=g_attach.9 g_detach.9 MLINKS+=g_bio.9 g_clone_bio.9 \ g_bio.9 g_destroy_bio.9 \ @@ -1142,8 +1144,10 @@ MLINKS+=stack.9 stack_copy.9 \ stack.9 stack_zero.9 MLINKS+=store.9 subyte.9 \ store.9 suswintr.9 \ - store.9 susword.9 \ - store.9 suword.9 + store.9 suword.9 \ + store.9 suword16.9 \ + store.9 suword32.9 \ + store.9 suword64.9 MLINKS+=swi.9 swi_add.9 \ swi.9 swi_sched.9 MLINKS+=sx.9 sx_assert.9 \ Modified: head/share/man/man9/fetch.9 ============================================================================== --- head/share/man/man9/fetch.9 Mon Oct 5 15:15:13 2009 (r197779) +++ head/share/man/man9/fetch.9 Mon Oct 5 15:16:28 2009 (r197780) @@ -34,29 +34,35 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 1996 +.Dd October 5, 2009 .Dt FETCH 9 .Os .Sh NAME .Nm fetch , .Nm fubyte , -.Nm fusword , .Nm fuswintr , -.Nm fuword +.Nm fuword , +.Nm fuword16 , +.Nm fuword32 , +.Nm fuword64 .Nd fetch data from user-space .Sh SYNOPSIS .In sys/types.h .In sys/time.h .In sys/systm.h -.In sys/resourcevar.h .Ft int .Fn fubyte "const void *base" +.Ft long +.Fn fuword "const void *base" .Ft int -.Fn fusword "void *base" +.Fn fuword16 "void *base" +.Ft int32_t +.Fn fuword32 "const void *base" +.Ft int64_t +.Fn fuword64 "const void *base" +.In sys/resourcevar.h .Ft int .Fn fuswintr "void *base" -.Ft long -.Fn fuword "const void *base" .Sh DESCRIPTION The .Nm @@ -69,16 +75,22 @@ routines provide the following functiona .It Fn fubyte Fetches a byte of data from the user-space address .Pa base . -.It Fn fusword -Fetches a short word of data from the user-space address +.It Fn fuword +Fetches a word of data from the user-space address +.Pa base . +.It Fn fuword16 +Fetches 16 bits of data from the user-space address +.Pa base . +.It Fn fuword32 +Fetches 32 bits of data from the user-space address +.Pa base . +.It Fn fuword64 +Fetches 64 bits of data from the user-space address .Pa base . .It Fn fuswintr Fetches a short word of data from the user-space address .Pa base . This function is safe to call during an interrupt context. -.It Fn fuword -Fetches a word of data from the user-space address -.Pa base . .El .Sh RETURN VALUES The Modified: head/share/man/man9/store.9 ============================================================================== --- head/share/man/man9/store.9 Mon Oct 5 15:15:13 2009 (r197779) +++ head/share/man/man9/store.9 Mon Oct 5 15:16:28 2009 (r197780) @@ -34,13 +34,12 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 1996 +.Dd October 5, 2009 .Dt STORE 9 .Os .Sh NAME .Nm store , .Nm subyte , -.Nm susword , .Nm suswintr , .Nm suword .Nd store data to user-space @@ -48,15 +47,19 @@ .In sys/types.h .In sys/time.h .In sys/systm.h -.In sys/resourcevar.h .Ft int .Fn subyte "void *base" "int byte" .Ft int -.Fn susword "void *base" "int word" +.Fn suword "void *base" "long word" .Ft int -.Fn suswintr "void *base" "int word" +.Fn suword16 "void *base" "int word" .Ft int -.Fn suword "void *base" "long word" +.Fn suword32 "void *base" "int32_t word" +.Ft int +.Fn suword64 "void *base" "int64_t word" +.In sys/resourcevar.h +.Ft int +.Fn suswintr "void *base" "int word" .Sh DESCRIPTION The .Nm @@ -69,16 +72,22 @@ routines provide the following functiona .It Fn subyte Stores a byte of data to the user-space address .Pa base . -.It Fn susword -Stores a short word of data to the user-space address +.It Fn suword +Stores a word of data to the user-space address +.Pa base . +.It Fn suword16 +Stores 16 bits of of data to the user-space address +.Pa base . +.It Fn suword32 +Stores 32 bits of of data to the user-space address +.Pa base . +.It Fn suword64 +Stores 64 bits of of data to the user-space address .Pa base . .It Fn suswintr Stores a short word of data to the user-space address .Pa base . This function is safe to call during an interrupt context. -.It Fn suword -Stores a word of data to the user-space address -.Pa base . .El .Sh RETURN VALUES The From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:21: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 2E3461065670; Mon, 5 Oct 2009 15:21:48 +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 F324C8FC0C; Mon, 5 Oct 2009 15:21:47 +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 8610646B32; Mon, 5 Oct 2009 11:21:47 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2B28B8A024; Mon, 5 Oct 2009 11:21:46 -0400 (EDT) Message-ID: <4ACA0F09.2010808@FreeBSD.org> Date: Mon, 05 Oct 2009 11:21:45 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Alan Cox References: <200910041853.n94IrAf7082338@svn.freebsd.org> <4AC9F4F4.4030008@FreeBSD.org> <4ACA0000.2080005@cs.rice.edu> In-Reply-To: <4ACA0000.2080005@cs.rice.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 05 Oct 2009 11:21:46 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197750 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 15:21:48 -0000 Alan Cox wrote: > John Baldwin wrote: >> Alan Cox wrote: >>> Author: alc >>> Date: Sun Oct 4 18:53:10 2009 >>> New Revision: 197750 >>> URL: http://svn.freebsd.org/changeset/base/197750 >>> >>> Log: >>> Align and pad the page queue and free page queue locks so that the >>> linker >>> can't possibly place them together within the same cache line. >>> MFC after: 3 weeks >>> >>> Modified: >>> head/sys/vm/vm_page.c >>> head/sys/vm/vm_page.h >>> >>> Modified: head/sys/vm/vm_page.c >>> ============================================================================== >>> >>> --- head/sys/vm/vm_page.c Sun Oct 4 17:22:51 2009 (r197749) >>> +++ head/sys/vm/vm_page.c Sun Oct 4 18:53:10 2009 (r197750) >>> @@ -135,8 +135,8 @@ __FBSDID("$FreeBSD$"); >>> */ >>> >>> struct vpgqueues vm_page_queues[PQ_COUNT]; >>> -struct mtx vm_page_queue_mtx; >>> -struct mtx vm_page_queue_free_mtx; >>> +struct vpglocks vm_page_queue_lock; >>> +struct vpglocks vm_page_queue_free_lock; >> >> I think you can do this by just: >> >> struct mtx vm_page_queue_mtx __aligned(CACHE_LINE_SIZE); >> >> without the need for a wrapper structure. >> > > Unfortunately, no. When I compile the following example: > > int a; > int b __attribute__((aligned(16))); > int x; > int y; > int z; > > int > main(void) > { > > return (0); > } > > I get the following: > > 080495b4 A __bss_start > 080495b4 A _edata > 080495c0 b completed.4860 > 080495c4 B environ > 080495d0 B b > 080495d4 B x > 080495d8 B z > 080495dc B y > 080495e0 B a > 080495e4 A _end > > Thus, "b" is aligned as specified, but not padded to 16 bytes. Do you care what is in the padding in this case or more about just having each mutex on a separate cache line? __aligned() is fine if you don't mind the padding getting reused for something else. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 15:27: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 C517E1065670; Mon, 5 Oct 2009 15:27:01 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B18278FC2E; Mon, 5 Oct 2009 15:27: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 n95FR1qU016545; Mon, 5 Oct 2009 15:27:01 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95FR1Je016540; Mon, 5 Oct 2009 15:27:01 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910051527.n95FR1Je016540@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 15:27: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: r197781 - in head/tools/regression/sockets: unix_seqpacket unix_seqpacket_exercise X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 15:27:01 -0000 Author: rwatson Date: Mon Oct 5 15:27:01 2009 New Revision: 197781 URL: http://svn.freebsd.org/changeset/base/197781 Log: A few regression tests for SOCK_SEQPACKET UNIX domain sockets. Sponsored by: Google Added: head/tools/regression/sockets/unix_seqpacket/ head/tools/regression/sockets/unix_seqpacket/Makefile (contents, props changed) head/tools/regression/sockets/unix_seqpacket/unix_seqpacket.c (contents, props changed) head/tools/regression/sockets/unix_seqpacket_exercise/ head/tools/regression/sockets/unix_seqpacket_exercise/Makefile (contents, props changed) head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c (contents, props changed) Added: head/tools/regression/sockets/unix_seqpacket/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_seqpacket/Makefile Mon Oct 5 15:27:01 2009 (r197781) @@ -0,0 +1,9 @@ +# +# $FreeBSD$ +# + +PROG= unix_seqpacket +CFLAGS+= -Wall -Werror +NO_MAN= + +.include Added: head/tools/regression/sockets/unix_seqpacket/unix_seqpacket.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_seqpacket/unix_seqpacket.c Mon Oct 5 15:27:01 2009 (r197781) @@ -0,0 +1,140 @@ +/*- + * Copyright (c) 2009 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, Inc. + * + * 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 + +#define FAILERR(str) err(-1, "%s: %s", __func__, str) +#define FAILERRX(str) errx(-1, "%s: %s", __func__, str) + +static void +test_socket(void) +{ + int s; + + s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (s < 0) + FAILERR("socket"); + (void)close(s); +} + +static void +test_socketpair(void) +{ + int sv[2]; + + if (socketpair(PF_LOCAL, SOCK_SEQPACKET, 0, sv) < 0) + FAILERR("socketpair"); + (void)close(sv[0]); + (void)close(sv[1]); +} + +static void +test_listen_unbound(void) +{ + int s; + + s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (s < 0) + FAILERR("socket"); + if (listen(s, -1) == 0) + FAILERRX("listen"); + (void)close(s); +} + +static void +test_bind(void) +{ + struct sockaddr_un sun; + char path[PATH_MAX]; + int s; + + snprintf(path, sizeof(path), "/tmp/lds.XXXXXXXXX"); + if (mktemp(path) == NULL) + FAILERR("mktemp"); + s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (s < 0) + FAILERR("socket"); + bzero(&sun, sizeof(sun)); + sun.sun_family = AF_LOCAL; + sun.sun_len = sizeof(sun); + strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); + if (bind(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) + FAILERR("bind"); + close(s); + (void)unlink(path); +} + +static void +test_listen_bound(void) +{ + struct sockaddr_un sun; + char path[PATH_MAX]; + int s; + + snprintf(path, sizeof(path), "/tmp/lds.XXXXXXXXX"); + if (mktemp(path) == NULL) + FAILERR("mktemp"); + s = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (s < 0) + FAILERR("socket"); + bzero(&sun, sizeof(sun)); + sun.sun_family = AF_LOCAL; + sun.sun_len = sizeof(sun); + strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); + if (bind(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) + FAILERR("bind"); + if (listen(s, -1)) { + (void)unlink(path); + FAILERR("bind"); + } + close(s); + (void)unlink(path); +} + +int +main(int argc, char *argv[]) +{ + + test_socket(); + test_socketpair(); + test_listen_unbound(); + test_bind(); + test_listen_bound(); +} Added: head/tools/regression/sockets/unix_seqpacket_exercise/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_seqpacket_exercise/Makefile Mon Oct 5 15:27:01 2009 (r197781) @@ -0,0 +1,9 @@ +# +# $FreeBSD$ +# + +PROG=unix_seqpacket_exercise +CFLAGS+=-Wall -Werror +NO_MAN= + +.include Added: head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c Mon Oct 5 15:27:01 2009 (r197781) @@ -0,0 +1,435 @@ +/*- + * Copyright (c) 2009 Robert N. M. Watson + * All rights reserved. + * + * This software was developed at the University of Cambridge Computer + * Laboratory with support from a grant from Google, Inc. + * + * 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 + +#define min(x, y) (x < y ? x : y) + +#define BUFLEN 32768 + +#define SEQPACKET_RCVBUF (131072-16) +#define SEQPACKET_SNDBUF (131072-16) + +#define FAILERR(str) err(-1, "%s: %s", __func__, str) +#define FAILNERR(str, n) err(-1, "%s %d: %s", __func__, n, str) +#define FAILNMERR(str, n, m) err(-1, "%s %d %d: %s", __func__, n, m, str) +#define FAILERRX(str) errx(-1, "%s: %s", __func__, str) +#define FAILNERRX(str, n) errx(-1, "%s %d: %s", __func__, n, str) +#define FAILNMERRX(str, n, m) errx(-1, "%s %d %d: %s", __func__, n, m, str) + +static int ann = 0; + +#define ANN() (ann ? warnx("%s: start", __func__) : 0) +#define ANNN(n) (ann ? warnx("%s %d: start", __func__, (n)) : 0) +#define ANNNM(n, m) (ann ? warnx("%s %d %d: start", __func__, (n), (m)) : 0) + +#define OK() warnx("%s: ok", __func__) +#define OKN(n) warnx("%s %d: ok", __func__, (n)) +#define OKNM(n, m) warnx("%s %d %d: ok", __func__, (n), (m)) + +#ifdef SO_NOSIGPIPE +#define NEW_SOCKET(s) do { \ + int i; \ + \ + (s) = socket(PF_LOCAL, SOCK_SEQPACKET, 0); \ + if ((s) < 0) \ + FAILERR("socket"); \ + \ + i = 1; \ + if (setsockopt((s), SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) < 0) \ + FAILERR("setsockopt SO_NOSIGPIPE"); \ + \ + i = SEQPACKET_RCVBUF; \ + if (setsockopt((s), SOL_SOCKET, SO_RCVBUF, &i, sizeof(i)) < 0) \ + FAILERR("setsockopt SO_RCVBUF"); \ + \ + i = SEQPACKET_SNDBUF; \ + if (setsockopt((s), SOL_SOCKET, SO_SNDBUF, &i, sizeof(i)) < 0) \ + FAILERR("setsockopt SO_SNDBUF"); \ +} while (0) +#else +#define NEW_SOCKET(s) do { \ + int i; \ + \ + (s) = socket(PF_LOCAL, SOCK_SEQPACKET, 0); \ + if ((s) < 0) \ + FAILERR("socket"); \ + \ + i = SEQPACKET_RCVBUF; \ + if (setsockopt((s), SOL_SOCKET, SO_RCVBUF, &i, sizeof(i)) < 0) \ + FAILERR("setsockopt SO_RCVBUF"); \ + \ + i = SEQPACKET_SNDBUF; \ + if (setsockopt((s), SOL_SOCKET, SO_SNDBUF, &i, sizeof(i)) < 0) \ + FAILERR("setsockopt SO_SNDBUF"); \ +} while (0) +#endif + +static void +server(int s_listen) +{ + char buffer[BUFLEN]; + ssize_t ssize_recv, ssize_send; + socklen_t socklen; + int i, s_accept; + + while (1) { + s_accept = accept(s_listen, NULL, 0); + if (s_accept >= 0) { + i = SEQPACKET_RCVBUF; + if (setsockopt(s_accept, SOL_SOCKET, SO_RCVBUF, &i, + sizeof(i)) < 0) { + warn("server: setsockopt SO_RCVBUF"); + close(s_accept); + continue; + } + + if (getsockopt(s_accept, SOL_SOCKET, SO_RCVBUF, &i, + &socklen) < 0) { + warn("server: getsockopt SO_RCVBUF"); + close(s_accept); + continue; + } + if (i != SEQPACKET_RCVBUF) { + warnx("server: getsockopt SO_RCVBUF wrong %d", + i); + close(s_accept); + continue; + } + + socklen = sizeof(i); + if (getsockopt(s_accept, SOL_SOCKET, SO_SNDBUF, &i, + &socklen) < 0) { + warn("server: getsockopt SO_SNDBUF"); + close(s_accept); + continue; + } + if (i != SEQPACKET_SNDBUF) { + warnx("server: getsockopt SO_SNDBUF wrong %d", + i); + close(s_accept); + continue; + } + + do { + ssize_recv = recv(s_accept, buffer, + sizeof(buffer), 0); + if (ssize_recv == 0) + break; + if (ssize_recv < 0) { + warn("server: recv"); + break; + } + ssize_send = send(s_accept, buffer, + ssize_recv, 0); + if (ssize_send == 0) + break; + if (ssize_send < 0) { + warn("server: send"); + break; + } + if (ssize_send != ssize_recv) + warnx("server: recv %d sent %d", + ssize_recv, ssize_send); + } while (1); + close(s_accept); + } else + warn("server: accept"); + } +} + +static void +test_connect(struct sockaddr_un *sun) +{ + int s; + + ANN(); + NEW_SOCKET(s); + if (connect(s, (struct sockaddr *)sun, sizeof(*sun)) < 0) + FAILERR("connect"); + (void)close(s); + OK(); +} + +static void +test_connect_send(struct sockaddr_un *sun) +{ + ssize_t ssize; + char ch; + int s; + + ANN(); + NEW_SOCKET(s); + if (connect(s, (struct sockaddr *)sun, sizeof(*sun)) < 0) + FAILERR("connect"); + ssize = send(s, &ch, sizeof(ch), 0); + if (ssize < 0) + FAILERR("send"); + if (ssize != sizeof(ch)) + FAILERRX("send wrong size"); + (void)close(s); + OK(); +} + +static void +test_connect_shutdown_send(struct sockaddr_un *sun) +{ + ssize_t ssize; + char ch; + int s; + + ANN(); + NEW_SOCKET(s); + if (connect(s, (struct sockaddr *)sun, sizeof(*sun)) < 0) + FAILERR("connect"); + if (shutdown(s, SHUT_RDWR) < 0) + FAILERR("shutdown SHUT_RDWR"); + ssize = send(s, &ch, sizeof(ch), 0); + if (ssize >= 0) + FAILERRX("send"); + if (errno != EPIPE) + FAILERR("send unexpected error"); + (void)close(s); + OK(); +} + +static void +test_connect_send_recv(struct sockaddr_un *sun, size_t size) +{ + char buf[size + 4]; /* Detect extra bytes. */ + size_t truncsize; + ssize_t ssize; + int s; + + ANNN(size); + NEW_SOCKET(s); + if (connect(s, (struct sockaddr *)sun, sizeof(*sun)) < 0) + FAILNERR("connect", size); + ssize = send(s, buf, size, 0); + if (ssize < 0 && size >= SEQPACKET_RCVBUF) + goto out; + if (ssize < 0) + FAILNERR("send", size); + if (ssize == 0) + FAILNERR("send eof", size); + if (ssize != size) + FAILNERRX("send size", size); + + truncsize = min(size, BUFLEN); + ssize = recv(s, buf, sizeof(buf), 0); + if (ssize < 0) + FAILNERR("recv", size); + if (ssize == 0) + FAILNERRX("recv eof", size); + if (ssize < truncsize) + FAILNERRX("recv too few bytes", size); + if (ssize > truncsize) + FAILNERRX("recv too many bytes", size); +out: + (void)close(s); + OKN(size); +} + +static void +test_connect_send_recv_count(struct sockaddr_un *sun, int count, size_t size) +{ + char buf[size + 4]; /* Detect extra bytes and coalescing. */ + size_t truncsize; + ssize_t ssize; + int i, s; + + ANNNM(size, count); + NEW_SOCKET(s); + if (connect(s, (struct sockaddr *)sun, sizeof(*sun)) < 0) + FAILNMERR("connect", size, count); + for (i = 0; i < count; i++) { + usleep(5000); + ssize = send(s, buf, size, 0); + if (ssize < 0 && size >= SEQPACKET_RCVBUF) + goto out; + if (ssize < 0) + FAILNMERR("send", size, count); + if (ssize == 0) + FAILNMERRX("send eof", size, count); + if (ssize != size) + FAILNMERRX("send size", size, count); + } + + truncsize = min(size, BUFLEN); + for (i = 0; i < count; i++) { + ssize = recv(s, buf, sizeof(buf), 0); + if (ssize < 0) + FAILNMERR("recv", size, count); + if (ssize == 0) + FAILNMERRX("recv eof", size, count); + if (ssize < truncsize) + FAILNMERRX("recv too few bytes", size, count); + if (ssize > truncsize) + FAILNMERRX("recv too many bytes", size, count); + } +out: + (void)close(s); + OKNM(size, count); +} + +static void +test_sendto(struct sockaddr_un *sun) +{ + ssize_t ssize; + char ch; + int s; + + ANN(); + NEW_SOCKET(s); + ssize = sendto(s, &ch, sizeof(ch), 0, (struct sockaddr *)sun, + sizeof(*sun)); + if (ssize < 0) + FAILERR("sendto"); + (void)close(s); + OK(); +} + +static void +client(struct sockaddr_un *sun) +{ + size_t sizes[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, + 4096, 8192, 16384, 32768, 65536 /*, 131072 */}; + int c, i; + + test_connect(sun); + test_connect_send(sun); + test_connect_shutdown_send(sun); + + /* + * Try a range of sizes and packet counts. + */ + for (i = 0; i < sizeof(sizes) / sizeof(sizes[0]); i++) + test_connect_send_recv(sun, sizes[i]); + for (c = 1; c <= 8; c++) { + for (i = 0; i < sizeof(sizes) / sizeof(sizes[0]); i++) + test_connect_send_recv_count(sun, c, sizes[i]); + } + test_sendto(sun); + printf("client done\n"); +} + +int +main(int argc, char *argv[]) +{ + struct sockaddr_un sun; + char path[PATH_MAX]; + pid_t pid_client, pid_server; + int i, s_listen; + + snprintf(path, sizeof(path), "/tmp/lds_exercise.XXXXXXXXX"); + if (mktemp(path) == NULL) + FAILERR("mktemp"); + + s_listen = socket(PF_LOCAL, SOCK_SEQPACKET, 0); + if (s_listen < 0) { + (void)unlink(path); + FAILERR("socket"); + } + + i = SEQPACKET_RCVBUF; + if (setsockopt(s_listen, SOL_SOCKET, SO_RCVBUF, &i, sizeof(i)) < 0) { + (void)unlink(path); + FAILERR("setsockopt SO_RCVBUF"); + } + + i = SEQPACKET_SNDBUF; + if (setsockopt(s_listen, SOL_SOCKET, SO_SNDBUF, &i, sizeof(i)) < 0) { + (void)unlink(path); + FAILERR("setsockopt SO_SNDBUF"); + } + + i = 1; + if (setsockopt(s_listen, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i)) + < 0) { + (void)unlink(path); + FAILERR("setsockopt SO_NOSIGPIPE"); + } + + bzero(&sun, sizeof(sun)); + sun.sun_len = sizeof(sun); + sun.sun_family = AF_LOCAL; + strlcpy(sun.sun_path, path, sizeof(sun.sun_path)); + + if (bind(s_listen, (struct sockaddr *)&sun, sizeof(sun)) < 0) { + (void)unlink(path); + FAILERR("bind"); + } + + if (listen(s_listen, -1) < 0) { + (void)unlink(path); + FAILERR("listen"); + } + + pid_server = fork(); + if (pid_server < 0) { + (void)unlink(path); + FAILERR("fork"); + } + if (pid_server == 0) { + server(s_listen); + return (0); + } + + pid_client = fork(); + if (pid_client < 0) { + (void)kill(pid_server, SIGKILL); + (void)unlink(path); + FAILERR("fork"); + } + if (pid_client == 0) { + client(&sun); + return (0); + } + + /* + * When the client is done, kill the server and clean up. + */ + (void)waitpid(pid_client, NULL, 0); + (void)kill(pid_server, SIGKILL); + (void)unlink(path); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 16:26: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 F0B4C106568B; Mon, 5 Oct 2009 16:26:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF7308FC43; Mon, 5 Oct 2009 16:26: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 n95GQse0018033; Mon, 5 Oct 2009 16:26:54 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95GQs3T018031; Mon, 5 Oct 2009 16:26:54 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910051626.n95GQs3T018031@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 5 Oct 2009 16:26: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: r197783 - 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: Mon, 05 Oct 2009 16:26:55 -0000 Author: jkim Date: Mon Oct 5 16:26:54 2009 New Revision: 197783 URL: http://svn.freebsd.org/changeset/base/197783 Log: - Revert r191568 partially. Forcing AHCI mode by changing device subclass and progif is evil. It doesn't work reliably[1] and we should honor BIOS configuration by the user. - If the SATA controller is enbled but combined mode is disabled, mask off the emulated IDE channel on the legacy IDE controller. Pointed out by: mav[1] Modified: head/sys/dev/ata/chipsets/ata-ati.c Modified: head/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ati.c Mon Oct 5 15:45:25 2009 (r197782) +++ head/sys/dev/ata/chipsets/ata-ati.c Mon Oct 5 16:26:54 2009 (r197783) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -55,9 +54,6 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ati_chipinit(device_t dev); static void ata_ati_setmode(device_t dev, int mode); -static void ata_ati_ahci_enable(device_t dev); -static int ata_ati_ahci_chipinit(device_t dev); -static int ata_ati_ahci_resume(device_t dev); /* misc defines */ #define ATI_PATA 0x01 @@ -66,13 +62,6 @@ static int ata_ati_ahci_resume(device_t #define SII_MEMIO 1 #define SII_BUG 0x04 -/* Misc Control Register */ -#define ATI_PCI_MISC_CTRL 0x40 -#define ATI_PCI_MISCCTRL_ENABLE_WR 0x00000001 - -/* Watchdog Control/Status Register */ -#define ATI_PCI_WD_CTRL 0x44 -#define ATI_PCI_WDCTRL_ENABLE 0x0001 /* * ATI chipset support functions @@ -121,19 +110,7 @@ ata_ati_probe(device_t dev) ctlr->chipinit = ata_sii_chipinit; break; case ATI_AHCI: - /* - * Force AHCI mode if IDE mode is set from BIOS. - */ - if ((ctlr->chip->chipid == ATA_ATI_IXP600_S1 || - ctlr->chip->chipid == ATA_ATI_IXP700_S1) && - pci_get_subclass(dev) == PCIS_STORAGE_IDE) { - struct pci_devinfo *dinfo = device_get_ivars(dev); - pcicfgregs *cfg = &dinfo->cfg; - cfg->subclass = PCIS_STORAGE_SATA; - cfg->progif = PCIP_STORAGE_SATA_AHCI_1_0; - ata_ati_ahci_enable(dev); - } - ctlr->chipinit = ata_ati_ahci_chipinit; + ctlr->chipinit = ata_ahci_chipinit; break; } return (BUS_PROBE_DEFAULT); @@ -143,13 +120,41 @@ static int ata_ati_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + device_t smbdev; + int satacfg; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - /* IXP600 only has 1 PATA channel */ - if (ctlr->chip->chipid == ATA_ATI_IXP600) + switch (ctlr->chip->chipid) { + case ATA_ATI_IXP600: + /* IXP600 only has 1 PATA channel */ ctlr->channels = 1; + break; + case ATA_ATI_IXP700: + /* + * When "combined mode" is enabled, an additional PATA channel is + * emulated with two SATA ports and appears on this device. + * This mode can only be detected via SMB controller. + */ + smbdev = pci_find_device(ATA_ATI_ID, 0x4385); + if (smbdev != NULL) { + satacfg = pci_read_config(smbdev, 0xad, 1); + if (bootverbose) + device_printf(dev, "SATA controller %s (%s%s channel)\n", + (satacfg & 0x01) == 0 ? "disabled" : "enabled", + (satacfg & 0x08) == 0 ? "" : "combined mode, ", + (satacfg & 0x10) == 0 ? "primary" : "secondary"); + + /* + * If SATA controller is enabled but combined mode is disabled, + * we have only one PATA channel. Ignore a non-existent channel. + */ + if ((satacfg & 0x09) == 0x01) + ctlr->ichannels &= ~(1 << ((satacfg & 0x10) >> 4)); + } + break; + } ctlr->setmode = ata_ati_setmode; return 0; @@ -219,43 +224,6 @@ ata_ati_setmode(device_t dev, int mode) } } -static void -ata_ati_ahci_enable(device_t dev) -{ - struct pci_devinfo *dinfo = device_get_ivars(dev); - pcicfgregs *cfg = &dinfo->cfg; - uint32_t ctrl; - - ctrl = pci_read_config(dev, ATI_PCI_MISC_CTRL, 4); - pci_write_config(dev, ATI_PCI_MISC_CTRL, - ctrl | ATI_PCI_MISCCTRL_ENABLE_WR, 4); - pci_write_config(dev, PCIR_SUBCLASS, cfg->subclass, 1); - pci_write_config(dev, PCIR_PROGIF, cfg->progif, 1); - pci_write_config(dev, ATI_PCI_WD_CTRL, - pci_read_config(dev, ATI_PCI_WD_CTRL, 2) | ATI_PCI_WDCTRL_ENABLE, 2); - pci_write_config(dev, ATI_PCI_MISC_CTRL, - ctrl & ~ATI_PCI_MISCCTRL_ENABLE_WR, 4); -} - -static int -ata_ati_ahci_chipinit(device_t dev) -{ - struct ata_pci_controller *ctlr = device_get_softc(dev); - int error; - - error = ata_ahci_chipinit(dev); - ctlr->resume = ata_ati_ahci_resume; - return (error); -} - -static int -ata_ati_ahci_resume(device_t dev) -{ - - ata_ati_ahci_enable(dev); - return (ata_ahci_ctlr_reset(dev)); -} - ATA_DECLARE_DRIVER(ata_ati); MODULE_DEPEND(ata_ati, ata_ahci, 1, 1, 1); MODULE_DEPEND(ata_ati, ata_sii, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 18:20: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 C84231065692; Mon, 5 Oct 2009 18:20:37 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DC2E8FC1C; Mon, 5 Oct 2009 18:20: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 n95IKbiC021053; Mon, 5 Oct 2009 18:20:37 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95IKbVE021052; Mon, 5 Oct 2009 18:20:37 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <200910051820.n95IKbVE021052@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 5 Oct 2009 18:20:37 +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: r197784 - 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: Mon, 05 Oct 2009 18:20:37 -0000 Author: gnn Date: Mon Oct 5 18:20:36 2009 New Revision: 197784 URL: http://svn.freebsd.org/changeset/base/197784 Log: Free Navdeep from membership and promote him to project status. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Oct 5 16:26:54 2009 (r197783) +++ svnadmin/conf/mentors Mon Oct 5 18:20:36 2009 (r197784) @@ -20,7 +20,6 @@ jinmei gnn lstewart gnn neel imp nork imp -np gnn rdivacky ed remko imp rmacklem rwatson Co-mentor: kib From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 18:55: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 1A7D51065679; Mon, 5 Oct 2009 18:55:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09B5F8FC26; Mon, 5 Oct 2009 18:55: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 n95ItDGB021924; Mon, 5 Oct 2009 18:55:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95ItDOj021922; Mon, 5 Oct 2009 18:55:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910051855.n95ItDOj021922@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 5 Oct 2009 18:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197785 - head/crypto/openssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 18:55:14 -0000 Author: des Date: Mon Oct 5 18:55:13 2009 New Revision: 197785 URL: http://svn.freebsd.org/changeset/base/197785 Log: Add more symbols that need to be masked: - initialized and uninitialized data - symbols from roaming_dummy.c which end up in pam_ssh Update the command line used to generate the #defines. Modified: head/crypto/openssh/ssh_namespace.h Modified: head/crypto/openssh/ssh_namespace.h ============================================================================== --- head/crypto/openssh/ssh_namespace.h Mon Oct 5 18:20:36 2009 (r197784) +++ head/crypto/openssh/ssh_namespace.h Mon Oct 5 18:55:13 2009 (r197785) @@ -7,7 +7,7 @@ * * A list of symbols which need munging is obtained as follows: * - * nm libssh.a | awk '$2 == "T" && $3 !~ /^ssh_/ { print "#define", $3, "ssh_" $3 }' + * nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define", $3, "ssh_" $3 }' * * $FreeBSD$ */ @@ -18,6 +18,7 @@ #define acss_setkey ssh_acss_setkey #define acss_setsubkey ssh_acss_setsubkey #define add_host_to_hostfile ssh_add_host_to_hostfile +#define add_recv_bytes ssh_add_recv_bytes #define addargs ssh_addargs #define addr_match_list ssh_addr_match_list #define ask_permission ssh_ask_permission @@ -111,6 +112,8 @@ #define channel_open_message ssh_channel_open_message #define channel_output_poll ssh_channel_output_poll #define channel_permit_all_opens ssh_channel_permit_all_opens +#define channel_post ssh_channel_post +#define channel_pre ssh_channel_pre #define channel_prepare_select ssh_channel_prepare_select #define channel_print_adm_permitted_opens ssh_channel_print_adm_permitted_opens #define channel_register_cleanup ssh_channel_register_cleanup @@ -150,14 +153,19 @@ #define cipher_set_key_string ssh_cipher_set_key_string #define cipher_set_keycontext ssh_cipher_set_keycontext #define cipher_set_keyiv ssh_cipher_set_keyiv +#define ciphers ssh_ciphers #define ciphers_valid ssh_ciphers_valid #define cleanhostname ssh_cleanhostname #define cleanup_exit ssh_cleanup_exit #define clear_cached_addr ssh_clear_cached_addr #define colon ssh_colon +#define compat13 ssh_compat13 +#define compat20 ssh_compat20 #define compat_cipher_proposal ssh_compat_cipher_proposal #define compat_datafellows ssh_compat_datafellows #define convtime ssh_convtime +#define current_keys ssh_current_keys +#define datafellows ssh_datafellows #define debug ssh_debug #define debug ssh_debug #define debug2 ssh_debug2 @@ -175,6 +183,7 @@ #define dh_new_group14 ssh_dh_new_group14 #define dh_new_group_asc ssh_dh_new_group_asc #define dh_pub_is_valid ssh_dh_pub_is_valid +#define dispatch ssh_dispatch #define dispatch_init ssh_dispatch_init #define dispatch_protocol_error ssh_dispatch_protocol_error #define dispatch_protocol_ignore ssh_dispatch_protocol_ignore @@ -205,6 +214,7 @@ #define get_local_port ssh_get_local_port #define get_peer_ipaddr ssh_get_peer_ipaddr #define get_peer_port ssh_get_peer_port +#define get_recv_bytes ssh_get_recv_bytes #define get_remote_ipaddr ssh_get_remote_ipaddr #define get_remote_name_or_ip ssh_get_remote_name_or_ip #define get_remote_port ssh_get_remote_port @@ -216,6 +226,7 @@ #define host_hash ssh_host_hash #define hostfile_read_key ssh_hostfile_read_key #define hpdelim ssh_hpdelim +#define incoming_stream ssh_incoming_stream #define init_rng ssh_init_rng #define ipv64_normalise_mapped ssh_ipv64_normalise_mapped #define kex_derive_keys ssh_kex_derive_keys @@ -268,6 +279,7 @@ #define mac_init ssh_mac_init #define mac_setup ssh_mac_setup #define mac_valid ssh_mac_valid +#define macs ssh_macs #define match_host_and_ip ssh_match_host_and_ip #define match_hostname ssh_match_hostname #define match_list ssh_match_list @@ -279,6 +291,7 @@ #define ms_subtract_diff ssh_ms_subtract_diff #define ms_to_timeval ssh_ms_to_timeval #define mysignal ssh_mysignal +#define outgoing_stream ssh_outgoing_stream #define packet_add_padding ssh_packet_add_padding #define packet_backup_state ssh_packet_backup_state #define packet_close ssh_packet_close @@ -363,9 +376,13 @@ #define refresh_progress_meter ssh_refresh_progress_meter #define replacearg ssh_replacearg #define restore_uid ssh_restore_uid +#define resume_in_progress ssh_resume_in_progress +#define resume_kex ssh_resume_kex #define rijndael_decrypt ssh_rijndael_decrypt #define rijndael_encrypt ssh_rijndael_encrypt #define rijndael_set_key ssh_rijndael_set_key +#define roaming_read ssh_roaming_read +#define roaming_write ssh_roaming_write #define rsa_generate_additional_parameters ssh_rsa_generate_additional_parameters #define rsa_private_decrypt ssh_rsa_private_decrypt #define rsa_public_encrypt ssh_rsa_public_encrypt @@ -393,6 +410,7 @@ #define tty_make_modes ssh_tty_make_modes #define tty_parse_modes ssh_tty_parse_modes #define tun_open ssh_tun_open +#define umac_ctx ssh_umac_ctx #define umac_delete ssh_umac_delete #define umac_final ssh_umac_final #define umac_new ssh_umac_new From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 18:56: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 6C32610656A4; Mon, 5 Oct 2009 18:56:18 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6598FC2D; Mon, 5 Oct 2009 18:56: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 n95IuIvo021987; Mon, 5 Oct 2009 18:56:18 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95IuIow021985; Mon, 5 Oct 2009 18:56:18 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910051856.n95IuIow021985@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 5 Oct 2009 18:56: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: r197786 - head/lib/libpam/modules/pam_ssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 18:56:18 -0000 Author: des Date: Mon Oct 5 18:56:18 2009 New Revision: 197786 URL: http://svn.freebsd.org/changeset/base/197786 Log: pam_ssh needs roaming_dummy to link correctly against libssh. Modified: head/lib/libpam/modules/pam_ssh/Makefile Modified: head/lib/libpam/modules/pam_ssh/Makefile ============================================================================== --- head/lib/libpam/modules/pam_ssh/Makefile Mon Oct 5 18:55:13 2009 (r197785) +++ head/lib/libpam/modules/pam_ssh/Makefile Mon Oct 5 18:56:18 2009 (r197786) @@ -7,6 +7,9 @@ LIB= pam_ssh MAN= pam_ssh.8 SRCS= pam_ssh.c +# required when linking with a dynamic libssh +SRCS+= roaming_dummy.c + WARNS?= 0 CFLAGS+= -I${SSHDIR} -include ssh_namespace.h From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 19: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 DF8201065679; Mon, 5 Oct 2009 19:29:25 +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 CB4548FC08; Mon, 5 Oct 2009 19: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 n95JTPI7022872; Mon, 5 Oct 2009 19:29:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95JTPDg022869; Mon, 5 Oct 2009 19:29:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200910051929.n95JTPDg022869@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 5 Oct 2009 19:29:25 +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: r197787 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/de dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 19:29:26 -0000 Author: yongari Date: Mon Oct 5 19:29:25 2009 New Revision: 197787 URL: http://svn.freebsd.org/changeset/base/197787 Log: MFC r197461: Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply alignment fixup code for received frames on strict alignment architectures. MFC r197463: Consistently use bus_addr_t. MFC r197464: Destroy dmamap in dma cleanup. MFC r197465: Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE. Also align setup descriptor on 32 bytes boundary. Tx buffer have no alignment limitation so create dmamap without alignment restriction[1]. Rx buffer still seems to require 4 bytes alignment limitation but we can simply use MCLBYTES for size to map the buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated with m_getcl(9). de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers, increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES. While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore. This should fix de(4) breakage introduced after r176206. Submitted by: jhb [1] Reported by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp > Tested by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >, Takahashi Yoshihiro < nyan <> jp dot freebsd dot org > Approved by: re (kib) Modified: 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/de/if_de.c stable/8/sys/dev/de/if_devar.h stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/de/if_de.c ============================================================================== --- stable/8/sys/dev/de/if_de.c Mon Oct 5 18:56:18 2009 (r197786) +++ stable/8/sys/dev/de/if_de.c Mon Oct 5 19:29:25 2009 (r197787) @@ -160,7 +160,7 @@ static void tulip_dma_map_rxbuf(void *, static void tulip_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - u_int32_t *paddr; + bus_addr_t *paddr; if (error) return; @@ -182,7 +182,7 @@ tulip_dma_map_rxbuf(void *arg, bus_dma_s KASSERT(nseg == 1, ("too many DMA segments")); KASSERT(segs[0].ds_len >= TULIP_RX_BUFLEN, ("receive buffer too small")); - desc->d_addr1 = segs[0].ds_addr; + desc->d_addr1 = segs[0].ds_addr & 0xffffffff; desc->d_length1 = TULIP_RX_BUFLEN; #ifdef not_needed /* These should already always be zero. */ @@ -3171,8 +3171,8 @@ tulip_reset(tulip_softc_t * const sc) sc->tulip_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } - TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr); - TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr); + TULIP_CSR_WRITE(sc, csr_txlist, sc->tulip_txinfo.ri_dma_addr & 0xffffffff); + TULIP_CSR_WRITE(sc, csr_rxlist, sc->tulip_rxinfo.ri_dma_addr & 0xffffffff); TULIP_CSR_WRITE(sc, csr_busmode, (1 << (3 /*pci_max_burst_len*/ + 8)) |TULIP_BUSMODE_CACHE_ALIGN8 @@ -3488,7 +3488,7 @@ tulip_rx_intr(tulip_softc_t * const sc) struct mbuf *m0; KASSERT(ms != NULL, ("no packet to accept")); -#if defined(TULIP_COPY_RXDATA) +#ifndef __NO_STRICT_ALIGNMENT /* * Copy the data into a new mbuf that is properly aligned. If * we fail to allocate a new mbuf, then drop the packet. We will @@ -3527,7 +3527,7 @@ tulip_rx_intr(tulip_softc_t * const sc) */ ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); -#if defined(TULIP_COPY_RXDATA) +#ifndef __NO_STRICT_ALIGNMENT skip_input: #endif if (ms == NULL) { @@ -4016,9 +4016,9 @@ tulip_txput(tulip_softc_t * const sc, st eop = nextout; eop->di_desc->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN; eop->di_desc->d_status = d_status; - eop->di_desc->d_addr1 = segs[segcnt].ds_addr; + eop->di_desc->d_addr1 = segs[segcnt].ds_addr & 0xffffffff; eop->di_desc->d_length1 = segs[segcnt].ds_len; - eop->di_desc->d_addr2 = segs[segcnt+1].ds_addr; + eop->di_desc->d_addr2 = segs[segcnt+1].ds_addr & 0xffffffff; eop->di_desc->d_length2 = segs[segcnt+1].ds_len; d_status = TULIP_DSTS_OWNER; if (++nextout == ri->ri_last) @@ -4028,7 +4028,7 @@ tulip_txput(tulip_softc_t * const sc, st eop = nextout; eop->di_desc->d_flag &= TULIP_DFLAG_ENDRING|TULIP_DFLAG_CHAIN; eop->di_desc->d_status = d_status; - eop->di_desc->d_addr1 = segs[segcnt].ds_addr; + eop->di_desc->d_addr1 = segs[segcnt].ds_addr & 0xffffffff; eop->di_desc->d_length1 = segs[segcnt].ds_len; eop->di_desc->d_addr2 = 0; eop->di_desc->d_length2 = 0; @@ -4194,7 +4194,7 @@ tulip_txput_setup(tulip_softc_t * const nextout->d_length2 = 0; nextout->d_addr2 = 0; nextout->d_length1 = sizeof(sc->tulip_setupdata); - nextout->d_addr1 = sc->tulip_setup_dma_addr; + nextout->d_addr1 = sc->tulip_setup_dma_addr & 0xffffffff; bus_dmamap_sync(sc->tulip_setup_tag, sc->tulip_setup_map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); TULIP_TXDESC_PRESYNC(ri); @@ -4491,7 +4491,7 @@ tulip_busdma_freering(tulip_ringinfo_t * /* Allocate memory for a single descriptor ring. */ static int tulip_busdma_allocring(device_t dev, tulip_softc_t * const sc, size_t count, - bus_size_t maxsize, int nsegs, tulip_ringinfo_t *ri, const char *name) + bus_size_t align, int nsegs, tulip_ringinfo_t *ri, const char *name) { size_t size; int error, i; @@ -4499,7 +4499,7 @@ tulip_busdma_allocring(device_t dev, tul /* First, setup a tag. */ ri->ri_max = count; size = count * sizeof(tulip_desc_t); - error = bus_dma_tag_create(NULL, PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, 1, size, 0, NULL, NULL, &ri->ri_ring_tag); if (error) { @@ -4527,9 +4527,9 @@ tulip_busdma_allocring(device_t dev, tul } /* Allocate a tag for the data buffers. */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, align, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - maxsize, nsegs, TULIP_DATA_PER_DESC, 0, NULL, NULL, &ri->ri_data_tag); + MCLBYTES * nsegs, nsegs, MCLBYTES, 0, NULL, NULL, &ri->ri_data_tag); if (error) { device_printf(dev, "failed to allocate %s buffer dma tag\n", name); return (error); @@ -4563,6 +4563,7 @@ tulip_busdma_cleanup(tulip_softc_t * con if (sc->tulip_setupbuf != NULL) { bus_dmamem_free(sc->tulip_setup_tag, sc->tulip_setupbuf, sc->tulip_setup_map); + bus_dmamap_destroy(sc->tulip_setup_tag, sc->tulip_setup_map); sc->tulip_setup_map = NULL; sc->tulip_setupbuf = NULL; } @@ -4586,8 +4587,8 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate space and dmamap for transmit ring. */ - error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, TULIP_DATA_PER_DESC, - TULIP_MAX_TXSEG, &sc->tulip_txinfo, "transmit"); + error = tulip_busdma_allocring(dev, sc, TULIP_TXDESCS, 1, TULIP_MAX_TXSEG, + &sc->tulip_txinfo, "transmit"); if (error) return (error); @@ -4598,7 +4599,7 @@ tulip_busdma_init(device_t dev, tulip_so * a waste in practice though as an ethernet frame can easily fit * in TULIP_RX_BUFLEN bytes. */ - error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, MCLBYTES, 1, + error = tulip_busdma_allocring(dev, sc, TULIP_RXDESCS, 4, 1, &sc->tulip_rxinfo, "receive"); if (error) return (error); @@ -4606,7 +4607,7 @@ tulip_busdma_init(device_t dev, tulip_so /* * Allocate a DMA tag, memory, and map for setup descriptor */ - error = bus_dma_tag_create(NULL, 4, 0, + error = bus_dma_tag_create(NULL, 32, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, sizeof(sc->tulip_setupdata), 1, sizeof(sc->tulip_setupdata), 0, NULL, NULL, &sc->tulip_setup_tag); Modified: stable/8/sys/dev/de/if_devar.h ============================================================================== --- stable/8/sys/dev/de/if_devar.h Mon Oct 5 18:56:18 2009 (r197786) +++ stable/8/sys/dev/de/if_devar.h Mon Oct 5 19:29:25 2009 (r197787) @@ -104,7 +104,7 @@ typedef struct { tulip_descinfo_t *ri_descinfo; bus_dma_tag_t ri_ring_tag; bus_dmamap_t ri_ring_map; - uint32_t ri_dma_addr; + bus_addr_t ri_dma_addr; bus_dma_tag_t ri_data_tag; bus_dmamap_t *ri_data_maps; } tulip_ringinfo_t; @@ -134,11 +134,7 @@ typedef struct { * architecture which can't handle unaligned accesses) because with * 100Mb/s cards the copying is just too much of a hit. */ -#if !defined(__i386__) -#define TULIP_COPY_RXDATA 1 -#endif -#define TULIP_DATA_PER_DESC 2032 #define TULIP_TXTIMER 4 #define TULIP_RXDESCS 48 #define TULIP_TXDESCS 128 @@ -560,7 +556,7 @@ struct tulip_softc { */ bus_dma_tag_t tulip_setup_tag; bus_dmamap_t tulip_setup_map; - uint32_t tulip_setup_dma_addr; + bus_addr_t tulip_setup_dma_addr; u_int32_t *tulip_setupbuf; u_int32_t tulip_setupdata[192 / sizeof(u_int32_t)]; char tulip_boardid[24]; From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 19:29: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 A5E141065670; Mon, 5 Oct 2009 19:29:49 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94FE48FC0C; Mon, 5 Oct 2009 19:29: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 n95JTn7N022942; Mon, 5 Oct 2009 19:29:49 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95JTnbD022940; Mon, 5 Oct 2009 19:29:49 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200910051929.n95JTnbD022940@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 5 Oct 2009 19:29: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: r197788 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 05 Oct 2009 19:29:49 -0000 Author: bcr (doc committer) Date: Mon Oct 5 19:29:49 2009 New Revision: 197788 URL: http://svn.freebsd.org/changeset/base/197788 Log: Belatedly add my calendar entry. Discussed with: remko Approved by: remko, jkois (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Oct 5 19:29:25 2009 (r197787) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Oct 5 19:29:49 2009 (r197788) @@ -244,6 +244,7 @@ 09/10 Wesley R. Peters born in Hartford, Alabama, United States, 1961 09/12 Weongyo Jeong born in Haman, Korea, 1980 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 +09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 19:56: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 05EF6106566B; Mon, 5 Oct 2009 19:56:57 +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 7CF4B8FC1C; Mon, 5 Oct 2009 19:56: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 n95JuuiD023640; Mon, 5 Oct 2009 19:56:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95Juu6T023638; Mon, 5 Oct 2009 19:56:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200910051956.n95Juu6T023638@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 5 Oct 2009 19:56: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: r197789 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 19:56:57 -0000 Author: trasz Date: Mon Oct 5 19:56:56 2009 New Revision: 197789 URL: http://svn.freebsd.org/changeset/base/197789 Log: Fix NFSv4 ACLs on sparc64. Turns out that fuword(9) fetches 64 bits instead of sizeof(int), and on sparc64 that resulted in fetching wrong value for acl_maxcnt, which in turn caused __acl_get_link(2) to fail with EINVAL. PR: sparc64/139304 Submitted by: Dmitry Afanasiev Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Mon Oct 5 19:29:49 2009 (r197788) +++ head/sys/kern/vfs_acl.c Mon Oct 5 19:56:56 2009 (r197789) @@ -161,7 +161,7 @@ acl_copyout(struct acl *kernel_acl, void break; default: - if (fuword((char *)user_acl + + if (fuword32((char *)user_acl + offsetof(struct acl, acl_maxcnt)) != ACL_MAX_ENTRIES) return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 20:11: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 8E4CB106568B; Mon, 5 Oct 2009 20:11:33 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4728FC19; Mon, 5 Oct 2009 20:11: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 n95KBXJ6024046; Mon, 5 Oct 2009 20:11:33 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95KBXdS024044; Mon, 5 Oct 2009 20:11:33 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200910052011.n95KBXdS024044@svn.freebsd.org> From: Hiroki Sato Date: Mon, 5 Oct 2009 20:11: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: r197790 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 20:11:33 -0000 Author: hrs Date: Mon Oct 5 20:11:33 2009 New Revision: 197790 URL: http://svn.freebsd.org/changeset/base/197790 Log: Fix a case when both ${name}_program and ${command} are defined. Spotted by: Michio "Karl" Jinbo Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Mon Oct 5 19:56:56 2009 (r197789) +++ head/etc/rc.subr Mon Oct 5 20:11:33 2009 (r197790) @@ -602,7 +602,7 @@ run_rc_command() esac eval _override_command=\$${name}_program - command=${command:-${_override_command}} + command=${command:+${_override_command:-$command}} _keywords="start stop restart rcvar $extra_commands" rc_pid= From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 20:21: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 86E811065670; Mon, 5 Oct 2009 20:21:41 +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 402FD8FC14; Mon, 5 Oct 2009 20:21:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n95KLfg4024355; Mon, 5 Oct 2009 20:21:41 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95KLfDJ024351; Mon, 5 Oct 2009 20:21:41 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200910052021.n95KLfDJ024351@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 5 Oct 2009 20:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197791 - in head/sys: conf dev/cxgb dev/cxgb/common modules/cxgb/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, 05 Oct 2009 20:21:41 -0000 Author: np Date: Mon Oct 5 20:21:41 2009 New Revision: 197791 URL: http://svn.freebsd.org/changeset/base/197791 Log: cxgb(4) updates, including: - support for the new Gen-2, BT, and LP-CR cards. - T3 firmware 7.7.0 - shared "common code" updates. Approved by: gnn (mentor) Obtained from: Chelsio MFC after: 1 month Added: head/sys/dev/cxgb/common/cxgb_aq100x.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgb/common/cxgb_ael1002.c head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/common/cxgb_mv88e1xxx.c head/sys/dev/cxgb/common/cxgb_regs.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/common/cxgb_tn1010.c head/sys/dev/cxgb/common/cxgb_vsc8211.c head/sys/dev/cxgb/common/cxgb_xgmac.c head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_osdep.h head/sys/dev/cxgb/cxgb_t3fw.h head/sys/modules/cxgb/cxgb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Oct 5 20:11:33 2009 (r197790) +++ head/sys/conf/files Mon Oct 5 20:21:41 2009 (r197791) @@ -774,6 +774,8 @@ dev/cxgb/common/cxgb_vsc8211.c optional compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/common/cxgb_ael1002.c optional cxgb pci \ compile-with "${NORMAL_C} -I$S/dev/cxgb" +dev/cxgb/common/cxgb_aq100x.c optional cxgb pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/common/cxgb_mv88e1xxx.c optional cxgb pci \ compile-with "${NORMAL_C} -I$S/dev/cxgb" dev/cxgb/common/cxgb_xgmac.c optional cxgb pci \ Modified: head/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_ael1002.c Mon Oct 5 20:11:33 2009 (r197790) +++ head/sys/dev/cxgb/common/cxgb_ael1002.c Mon Oct 5 20:21:41 2009 (r197791) @@ -45,16 +45,30 @@ enum { enum { AEL100X_TX_DISABLE = 9, AEL100X_TX_CONFIG1 = 0xc002, + AEL1002_PWR_DOWN_HI = 0xc011, AEL1002_PWR_DOWN_LO = 0xc012, AEL1002_XFI_EQL = 0xc015, AEL1002_LB_EN = 0xc017, + AEL_OPT_SETTINGS = 0xc017, AEL_I2C_CTRL = 0xc30a, AEL_I2C_DATA = 0xc30b, AEL_I2C_STAT = 0xc30c, + AEL2005_GPIO_CTRL = 0xc214, AEL2005_GPIO_STAT = 0xc215, + + AEL2020_GPIO_INTR = 0xc103, + AEL2020_GPIO_CTRL = 0xc108, + AEL2020_GPIO_STAT = 0xc10c, + AEL2020_GPIO_CFG = 0xc110, + + AEL2020_GPIO_SDA = 0, + AEL2020_GPIO_MODDET = 1, + AEL2020_GPIO_0 = 3, + AEL2020_GPIO_1 = 2, + AEL2020_GPIO_LSTAT = AEL2020_GPIO_1, }; enum { edc_none, edc_sr, edc_twinax }; @@ -81,7 +95,7 @@ struct reg_val { unsigned short set_bits; }; -static int get_module_type(struct cphy *phy); +static int ael2xxx_get_module_type(struct cphy *phy, int delay_ms); static int set_phy_regs(struct cphy *phy, const struct reg_val *rv) { @@ -108,6 +122,9 @@ static void ael100x_txon(struct cphy *ph msleep(30); } +/* + * Read an 8-bit word from a device attached to the PHY's i2c bus. + */ static int ael_i2c_rd(struct cphy *phy, int dev_addr, int word_addr) { int i, err; @@ -131,11 +148,14 @@ static int ael_i2c_rd(struct cphy *phy, return data >> 8; } } - CH_WARN(phy->adapter, "PHY %u I2C read of addr %u timed out\n", - phy->addr, word_addr); + CH_WARN(phy->adapter, "PHY %u i2c read of dev.addr %x.%x timed out\n", + phy->addr, dev_addr, word_addr); return -ETIMEDOUT; } +/* + * Write an 8-bit word to a device attached to the PHY's i2c bus. + */ static int ael_i2c_wr(struct cphy *phy, int dev_addr, int word_addr, int data) { int i, err; @@ -158,8 +178,8 @@ static int ael_i2c_wr(struct cphy *phy, if ((stat & 3) == 1) return 0; } - CH_WARN(phy->adapter, "PHY %u I2C Write of addr %u timed out\n", - phy->addr, word_addr); + CH_WARN(phy->adapter, "PHY %u i2c Write of dev.addr %x.%x = %#x timed out\n", + phy->addr, dev_addr, word_addr, data); return -ETIMEDOUT; } @@ -230,9 +250,9 @@ static int ael1002_get_module_type(struc if (delay_ms) msleep(delay_ms); - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0); + v = ael2xxx_get_module_type(phy, delay_ms); - return v == -ETIMEDOUT ? phy_modtype_none : get_module_type(phy); + return (v == -ETIMEDOUT ? phy_modtype_none : v); } static int ael1002_reset(struct cphy *phy, int wait) @@ -312,12 +332,13 @@ static struct cphy_ops ael1002_ops = { }; #endif -int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, +int t3_ael1002_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops) { int err; + struct cphy *phy = &pinfo->phy; - cphy_init(phy, adapter, phy_addr, &ael1002_ops, mdio_ops, + cphy_init(phy, pinfo->adapter, pinfo, phy_addr, &ael1002_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE, "10GBASE-R"); ael100x_txon(phy); @@ -366,12 +387,6 @@ static int ael1006_reset(struct cphy *ph } -static int ael1006_power_down(struct cphy *phy, int enable) -{ - return t3_mdio_change_bits(phy, MDIO_DEV_PMA_PMD, MII_BMCR, - BMCR_PDOWN, enable ? BMCR_PDOWN : 0); -} - #ifdef C99_NOT_SUPPORTED static struct cphy_ops ael1006_ops = { ael1006_reset, @@ -385,7 +400,7 @@ static struct cphy_ops ael1006_ops = { NULL, NULL, get_link_status_r, - ael1006_power_down, + ael1002_power_down, }; #else static struct cphy_ops ael1006_ops = { @@ -395,20 +410,97 @@ static struct cphy_ops ael1006_ops = { .intr_clear = t3_phy_lasi_intr_clear, .intr_handler = t3_phy_lasi_intr_handler, .get_link_status = get_link_status_r, - .power_down = ael1006_power_down, + .power_down = ael1002_power_down, }; #endif -int t3_ael1006_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, +int t3_ael1006_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops) { - cphy_init(phy, adapter, phy_addr, &ael1006_ops, mdio_ops, + struct cphy *phy = &pinfo->phy; + + cphy_init(phy, pinfo->adapter, pinfo, phy_addr, &ael1006_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE, "10GBASE-SR"); + phy->modtype = phy_modtype_sr; ael100x_txon(phy); return 0; } +/* + * Decode our module type. + */ +static int ael2xxx_get_module_type(struct cphy *phy, int delay_ms) +{ + int v; + + if (delay_ms) + msleep(delay_ms); + + v = get_phytrans_type(phy); + if (v == phy_transtype_sfp) { + /* SFP: see SFF-8472 for below */ + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 3); + if (v < 0) + return v; + + if (v == 0x1) + return phy_modtype_twinax; + if (v == 0x10) + return phy_modtype_sr; + if (v == 0x20) + return phy_modtype_lr; + if (v == 0x40) + return phy_modtype_lrm; + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6); + if (v < 0) + return v; + if (v != 4) + return phy_modtype_unknown; + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 10); + if (v < 0) + return v; + + if (v & 0x80) { + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); + if (v < 0) + return v; + return v > 10 ? phy_modtype_twinax_long : + phy_modtype_twinax; + } + } else if (v == phy_transtype_xfp) { + /* XFP: See INF-8077i for details. */ + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 127); + if (v < 0) + return v; + + if (v != 1) { + /* XXX: set page select to table 1 yourself */ + return phy_modtype_unknown; + } + + v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 131); + if (v < 0) + return v; + v &= 0xf0; + if (v == 0x10) + return phy_modtype_lrm; + if (v == 0x40) + return phy_modtype_lr; + if (v == 0x80) + return phy_modtype_sr; + } + + return phy_modtype_unknown; +} + +/* + * Code to support the Aeluros/NetLogic 2005 10Gb PHY. + */ static int ael2005_setup_sr_edc(struct cphy *phy) { static struct reg_val regs[] = { @@ -1103,72 +1195,21 @@ static int ael2005_setup_twinax_edc(stru return err; } -static int get_module_type(struct cphy *phy) +static int ael2005_get_module_type(struct cphy *phy, int delay_ms) { int v; + unsigned int stat; - v = get_phytrans_type(phy); - if (v == phy_transtype_sfp) { - /* SFP: see SFF-8472 for below */ - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 3); - if (v < 0) - return v; - - if (v == 0x1) - return phy_modtype_twinax; - if (v == 0x10) - return phy_modtype_sr; - if (v == 0x20) - return phy_modtype_lr; - if (v == 0x40) - return phy_modtype_lrm; - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 6); - if (v < 0) - return v; - if (v != 4) - return phy_modtype_unknown; - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 10); - if (v < 0) - return v; - - if (v & 0x80) { - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 0x12); - if (v < 0) - return v; - return v > 10 ? phy_modtype_twinax_long : - phy_modtype_twinax; - } - } else if (v == phy_transtype_xfp) { - /* XFP: See INF-8077i for details. */ - - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 127); - if (v < 0) - return v; - - if (v != 1) { - /* XXX: set page select to table 1 yourself */ - return phy_modtype_unknown; - } + v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, &stat); + if (v) + return v; - v = ael_i2c_rd(phy, MODULE_DEV_ADDR, 131); - if (v < 0) - return v; - v &= 0xf0; - if (v == 0x10) - return phy_modtype_lrm; - if (v == 0x40) - return phy_modtype_lr; - if (v == 0x80) - return phy_modtype_sr; - } + if (stat & (1 << 8)) /* module absent */ + return phy_modtype_none; - return phy_modtype_unknown; + return ael2xxx_get_module_type(phy, delay_ms); } - static int ael2005_intr_enable(struct cphy *phy) { int err = mdio_write(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, 0x200); @@ -1187,24 +1228,6 @@ static int ael2005_intr_clear(struct cph return err ? err : t3_phy_lasi_intr_clear(phy); } -static int ael2005_get_module_type(struct cphy *phy, int delay_ms) -{ - int v; - unsigned int stat; - - v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2005_GPIO_CTRL, &stat); - if (v) - return v; - - if (stat & (1 << 8)) /* module absent */ - return phy_modtype_none; - - if (delay_ms) - msleep(delay_ms); - - return get_module_type(phy); -} - static int ael2005_reset(struct cphy *phy, int wait) { static struct reg_val regs0[] = { @@ -1223,7 +1246,8 @@ static int ael2005_reset(struct cphy *ph { 0, 0, 0, 0 } }; - int err, lasi_ctrl; + int err; + unsigned int lasi_ctrl; err = mdio_read(phy, MDIO_DEV_PMA_PMD, LASI_CTRL, &lasi_ctrl); if (err) @@ -1311,8 +1335,8 @@ static int ael2005_intr_handler(struct c return ret; } -#ifdef C99_NOT_SUPPORTED static struct cphy_ops ael2005_ops = { +#ifdef C99_NOT_SUPPORTED ael2005_reset, ael2005_intr_enable, ael2005_intr_disable, @@ -1325,9 +1349,7 @@ static struct cphy_ops ael2005_ops = { NULL, get_link_status_r, ael1002_power_down, -}; #else -static struct cphy_ops ael2005_ops = { .reset = ael2005_reset, .intr_enable = ael2005_intr_enable, .intr_disable = ael2005_intr_disable, @@ -1335,14 +1357,16 @@ static struct cphy_ops ael2005_ops = { .intr_handler = ael2005_intr_handler, .get_link_status = get_link_status_r, .power_down = ael1002_power_down, -}; #endif +}; -int t3_ael2005_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr, +int t3_ael2005_phy_prep(pinfo_t *pinfo, int phy_addr, const struct mdio_ops *mdio_ops) { int err; - cphy_init(phy, adapter, phy_addr, &ael2005_ops, mdio_ops, + struct cphy *phy = &pinfo->phy; + + cphy_init(phy, pinfo->adapter, pinfo, phy_addr, &ael2005_ops, mdio_ops, SUPPORTED_10000baseT_Full | SUPPORTED_AUI | SUPPORTED_FIBRE | SUPPORTED_IRQ, "10GBASE-R"); msleep(125); @@ -1357,6 +1381,713 @@ int t3_ael2005_phy_prep(struct cphy *phy } /* + * Setup EDC and other parameters for operation with an optical module. + */ +static int ael2020_setup_sr_edc(struct cphy *phy) +{ + static struct reg_val regs[] = { + { MDIO_DEV_PMA_PMD, 0xcc01, 0xffff, 0x488a }, + + { MDIO_DEV_PMA_PMD, 0xcb1b, 0xffff, 0x0200 }, + { MDIO_DEV_PMA_PMD, 0xcb1c, 0xffff, 0x00f0 }, + { MDIO_DEV_PMA_PMD, 0xcc06, 0xffff, 0x00e0 }, + + /* end */ + { 0, 0, 0, 0 } + }; + int err; + + err = set_phy_regs(phy, regs); + msleep(50); + if (err) + return err; + + phy->priv = edc_sr; + return 0; +} + +/* + * Setup EDC and other parameters for operation with an TWINAX module. + */ +static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype) +{ + static struct reg_val uCclock40MHz[] = { + { MDIO_DEV_PMA_PMD, 0xff28, 0xffff, 0x4001 }, + { MDIO_DEV_PMA_PMD, 0xff2a, 0xffff, 0x0002 }, + { 0, 0, 0, 0 } + }; + + static struct reg_val uCclockActivate[] = { + { MDIO_DEV_PMA_PMD, 0xd000, 0xffff, 0x5200 }, + { 0, 0, 0, 0 } + }; + + static struct reg_val uCactivate[] = { + { MDIO_DEV_PMA_PMD, 0xd080, 0xffff, 0x0100 }, + { MDIO_DEV_PMA_PMD, 0xd092, 0xffff, 0x0000 }, + { 0, 0, 0, 0 } + }; + + static u16 twinax_edc[] = { + 0xd800, 0x4009, + 0xd801, 0x2fff, + 0xd802, 0x300f, + 0xd803, 0x40aa, + 0xd804, 0x401c, + 0xd805, 0x401e, + 0xd806, 0x2ff4, + 0xd807, 0x3dc4, + 0xd808, 0x2035, + 0xd809, 0x3035, + 0xd80a, 0x6524, + 0xd80b, 0x2cb2, + 0xd80c, 0x3012, + 0xd80d, 0x1002, + 0xd80e, 0x26e2, + 0xd80f, 0x3022, + 0xd810, 0x1002, + 0xd811, 0x27d2, + 0xd812, 0x3022, + 0xd813, 0x1002, + 0xd814, 0x2822, + 0xd815, 0x3012, + 0xd816, 0x1002, + 0xd817, 0x2492, + 0xd818, 0x3022, + 0xd819, 0x1002, + 0xd81a, 0x2772, + 0xd81b, 0x3012, + 0xd81c, 0x1002, + 0xd81d, 0x23d2, + 0xd81e, 0x3022, + 0xd81f, 0x1002, + 0xd820, 0x22cd, + 0xd821, 0x301d, + 0xd822, 0x27f2, + 0xd823, 0x3022, + 0xd824, 0x1002, + 0xd825, 0x5553, + 0xd826, 0x0307, + 0xd827, 0x2522, + 0xd828, 0x3022, + 0xd829, 0x1002, + 0xd82a, 0x2142, + 0xd82b, 0x3012, + 0xd82c, 0x1002, + 0xd82d, 0x4016, + 0xd82e, 0x5e63, + 0xd82f, 0x0344, + 0xd830, 0x2142, + 0xd831, 0x3012, + 0xd832, 0x1002, + 0xd833, 0x400e, + 0xd834, 0x2522, + 0xd835, 0x3022, + 0xd836, 0x1002, + 0xd837, 0x2b52, + 0xd838, 0x3012, + 0xd839, 0x1002, + 0xd83a, 0x2742, + 0xd83b, 0x3022, + 0xd83c, 0x1002, + 0xd83d, 0x25e2, + 0xd83e, 0x3022, + 0xd83f, 0x1002, + 0xd840, 0x2fa4, + 0xd841, 0x3dc4, + 0xd842, 0x6624, + 0xd843, 0x414b, + 0xd844, 0x56b3, + 0xd845, 0x03c6, + 0xd846, 0x866b, + 0xd847, 0x400c, + 0xd848, 0x2712, + 0xd849, 0x3012, + 0xd84a, 0x1002, + 0xd84b, 0x2c4b, + 0xd84c, 0x309b, + 0xd84d, 0x56b3, + 0xd84e, 0x03c3, + 0xd84f, 0x866b, + 0xd850, 0x400c, + 0xd851, 0x2272, + 0xd852, 0x3022, + 0xd853, 0x1002, + 0xd854, 0x2742, + 0xd855, 0x3022, + 0xd856, 0x1002, + 0xd857, 0x25e2, + 0xd858, 0x3022, + 0xd859, 0x1002, + 0xd85a, 0x2fb4, + 0xd85b, 0x3dc4, + 0xd85c, 0x6624, + 0xd85d, 0x56b3, + 0xd85e, 0x03c3, + 0xd85f, 0x866b, + 0xd860, 0x401c, + 0xd861, 0x2c45, + 0xd862, 0x3095, + 0xd863, 0x5b53, + 0xd864, 0x2372, + 0xd865, 0x3012, + 0xd866, 0x13c2, + 0xd867, 0x5cc3, + 0xd868, 0x2712, + 0xd869, 0x3012, + 0xd86a, 0x1312, + 0xd86b, 0x2b52, + 0xd86c, 0x3012, + 0xd86d, 0x1002, + 0xd86e, 0x2742, + 0xd86f, 0x3022, + 0xd870, 0x1002, + 0xd871, 0x2582, + 0xd872, 0x3022, + 0xd873, 0x1002, + 0xd874, 0x2142, + 0xd875, 0x3012, + 0xd876, 0x1002, + 0xd877, 0x628f, + 0xd878, 0x2985, + 0xd879, 0x33a5, + 0xd87a, 0x25e2, + 0xd87b, 0x3022, + 0xd87c, 0x1002, + 0xd87d, 0x5653, + 0xd87e, 0x03d2, + 0xd87f, 0x401e, + 0xd880, 0x6f72, + 0xd881, 0x1002, + 0xd882, 0x628f, + 0xd883, 0x2304, + 0xd884, 0x3c84, + 0xd885, 0x6436, + 0xd886, 0xdff4, + 0xd887, 0x6436, + 0xd888, 0x2ff5, + 0xd889, 0x3005, + 0xd88a, 0x8656, + 0xd88b, 0xdfba, + 0xd88c, 0x56a3, + 0xd88d, 0xd05a, + 0xd88e, 0x2972, + 0xd88f, 0x3012, + 0xd890, 0x1392, + 0xd891, 0xd05a, + 0xd892, 0x56a3, + 0xd893, 0xdfba, + 0xd894, 0x0383, + 0xd895, 0x6f72, + 0xd896, 0x1002, + 0xd897, 0x2b45, + 0xd898, 0x3005, + 0xd899, 0x4178, + 0xd89a, 0x5653, + 0xd89b, 0x0384, + 0xd89c, 0x2a62, + 0xd89d, 0x3012, + 0xd89e, 0x1002, + 0xd89f, 0x2f05, + 0xd8a0, 0x3005, + 0xd8a1, 0x41c8, + 0xd8a2, 0x5653, + 0xd8a3, 0x0382, + 0xd8a4, 0x0002, + 0xd8a5, 0x4218, + 0xd8a6, 0x2474, + 0xd8a7, 0x3c84, + 0xd8a8, 0x6437, + 0xd8a9, 0xdff4, + 0xd8aa, 0x6437, + 0xd8ab, 0x2ff5, + 0xd8ac, 0x3c05, + 0xd8ad, 0x8757, + 0xd8ae, 0xb888, + 0xd8af, 0x9787, + 0xd8b0, 0xdff4, + 0xd8b1, 0x6724, + 0xd8b2, 0x866a, + 0xd8b3, 0x6f72, + 0xd8b4, 0x1002, + 0xd8b5, 0x2641, + 0xd8b6, 0x3021, + 0xd8b7, 0x1001, + 0xd8b8, 0xc620, + 0xd8b9, 0x0000, + 0xd8ba, 0xc621, + 0xd8bb, 0x0000, + 0xd8bc, 0xc622, + 0xd8bd, 0x00ce, + 0xd8be, 0xc623, + 0xd8bf, 0x007f, + 0xd8c0, 0xc624, + 0xd8c1, 0x0032, + 0xd8c2, 0xc625, + 0xd8c3, 0x0000, + 0xd8c4, 0xc627, + 0xd8c5, 0x0000, + 0xd8c6, 0xc628, + 0xd8c7, 0x0000, + 0xd8c8, 0xc62c, + 0xd8c9, 0x0000, + 0xd8ca, 0x0000, + 0xd8cb, 0x2641, + 0xd8cc, 0x3021, + 0xd8cd, 0x1001, + 0xd8ce, 0xc502, + 0xd8cf, 0x53ac, + 0xd8d0, 0xc503, + 0xd8d1, 0x2cd3, + 0xd8d2, 0xc600, + 0xd8d3, 0x2a6e, + 0xd8d4, 0xc601, + 0xd8d5, 0x2a2c, + 0xd8d6, 0xc605, + 0xd8d7, 0x5557, + 0xd8d8, 0xc60c, + 0xd8d9, 0x5400, + 0xd8da, 0xc710, + 0xd8db, 0x0700, + 0xd8dc, 0xc711, + 0xd8dd, 0x0f06, + 0xd8de, 0xc718, + 0xd8df, 0x0700, + 0xd8e0, 0xc719, + 0xd8e1, 0x0f06, + 0xd8e2, 0xc720, + 0xd8e3, 0x4700, + 0xd8e4, 0xc721, + 0xd8e5, 0x0f06, + 0xd8e6, 0xc728, + 0xd8e7, 0x0700, + 0xd8e8, 0xc729, + 0xd8e9, 0x1207, + 0xd8ea, 0xc801, + 0xd8eb, 0x7f50, + 0xd8ec, 0xc802, + 0xd8ed, 0x7760, + 0xd8ee, 0xc803, + 0xd8ef, 0x7fce, + 0xd8f0, 0xc804, + 0xd8f1, 0x520e, + 0xd8f2, 0xc805, + 0xd8f3, 0x5c11, + 0xd8f4, 0xc806, + 0xd8f5, 0x3c51, + 0xd8f6, 0xc807, + 0xd8f7, 0x4061, + 0xd8f8, 0xc808, + 0xd8f9, 0x49c1, + 0xd8fa, 0xc809, + 0xd8fb, 0x3840, + 0xd8fc, 0xc80a, + 0xd8fd, 0x0000, + 0xd8fe, 0xc821, + 0xd8ff, 0x0002, + 0xd900, 0xc822, + 0xd901, 0x0046, + 0xd902, 0xc844, + 0xd903, 0x182f, + 0xd904, 0xc013, + 0xd905, 0xf341, + 0xd906, 0xc084, + 0xd907, 0x0030, + 0xd908, 0xc904, + 0xd909, 0x1401, + 0xd90a, 0xcb0c, + 0xd90b, 0x0004, + 0xd90c, 0xcb0e, + 0xd90d, 0xa00a, + 0xd90e, 0xcb0f, + 0xd90f, 0xc0c0, + 0xd910, 0xcb10, + 0xd911, 0xc0c0, + 0xd912, 0xcb11, + 0xd913, 0x00a0, + 0xd914, 0xcb12, + 0xd915, 0x0007, + 0xd916, 0xc241, + 0xd917, 0xa000, + 0xd918, 0xc243, + 0xd919, 0x7fe0, + 0xd91a, 0xc604, + 0xd91b, 0x000e, + 0xd91c, 0xc609, + 0xd91d, 0x00f5, + 0xd91e, 0xc611, + 0xd91f, 0x000e, + 0xd920, 0xc660, + 0xd921, 0x9600, + 0xd922, 0xc687, + 0xd923, 0x0004, + 0xd924, 0xc60a, + 0xd925, 0x04f5, + 0xd926, 0x0000, + 0xd927, 0x2641, + 0xd928, 0x3021, + 0xd929, 0x1001, + 0xd92a, 0xc620, + 0xd92b, 0x14e5, + 0xd92c, 0xc621, + 0xd92d, 0xc53d, + 0xd92e, 0xc622, + 0xd92f, 0x3cbe, + 0xd930, 0xc623, + 0xd931, 0x4452, + 0xd932, 0xc624, + 0xd933, 0xc5c5, + 0xd934, 0xc625, + 0xd935, 0xe01e, + 0xd936, 0xc627, + 0xd937, 0x0000, + 0xd938, 0xc628, + 0xd939, 0x0000, + 0xd93a, 0xc62c, + 0xd93b, 0x0000, + 0xd93c, 0x0000, + 0xd93d, 0x2b84, + 0xd93e, 0x3c74, + 0xd93f, 0x6435, + 0xd940, 0xdff4, + 0xd941, 0x6435, + 0xd942, 0x2806, + 0xd943, 0x3006, + 0xd944, 0x8565, + 0xd945, 0x2b24, + 0xd946, 0x3c24, + 0xd947, 0x6436, + 0xd948, 0x1002, + 0xd949, 0x2b24, + 0xd94a, 0x3c24, + 0xd94b, 0x6436, + 0xd94c, 0x4045, + 0xd94d, 0x8656, + 0xd94e, 0x5663, + 0xd94f, 0x0302, + 0xd950, 0x401e, + 0xd951, 0x1002, + 0xd952, 0x2807, + 0xd953, 0x31a7, + 0xd954, 0x20c4, + 0xd955, 0x3c24, + 0xd956, 0x6724, + 0xd957, 0x1002, + 0xd958, 0x2807, + 0xd959, 0x3187, + 0xd95a, 0x20c4, + 0xd95b, 0x3c24, + 0xd95c, 0x6724, + 0xd95d, 0x1002, + 0xd95e, 0x24f4, + 0xd95f, 0x3c64, + 0xd960, 0x6436, + 0xd961, 0xdff4, + 0xd962, 0x6436, + 0xd963, 0x1002, + 0xd964, 0x2006, + 0xd965, 0x3d76, + 0xd966, 0xc161, + 0xd967, 0x6134, + 0xd968, 0x6135, + 0xd969, 0x5443, + 0xd96a, 0x0303, + 0xd96b, 0x6524, + 0xd96c, 0x00fb, + 0xd96d, 0x1002, + 0xd96e, 0x20d4, + 0xd96f, 0x3c24, + 0xd970, 0x2025, + 0xd971, 0x3005, + 0xd972, 0x6524, + 0xd973, 0x1002, + 0xd974, 0xd019, + 0xd975, 0x2104, + 0xd976, 0x3c24, + 0xd977, 0x2105, + 0xd978, 0x3805, + 0xd979, 0x6524, + 0xd97a, 0xdff4, + 0xd97b, 0x4005, + 0xd97c, 0x6524, + 0xd97d, 0x2e8d, + 0xd97e, 0x303d, + 0xd97f, 0x2408, + 0xd980, 0x35d8, + 0xd981, 0x5dd3, + 0xd982, 0x0307, + 0xd983, 0x8887, + 0xd984, 0x63a7, + 0xd985, 0x8887, + 0xd986, 0x63a7, + 0xd987, 0xdffd, + 0xd988, 0x00f9, + 0xd989, 0x1002, + 0xd98a, 0x0000, + }; + int i, err; + + /* set uC clock and activate it */ + err = set_phy_regs(phy, uCclock40MHz); + msleep(500); + if (err) + return err; + err = set_phy_regs(phy, uCclockActivate); + msleep(500); + if (err) + return err; + + for (i = 0; i < ARRAY_SIZE(twinax_edc) && !err; i += 2) + err = mdio_write(phy, MDIO_DEV_PMA_PMD, twinax_edc[i], + twinax_edc[i + 1]); + /* activate uC */ + err = set_phy_regs(phy, uCactivate); + if (!err) + phy->priv = edc_twinax; + return err; +} + +/* + * Return Module Type. + */ +static int ael2020_get_module_type(struct cphy *phy, int delay_ms) +{ + int v; + unsigned int stat; + + v = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2020_GPIO_STAT, &stat); + if (v) + return v; + + if (stat & (0x1 << (AEL2020_GPIO_MODDET*4))) { + /* module absent */ + return phy_modtype_none; + } + + return ael2xxx_get_module_type(phy, delay_ms); +} + +/* + * Enable PHY interrupts. We enable "Module Detection" interrupts (on any + * state transition) and then generic Link Alarm Status Interrupt (LASI). + */ +static int ael2020_intr_enable(struct cphy *phy) +{ + struct reg_val regs[] = { + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT, + 0xffff, 0x4 }, + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0x8 << (AEL2020_GPIO_LSTAT*4) }, + + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0x2 << (AEL2020_GPIO_MODDET*4) }, + + /* end */ + { 0, 0, 0, 0 } + }; + int err; + + err = set_phy_regs(phy, regs); + if (err) + return err; + + phy->caps |= POLL_LINK_1ST_TIME; + + /* enable standard Link Alarm Status Interrupts */ + err = t3_phy_lasi_intr_enable(phy); + if (err) + return err; + + return 0; +} + +/* + * Disable PHY interrupts. The mirror of the above ... + */ +static int ael2020_intr_disable(struct cphy *phy) +{ + struct reg_val regs[] = { + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) }, + + { MDIO_DEV_PMA_PMD, AEL2020_GPIO_CTRL, + 0xffff, 0x1 << (AEL2020_GPIO_MODDET*4) }, + + /* end */ + { 0, 0, 0, 0 } + }; + int err; + + err = set_phy_regs(phy, regs); + if (err) + return err; + + /* disable standard Link Alarm Status Interrupts */ + return t3_phy_lasi_intr_disable(phy); +} + +/* + * Clear PHY interrupt state. + */ +static int ael2020_intr_clear(struct cphy *phy) +{ + unsigned int stat; + int err = mdio_read(phy, MDIO_DEV_PMA_PMD, AEL2020_GPIO_INTR, &stat); + return err ? err : t3_phy_lasi_intr_clear(phy); +} + +/* + * Common register settings for the AEL2020 when it comes out of reset. + */ +static struct reg_val ael2020_reset_regs[] = { + { MDIO_DEV_PMA_PMD, 0xc003, 0xffff, 0x3101 }, + + { MDIO_DEV_PMA_PMD, 0xcd40, 0xffff, 0x0001 }, + + { MDIO_DEV_PMA_PMD, 0xff02, 0xffff, 0x0023 }, + { MDIO_DEV_PMA_PMD, 0xff03, 0xffff, 0x0000 }, + { MDIO_DEV_PMA_PMD, 0xff04, 0xffff, 0x0000 }, + + /* end */ + { 0, 0, 0, 0 } +}; + +/* + * Reset the PHY and put it into a canonical operating state. + */ +static int ael2020_reset(struct cphy *phy, int wait) +{ + int err; + unsigned int lasi_ctrl; + + /* grab current interrupt state */ + err = mdio_read(phy, MDIO_DEV_PMA_PMD, LASI_CTRL, &lasi_ctrl); + if (err) + return err; + + err = t3_phy_reset(phy, MDIO_DEV_PMA_PMD, 125); + if (err) + return err; + msleep(100); + + /* basic initialization for all module types */ + phy->priv = edc_none; + err = set_phy_regs(phy, ael2020_reset_regs); + if (err) + return err; + + /* determine module type and perform appropriate initialization */ + err = ael2020_get_module_type(phy, 0); + if (err < 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 20: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 59CF1106568D; Mon, 5 Oct 2009 20:38:37 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F09F8FC1A; Mon, 5 Oct 2009 20: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 n95KcbsS024888; Mon, 5 Oct 2009 20:38:37 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95KcbM9024887; Mon, 5 Oct 2009 20:38:37 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910052038.n95KcbM9024887@svn.freebsd.org> From: Joe Marcus Clarke Date: Mon, 5 Oct 2009 20:38: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: r197792 - 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: Mon, 05 Oct 2009 20:38:37 -0000 Author: marcus (doc,ports committer) Date: Mon Oct 5 20:38:36 2009 New Revision: 197792 URL: http://svn.freebsd.org/changeset/base/197792 Log: Add merginfo for the _pthread_stubs.c commit which merged r197681 to stable/8. Requested by: kib Approved by: re (kib) Modified: stable/8/lib/libc/gen/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 21:11: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 40F8D106566B; Mon, 5 Oct 2009 21:11:05 +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 308E38FC1C; Mon, 5 Oct 2009 21:11: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 n95LB5cc025844; Mon, 5 Oct 2009 21:11:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95LB5mH025841; Mon, 5 Oct 2009 21:11:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200910052111.n95LB5mH025841@svn.freebsd.org> From: Xin LI Date: Mon, 5 Oct 2009 21:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197793 - 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: Mon, 05 Oct 2009 21:11:05 -0000 Author: delphij Date: Mon Oct 5 21:11:04 2009 New Revision: 197793 URL: http://svn.freebsd.org/changeset/base/197793 Log: fts_open() requires that the list passed as argument to contain at least one path. When the list is empty (contain only a NULL pointer), return EINVAL instead of pretending to succeed, which will cause a NULL pointer deference in a later fts_read() call. Noticed by: Christoph Mallon (via rdivacky@) MFC after: 2 weeks Modified: head/lib/libc/gen/fts.3 head/lib/libc/gen/fts.c Modified: head/lib/libc/gen/fts.3 ============================================================================== --- head/lib/libc/gen/fts.3 Mon Oct 5 20:38:36 2009 (r197792) +++ head/lib/libc/gen/fts.3 Mon Oct 5 21:11:04 2009 (r197793) @@ -28,7 +28,7 @@ .\" @(#)fts.3 8.5 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd January 26, 2008 +.Dd October 5, 2009 .Dt FTS 3 .Os .Sh NAME @@ -776,7 +776,7 @@ may fail and set as follows: .Bl -tag -width Er .It Bq Er EINVAL -The options were invalid. +The options were invalid, or the list were empty. .El .Sh SEE ALSO .Xr find 1 , Modified: head/lib/libc/gen/fts.c ============================================================================== --- head/lib/libc/gen/fts.c Mon Oct 5 20:38:36 2009 (r197792) +++ head/lib/libc/gen/fts.c Mon Oct 5 21:11:04 2009 (r197793) @@ -124,6 +124,12 @@ fts_open(argv, options, compar) return (NULL); } + /* fts_open() requires at least one path */ + if (*argv == NULL) { + errno = EINVAL; + return (NULL); + } + /* Allocate/initialize the stream. */ if ((priv = malloc(sizeof(*priv))) == NULL) return (NULL); From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 22:23: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 6FFAD1065672; Mon, 5 Oct 2009 22:23:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB8B8FC0C; Mon, 5 Oct 2009 22:23: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 n95MND6e027484; Mon, 5 Oct 2009 22:23:13 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95MNDc9027482; Mon, 5 Oct 2009 22:23:13 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910052223.n95MNDc9027482@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 22:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197794 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 22:23:13 -0000 Author: rwatson Date: Mon Oct 5 22:23:12 2009 New Revision: 197794 URL: http://svn.freebsd.org/changeset/base/197794 Log: Fix build on amd64, where sysctl arg1 is a pointer. Reported by: Mr Tinderbox MFC after: 3 months Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Oct 5 21:11:04 2009 (r197793) +++ head/sys/kern/uipc_usrreq.c Mon Oct 5 22:23:12 2009 (r197794) @@ -1468,7 +1468,7 @@ unp_pcblist(SYSCTL_HANDLER_ARGS) break; default: - panic("unp_pcblist: arg1 %d", (intptr_t)arg1); + panic("unp_pcblist: arg1 %d", (int)(intptr_t)arg1); } /* From owner-svn-src-all@FreeBSD.ORG Mon Oct 5 22:24: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 5003E1065693; Mon, 5 Oct 2009 22:24:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD858FC1B; Mon, 5 Oct 2009 22:24: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 n95MOE0V027551; Mon, 5 Oct 2009 22:24:14 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n95MOEXH027549; Mon, 5 Oct 2009 22:24:14 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910052224.n95MOEXH027549@svn.freebsd.org> From: Robert Watson Date: Mon, 5 Oct 2009 22:24: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: r197795 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2009 22:24:14 -0000 Author: rwatson Date: Mon Oct 5 22:24:13 2009 New Revision: 197795 URL: http://svn.freebsd.org/changeset/base/197795 Log: In tcp_input(), we acquire a global write lock at first only if a segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN). If we later have to upgrade the lock, we acquire an inpcb reference and drop both global/inpcb locks before reacquiring in-order. In that gap, the connection may transition into TIMEWAIT, so we need to loop back and reevaluate the inpcb after relocking. MFC after: 3 days Reported by: Kamigishi Rei Reviewed by: bz Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Oct 5 22:23:12 2009 (r197794) +++ head/sys/netinet/tcp_input.c Mon Oct 5 22:24:13 2009 (r197795) @@ -648,6 +648,7 @@ findpcb: * tried to free the inpcb, in which case we need to loop back and * try to find a new inpcb to deliver to. */ +relocked: if (inp->inp_flags & INP_TIMEWAIT) { KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked)); @@ -698,7 +699,8 @@ findpcb: * We've identified a valid inpcb, but it could be that we need an * inpcbinfo write lock and have only a read lock. In this case, * attempt to upgrade/relock using the same strategy as the TIMEWAIT - * case above. + * case above. If we relock, we have to jump back to 'relocked' as + * the connection might now be in TIMEWAIT. */ if (tp->t_state != TCPS_ESTABLISHED || (thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || @@ -720,6 +722,7 @@ findpcb: goto findpcb; } tcp_wlock_relocked++; + goto relocked; } else { ti_locked = TI_WLOCKED; tcp_wlock_upgraded++; From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 02:13: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 8B890106566B; Tue, 6 Oct 2009 02:13:35 +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 7A41F8FC17; Tue, 6 Oct 2009 02:13: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 n962DYlh032506; Tue, 6 Oct 2009 02:13:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n962DWVr032502; Tue, 6 Oct 2009 02:13:32 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200910060213.n962DWVr032502@svn.freebsd.org> From: Doug Barton Date: Tue, 6 Oct 2009 02:13: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: r197797 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 02:13:35 -0000 Author: dougb Date: Tue Oct 6 02:13:32 2009 New Revision: 197797 URL: http://svn.freebsd.org/changeset/base/197797 Log: "Potluck Pogo" was a collection of Walt Kelly's "Pogo" cartoons first published in 1955. "Putluck Pogo" seems to be a typo. Modified: head/games/fortune/datfiles/fortunes head/games/fortune/datfiles/fortunes.sp.ok Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Mon Oct 5 23:19:51 2009 (r197796) +++ head/games/fortune/datfiles/fortunes Tue Oct 6 02:13:32 2009 (r197797) @@ -18126,7 +18126,7 @@ tail on me, go ahead. They'd be very bo commenting on rumors of womanizing. % Food for thought is no substitute for the real thing. - -- Walt Kelly, "Putluck Pogo" + -- Walt Kelly, "Potluck Pogo" % Foolproof Operation: No provision for adjustment. Modified: head/games/fortune/datfiles/fortunes.sp.ok ============================================================================== --- head/games/fortune/datfiles/fortunes.sp.ok Mon Oct 5 23:19:51 2009 (r197796) +++ head/games/fortune/datfiles/fortunes.sp.ok Tue Oct 6 02:13:32 2009 (r197797) @@ -3300,6 +3300,7 @@ postjudice Postnews Postpetroleum potholes +Potluck potty Poul Pournelle @@ -3376,7 +3377,6 @@ Purshottam PUSHes pushy pussycats -Putluck Putt's PVLC PxP From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 04:57: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 811601065676; Tue, 6 Oct 2009 04:57:19 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FDD08FC0A; Tue, 6 Oct 2009 04:57: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 n964vJTo036057; Tue, 6 Oct 2009 04:57:19 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n964vJPT036055; Tue, 6 Oct 2009 04:57:19 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200910060457.n964vJPT036055@svn.freebsd.org> From: Maxim Konovalov Date: Tue, 6 Oct 2009 04:57: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: r197799 - 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: Tue, 06 Oct 2009 04:57:19 -0000 Author: maxim Date: Tue Oct 6 04:57:18 2009 New Revision: 197799 URL: http://svn.freebsd.org/changeset/base/197799 Log: o Fix typo: "an in particular" -> "and in particular". PR: docs/139370 Submitted by: Kenyon Ralph MFC after: 1 week Modified: head/share/man/man4/de.4 Modified: head/share/man/man4/de.4 ============================================================================== --- head/share/man/man4/de.4 Tue Oct 6 03:53:29 2009 (r197798) +++ head/share/man/man4/de.4 Tue Oct 6 04:57:18 2009 (r197799) @@ -88,7 +88,7 @@ setup utility and are not changeable. .Pp Use the .Xr ifconfig 8 -command an in particular the +command and in particular the .Fl m flag to list the supported media types for your particular card. .Pp From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 08:01: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 2E1A41065676; Tue, 6 Oct 2009 08:01:58 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id E9EE68FC19; Tue, 6 Oct 2009 08:01:57 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 6D9BF2C2D29; Tue, 6 Oct 2009 03:01:57 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id UE9tbfwu5Ptl; Tue, 6 Oct 2009 03:01:49 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 640662C2D54; Tue, 6 Oct 2009 03:01:49 -0500 (CDT) Message-ID: <4ACAF96C.6070204@cs.rice.edu> Date: Tue, 06 Oct 2009 03:01:48 -0500 From: Alan Cox User-Agent: Thunderbird 2.0.0.23 (X11/20090822) MIME-Version: 1.0 To: John Baldwin References: <200910041853.n94IrAf7082338@svn.freebsd.org> <4AC9F4F4.4030008@FreeBSD.org> <4ACA0000.2080005@cs.rice.edu> <4ACA0F09.2010808@FreeBSD.org> In-Reply-To: <4ACA0F09.2010808@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197750 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2009 08:01:58 -0000 John Baldwin wrote: > > Do you care what is in the padding in this case or more about just > having each mutex on a separate cache line? __aligned() is fine if > you don't mind the padding getting reused for something else. > Yes, I care. I would also like to prevent the placement of the heads of the active, inactive, and hold queues (vm_page_queues[]) in the same cache line as the free page queue mutex. Alan From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 10:19: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 1819E1065670; Tue, 6 Oct 2009 10:19:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15648FC0C; Tue, 6 Oct 2009 10:19: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 n96AJKWw043721; Tue, 6 Oct 2009 10:19:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96AJKjW043720; Tue, 6 Oct 2009 10:19:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910061019.n96AJKjW043720@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 6 Oct 2009 10:19: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: r197802 - head/crypto/openssh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 10:19:21 -0000 Author: des Date: Tue Oct 6 10:19:20 2009 New Revision: 197802 URL: http://svn.freebsd.org/changeset/base/197802 Log: Expand $FreeBSD$ Modified: head/crypto/openssh/sftp-server.8 (props changed) head/crypto/openssh/ssh-agent.1 (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 13:45: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 200211065692; Tue, 6 Oct 2009 13:45:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8BF8FC19; Tue, 6 Oct 2009 13:45: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 n96Djn7U048713; Tue, 6 Oct 2009 13:45:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96DjnS1048710; Tue, 6 Oct 2009 13:45:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200910061345.n96DjnS1048710@svn.freebsd.org> From: Attilio Rao Date: Tue, 6 Oct 2009 13:45: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: r197803 - in head/sys: amd64/include 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: Tue, 06 Oct 2009 13:45:50 -0000 Author: attilio Date: Tue Oct 6 13:45:49 2009 New Revision: 197803 URL: http://svn.freebsd.org/changeset/base/197803 Log: Per their definition, atomic instructions used in conjuction with memory barriers should also ensure that the compiler doesn't reorder paths where they are used. GCC, however, does that aggressively, even in presence of volatile operands. The most reliable way GCC offers for avoid instructions reordering is clobbering "memory" even if that is theoretically an heavy-weight operation, flushing the content of all the registers and forcing reload of them (We could rely, however, on gcc DTRT by just understanding the purpose as this is a well-known pattern for many modern operating-systems). Not all our memory barriers, right now, clobber memory for GCC-like compilers. The most notable cases are IA32 and amd64 where the memory barrier are treacted the same as normal atomic instructions. Fix this by offering the possibility to implement atomic instructions with memory barriers separately from the normal version and implement the GCC-like specific one using memory clobbering. Thanks to Chris Lattner (@apple) for his discussion on llvm specifics. Reported by: jhb Reviewed by: jhb Tested by: rdivacky, Giovanni Trematerra Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Tue Oct 6 10:19:20 2009 (r197802) +++ head/sys/amd64/include/atomic.h Tue Oct 6 13:45:49 2009 (r197803) @@ -73,10 +73,13 @@ */ #if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM) #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ -void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v) +void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ +void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src); int atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src); +int atomic_cmpset_barr_int(volatile u_int *dst, u_int exp, u_int src); +int atomic_cmpset_barr_long(volatile u_long *dst, u_long exp, u_long src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); u_long atomic_fetchadd_long(volatile u_long *p, u_long v); @@ -97,8 +100,9 @@ void atomic_store_rel_##TYPE(volatile u #endif /* - * The assembly is volatilized to demark potential before-and-after side - * effects if an interrupt or SMP collision were to occur. + * The assembly is volatilized to avoid code chunk removal by the compiler. + * GCC aggressively reorders operations and memory clobbering is necessary + * in order to avoid that for memory barriers. */ #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ static __inline void \ @@ -108,6 +112,15 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE : "=m" (*p) \ : CONS (V), "m" (*p)); \ } \ + \ +static __inline void \ +atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ +{ \ + __asm __volatile(MPLOCKED OP \ + : "=m" (*p) \ + : CONS (V), "m" (*p) \ + : "memory"); \ +} \ struct __hack /* @@ -160,6 +173,9 @@ atomic_cmpset_long(volatile u_long *dst, return (res); } +#define atomic_cmpset_barr_int atomic_cmpset_int +#define atomic_cmpset_barr_long atomic_cmpset_long + /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -205,18 +221,23 @@ atomic_fetchadd_long(volatile u_long *p, * PentiumPro or higher, reads may pass writes, so for that case we have * to use a serializing instruction (i.e. with LOCK) to do the load in * SMP kernels. For UP kernels, however, the cache of the single processor - * is always consistent, so we don't need any memory barriers. + * is always consistent, so we only need to take care of compiler. */ #define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ static __inline u_##TYPE \ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ { \ - return (*p); \ + u_##TYPE tmp; \ + \ + tmp = *p; \ + __asm __volatile ("" : : : "memory"); \ + return (tmp); \ } \ \ static __inline void \ atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ + __asm __volatile ("" : : : "memory"); \ *p = v; \ } \ struct __hack @@ -247,7 +268,8 @@ atomic_store_rel_##TYPE(volatile u_##TYP __asm __volatile(SOP \ : "=m" (*p), /* 0 */ \ "+r" (v) /* 1 */ \ - : "m" (*p)); /* 2 */ \ + : "m" (*p) /* 2 */ \ + : "memory"); \ } \ struct __hack @@ -327,46 +349,45 @@ u_long atomic_readandclear_long(volatile #endif /* __GNUCLIKE_ASM */ -/* Acquire and release variants are identical to the normal ones. */ -#define atomic_set_acq_char atomic_set_char -#define atomic_set_rel_char atomic_set_char -#define atomic_clear_acq_char atomic_clear_char -#define atomic_clear_rel_char atomic_clear_char -#define atomic_add_acq_char atomic_add_char -#define atomic_add_rel_char atomic_add_char -#define atomic_subtract_acq_char atomic_subtract_char -#define atomic_subtract_rel_char atomic_subtract_char - -#define atomic_set_acq_short atomic_set_short -#define atomic_set_rel_short atomic_set_short -#define atomic_clear_acq_short atomic_clear_short -#define atomic_clear_rel_short atomic_clear_short -#define atomic_add_acq_short atomic_add_short -#define atomic_add_rel_short atomic_add_short -#define atomic_subtract_acq_short atomic_subtract_short -#define atomic_subtract_rel_short atomic_subtract_short - -#define atomic_set_acq_int atomic_set_int -#define atomic_set_rel_int atomic_set_int -#define atomic_clear_acq_int atomic_clear_int -#define atomic_clear_rel_int atomic_clear_int -#define atomic_add_acq_int atomic_add_int -#define atomic_add_rel_int atomic_add_int -#define atomic_subtract_acq_int atomic_subtract_int -#define atomic_subtract_rel_int atomic_subtract_int -#define atomic_cmpset_acq_int atomic_cmpset_int -#define atomic_cmpset_rel_int atomic_cmpset_int - -#define atomic_set_acq_long atomic_set_long -#define atomic_set_rel_long atomic_set_long -#define atomic_clear_acq_long atomic_clear_long -#define atomic_clear_rel_long atomic_clear_long -#define atomic_add_acq_long atomic_add_long -#define atomic_add_rel_long atomic_add_long -#define atomic_subtract_acq_long atomic_subtract_long -#define atomic_subtract_rel_long atomic_subtract_long -#define atomic_cmpset_acq_long atomic_cmpset_long -#define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_set_acq_char atomic_set_barr_char +#define atomic_set_rel_char atomic_set_barr_char +#define atomic_clear_acq_char atomic_clear_barr_char +#define atomic_clear_rel_char atomic_clear_barr_char +#define atomic_add_acq_char atomic_add_barr_char +#define atomic_add_rel_char atomic_add_barr_char +#define atomic_subtract_acq_char atomic_subtract_barr_char +#define atomic_subtract_rel_char atomic_subtract_barr_char + +#define atomic_set_acq_short atomic_set_barr_short +#define atomic_set_rel_short atomic_set_barr_short +#define atomic_clear_acq_short atomic_clear_barr_short +#define atomic_clear_rel_short atomic_clear_barr_short +#define atomic_add_acq_short atomic_add_barr_short +#define atomic_add_rel_short atomic_add_barr_short +#define atomic_subtract_acq_short atomic_subtract_barr_short +#define atomic_subtract_rel_short atomic_subtract_barr_short + +#define atomic_set_acq_int atomic_set_barr_int +#define atomic_set_rel_int atomic_set_barr_int +#define atomic_clear_acq_int atomic_clear_barr_int +#define atomic_clear_rel_int atomic_clear_barr_int +#define atomic_add_acq_int atomic_add_barr_int +#define atomic_add_rel_int atomic_add_barr_int +#define atomic_subtract_acq_int atomic_subtract_barr_int +#define atomic_subtract_rel_int atomic_subtract_barr_int +#define atomic_cmpset_acq_int atomic_cmpset_barr_int +#define atomic_cmpset_rel_int atomic_cmpset_barr_int + +#define atomic_set_acq_long atomic_set_barr_long +#define atomic_set_rel_long atomic_set_barr_long +#define atomic_clear_acq_long atomic_clear_barr_long +#define atomic_clear_rel_long atomic_clear_barr_long +#define atomic_add_acq_long atomic_add_barr_long +#define atomic_add_rel_long atomic_add_barr_long +#define atomic_subtract_acq_long atomic_subtract_barr_long +#define atomic_subtract_rel_long atomic_subtract_barr_long +#define atomic_cmpset_acq_long atomic_cmpset_barr_long +#define atomic_cmpset_rel_long atomic_cmpset_barr_long /* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Tue Oct 6 10:19:20 2009 (r197802) +++ head/sys/i386/include/atomic.h Tue Oct 6 13:45:49 2009 (r197803) @@ -73,9 +73,11 @@ */ #if defined(KLD_MODULE) || !defined(__GNUCLIKE_ASM) #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ -void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v) +void atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v); \ +void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src); +int atomic_cmpset_barr_int(volatile u_int *dst, u_int exp, u_int src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); #define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ @@ -95,8 +97,9 @@ void atomic_store_rel_##TYPE(volatile u #endif /* - * The assembly is volatilized to demark potential before-and-after side - * effects if an interrupt or SMP collision were to occur. + * The assembly is volatilized to avoid code chunk removal by the compiler. + * GCC aggressively reorders operations and memory clobbering is necessary + * in order to avoid that for memory barriers. */ #define ATOMIC_ASM(NAME, TYPE, OP, CONS, V) \ static __inline void \ @@ -106,6 +109,15 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE : "=m" (*p) \ : CONS (V), "m" (*p)); \ } \ + \ +static __inline void \ +atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ +{ \ + __asm __volatile(MPLOCKED OP \ + : "=m" (*p) \ + : CONS (V), "m" (*p) \ + : "memory"); \ +} \ struct __hack /* @@ -168,6 +180,8 @@ atomic_cmpset_int(volatile u_int *dst, u #endif /* CPU_DISABLE_CMPXCHG */ +#define atomic_cmpset_barr_int atomic_cmpset_int + /* * Atomically add the value of v to the integer pointed to by p and return * the previous value of *p. @@ -194,18 +208,23 @@ atomic_fetchadd_int(volatile u_int *p, u * PentiumPro or higher, reads may pass writes, so for that case we have * to use a serializing instruction (i.e. with LOCK) to do the load in * SMP kernels. For UP kernels, however, the cache of the single processor - * is always consistent, so we don't need any memory barriers. + * is always consistent, so we only need to take care of compiler. */ #define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ static __inline u_##TYPE \ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \ { \ - return (*p); \ + u_##TYPE tmp; \ + \ + tmp = *p; \ + __asm __volatile("" : : : "memory"); \ + return (tmp); \ } \ \ static __inline void \ atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\ { \ + __asm __volatile("" : : : "memory"); \ *p = v; \ } \ struct __hack @@ -236,7 +255,8 @@ atomic_store_rel_##TYPE(volatile u_##TYP __asm __volatile(SOP \ : "=m" (*p), /* 0 */ \ "+r" (v) /* 1 */ \ - : "m" (*p)); /* 2 */ \ + : "m" (*p) /* 2 */ \ + : "memory"); \ } \ struct __hack @@ -282,6 +302,14 @@ atomic_cmpset_long(volatile u_long *dst, (u_int)src)); } +static __inline int +atomic_cmpset_barr_long(volatile u_long *dst, u_long exp, u_long src) +{ + + return (atomic_cmpset_barr_int((volatile u_int *)dst, (u_int)exp, + (u_int)src)); +} + static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) { @@ -331,46 +359,45 @@ u_long atomic_readandclear_long(volatile #endif /* __GNUCLIKE_ASM */ -/* Acquire and release variants are identical to the normal ones. */ -#define atomic_set_acq_char atomic_set_char -#define atomic_set_rel_char atomic_set_char -#define atomic_clear_acq_char atomic_clear_char -#define atomic_clear_rel_char atomic_clear_char -#define atomic_add_acq_char atomic_add_char -#define atomic_add_rel_char atomic_add_char -#define atomic_subtract_acq_char atomic_subtract_char -#define atomic_subtract_rel_char atomic_subtract_char - -#define atomic_set_acq_short atomic_set_short -#define atomic_set_rel_short atomic_set_short -#define atomic_clear_acq_short atomic_clear_short -#define atomic_clear_rel_short atomic_clear_short -#define atomic_add_acq_short atomic_add_short -#define atomic_add_rel_short atomic_add_short -#define atomic_subtract_acq_short atomic_subtract_short -#define atomic_subtract_rel_short atomic_subtract_short - -#define atomic_set_acq_int atomic_set_int -#define atomic_set_rel_int atomic_set_int -#define atomic_clear_acq_int atomic_clear_int -#define atomic_clear_rel_int atomic_clear_int -#define atomic_add_acq_int atomic_add_int -#define atomic_add_rel_int atomic_add_int -#define atomic_subtract_acq_int atomic_subtract_int -#define atomic_subtract_rel_int atomic_subtract_int -#define atomic_cmpset_acq_int atomic_cmpset_int -#define atomic_cmpset_rel_int atomic_cmpset_int - -#define atomic_set_acq_long atomic_set_long -#define atomic_set_rel_long atomic_set_long -#define atomic_clear_acq_long atomic_clear_long -#define atomic_clear_rel_long atomic_clear_long -#define atomic_add_acq_long atomic_add_long -#define atomic_add_rel_long atomic_add_long -#define atomic_subtract_acq_long atomic_subtract_long -#define atomic_subtract_rel_long atomic_subtract_long -#define atomic_cmpset_acq_long atomic_cmpset_long -#define atomic_cmpset_rel_long atomic_cmpset_long +#define atomic_set_acq_char atomic_set_barr_char +#define atomic_set_rel_char atomic_set_barr_char +#define atomic_clear_acq_char atomic_clear_barr_char +#define atomic_clear_rel_char atomic_clear_barr_char +#define atomic_add_acq_char atomic_add_barr_char +#define atomic_add_rel_char atomic_add_barr_char +#define atomic_subtract_acq_char atomic_subtract_barr_char +#define atomic_subtract_rel_char atomic_subtract_barr_char + +#define atomic_set_acq_short atomic_set_barr_short +#define atomic_set_rel_short atomic_set_barr_short +#define atomic_clear_acq_short atomic_clear_barr_short +#define atomic_clear_rel_short atomic_clear_barr_short +#define atomic_add_acq_short atomic_add_barr_short +#define atomic_add_rel_short atomic_add_barr_short +#define atomic_subtract_acq_short atomic_subtract_barr_short +#define atomic_subtract_rel_short atomic_subtract_barr_short + +#define atomic_set_acq_int atomic_set_barr_int +#define atomic_set_rel_int atomic_set_barr_int +#define atomic_clear_acq_int atomic_clear_barr_int +#define atomic_clear_rel_int atomic_clear_barr_int +#define atomic_add_acq_int atomic_add_barr_int +#define atomic_add_rel_int atomic_add_barr_int +#define atomic_subtract_acq_int atomic_subtract_barr_int +#define atomic_subtract_rel_int atomic_subtract_barr_int +#define atomic_cmpset_acq_int atomic_cmpset_barr_int +#define atomic_cmpset_rel_int atomic_cmpset_barr_int + +#define atomic_set_acq_long atomic_set_barr_long +#define atomic_set_rel_long atomic_set_barr_long +#define atomic_clear_acq_long atomic_clear_barr_long +#define atomic_clear_rel_long atomic_clear_barr_long +#define atomic_add_acq_long atomic_add_barr_long +#define atomic_add_rel_long atomic_add_barr_long +#define atomic_subtract_acq_long atomic_subtract_barr_long +#define atomic_subtract_rel_long atomic_subtract_barr_long +#define atomic_cmpset_acq_long atomic_cmpset_barr_long +#define atomic_cmpset_rel_long atomic_cmpset_barr_long /* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 14:05: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 C622610656E9; Tue, 6 Oct 2009 14:05:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B48788FC1F; Tue, 6 Oct 2009 14:05: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 n96E5vXs049159; Tue, 6 Oct 2009 14:05:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96E5vsq049153; Tue, 6 Oct 2009 14:05:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910061405.n96E5vsq049153@svn.freebsd.org> From: Robert Watson Date: Tue, 6 Oct 2009 14:05: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: r197804 - in head: include 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: Tue, 06 Oct 2009 14:05:58 -0000 Author: rwatson Date: Tue Oct 6 14:05:57 2009 New Revision: 197804 URL: http://svn.freebsd.org/changeset/base/197804 Log: Add basename_r(3) to complement basename(3). basename_r(3) which accepts a caller-allocated buffer of at least MAXPATHLEN, rather than using a global buffer. MFC after: 1 month Sponsored by: Google Modified: head/include/libgen.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/basename.3 head/lib/libc/gen/basename.c Modified: head/include/libgen.h ============================================================================== --- head/include/libgen.h Tue Oct 6 13:45:49 2009 (r197803) +++ head/include/libgen.h Tue Oct 6 14:05:57 2009 (r197804) @@ -36,6 +36,7 @@ __BEGIN_DECLS char *basename(const char *); +char *basename_r(const char *, char *); char *dirname(const char *); #if 0 char *regcmp(const char *, ...); Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Oct 6 13:45:49 2009 (r197803) +++ head/lib/libc/gen/Makefile.inc Tue Oct 6 14:05:57 2009 (r197804) @@ -76,6 +76,7 @@ MAN+= alarm.3 arc4random.3 \ MLINKS+=arc4random.3 arc4random_addrandom.3 arc4random.3 arc4random_stir.3 \ arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3 +MLINKS+=basename.3 basename_r.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=devname.3 devname_r.3 MLINKS+=devname.3 fdevname.3 Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue Oct 6 13:45:49 2009 (r197803) +++ head/lib/libc/gen/Symbol.map Tue Oct 6 14:05:57 2009 (r197804) @@ -367,6 +367,7 @@ FBSD_1.1 { }; FBSD_1.2 { + basename_r; getpagesizes; }; Modified: head/lib/libc/gen/basename.3 ============================================================================== --- head/lib/libc/gen/basename.3 Tue Oct 6 13:45:49 2009 (r197803) +++ head/lib/libc/gen/basename.3 Tue Oct 6 14:05:57 2009 (r197804) @@ -27,7 +27,7 @@ .\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $ .\" $FreeBSD$ .\" -.Dd October 12, 2006 +.Dd October 6, 2009 .Dt BASENAME 3 .Os .Sh NAME @@ -37,6 +37,8 @@ .In libgen.h .Ft char * .Fn basename "const char *path" +.Ft char * +.Fn basename_r "const char *path" "char *bname" .Sh DESCRIPTION The .Fn basename @@ -58,6 +60,12 @@ If is a null pointer or the empty string, a pointer to the string .Qq \&. is returned. +.Pp +The +.Fn basename_r +variation accepts a buffer of at least +.Dv MAXPATHLEN +bytes in which to store the resulting component. .Sh IMPLEMENTATION NOTES The .Fn basename @@ -65,15 +73,17 @@ function returns a pointer to internal storage space allocated on the first call that will be overwritten by subsequent calls. +.Fn basename_r +is therefore preferred for threaded applications. .Sh RETURN VALUES On successful completion, .Fn basename -returns a pointer to the last component of +and +.Fn basename_r +return pointers to the last component of .Fa path . .Pp -If -.Fn basename -fails, a null pointer is returned and the global variable +If they fail, a null pointer is returned and the global variable .Va errno is set to indicate the error. .Sh ERRORS Modified: head/lib/libc/gen/basename.c ============================================================================== --- head/lib/libc/gen/basename.c Tue Oct 6 13:45:49 2009 (r197803) +++ head/lib/libc/gen/basename.c Tue Oct 6 14:05:57 2009 (r197804) @@ -40,18 +40,12 @@ __FBSDID("$FreeBSD$"); #include char * -basename(path) +basename_r(path, bname) const char *path; + char *bname; { - static char *bname = NULL; const char *endp, *startp; - if (bname == NULL) { - bname = (char *)malloc(MAXPATHLEN); - if (bname == NULL) - return(NULL); - } - /* Empty or NULL string gets treated as "." */ if (path == NULL || *path == '\0') { (void)strcpy(bname, "."); @@ -82,3 +76,17 @@ basename(path) bname[endp - startp + 1] = '\0'; return(bname); } + +char * +basename(path) + const char *path; +{ + static char *bname = NULL; + + if (bname == NULL) { + bname = (char *)malloc(MAXPATHLEN); + if (bname == NULL) + return (NULL); + } + return (basename_r(path, bname)); +} From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 16: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 35EA9106568F; Tue, 6 Oct 2009 16:05:07 +0000 (UTC) (envelope-from cokane@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 091518FC0C; Tue, 6 Oct 2009 16:05: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 n96G56bT051646; Tue, 6 Oct 2009 16:05:06 GMT (envelope-from cokane@svn.freebsd.org) Received: (from cokane@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96G56kA051644; Tue, 6 Oct 2009 16:05:06 GMT (envelope-from cokane@svn.freebsd.org) Message-Id: <200910061605.n96G56kA051644@svn.freebsd.org> From: Coleman Kane Date: Tue, 6 Oct 2009 16:05:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197806 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/if_ndis dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 16:05:07 -0000 Author: cokane Date: Tue Oct 6 16:05:06 2009 New Revision: 197806 URL: http://svn.freebsd.org/changeset/base/197806 Log: MFC: r197403, r197644, r197654, and r197659 Fix some unexpected potential NULL de-references in kernel mode due to usage of pre-8.0 wifi operations with the ndis driver wrapping a Win32/64 wifi driver. Submitted by: Paul B Mahol Approved by: re Modified: 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/if_ndis/if_ndis.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Tue Oct 6 15:44:08 2009 (r197805) +++ stable/8/sys/dev/if_ndis/if_ndis.c Tue Oct 6 16:05:06 2009 (r197806) @@ -1012,7 +1012,12 @@ static void ndis_vap_delete(struct ieee80211vap *vap) { struct ndis_vap *nvp = NDIS_VAP(vap); + struct ieee80211com *ic = vap->iv_ic; + struct ifnet *ifp = ic->ic_ifp; + struct ndis_softc *sc = ifp->if_softc; + ndis_stop(sc); + callout_drain(&sc->ndis_scan_callout); ieee80211_vap_detach(vap); free(nvp, M_80211_VAP); } @@ -1529,7 +1534,7 @@ ndis_inputtask(dobj, arg) if (m == NULL) break; KeReleaseSpinLock(&sc->ndis_rxlock, irql); - if (sc->ndis_80211) + if ((sc->ndis_80211 != 0) && (vap != NULL)) vap->iv_deliver_data(vap, vap->iv_bss, m); else (*ifp->if_input)(ifp, m); @@ -1741,7 +1746,7 @@ ndis_ticktask(d, xsc) sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) { sc->ndis_link = 1; NDIS_UNLOCK(sc); - if (sc->ndis_80211) { + if ((sc->ndis_80211 != 0) && (vap != NULL)) { ndis_getstate_80211(sc); ieee80211_new_state(vap, IEEE80211_S_RUN, -1); } @@ -1753,7 +1758,7 @@ ndis_ticktask(d, xsc) sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) { sc->ndis_link = 0; NDIS_UNLOCK(sc); - if (sc->ndis_80211) + if ((sc->ndis_80211 != 0) && (vap != NULL)) ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); NDIS_LOCK(sc); if_link_state_change(sc->ifp, LINK_STATE_DOWN); @@ -2042,9 +2047,6 @@ ndis_init(xsc) /* Setup task offload. */ ndis_set_offload(sc); - if (sc->ndis_80211) - ndis_setstate_80211(sc); - NDIS_LOCK(sc); sc->ndis_txidx = 0; @@ -2292,8 +2294,6 @@ ndis_setstate_80211(sc) ifp = sc->ifp; ic = ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); - if (vap == NULL) - return; if (!NDIS_INITIALIZED(sc)) { DPRINTF(("%s: NDIS not initialized\n", __func__)); @@ -2725,8 +2725,6 @@ ndis_getstate_80211(sc) ifp = sc->ifp; ic = ifp->if_l2com; vap = TAILQ_FIRST(&ic->ic_vaps); - if (vap == NULL) - return; ni = vap->iv_bss; if (!NDIS_INITIALIZED(sc)) From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 17: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 6995910656A5; Tue, 6 Oct 2009 17:10:38 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5821A8FC1B; Tue, 6 Oct 2009 17: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 n96HAcu0053054; Tue, 6 Oct 2009 17:10:38 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96HAcrw053053; Tue, 6 Oct 2009 17:10:38 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910061710.n96HAcrw053053@svn.freebsd.org> From: Joe Marcus Clarke Date: Tue, 6 Oct 2009 17:10: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: r197807 - in stable/8/lib/libc: . stdio stdtime 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, 06 Oct 2009 17:10:38 -0000 Author: marcus (doc,ports committer) Date: Tue Oct 6 17:10:38 2009 New Revision: 197807 URL: http://svn.freebsd.org/changeset/base/197807 Log: Properly record merginfo for r197681 into lib/libc instead of lib/libc/gen. Kib didn't see the previous commit before I committed it. I had assumed implicit approval when he requested the merginfo. So pointhats to me all around. This commit was reviewed by kib. Approved by: re (kib) Modified: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdio/asprintf.c (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/string/ffsll.c (props changed) stable/8/lib/libc/string/flsll.c (props changed) stable/8/lib/libc/string/wcpcpy.c (props changed) stable/8/lib/libc/string/wcpncpy.c (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 17:14: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 C9BE31065672; Tue, 6 Oct 2009 17:14:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B90FA8FC12; Tue, 6 Oct 2009 17:14: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 n96HEdOP053185; Tue, 6 Oct 2009 17:14:39 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96HEd4U053183; Tue, 6 Oct 2009 17:14:39 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910061714.n96HEd4U053183@svn.freebsd.org> From: Robert Watson Date: Tue, 6 Oct 2009 17:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197808 - 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, 06 Oct 2009 17:14:39 -0000 Author: rwatson Date: Tue Oct 6 17:14:39 2009 New Revision: 197808 URL: http://svn.freebsd.org/changeset/base/197808 Log: In rtld's map_object(), use pread(..., 0) rather than read() to read the ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking. MFC after: 1 month Sponsored by: Google Modified: head/libexec/rtld-elf/map_object.c Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Tue Oct 6 17:10:38 2009 (r197807) +++ head/libexec/rtld-elf/map_object.c Tue Oct 6 17:14:39 2009 (r197808) @@ -273,7 +273,7 @@ get_elf_header (int fd, const char *path } u; ssize_t nbytes; - if ((nbytes = read(fd, u.buf, PAGE_SIZE)) == -1) { + if ((nbytes = pread(fd, u.buf, PAGE_SIZE, 0)) == -1) { _rtld_error("%s: read error: %s", path, strerror(errno)); return NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 18:47: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 0285C106566B; Tue, 6 Oct 2009 18:47:03 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E32AC8FC18; Tue, 6 Oct 2009 18:47: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 n96Il2Ll060979; Tue, 6 Oct 2009 18:47:02 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96Il2Dm060975; Tue, 6 Oct 2009 18:47:02 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200910061847.n96Il2Dm060975@svn.freebsd.org> From: Qing Li Date: Tue, 6 Oct 2009 18:47: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: r197810 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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, 06 Oct 2009 18:47:03 -0000 Author: qingli Date: Tue Oct 6 18:47:02 2009 New Revision: 197810 URL: http://svn.freebsd.org/changeset/base/197810 Log: MFC r197687 The flow-table associates TCP/UDP flows and IP destinations with specific routes. When the routing table changes, for example, when a new route with a more specific prefix is inserted into the routing table, the flow-table is not updated to reflect that change. As such existing connections cannot take advantage of the new path. In some cases the path is broken. This patch will update the affected flow-table entries when a more specific route is added. The route entry is properly marked when a route is deleted from the table. In this case, when the flow-table performs a search, the stale entry is updated automatically. Therefore this patch is not necessary for route deletion. Reviewed by: bz, kmacy Approved by: re Modified: 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/sys/net/flowtable.c stable/8/sys/net/flowtable.h stable/8/sys/net/route.c Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Tue Oct 6 17:33:00 2009 (r197809) +++ stable/8/sys/net/flowtable.c Tue Oct 6 18:47:02 2009 (r197810) @@ -830,7 +830,7 @@ fle_free(struct flentry *fle) } static void -flowtable_free_stale(struct flowtable *ft) +flowtable_free_stale(struct flowtable *ft, struct rtentry *rt) { int curbit = 0, count; struct flentry *fle, **flehead, *fleprev; @@ -866,8 +866,14 @@ flowtable_free_stale(struct flowtable *f curbit); } #endif - while (fle != NULL) { - if (!flow_stale(ft, fle)) { + while (fle != NULL) { + if (rt != NULL) { + if (__DEVOLATILE(struct rtentry *, fle->f_rt) != rt) { + fleprev = fle; + fle = fle->f_next; + continue; + } + } else if (!flow_stale(ft, fle)) { fleprev = fle; fle = fle->f_next; continue; @@ -916,6 +922,30 @@ flowtable_free_stale(struct flowtable *f log(LOG_DEBUG, "freed %d flow entries\n", count); } +void +flowtable_route_flush(struct flowtable *ft, struct rtentry *rt) +{ + int i; + if (ft->ft_flags & FL_PCPU) { + for (i = 0; i <= mp_maxid; i++) { + if (CPU_ABSENT(i)) + continue; + + thread_lock(curthread); + sched_bind(curthread, i); + thread_unlock(curthread); + + flowtable_free_stale(ft, rt); + + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); + } + } else { + flowtable_free_stale(ft, rt); + } +} + static void flowtable_clean_vnet(void) { @@ -933,14 +963,14 @@ flowtable_clean_vnet(void) sched_bind(curthread, i); thread_unlock(curthread); - flowtable_free_stale(ft); + flowtable_free_stale(ft, NULL); thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); } } else { - flowtable_free_stale(ft); + flowtable_free_stale(ft, NULL); } ft = ft->ft_next; } Modified: stable/8/sys/net/flowtable.h ============================================================================== --- stable/8/sys/net/flowtable.h Tue Oct 6 17:33:00 2009 (r197809) +++ stable/8/sys/net/flowtable.h Tue Oct 6 18:47:02 2009 (r197810) @@ -51,5 +51,7 @@ struct flowtable *flowtable_alloc(int ne int flowtable_lookup(struct flowtable *ft, struct mbuf *m, struct route *ro, uint32_t fibnum); +void flowtable_route_flush(struct flowtable *ft, struct rtentry *rt); + #endif /* _KERNEL */ #endif Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Tue Oct 6 17:33:00 2009 (r197809) +++ stable/8/sys/net/route.c Tue Oct 6 18:47:02 2009 (r197810) @@ -56,6 +56,7 @@ #include #include #include +#include #ifdef RADIX_MPATH #include @@ -996,6 +997,9 @@ rtrequest1_fib(int req, struct rt_addrin { int error = 0, needlock = 0; register struct rtentry *rt; +#ifdef FLOWTABLE + register struct rtentry *rt0; +#endif register struct radix_node *rn; register struct radix_node_head *rnh; struct ifaddr *ifa; @@ -1153,6 +1157,53 @@ rtrequest1_fib(int req, struct rt_addrin } #endif +#ifdef FLOWTABLE + rt0 = NULL; + /* XXX + * "flow-table" only support IPv4 at the moment. + */ + if (dst->sa_family == AF_INET) { + rn = rnh->rnh_matchaddr(dst, rnh); + if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { + struct sockaddr *mask; + u_char *m, *n; + int len; + + /* + * compare mask to see if the new route is + * more specific than the existing one + */ + rt0 = RNTORT(rn); + RT_LOCK(rt0); + RT_ADDREF(rt0); + RT_UNLOCK(rt0); + /* + * A host route is already present, so + * leave the flow-table entries as is. + */ + if (rt0->rt_flags & RTF_HOST) { + RTFREE(rt0); + rt0 = NULL; + } else if (!(flags & RTF_HOST) && netmask) { + mask = rt_mask(rt0); + len = mask->sa_len; + m = (u_char *)mask; + n = (u_char *)netmask; + while (len-- > 0) { + if (*n != *m) + break; + n++; + m++; + } + if (len == 0 || (*n < *m)) { + RTFREE(rt0); + rt0 = NULL; + } + } + } + } +#endif + /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); /* @@ -1165,8 +1216,18 @@ rtrequest1_fib(int req, struct rt_addrin Free(rt_key(rt)); RT_LOCK_DESTROY(rt); uma_zfree(V_rtzone, rt); +#ifdef FLOWTABLE + if (rt0 != NULL) + RTFREE(rt0); +#endif senderr(EEXIST); + } +#ifdef FLOWTABLE + else if (rt0 != NULL) { + flowtable_route_flush(V_ip_ft, rt0); + RTFREE(rt0); } +#endif /* * If this protocol has something to add to this then From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 19:44: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 51E701065676; Tue, 6 Oct 2009 19:44:45 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EEDA8FC12; Tue, 6 Oct 2009 19:44: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 n96JijoI062099; Tue, 6 Oct 2009 19:44:45 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96JijDv062097; Tue, 6 Oct 2009 19:44:45 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200910061944.n96JijDv062097@svn.freebsd.org> From: Qing Li Date: Tue, 6 Oct 2009 19:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197811 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2009 19:44:45 -0000 Author: qingli Date: Tue Oct 6 19:44:44 2009 New Revision: 197811 URL: http://svn.freebsd.org/changeset/base/197811 Log: MFC 197695 Previously, if an address alias is configured on an interface, and this address alias has a prefix matching that of another address configured on the same interface, then the ARP entry for the alias is not deleted from the ARP table when that address alias is removed. This patch fixes the aforementioned issue. PR: kern/139113 Reviewed by: bz Approved by: re Modified: 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/sys/netinet/in.c Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Oct 6 18:47:02 2009 (r197810) +++ stable/8/sys/netinet/in.c Tue Oct 6 19:44:44 2009 (r197811) @@ -1060,6 +1060,8 @@ in_scrubprefix(struct in_ifaddr *target) !(target->ia_ifp->if_flags & IFF_LOOPBACK)) { error = ifa_del_loopback_route((struct ifaddr *)target, (struct sockaddr *)&target->ia_addr); + /* remove arp cache */ + arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } if ((target->ia_flags & IFA_ROUTE) == 0) { @@ -1082,8 +1084,6 @@ in_scrubprefix(struct in_ifaddr *target) prefix = target->ia_addr.sin_addr; mask = target->ia_sockmask.sin_addr; prefix.s_addr &= mask.s_addr; - /* remove arp cache */ - arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } IN_IFADDR_RLOCK(); From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 19:47: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 3082F1065672; Tue, 6 Oct 2009 19:47:03 +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 DAE828FC12; Tue, 6 Oct 2009 19:47:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id D3C4C14D97D4; Tue, 6 Oct 2009 21:27:35 +0200 (CEST) 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 m+m63mMSIBTb; Tue, 6 Oct 2009 21:27:33 +0200 (CEST) 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 1D67814D97D3; Tue, 6 Oct 2009 21:27:33 +0200 (CEST) Message-ID: <4ACB9A21.10502@FreeBSD.org> Date: Tue, 06 Oct 2009 21:27:29 +0200 From: Gabor Kovesdan User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Robert Watson References: <200910061405.n96E5vsq049153@svn.freebsd.org> In-Reply-To: <200910061405.n96E5vsq049153@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: r197804 - in head: include 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: Tue, 06 Oct 2009 19:47:03 -0000 Robert Watson escribió: > + > +char * > +basename(path) > + const char *path; > +{ > + static char *bname = NULL; > + > Sorry if it's a trivial question but isn't ANSI prototype preferred over K&R function definition? -- 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 Tue Oct 6 20:19: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 DDC101065672; Tue, 6 Oct 2009 20:19:16 +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 B23788FC08; Tue, 6 Oct 2009 20:19: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 n96KJG03062848; Tue, 6 Oct 2009 20:19:16 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96KJG5Q062846; Tue, 6 Oct 2009 20:19:16 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200910062019.n96KJG5Q062846@svn.freebsd.org> From: Roman Divacky Date: Tue, 6 Oct 2009 20:19: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: r197812 - head/contrib/tcsh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 20:19:17 -0000 Author: rdivacky Date: Tue Oct 6 20:19:16 2009 New Revision: 197812 URL: http://svn.freebsd.org/changeset/base/197812 Log: Fix tcsh losing history when tcsh terminates because the pty beneath it is closed. Diagnosed by Ted Anderson: New signal queuing logic was introduced in 6.15 and allows the signal handlers to be run explicitly by calling handle_pending_signals, instead of immediately when the signal is delivered. This function is called at various places, typically when receiving a EINTR from a slow system call such as read or write. In the pty exit case, it was called from xwrite, called from flush, while printing the "exit" message after receiving EOF when reading from the pty (note that the read did not return EINTR but zero bytes, indicating EOF). The SIGHUP handler, phup(), called rechist, which opened the history file and began writing the merged history to it. This process invoked flush recursively to actually write the data. In this case, however, the flush noticed it was being called recursively and decided fail by calling stderror. My conclusion was that the signal was being handled at a bad time. But whether to fix flush not to care about the recursive call, or to handle the signal some other time and when to handle it, was unclear to me. However, by adding an extra call to handle_pending_signals, just after process() returns to main(), I was able to avoid the truncated history after network outages and similar failures. I verified this fix in version 6.17. Approved by: ed (mentor) MFC after: 1 week Modified: head/contrib/tcsh/sh.c Modified: head/contrib/tcsh/sh.c ============================================================================== --- head/contrib/tcsh/sh.c Tue Oct 6 19:44:44 2009 (r197811) +++ head/contrib/tcsh/sh.c Tue Oct 6 20:19:16 2009 (r197812) @@ -1291,6 +1291,8 @@ main(int argc, char **argv) /* * Mop-up. */ + /* Take care of these (especially HUP) here instead of inside flush. */ + handle_pending_signals(); if (intty) { if (loginsh) { xprintf("logout\n"); From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 20: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 4A10C1065693; Tue, 6 Oct 2009 20:21:58 +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 22BD68FC14; Tue, 6 Oct 2009 20:21:58 +0000 (UTC) Received: from [192.168.2.101] (host81-155-13-237.range81-155.btcentralplus.com [81.155.13.237]) by cyrus.watson.org (Postfix) with ESMTPSA id 30A2346B03; Tue, 6 Oct 2009 16:21:57 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes From: "Robert N. M. Watson" In-Reply-To: <4ACB9A21.10502@FreeBSD.org> Date: Tue, 6 Oct 2009 21:21:53 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <1A174135-001D-4550-B3E7-84EAA69A2169@FreeBSD.org> References: <200910061405.n96E5vsq049153@svn.freebsd.org> <4ACB9A21.10502@FreeBSD.org> To: Gabor Kovesdan X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197804 - in head: include 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: Tue, 06 Oct 2009 20:21:58 -0000 On 6 Oct 2009, at 20:27, Gabor Kovesdan wrote: > Robert Watson escribi=F3: >> + >> +char * >> +basename(path) >> + const char *path; >> +{ >> + static char *bname =3D NULL; >> + >> > Sorry if it's a trivial question but isn't ANSI prototype preferred =20= > over K&R function definition? For the purposes of this purely functional change, I maintained the =20 existing style in the file, which was K&R. Robert= From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 20:33: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 6D5A71065676; Tue, 6 Oct 2009 20:33:02 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0FC8FC1D; Tue, 6 Oct 2009 20:33: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 n96KX2No063172; Tue, 6 Oct 2009 20:33:02 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96KX2iw063170; Tue, 6 Oct 2009 20:33:02 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <200910062033.n96KX2iw063170@svn.freebsd.org> From: Qing Li Date: Tue, 6 Oct 2009 20:33: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: r197813 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2009 20:33:02 -0000 Author: qingli Date: Tue Oct 6 20:33:02 2009 New Revision: 197813 URL: http://svn.freebsd.org/changeset/base/197813 Log: MFC r197696 Remove a log message from production code. This log message can be triggered by a misconfigured host that is sending out gratuious ARPs. This log message can also be triggered during a network renumbering event when multiple prefixes co-exist on a single network segment. Approved by: re Modified: 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/sys/netinet/in.c Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Oct 6 20:19:16 2009 (r197812) +++ stable/8/sys/netinet/in.c Tue Oct 6 20:33:02 2009 (r197813) @@ -1327,8 +1327,10 @@ in_lltable_rtcheck(struct ifnet *ifp, co /* XXX rtalloc1 should take a const param */ rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) { +#ifdef DIAGNOSTICS log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); +#endif if (rt != NULL) RTFREE_LOCKED(rt); return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 20:35: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 B2742106566B; Tue, 6 Oct 2009 20:35:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87B1B8FC08; Tue, 6 Oct 2009 20:35: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 n96KZfm8063264; Tue, 6 Oct 2009 20:35:41 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96KZfM3063262; Tue, 6 Oct 2009 20:35:41 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910062035.n96KZfM3063262@svn.freebsd.org> From: Robert Watson Date: Tue, 6 Oct 2009 20:35: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: r197814 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2009 20:35:41 -0000 Author: rwatson Date: Tue Oct 6 20:35:41 2009 New Revision: 197814 URL: http://svn.freebsd.org/changeset/base/197814 Log: Remove tcp_input lock statistics; these are intended for debugging only and are not intended to ship in 8.0 as they dirty additional cache lines in a performance-critical per-packet path. MFC after: 3 days Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Oct 6 20:33:02 2009 (r197813) +++ head/sys/netinet/tcp_input.c Tue Oct 6 20:35:41 2009 (r197814) @@ -180,26 +180,6 @@ int tcp_read_locking = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, read_locking, CTLFLAG_RW, &tcp_read_locking, 0, "Enable read locking strategy"); -int tcp_rlock_atfirst; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, rlock_atfirst, CTLFLAG_RD, - &tcp_rlock_atfirst, 0, ""); - -int tcp_wlock_atfirst; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_wlock_atfirst, CTLFLAG_RD, - &tcp_wlock_atfirst, 0, ""); - -int tcp_wlock_upgraded; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_upgraded, CTLFLAG_RD, - &tcp_wlock_upgraded, 0, ""); - -int tcp_wlock_relocked; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_relocked, CTLFLAG_RD, - &tcp_wlock_relocked, 0, ""); - -int tcp_wlock_looped; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_looped, CTLFLAG_RD, - &tcp_wlock_looped, 0, ""); - VNET_DEFINE(struct inpcbhead, tcb); VNET_DEFINE(struct inpcbinfo, tcbinfo); #define tcb6 tcb /* for KAME src sync over BSD*'s */ @@ -505,11 +485,9 @@ tcp_input(struct mbuf *m, int off0) tcp_read_locking == 0) { INP_INFO_WLOCK(&V_tcbinfo); ti_locked = TI_WLOCKED; - tcp_wlock_atfirst++; } else { INP_INFO_RLOCK(&V_tcbinfo); ti_locked = TI_RLOCKED; - tcp_rlock_atfirst++; } findpcb: @@ -662,15 +640,11 @@ relocked: ti_locked = TI_WLOCKED; INP_WLOCK(inp); if (in_pcbrele(inp)) { - tcp_wlock_looped++; inp = NULL; goto findpcb; } - tcp_wlock_relocked++; - } else { + } else ti_locked = TI_WLOCKED; - tcp_wlock_upgraded++; - } } INP_INFO_WLOCK_ASSERT(&V_tcbinfo); @@ -717,16 +691,12 @@ relocked: ti_locked = TI_WLOCKED; INP_WLOCK(inp); if (in_pcbrele(inp)) { - tcp_wlock_looped++; inp = NULL; goto findpcb; } - tcp_wlock_relocked++; goto relocked; - } else { + } else ti_locked = TI_WLOCKED; - tcp_wlock_upgraded++; - } } INP_INFO_WLOCK_ASSERT(&V_tcbinfo); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 21:23: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 7310A1065676; Tue, 6 Oct 2009 21:23:51 +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 611658FC08; Tue, 6 Oct 2009 21:23: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 n96LNoIA064348; Tue, 6 Oct 2009 21:23:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96LNo2R064347; Tue, 6 Oct 2009 21:23:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910062123.n96LNo2R064347@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 6 Oct 2009 21:23: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: r197815 - in stable/8/usr.sbin/lpr: . lp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 21:23:51 -0000 Author: jilles Date: Tue Oct 6 21:23:49 2009 New Revision: 197815 URL: http://svn.freebsd.org/changeset/base/197815 Log: MFC r197625: Fix using lp(1) without the new -t option after r194171. Approved by: re (kib) Modified: stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/lpr/lp/lp.sh Modified: stable/8/usr.sbin/lpr/lp/lp.sh ============================================================================== --- stable/8/usr.sbin/lpr/lp/lp.sh Tue Oct 6 20:35:41 2009 (r197814) +++ stable/8/usr.sbin/lpr/lp/lp.sh Tue Oct 6 21:23:49 2009 (r197815) @@ -70,7 +70,7 @@ do s) # (silent option) : ;; t) # title for banner page - title="-J${OPTARG}";; + title="${OPTARG}";; *) # (error msg printed by getopts) exit 2;; esac @@ -78,4 +78,4 @@ done shift $(($OPTIND - 1)) -exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@" +exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} ${title:+-J"${title}"} "$@" From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 21:40: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 D9A951065696; Tue, 6 Oct 2009 21:40:50 +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 C81148FC2E; Tue, 6 Oct 2009 21:40: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 n96LeoVE064739; Tue, 6 Oct 2009 21:40:50 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96LeoDG064737; Tue, 6 Oct 2009 21:40:50 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200910062140.n96LeoDG064737@svn.freebsd.org> From: Kip Macy Date: Tue, 6 Oct 2009 21:40: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: r197816 - 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: Tue, 06 Oct 2009 21:40:51 -0000 Author: kmacy Date: Tue Oct 6 21:40:50 2009 New Revision: 197816 URL: http://svn.freebsd.org/changeset/base/197816 Log: Prevent paging pressure from draining arc too much - always drain arc if above arc_c_max - never drain arc if arc is below arc_c_max MFC after: 3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Oct 6 21:23:49 2009 (r197815) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Oct 6 21:40:50 2009 (r197816) @@ -1821,6 +1821,12 @@ arc_reclaim_needed(void) #endif #ifdef _KERNEL + if (needfree) + return (1); + if (arc_size > arc_c_max) + return (1); + if (arc_size <= arc_c_min) + return (0); /* * If pages are needed or we're within 2048 pages @@ -1829,9 +1835,6 @@ arc_reclaim_needed(void) if (vm_pages_needed || (vm_paging_target() > -2048)) return (1); - if (needfree) - return (1); - #if 0 /* * take 'desfree' extra pages, so we reclaim sooner, rather than later From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 21:49: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 0DA51106566B; Tue, 6 Oct 2009 21:49:14 +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 EF8B38FC0C; Tue, 6 Oct 2009 21:49:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n96LnDxA065034; Tue, 6 Oct 2009 21:49:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96LnDgL065032; Tue, 6 Oct 2009 21:49:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910062149.n96LnDgL065032@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 6 Oct 2009 21:49: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: r197819 - in stable/7/usr.sbin/lpr: . lp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 21:49:14 -0000 Author: jilles Date: Tue Oct 6 21:49:13 2009 New Revision: 197819 URL: http://svn.freebsd.org/changeset/base/197819 Log: MFC r197625: Fix using lp(1) without the new -t option after r195349. Modified: stable/7/usr.sbin/lpr/ (props changed) stable/7/usr.sbin/lpr/lp/lp.sh Modified: stable/7/usr.sbin/lpr/lp/lp.sh ============================================================================== --- stable/7/usr.sbin/lpr/lp/lp.sh Tue Oct 6 21:46:03 2009 (r197818) +++ stable/7/usr.sbin/lpr/lp/lp.sh Tue Oct 6 21:49:13 2009 (r197819) @@ -70,7 +70,7 @@ do s) # (silent option) : ;; t) # title for banner page - title="-J${OPTARG}";; + title="${OPTARG}";; *) # (error msg printed by getopts) exit 2;; esac @@ -78,4 +78,4 @@ done shift $(($OPTIND - 1)) -exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@" +exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} ${title:+-J"${title}"} "$@" From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 22:00: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 93122106566B; Tue, 6 Oct 2009 22:00:15 +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 811CC8FC20; Tue, 6 Oct 2009 22:00: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 n96M0FCf065305; Tue, 6 Oct 2009 22:00:15 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96M0FMX065301; Tue, 6 Oct 2009 22:00:15 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910062200.n96M0FMX065301@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 6 Oct 2009 22:00: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: r197820 - 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: Tue, 06 Oct 2009 22:00:15 -0000 Author: jilles Date: Tue Oct 6 22:00:14 2009 New Revision: 197820 URL: http://svn.freebsd.org/changeset/base/197820 Log: sh: Send the "xyz: not found" message to redirected fd 2. This also fixes that trying to execute a non-regular file with a command name without '/' returns 127 instead of 126. The fix is rather simplistic: treat CMDUNKNOWN as if the command were found as an external program. The resulting fork is a bit wasteful but executing unknown commands should not be very frequent. PR: bin/137659 Added: head/tools/regression/bin/sh/execution/unknown1.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/exec.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Tue Oct 6 21:49:13 2009 (r197819) +++ head/bin/sh/eval.c Tue Oct 6 22:00:14 2009 (r197820) @@ -713,12 +713,7 @@ evalcommand(union node *cmd, int flags, do_clearcmdentry = 1; } - find_command(argv[0], &cmdentry, 1, path); - if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */ - exitstatus = 127; - flushout(&errout); - return; - } + find_command(argv[0], &cmdentry, 0, path); /* implement the bltin builtin here */ if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) { for (;;) { @@ -740,7 +735,7 @@ evalcommand(union node *cmd, int flags, /* Fork off a child process if necessary. */ if (cmd->ncmd.backgnd - || (cmdentry.cmdtype == CMDNORMAL + || ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN) && ((flags & EV_EXIT) == 0 || have_traps())) || ((flags & EV_BACKCMD) != 0 && (cmdentry.cmdtype != CMDBUILTIN Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Tue Oct 6 21:49:13 2009 (r197819) +++ head/bin/sh/exec.c Tue Oct 6 22:00:14 2009 (r197820) @@ -429,6 +429,7 @@ loop: outfmt(out2, "%s: %s\n", name, strerror(e)); } entry->cmdtype = CMDUNKNOWN; + entry->u.index = 0; return; success: Added: head/tools/regression/bin/sh/execution/unknown1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/unknown1.0 Tue Oct 6 22:00:14 2009 (r197820) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +nosuchtool 2>/dev/null +[ $? -ne 127 ] && exit 1 +/var/empty/nosuchtool 2>/dev/null +[ $? -ne 127 ] && exit 1 +(nosuchtool) 2>/dev/null +[ $? -ne 127 ] && exit 1 +(/var/empty/nosuchtool) 2>/dev/null +[ $? -ne 127 ] && exit 1 +/ 2>/dev/null +[ $? -ne 126 ] && exit 1 +PATH=/usr bin 2>/dev/null +[ $? -ne 126 ] && exit 1 + +dummy=$(nosuchtool 2>/dev/null) +[ $? -ne 127 ] && exit 1 +dummy=$(/var/empty/nosuchtool 2>/dev/null) +[ $? -ne 127 ] && exit 1 +dummy=$( (nosuchtool) 2>/dev/null) +[ $? -ne 127 ] && exit 1 +dummy=$( (/var/empty/nosuchtool) 2>/dev/null) +[ $? -ne 127 ] && exit 1 +dummy=$(/ 2>/dev/null) +[ $? -ne 126 ] && exit 1 +dummy=$(PATH=/usr bin 2>/dev/null) +[ $? -ne 126 ] && exit 1 + +exit 0 From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 22:15: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 B7DCD106566B; Tue, 6 Oct 2009 22:15:12 +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 8C3728FC0A; Tue, 6 Oct 2009 22:15: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 n96MFC1l065660; Tue, 6 Oct 2009 22:15:12 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96MFCgE065657; Tue, 6 Oct 2009 22:15:12 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200910062215.n96MFCgE065657@svn.freebsd.org> From: Doug Barton Date: Tue, 6 Oct 2009 22:15:12 +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: r197821 - stable/8/usr.bin/whois X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 22:15:12 -0000 Author: dougb Date: Tue Oct 6 22:15:12 2009 New Revision: 197821 URL: http://svn.freebsd.org/changeset/base/197821 Log: MFC r197725: The 6bone was decommissioned on 6/6/06, so remove references to it. Approved by: re (kib) Modified: stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/whois/whois.1 stable/8/usr.bin/whois/whois.c Modified: stable/8/usr.bin/whois/whois.1 ============================================================================== --- stable/8/usr.bin/whois/whois.1 Tue Oct 6 22:00:14 2009 (r197820) +++ stable/8/usr.bin/whois/whois.1 Tue Oct 6 22:15:12 2009 (r197821) @@ -32,7 +32,7 @@ .\" From: @(#)whois.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 23, 2006 +.Dd October 2, 2009 .Dt WHOIS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd "Internet domain name and network number directory service" .Sh SYNOPSIS .Nm -.Op Fl aAbdfgiIklmQrR6 +.Op Fl aAbdfgiIklmQrR .Op Fl c Ar country-code | Fl h Ar host .Op Fl p Ar port .Ar name ... @@ -212,17 +212,14 @@ This option is deprecated; use the option with an argument of .Qq Li RU instead. -.It Fl 6 -Use the IPv6 Resource Center -.Pq Tn 6bone -database. -It contains network names and addresses for the IPv6 network. -.El .Pp The operands specified to .Nm are treated independently and may be used as queries on different whois servers. +.El +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES Most types of data, such as domain names and .Tn IP @@ -255,15 +252,6 @@ but other .Tn TLDs can be queried by using a similar syntax.) .Pp -The following example demonstrates how to obtain information about an -.Tn IPv6 -address or hostname using the -.Fl 6 -option, which directs the query to -.Tn 6bone . -.Pp -.Dl "whois -6 IPv6-IP-Address" -.Pp The following example demonstrates how to query a whois server using a non-standard port, where .Dq Li query-data Modified: stable/8/usr.bin/whois/whois.c ============================================================================== --- stable/8/usr.bin/whois/whois.c Tue Oct 6 22:00:14 2009 (r197820) +++ stable/8/usr.bin/whois/whois.c Tue Oct 6 22:15:12 2009 (r197821) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #define PNICHOST "whois.apnic.net" #define MNICHOST "whois.ra.net" #define QNICHOST_TAIL ".whois-servers.net" -#define SNICHOST "whois.6bone.net" #define BNICHOST "whois.registro.br" #define NORIDHOST "whois.norid.no" #define IANAHOST "whois.iana.org" @@ -164,8 +163,10 @@ main(int argc, char *argv[]) warnx("-R is deprecated; use '-c ru' instead"); country = "ru"; break; + /* Remove in FreeBSD 10 */ case '6': - host = SNICHOST; + errx(EX_USAGE, + "-6 is deprecated; use -[aAflr] instead"); break; case '?': default: From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 22:19: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 0981F10656BD; Tue, 6 Oct 2009 22:19: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 EB12F8FC15; Tue, 6 Oct 2009 22:19: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 n96MJW5p065811; Tue, 6 Oct 2009 22:19:32 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96MJWow065808; Tue, 6 Oct 2009 22:19:32 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200910062219.n96MJWow065808@svn.freebsd.org> From: Doug Barton Date: Tue, 6 Oct 2009 22:19: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: r197822 - stable/7/usr.bin/whois X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 22:19:34 -0000 Author: dougb Date: Tue Oct 6 22:19:32 2009 New Revision: 197822 URL: http://svn.freebsd.org/changeset/base/197822 Log: MFC r197725: The 6bone was decommissioned on 6/6/06, so remove references to it. Modified: stable/7/usr.bin/whois/ (props changed) stable/7/usr.bin/whois/whois.1 stable/7/usr.bin/whois/whois.c Modified: stable/7/usr.bin/whois/whois.1 ============================================================================== --- stable/7/usr.bin/whois/whois.1 Tue Oct 6 22:15:12 2009 (r197821) +++ stable/7/usr.bin/whois/whois.1 Tue Oct 6 22:19:32 2009 (r197822) @@ -32,7 +32,7 @@ .\" From: @(#)whois.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 23, 2006 +.Dd October 2, 2009 .Dt WHOIS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd "Internet domain name and network number directory service" .Sh SYNOPSIS .Nm -.Op Fl aAbdfgiIklmQrR6 +.Op Fl aAbdfgiIklmQrR .Op Fl c Ar country-code | Fl h Ar host .Op Fl p Ar port .Ar name ... @@ -212,17 +212,14 @@ This option is deprecated; use the option with an argument of .Qq Li RU instead. -.It Fl 6 -Use the IPv6 Resource Center -.Pq Tn 6bone -database. -It contains network names and addresses for the IPv6 network. -.El .Pp The operands specified to .Nm are treated independently and may be used as queries on different whois servers. +.El +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES Most types of data, such as domain names and .Tn IP @@ -255,15 +252,6 @@ but other .Tn TLDs can be queried by using a similar syntax.) .Pp -The following example demonstrates how to obtain information about an -.Tn IPv6 -address or hostname using the -.Fl 6 -option, which directs the query to -.Tn 6bone . -.Pp -.Dl "whois -6 IPv6-IP-Address" -.Pp The following example demonstrates how to query a whois server using a non-standard port, where .Dq Li query-data Modified: stable/7/usr.bin/whois/whois.c ============================================================================== --- stable/7/usr.bin/whois/whois.c Tue Oct 6 22:15:12 2009 (r197821) +++ stable/7/usr.bin/whois/whois.c Tue Oct 6 22:19:32 2009 (r197822) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #define PNICHOST "whois.apnic.net" #define MNICHOST "whois.ra.net" #define QNICHOST_TAIL ".whois-servers.net" -#define SNICHOST "whois.6bone.net" #define BNICHOST "whois.registro.br" #define NORIDHOST "whois.norid.no" #define IANAHOST "whois.iana.org" @@ -164,8 +163,10 @@ main(int argc, char *argv[]) warnx("-R is deprecated; use '-c ru' instead"); country = "ru"; break; + /* Remove in FreeBSD 10 */ case '6': - host = SNICHOST; + errx(EX_USAGE, + "-6 is deprecated; use -[aAflr] instead"); break; case '?': default: From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 22:21: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 7AB7E106568B; Tue, 6 Oct 2009 22:21:53 +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 4F7E38FC0A; Tue, 6 Oct 2009 22:21: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 n96MLpx5065918; Tue, 6 Oct 2009 22:21:51 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96MLpru065915; Tue, 6 Oct 2009 22:21:51 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200910062221.n96MLpru065915@svn.freebsd.org> From: Doug Barton Date: Tue, 6 Oct 2009 22:21:51 +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: r197823 - stable/6/usr.bin/whois X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 06 Oct 2009 22:21:53 -0000 Author: dougb Date: Tue Oct 6 22:21:51 2009 New Revision: 197823 URL: http://svn.freebsd.org/changeset/base/197823 Log: MFC r197725: The 6bone was decommissioned on 6/6/06, so remove references to it. Modified: stable/6/usr.bin/whois/ (props changed) stable/6/usr.bin/whois/whois.1 stable/6/usr.bin/whois/whois.c Modified: stable/6/usr.bin/whois/whois.1 ============================================================================== --- stable/6/usr.bin/whois/whois.1 Tue Oct 6 22:19:32 2009 (r197822) +++ stable/6/usr.bin/whois/whois.1 Tue Oct 6 22:21:51 2009 (r197823) @@ -32,7 +32,7 @@ .\" From: @(#)whois.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 11, 2004 +.Dd October 2, 2009 .Dt WHOIS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd "Internet domain name and network number directory service" .Sh SYNOPSIS .Nm -.Op Fl aAbdfgiIklmQrR6 +.Op Fl aAbdfgiIklmQrR .Op Fl c Ar country-code | Fl h Ar host .Op Fl p Ar port .Ar name ... @@ -211,17 +211,14 @@ This option is deprecated; use the option with an argument of .Qq Li RU instead. -.It Fl 6 -Use the IPv6 Resource Center -.Pq Tn 6bone -database. -It contains network names and addresses for the IPv6 network. -.El .Pp The operands specified to .Nm are treated independently and may be used as queries on different whois servers. +.El +.Sh EXIT STATUS +.Ex -std .Sh EXAMPLES Most types of data, such as domain names and .Tn IP @@ -254,15 +251,6 @@ but other .Tn TLDs can be queried by using a similar syntax.) .Pp -The following example demonstrates how to obtain information about an -.Tn IPv6 -address or hostname using the -.Fl 6 -option, which directs the query to -.Tn 6bone . -.Pp -.Dl "whois -6 IPv6-IP-Address" -.Pp The following example demonstrates how to query a whois server using a non-standard port, where .Dq Li query-data Modified: stable/6/usr.bin/whois/whois.c ============================================================================== --- stable/6/usr.bin/whois/whois.c Tue Oct 6 22:19:32 2009 (r197822) +++ stable/6/usr.bin/whois/whois.c Tue Oct 6 22:21:51 2009 (r197823) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #define PNICHOST "whois.apnic.net" #define MNICHOST "whois.ra.net" #define QNICHOST_TAIL ".whois-servers.net" -#define SNICHOST "whois.6bone.net" #define BNICHOST "whois.registro.br" #define NORIDHOST "whois.norid.no" #define IANAHOST "whois.iana.org" @@ -164,8 +163,10 @@ main(int argc, char *argv[]) warnx("-R is deprecated; use '-c ru' instead"); country = "ru"; break; + /* Remove in FreeBSD 10 */ case '6': - host = SNICHOST; + errx(EX_USAGE, + "-6 is deprecated; use -[aAflr] instead"); break; case '?': default: From owner-svn-src-all@FreeBSD.ORG Tue Oct 6 23:48: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 E447D1065676; Tue, 6 Oct 2009 23:48:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D286B8FC1F; Tue, 6 Oct 2009 23:48: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 n96NmSQW067724; Tue, 6 Oct 2009 23:48:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n96NmSIj067721; Tue, 6 Oct 2009 23:48:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200910062348.n96NmSIj067721@svn.freebsd.org> From: Attilio Rao Date: Tue, 6 Oct 2009 23:48: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: r197824 - in head/sys: amd64/include 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: Tue, 06 Oct 2009 23:48:29 -0000 Author: attilio Date: Tue Oct 6 23:48:28 2009 New Revision: 197824 URL: http://svn.freebsd.org/changeset/base/197824 Log: - All the functions in atomic.h needs to be in "physical" form (like not defined through macros or similar) in order to be later compiled in the kernel and offer this way the support for modules (and compatibility among the UP case and SMP case). Fix this for the newly introduced atomic_cmpset_barr_* cases by defining and specifying a template. Note that the new DEFINE_CMPSET_GEN() template save more typing on amd64 than the current code. [1] - Fix the style for memory barriers on amd64. [1] Reported by: Paul B. Mahol Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Tue Oct 6 22:21:51 2009 (r197823) +++ head/sys/amd64/include/atomic.h Tue Oct 6 23:48:28 2009 (r197824) @@ -32,9 +32,9 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -#define mb() __asm__ __volatile__ ("mfence;": : :"memory") -#define wmb() __asm__ __volatile__ ("sfence;": : :"memory") -#define rmb() __asm__ __volatile__ ("lfence;": : :"memory") +#define mb() __asm __volatile("mfence;" : : : "memory") +#define wmb() __asm __volatile("sfence;" : : : "memory") +#define rmb() __asm __volatile("lfence;" : : : "memory") /* * Various simple operations on memory, each of which is atomic in the @@ -131,50 +131,33 @@ struct __hack * Returns 0 on failure, non-zero on success */ -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgl %2,%1 ; " - " sete %0 ; " - "1: " - "# atomic_cmpset_int" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); - - return (res); -} - -static __inline int -atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgq %2,%1 ; " - " sete %0 ; " - "1: " - "# atomic_cmpset_long" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); - - return (res); -} +#define DEFINE_CMPSET_GEN(NAME, TYPE, OP) \ +static __inline int \ +atomic_cmpset_##NAME(volatile u_##TYPE *dst, u_##TYPE exp, u_##TYPE src)\ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " " MPLOCKED " " \ + " " OP " %2,%1 ; " \ + " sete %0 ; " \ + "1: " \ + "# atomic_cmpset_##NAME" \ + : "=a" (res), /* 0 */ \ + "=m" (*dst) /* 1 */ \ + : "r" (src), /* 2 */ \ + "a" (exp), /* 3 */ \ + "m" (*dst) /* 4 */ \ + : "memory"); \ + \ + return (res); \ +} \ +struct __hack -#define atomic_cmpset_barr_int atomic_cmpset_int -#define atomic_cmpset_barr_long atomic_cmpset_long +DEFINE_CMPSET_GEN(int, int, "cmpxchgl"); +DEFINE_CMPSET_GEN(long, long, "cmpxchgq"); +DEFINE_CMPSET_GEN(barr_int, int, "cmpxchgl"); +DEFINE_CMPSET_GEN(barr_long, long, "cmpxchgq"); /* * Atomically add the value of v to the integer pointed to by p and return Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Tue Oct 6 22:21:51 2009 (r197823) +++ head/sys/i386/include/atomic.h Tue Oct 6 23:48:28 2009 (r197824) @@ -130,57 +130,62 @@ struct __hack #ifdef CPU_DISABLE_CMPXCHG -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) -{ - u_char res; - - __asm __volatile( - " pushfl ; " - " cli ; " - " cmpl %3,%4 ; " - " jne 1f ; " - " movl %2,%1 ; " - "1: " - " sete %0 ; " - " popfl ; " - "# atomic_cmpset_int" - : "=q" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "r" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); - - return (res); -} +#define DEFINE_CMPSET_GEN(NAME) \ +static __inline int \ +atomic_cmpset_##NAME(volatile u_int *dst, u_int exp, u_int src)\ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " pushfl ; " \ + " cli ; " \ + " cmpl %3,%4 ; " \ + " jne 1f ; " \ + " movl %2,%1 ; " \ + "1: " \ + " sete %0 ; " \ + " popfl ; " \ + "# atomic_cmpset_##NAME" \ + : "=q" (res), /* 0 */ \ + "=m" (*dst) /* 1 */ \ + : "r" (src), /* 2 */ \ + "r" (exp), /* 3 */ \ + "m" (*dst) /* 4 */ \ + : "memory"); \ + \ + return (res); \ +} \ +struct __hack #else /* !CPU_DISABLE_CMPXCHG */ -static __inline int -atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) -{ - u_char res; - - __asm __volatile( - " " MPLOCKED " " - " cmpxchgl %2,%1 ; " - " sete %0 ; " - "1: " - "# atomic_cmpset_int" - : "=a" (res), /* 0 */ - "=m" (*dst) /* 1 */ - : "r" (src), /* 2 */ - "a" (exp), /* 3 */ - "m" (*dst) /* 4 */ - : "memory"); - - return (res); -} +#define DEFINE_CMPSET_GEN(NAME) \ +static __inline int \ +atomic_cmpset_##NAME(volatile u_int *dst, u_int exp, u_int src)\ +{ \ + u_char res; \ + \ + __asm __volatile( \ + " " MPLOCKED " " \ + " cmpxchgl %2,%1 ; " \ + " sete %0 ; " \ + "1: " \ + "# atomic_cmpset_##NAME" \ + : "=a" (res), /* 0 */ \ + "=m" (*dst) /* 1 */ \ + : "r" (src), /* 2 */ \ + "a" (exp), /* 3 */ \ + "m" (*dst) /* 4 */ \ + : "memory"); \ + \ + return (res); \ +} \ +struct __hack #endif /* CPU_DISABLE_CMPXCHG */ -#define atomic_cmpset_barr_int atomic_cmpset_int +DEFINE_CMPSET_GEN(int); +DEFINE_CMPSET_GEN(barr_int); /* * Atomically add the value of v to the integer pointed to by p and return From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 09:07: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 91DD31065676; Wed, 7 Oct 2009 09:07:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677158FC1C; Wed, 7 Oct 2009 09:07: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 n979778k079395; Wed, 7 Oct 2009 09:07:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97977Dt079392; Wed, 7 Oct 2009 09:07:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910070907.n97977Dt079392@svn.freebsd.org> From: Rui Paulo Date: Wed, 7 Oct 2009 09:07: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: r197829 - head/contrib/tcpdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 09:07:08 -0000 Author: rpaulo Date: Wed Oct 7 09:07:06 2009 New Revision: 197829 URL: http://svn.freebsd.org/changeset/base/197829 Log: Add parsing code for TCP UTO (User Timeout Option). Submitted by: fangwang@ Obtained from: //depot/projects/soc2009/tcputo/ Modified: head/contrib/tcpdump/print-tcp.c head/contrib/tcpdump/tcp.h Modified: head/contrib/tcpdump/print-tcp.c ============================================================================== --- head/contrib/tcpdump/print-tcp.c Wed Oct 7 08:43:06 2009 (r197828) +++ head/contrib/tcpdump/print-tcp.c Wed Oct 7 09:07:06 2009 (r197829) @@ -124,6 +124,7 @@ struct tok tcp_option_values[] = { { TCPOPT_CCECHO, "" }, { TCPOPT_SIGNATURE, "md5" }, { TCPOPT_AUTH, "enhanced auth" }, + { TCPOPT_UTO, "uto" }, { 0, NULL } }; @@ -613,6 +614,17 @@ tcp_print(register const u_char *bp, reg */ break; + case TCPOPT_UTO: + datalen = 2; + LENCHECK(datalen); + uint utoval = EXTRACT_16BITS(cp); + if (utoval & 0x0001) + utoval = (utoval >> 1) * 60; + else + utoval >>= 1; + (void)printf(" %u", utoval); + break; + default: datalen = len - 2; for (i = 0; i < datalen; ++i) { Modified: head/contrib/tcpdump/tcp.h ============================================================================== --- head/contrib/tcpdump/tcp.h Wed Oct 7 08:43:06 2009 (r197828) +++ head/contrib/tcpdump/tcp.h Wed Oct 7 09:07:06 2009 (r197829) @@ -83,6 +83,8 @@ struct tcphdr { #define TCPOLEN_SIGNATURE 18 #define TCP_SIGLEN 16 /* length of an option 19 digest */ #define TCPOPT_AUTH 20 /* Enhanced AUTH option */ +#define TCPOPT_UTO 28 /* tcp user timeout (rfc5482) */ +#define TCPOLEN_UTO 4 #define TCPOPT_TSTAMP_HDR \ (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 09:22: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 A796A106566B; Wed, 7 Oct 2009 09:22:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5008FC0C; Wed, 7 Oct 2009 09:22: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 n979MSuD079725; Wed, 7 Oct 2009 09:22:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n979MSE2079723; Wed, 7 Oct 2009 09:22:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910070922.n979MSE2079723@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 7 Oct 2009 09:22: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: r197830 - 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: Wed, 07 Oct 2009 09:22:28 -0000 Author: kib Date: Wed Oct 7 09:22:27 2009 New Revision: 197830 URL: http://svn.freebsd.org/changeset/base/197830 Log: Free Rick Macklem from mentorship. Discussed with: rwatson Approved by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Oct 7 09:07:06 2009 (r197829) +++ svnadmin/conf/mentors Wed Oct 7 09:22:27 2009 (r197830) @@ -22,7 +22,6 @@ neel imp nork imp rdivacky ed remko imp -rmacklem rwatson Co-mentor: kib sbruno scottl snb dwmalone sson gnn From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 12:38: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 98D291065672; Wed, 7 Oct 2009 12:38:19 +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 874E58FC19; Wed, 7 Oct 2009 12:38: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 n97CcJGG084467; Wed, 7 Oct 2009 12:38:19 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97CcJxh084465; Wed, 7 Oct 2009 12:38:19 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910071238.n97CcJxh084465@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 7 Oct 2009 12:38: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: r197831 - 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: Wed, 07 Oct 2009 12:38:19 -0000 Author: pjd Date: Wed Oct 7 12:38:19 2009 New Revision: 197831 URL: http://svn.freebsd.org/changeset/base/197831 Log: Fix situation where Mac OS X NFS client creates a file and when it tries to set ownership and mode in the same setattr operation, the mode was overwritten by secpolicy_vnode_setattr(). PR: kern/118320 Submitted by: Mark Thompson MFC after: 3 days 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 Wed Oct 7 09:22:27 2009 (r197830) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Oct 7 12:38:19 2009 (r197831) @@ -2538,6 +2538,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, i vattr_t oldva; uint_t mask = vap->va_mask; uint_t saved_mask; + uint64_t saved_mode; int trim_mask = 0; uint64_t new_mode; znode_t *attrzp; @@ -2766,6 +2767,13 @@ top: if (trim_mask) { saved_mask = vap->va_mask; vap->va_mask &= ~trim_mask; + if (trim_mask & AT_MODE) { + /* + * Save the mode, as secpolicy_vnode_setattr() + * will overwrite it with ova.va_mode. + */ + saved_mode = vap->va_mode; + } } err = secpolicy_vnode_setattr(cr, vp, vap, &oldva, flags, (int (*)(void *, int, cred_t *))zfs_zaccess_unix, zp); @@ -2774,8 +2782,16 @@ top: return (err); } - if (trim_mask) + if (trim_mask) { vap->va_mask |= saved_mask; + if (trim_mask & AT_MODE) { + /* + * Recover the mode after + * secpolicy_vnode_setattr(). + */ + vap->va_mode = saved_mode; + } + } } /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 13:12: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 2B8491065676; Wed, 7 Oct 2009 13:12:44 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2FB8FC15; Wed, 7 Oct 2009 13:12: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 n97DCiU7085209; Wed, 7 Oct 2009 13:12:44 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97DCigb085206; Wed, 7 Oct 2009 13:12:44 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200910071312.n97DCigb085206@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 7 Oct 2009 13:12: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: r197832 - 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: Wed, 07 Oct 2009 13:12:44 -0000 Author: stas Date: Wed Oct 7 13:12:43 2009 New Revision: 197832 URL: http://svn.freebsd.org/changeset/base/197832 Log: - Add support for new BGE chips (5761, 5784 and 57780). These chips uses new BGE_PCI_PRODID_ASICREV register to store the chip identifier and its revision. - Add new grouping macro for 7575+ chips (BGE_IS_5755_PLUS). - Add IDs for Fujitsu-branded Broadcom adapters. PR: kern/127587 Tested by: Thomas Quinot (BCM7561 A0) MFC after: 2 weeks Obtained from: OpenBSD Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 7 12:38:19 2009 (r197831) +++ head/sys/dev/bge/if_bge.c Wed Oct 7 13:12:43 2009 (r197832) @@ -170,6 +170,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5723 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5750M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5751 }, @@ -184,12 +185,21 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5754M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5755M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761E }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761S }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5761SE }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5764 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5780S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5781 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5782 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5784 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785F }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5785G }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5786 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5787F }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5787M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5788 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5789 }, @@ -198,11 +208,19 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5903M }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5906M }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57760 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57780 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57788 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM57790 }, { SK_VENDORID, SK_DEVICEID_ALTIMA }, { TC_VENDORID, TC_DEVICEID_3C996 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE4 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PW008GE5 }, + { FJTSU_VENDORID, FJTSU_DEVICEID_PP250450 }, + { 0, 0 } }; @@ -216,6 +234,7 @@ static const struct bge_vendor { { BCOM_VENDORID, "Broadcom" }, { SK_VENDORID, "SysKonnect" }, { TC_VENDORID, "3Com" }, + { FJTSU_VENDORID, "Fujitsu" }, { 0, NULL } }; @@ -271,12 +290,18 @@ static const struct bge_revision { { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, { BGE_CHIPID_BCM5722_A0, "BCM5722 A0" }, + { BGE_CHIPID_BCM5761_A0, "BCM5761 A0" }, + { BGE_CHIPID_BCM5761_A1, "BCM5761 A1" }, + { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, + { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, { BGE_CHIPID_BCM5906_A2, "BCM5906 A2" }, + { BGE_CHIPID_BCM57780_A0, "BCM57780 A0" }, + { BGE_CHIPID_BCM57780_A1, "BCM57780 A1" }, { 0, NULL } }; @@ -297,9 +322,13 @@ static const struct bge_revision bge_maj { BGE_ASICREV_BCM5780, "unknown BCM5780" }, { BGE_ASICREV_BCM5714, "unknown BCM5714" }, { BGE_ASICREV_BCM5755, "unknown BCM5755" }, + { BGE_ASICREV_BCM5761, "unknown BCM5761" }, + { BGE_ASICREV_BCM5784, "unknown BCM5784" }, + { BGE_ASICREV_BCM5785, "unknown BCM5785" }, /* 5754 and 5787 share the same ASIC ID */ { BGE_ASICREV_BCM5787, "unknown BCM5754/5787" }, { BGE_ASICREV_BCM5906, "unknown BCM5906" }, + { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { 0, NULL } }; @@ -309,6 +338,7 @@ static const struct bge_revision bge_maj #define BGE_IS_5705_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5705_PLUS) #define BGE_IS_5714_FAMILY(sc) ((sc)->bge_flags & BGE_FLAG_5714_FAMILY) #define BGE_IS_575X_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_575X_PLUS) +#define BGE_IS_5755_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5755_PLUS) const struct bge_revision * bge_lookup_rev(uint32_t); const struct bge_vendor * bge_lookup_vendor(uint16_t); @@ -1758,8 +1788,7 @@ bge_blockinit(struct bge_softc *sc) val = BGE_WDMAMODE_ENABLE | BGE_WDMAMODE_ALL_ATTNS; /* Enable host coalescing bug fix. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) + if (BGE_IS_5755_PLUS(sc)) val |= 1 << 29; /* Turn on write DMA state machine */ @@ -1768,6 +1797,12 @@ bge_blockinit(struct bge_softc *sc) /* Turn on read DMA state machine */ val = BGE_RDMAMODE_ENABLE | BGE_RDMAMODE_ALL_ATTNS; + if (sc->bge_asicrev == BGE_ASICREV_BCM5784 || + sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_BD_SBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN | + BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -1790,7 +1825,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); /* Turn on send data completion state machine */ - CSR_WRITE_4(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); + val = BGE_SDCMODE_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5761) + val |= BGE_SDCMODE_CDELAY; + CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); @@ -1897,8 +1935,11 @@ bge_probe(device_t dev) const struct bge_vendor *v; uint32_t id; - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) + id = pci_read_config(dev, + BGE_PCI_PRODID_ASICREV, 4); br = bge_lookup_rev(id); v = bge_lookup_vendor(vid); { @@ -1915,8 +1956,8 @@ bge_probe(device_t dev) br != NULL ? br->br_name : "NetXtreme Ethernet Controller"); } - snprintf(buf, 96, "%s, %sASIC rev. %#04x", model, - br != NULL ? "" : "unknown ", id >> 16); + snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, + br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); if (pci_get_subvendor(dev) == DELL_VENDORID) sc->bge_flags |= BGE_FLAG_NO_3LED; @@ -2411,8 +2452,11 @@ bge_attach(device_t dev) /* Save various chip information. */ sc->bge_chipid = - pci_read_config(dev, BGE_PCI_MISC_CTL, 4) & - BGE_PCIMISCCTL_ASICREV; + pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) + sc->bge_chipid = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, + 4); sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); @@ -2431,6 +2475,15 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { + case BGE_ASICREV_BCM5755: + case BGE_ASICREV_BCM5761: + case BGE_ASICREV_BCM5784: + case BGE_ASICREV_BCM5785: + case BGE_ASICREV_BCM5787: + case BGE_ASICREV_BCM57780: + sc->bge_flags |= BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | + BGE_FLAG_5705_PLUS; + break; case BGE_ASICREV_BCM5700: case BGE_ASICREV_BCM5701: case BGE_ASICREV_BCM5703: @@ -2444,8 +2497,6 @@ bge_attach(device_t dev) /* FALLTHROUGH */ case BGE_ASICREV_BCM5750: case BGE_ASICREV_BCM5752: - case BGE_ASICREV_BCM5755: - case BGE_ASICREV_BCM5787: case BGE_ASICREV_BCM5906: sc->bge_flags |= BGE_FLAG_575X_PLUS; /* FALLTHROUGH */ @@ -2466,6 +2517,8 @@ bge_attach(device_t dev) if (BGE_IS_5705_PLUS(sc) && !(sc->bge_flags & BGE_FLAG_ADJUST_TRIM)) { if (sc->bge_asicrev == BGE_ASICREV_BCM5755 || + sc->bge_asicrev == BGE_ASICREV_BCM5761 || + sc->bge_asicrev == BGE_ASICREV_BCM5784 || sc->bge_asicrev == BGE_ASICREV_BCM5787) { if (sc->bge_chipid != BGE_CHIPID_BCM5722_A0) sc->bge_flags |= BGE_FLAG_JITTER_BUG; @@ -2873,8 +2926,7 @@ bge_reset(struct bge_softc *sc) /* Disable fastboot on controllers that support it. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || - sc->bge_asicrev == BGE_ASICREV_BCM5755 || - sc->bge_asicrev == BGE_ASICREV_BCM5787) { + BGE_IS_5755_PLUS(sc)) { if (bootverbose) device_printf(sc->bge_dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); @@ -4689,6 +4741,8 @@ bge_sysctl_debug_info(SYSCTL_HANDLER_ARG } printf("Hardware Flags:\n"); + if (BGE_IS_5755_PLUS(sc)) + printf(" - 5755 Plus\n"); if (BGE_IS_575X_PLUS(sc)) printf(" - 575X Plus\n"); if (BGE_IS_5705_PLUS(sc)) Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Wed Oct 7 12:38:19 2009 (r197831) +++ head/sys/dev/bge/if_bgereg.h Wed Oct 7 13:12:43 2009 (r197832) @@ -218,6 +218,7 @@ #define BGE_PCI_UNDI_TX_BD_PRODIDX_LO 0xAC #define BGE_PCI_ISR_MBX_HI 0xB0 #define BGE_PCI_ISR_MBX_LO 0xB4 +#define BGE_PCI_PRODID_ASICREV 0xBC /* PCI Misc. Host control register */ #define BGE_PCIMISCCTL_CLEAR_INTA 0x00000001 @@ -229,6 +230,7 @@ #define BGE_PCIMISCCTL_REG_WORDSWAP 0x00000040 #define BGE_PCIMISCCTL_INDIRECT_ACCESS 0x00000080 #define BGE_PCIMISCCTL_ASICREV 0xFFFF0000 +#define BGE_PCIMISCCTL_ASICREV_SHIFT 16 #define BGE_HIF_SWAP_OPTIONS (BGE_PCIMISCCTL_ENDIAN_WORDSWAP) #if BYTE_ORDER == LITTLE_ENDIAN @@ -245,66 +247,72 @@ (BGE_HIF_SWAP_OPTIONS|BGE_PCIMISCCTL_CLEAR_INTA| \ BGE_PCIMISCCTL_MASK_PCI_INTR|BGE_PCIMISCCTL_INDIRECT_ACCESS) -#define BGE_CHIPID_TIGON_I 0x40000000 -#define BGE_CHIPID_TIGON_II 0x60000000 -#define BGE_CHIPID_BCM5700_A0 0x70000000 -#define BGE_CHIPID_BCM5700_A1 0x70010000 -#define BGE_CHIPID_BCM5700_B0 0x71000000 -#define BGE_CHIPID_BCM5700_B1 0x71010000 -#define BGE_CHIPID_BCM5700_B2 0x71020000 -#define BGE_CHIPID_BCM5700_B3 0x71030000 -#define BGE_CHIPID_BCM5700_ALTIMA 0x71040000 -#define BGE_CHIPID_BCM5700_C0 0x72000000 -#define BGE_CHIPID_BCM5701_A0 0x00000000 /* grrrr */ -#define BGE_CHIPID_BCM5701_B0 0x01000000 -#define BGE_CHIPID_BCM5701_B2 0x01020000 -#define BGE_CHIPID_BCM5701_B5 0x01050000 -#define BGE_CHIPID_BCM5703_A0 0x10000000 -#define BGE_CHIPID_BCM5703_A1 0x10010000 -#define BGE_CHIPID_BCM5703_A2 0x10020000 -#define BGE_CHIPID_BCM5703_A3 0x10030000 -#define BGE_CHIPID_BCM5703_B0 0x11000000 -#define BGE_CHIPID_BCM5704_A0 0x20000000 -#define BGE_CHIPID_BCM5704_A1 0x20010000 -#define BGE_CHIPID_BCM5704_A2 0x20020000 -#define BGE_CHIPID_BCM5704_A3 0x20030000 -#define BGE_CHIPID_BCM5704_B0 0x21000000 -#define BGE_CHIPID_BCM5705_A0 0x30000000 -#define BGE_CHIPID_BCM5705_A1 0x30010000 -#define BGE_CHIPID_BCM5705_A2 0x30020000 -#define BGE_CHIPID_BCM5705_A3 0x30030000 -#define BGE_CHIPID_BCM5750_A0 0x40000000 -#define BGE_CHIPID_BCM5750_A1 0x40010000 -#define BGE_CHIPID_BCM5750_A3 0x40030000 -#define BGE_CHIPID_BCM5750_B0 0x41000000 -#define BGE_CHIPID_BCM5750_B1 0x41010000 -#define BGE_CHIPID_BCM5750_C0 0x42000000 -#define BGE_CHIPID_BCM5750_C1 0x42010000 -#define BGE_CHIPID_BCM5750_C2 0x42020000 -#define BGE_CHIPID_BCM5714_A0 0x50000000 -#define BGE_CHIPID_BCM5752_A0 0x60000000 -#define BGE_CHIPID_BCM5752_A1 0x60010000 -#define BGE_CHIPID_BCM5752_A2 0x60020000 -#define BGE_CHIPID_BCM5714_B0 0x80000000 -#define BGE_CHIPID_BCM5714_B3 0x80030000 -#define BGE_CHIPID_BCM5715_A0 0x90000000 -#define BGE_CHIPID_BCM5715_A1 0x90010000 -#define BGE_CHIPID_BCM5715_A3 0x90030000 -#define BGE_CHIPID_BCM5755_A0 0xa0000000 -#define BGE_CHIPID_BCM5755_A1 0xa0010000 -#define BGE_CHIPID_BCM5755_A2 0xa0020000 -#define BGE_CHIPID_BCM5722_A0 0xa2000000 -#define BGE_CHIPID_BCM5754_A0 0xb0000000 -#define BGE_CHIPID_BCM5754_A1 0xb0010000 -#define BGE_CHIPID_BCM5754_A2 0xb0020000 -#define BGE_CHIPID_BCM5787_A0 0xb0000000 -#define BGE_CHIPID_BCM5787_A1 0xb0010000 -#define BGE_CHIPID_BCM5787_A2 0xb0020000 -#define BGE_CHIPID_BCM5906_A1 0xc0010000 -#define BGE_CHIPID_BCM5906_A2 0xc0020000 +#define BGE_CHIPID_TIGON_I 0x4000 +#define BGE_CHIPID_TIGON_II 0x6000 +#define BGE_CHIPID_BCM5700_A0 0x7000 +#define BGE_CHIPID_BCM5700_A1 0x7001 +#define BGE_CHIPID_BCM5700_B0 0x7100 +#define BGE_CHIPID_BCM5700_B1 0x7101 +#define BGE_CHIPID_BCM5700_B2 0x7102 +#define BGE_CHIPID_BCM5700_B3 0x7103 +#define BGE_CHIPID_BCM5700_ALTIMA 0x7104 +#define BGE_CHIPID_BCM5700_C0 0x7200 +#define BGE_CHIPID_BCM5701_A0 0x0000 /* grrrr */ +#define BGE_CHIPID_BCM5701_B0 0x0100 +#define BGE_CHIPID_BCM5701_B2 0x0102 +#define BGE_CHIPID_BCM5701_B5 0x0105 +#define BGE_CHIPID_BCM5703_A0 0x1000 +#define BGE_CHIPID_BCM5703_A1 0x1001 +#define BGE_CHIPID_BCM5703_A2 0x1002 +#define BGE_CHIPID_BCM5703_A3 0x1003 +#define BGE_CHIPID_BCM5703_B0 0x1100 +#define BGE_CHIPID_BCM5704_A0 0x2000 +#define BGE_CHIPID_BCM5704_A1 0x2001 +#define BGE_CHIPID_BCM5704_A2 0x2002 +#define BGE_CHIPID_BCM5704_A3 0x2003 +#define BGE_CHIPID_BCM5704_B0 0x2100 +#define BGE_CHIPID_BCM5705_A0 0x3000 +#define BGE_CHIPID_BCM5705_A1 0x3001 +#define BGE_CHIPID_BCM5705_A2 0x3002 +#define BGE_CHIPID_BCM5705_A3 0x3003 +#define BGE_CHIPID_BCM5750_A0 0x4000 +#define BGE_CHIPID_BCM5750_A1 0x4001 +#define BGE_CHIPID_BCM5750_A3 0x4000 +#define BGE_CHIPID_BCM5750_B0 0x4100 +#define BGE_CHIPID_BCM5750_B1 0x4101 +#define BGE_CHIPID_BCM5750_C0 0x4200 +#define BGE_CHIPID_BCM5750_C1 0x4201 +#define BGE_CHIPID_BCM5750_C2 0x4202 +#define BGE_CHIPID_BCM5714_A0 0x5000 +#define BGE_CHIPID_BCM5752_A0 0x6000 +#define BGE_CHIPID_BCM5752_A1 0x6001 +#define BGE_CHIPID_BCM5752_A2 0x6002 +#define BGE_CHIPID_BCM5714_B0 0x8000 +#define BGE_CHIPID_BCM5714_B3 0x8003 +#define BGE_CHIPID_BCM5715_A0 0x9000 +#define BGE_CHIPID_BCM5715_A1 0x9001 +#define BGE_CHIPID_BCM5715_A3 0x9003 +#define BGE_CHIPID_BCM5755_A0 0xa000 +#define BGE_CHIPID_BCM5755_A1 0xa001 +#define BGE_CHIPID_BCM5755_A2 0xa002 +#define BGE_CHIPID_BCM5722_A0 0xa200 +#define BGE_CHIPID_BCM5754_A0 0xb000 +#define BGE_CHIPID_BCM5754_A1 0xb001 +#define BGE_CHIPID_BCM5754_A2 0xb002 +#define BGE_CHIPID_BCM5761_A0 0x5761000 +#define BGE_CHIPID_BCM5761_A1 0x5761100 +#define BGE_CHIPID_BCM5784_A0 0x5784000 +#define BGE_CHIPID_BCM5784_A1 0x5784100 +#define BGE_CHIPID_BCM5787_A0 0xb000 +#define BGE_CHIPID_BCM5787_A1 0xb001 +#define BGE_CHIPID_BCM5787_A2 0xb002 +#define BGE_CHIPID_BCM5906_A1 0xc001 +#define BGE_CHIPID_BCM5906_A2 0xc002 +#define BGE_CHIPID_BCM57780_A0 0x57780000 +#define BGE_CHIPID_BCM57780_A1 0x57780001 /* shorthand one */ -#define BGE_ASICREV(x) ((x) >> 28) +#define BGE_ASICREV(x) ((x) >> 12) #define BGE_ASICREV_BCM5701 0x00 #define BGE_ASICREV_BCM5703 0x01 #define BGE_ASICREV_BCM5704 0x02 @@ -319,9 +327,16 @@ #define BGE_ASICREV_BCM5754 0x0b #define BGE_ASICREV_BCM5787 0x0b #define BGE_ASICREV_BCM5906 0x0c +/* Should consult BGE_PCI_PRODID_ASICREV for ChipID */ +#define BGE_ASICREV_USE_PRODID_REG 0x0f +/* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ +#define BGE_ASICREV_BCM5761 0x5761 +#define BGE_ASICREV_BCM5784 0x5784 +#define BGE_ASICREV_BCM5785 0x5785 +#define BGE_ASICREV_BCM57780 0x57780 /* chip revisions */ -#define BGE_CHIPREV(x) ((x) >> 24) +#define BGE_CHIPREV(x) ((x) >> 8) #define BGE_CHIPREV_5700_AX 0x70 #define BGE_CHIPREV_5700_BX 0x71 #define BGE_CHIPREV_5700_CX 0x72 @@ -331,6 +346,9 @@ #define BGE_CHIPREV_5704_BX 0x21 #define BGE_CHIPREV_5750_AX 0x40 #define BGE_CHIPREV_5750_BX 0x41 +/* BGE_PCI_PRODID_ASICREV chip rev. identifiers. */ +#define BGE_CHIPREV_5761_AX 0x57611 +#define BGE_CHIPREV_5784_AX 0x57841 /* PCI DMA Read/Write Control register */ #define BGE_PCIDMARWCTL_MINDMA 0x000000FF @@ -861,6 +879,7 @@ #define BGE_SDCMODE_RESET 0x00000001 #define BGE_SDCMODE_ENABLE 0x00000002 #define BGE_SDCMODE_ATTN 0x00000004 +#define BGE_SDCMODE_CDELAY 0x00000010 /* Send Data completion status register */ #define BGE_SDCSTAT_ATTN 0x00000004 @@ -1378,6 +1397,9 @@ #define BGE_RDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_RDMAMODE_LOCWRITE_TOOBIG 0x00000200 #define BGE_RDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_RDMAMODE_BD_SBD_CRPT_ATTN 0x00000800 +#define BGE_RDMAMODE_MBUF_RBD_CRPT_ATTN 0x00001000 +#define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 @@ -2101,6 +2123,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A +#define BCOM_DEVICEID_BCM5723 0x165B #define BCOM_DEVICEID_BCM5750 0x1676 #define BCOM_DEVICEID_BCM5750M 0x167C #define BCOM_DEVICEID_BCM5751 0x1677 @@ -2115,13 +2138,22 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5754M 0x1672 #define BCOM_DEVICEID_BCM5755 0x167B #define BCOM_DEVICEID_BCM5755M 0x1673 +#define BCOM_DEVICEID_BCM5761 0x1681 +#define BCOM_DEVICEID_BCM5761E 0x1680 +#define BCOM_DEVICEID_BCM5761S 0x1688 +#define BCOM_DEVICEID_BCM5761SE 0x1689 +#define BCOM_DEVICEID_BCM5764 0x1684 #define BCOM_DEVICEID_BCM5780 0x166A #define BCOM_DEVICEID_BCM5780S 0x166B #define BCOM_DEVICEID_BCM5781 0x16DD #define BCOM_DEVICEID_BCM5782 0x1696 +#define BCOM_DEVICEID_BCM5784 0x1698 +#define BCOM_DEVICEID_BCM5785F 0x16a0 +#define BCOM_DEVICEID_BCM5785G 0x1699 #define BCOM_DEVICEID_BCM5786 0x169A #define BCOM_DEVICEID_BCM5787 0x169B #define BCOM_DEVICEID_BCM5787M 0x1693 +#define BCOM_DEVICEID_BCM5787F 0x167f #define BCOM_DEVICEID_BCM5788 0x169C #define BCOM_DEVICEID_BCM5789 0x169D #define BCOM_DEVICEID_BCM5901 0x170D @@ -2129,6 +2161,10 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5903M 0x16FF #define BCOM_DEVICEID_BCM5906 0x1712 #define BCOM_DEVICEID_BCM5906M 0x1713 +#define BCOM_DEVICEID_BCM57760 0x1690 +#define BCOM_DEVICEID_BCM57780 0x1692 +#define BCOM_DEVICEID_BCM57788 0x1691 +#define BCOM_DEVICEID_BCM57790 0x1694 /* * Alteon AceNIC PCI vendor/device ID. @@ -2179,6 +2215,14 @@ struct bge_status_block { #define SUN_VENDORID 0x108e /* + * Fujitsu vendor/device IDs + */ +#define FJTSU_VENDORID 0x10cf +#define FJTSU_DEVICEID_PW008GE5 0x11a1 +#define FJTSU_DEVICEID_PW008GE4 0x11a2 +#define FJTSU_DEVICEID_PP250450 0x11cc /* PRIMEPOWER250/450 LAN */ + +/* * Offset of MAC address inside EEPROM. */ #define BGE_EE_MAC_OFFSET 0x7C @@ -2558,6 +2602,7 @@ struct bge_softc { #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 +#define BGE_FLAG_5755_PLUS 0x00010000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 @@ -2568,8 +2613,8 @@ struct bge_softc { #define BGE_FLAG_CRC_BUG 0x08000000 #define BGE_FLAG_5788 0x20000000 uint32_t bge_chipid; - uint8_t bge_asicrev; - uint8_t bge_chiprev; + uint32_t bge_asicrev; + uint32_t bge_chiprev; uint8_t bge_asf_mode; uint8_t bge_asf_count; struct bge_ring_data bge_ldata; /* rings */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 13:25: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 4ECDF106568F; Wed, 7 Oct 2009 13:25:23 +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 3DFD88FC1E; Wed, 7 Oct 2009 13:25: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 n97DPNrI085486; Wed, 7 Oct 2009 13:25:23 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97DPNJN085484; Wed, 7 Oct 2009 13:25:23 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200910071325.n97DPNJN085484@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 7 Oct 2009 13:25: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: r197833 - head/usr.sbin/cdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 13:25:23 -0000 Author: jh Date: Wed Oct 7 13:25:22 2009 New Revision: 197833 URL: http://svn.freebsd.org/changeset/base/197833 Log: When run() returns an error, print the error message also in non-interactive mode. Previously error messages were printed only in interactive mode. PR: bin/124517 Approved by: trasz (mentor) MFC after: 1 month Modified: head/usr.sbin/cdcontrol/cdcontrol.c Modified: head/usr.sbin/cdcontrol/cdcontrol.c ============================================================================== --- head/usr.sbin/cdcontrol/cdcontrol.c Wed Oct 7 13:12:43 2009 (r197832) +++ head/usr.sbin/cdcontrol/cdcontrol.c Wed Oct 7 13:25:22 2009 (r197833) @@ -241,7 +241,7 @@ int main (int argc, char **argv) if (argc > 0) { char buf[80], *p; - int len; + int len, rc; for (p=buf; argc-->0; ++argv) { len = strlen (*argv); @@ -257,7 +257,11 @@ int main (int argc, char **argv) } *p = 0; arg = parse (buf, &cmd); - return (run (cmd, arg)); + rc = run (cmd, arg); + if (rc < 0 && verbose) + warn(NULL); + + return (rc); } if (verbose == 1) From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 13:25: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 B7B6E1065698; Wed, 7 Oct 2009 13:25:24 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6A998FC2E; Wed, 7 Oct 2009 13:25: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 n97DPOdc085519; Wed, 7 Oct 2009 13:25:24 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97DPODb085517; Wed, 7 Oct 2009 13:25:24 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200910071325.n97DPODb085517@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 7 Oct 2009 13:25: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: r197834 - 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: Wed, 07 Oct 2009 13:25:24 -0000 Author: stas Date: Wed Oct 7 13:25:24 2009 New Revision: 197834 URL: http://svn.freebsd.org/changeset/base/197834 Log: - Document new revisions of chips supported. Modified: head/share/man/man4/bge.4 Modified: head/share/man/man4/bge.4 ============================================================================== --- head/share/man/man4/bge.4 Wed Oct 7 13:25:22 2009 (r197833) +++ head/share/man/man4/bge.4 Wed Oct 7 13:25:24 2009 (r197834) @@ -31,12 +31,12 @@ .\" .\" $FreeBSD$ .\" -.Dd May 19, 2009 +.Dd Oct 7, 2009 .Dt BGE 4 .Os .Sh NAME .Nm bge -.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5789 PCI Gigabit Ethernet adapter driver" +.Nd "Broadcom BCM570x/5714/5721/5722/5750/5751/5752/5761/5784/5789/57780 PCI Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -56,8 +56,8 @@ if_bge_load="YES" The .Nm driver provides support for various NICs based on the Broadcom BCM570x, -5714, 5721, 5722, 5750, 5751, 5752 and 5789 families of Gigabit Ethernet -controller chips. +5714, 5721, 5722, 5750, 5751, 5752, 5761, 5784, 5789 and 57780 families +of Gigabit Ethernet controller chips. .Pp All of these NICs are capable of 10, 100 and 1000Mbps speeds over CAT5 copper cable, except for the SysKonnect SK-9D41 which supports only From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 13:45: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 9BDAE1065672; Wed, 7 Oct 2009 13:45:12 +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 8AD708FC15; Wed, 7 Oct 2009 13:45: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 n97DjCBx085939; Wed, 7 Oct 2009 13:45:12 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97DjC88085937; Wed, 7 Oct 2009 13:45:12 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <200910071345.n97DjC88085937@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 7 Oct 2009 13:45: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: r197835 - 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: Wed, 07 Oct 2009 13:45:12 -0000 Author: simon Date: Wed Oct 7 13:45:12 2009 New Revision: 197835 URL: http://svn.freebsd.org/changeset/base/197835 Log: - Document that 'Dell PowerEdge R710' has bce(4) supported NIC. - Bump document date. MFC after: 3 days Modified: head/share/man/man4/bce.4 Modified: head/share/man/man4/bce.4 ============================================================================== --- head/share/man/man4/bce.4 Wed Oct 7 13:25:24 2009 (r197834) +++ head/share/man/man4/bce.4 Wed Oct 7 13:45:12 2009 (r197835) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2009 +.Dd October 7, 2009 .Dt BCE 4 .Os .Sh NAME @@ -165,6 +165,8 @@ Dell PowerEdge 1950 integrated BCM5708 N .It Dell PowerEdge 2950 integrated BCM5708 NIC .It +Dell PowerEdge R710 integrated BCM5709 NIC +.It HP NC370F Multifunction Gigabit Server Adapter .It HP NC370T Multifunction Gigabit Server Adapter From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 14:14: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 E007C106566B; Wed, 7 Oct 2009 14:14:05 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC6708FC14; Wed, 7 Oct 2009 14:14: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 n97EE53a086512; Wed, 7 Oct 2009 14:14:05 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97EE5B3086509; Wed, 7 Oct 2009 14:14:05 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200910071414.n97EE5B3086509@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 7 Oct 2009 14:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197836 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci modules/nfslockd nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 14:14:06 -0000 Author: nyan Date: Wed Oct 7 14:14:05 2009 New Revision: 197836 URL: http://svn.freebsd.org/changeset/base/197836 Log: MFC: revision 197730 unifdef NFSCLIENT because the nlm depends on the nfsclient even if NFSCLIENT is not defined. Now the nfslockd module works with the nfsclient module. Reviewed by: kib Approved by: re (kensmith) Modified: 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/sys/modules/nfslockd/Makefile stable/8/sys/nlm/nlm_prot_impl.c Modified: stable/8/sys/modules/nfslockd/Makefile ============================================================================== --- stable/8/sys/modules/nfslockd/Makefile Wed Oct 7 13:45:12 2009 (r197835) +++ stable/8/sys/modules/nfslockd/Makefile Wed Oct 7 14:14:05 2009 (r197836) @@ -14,18 +14,12 @@ SRCS+= opt_inet6.h opt_nfs.h .if !defined(KERNBUILDDIR) NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel -NFSCLIENT?= 1 # 0/1 - requires NFSCLIENT to be configured in kernel .if ${NFS_INET6} > 0 opt_inet6.h: echo "#define INET6 1" > ${.TARGET} .endif -.if ${NFSCLIENT} > 0 -opt_nfs.h: - echo "#define NFSCLIENT 1" > ${.TARGET} -.endif - .endif .include Modified: stable/8/sys/nlm/nlm_prot_impl.c ============================================================================== --- stable/8/sys/nlm/nlm_prot_impl.c Wed Oct 7 13:45:12 2009 (r197835) +++ stable/8/sys/nlm/nlm_prot_impl.c Wed Oct 7 14:14:05 2009 (r197836) @@ -26,7 +26,6 @@ */ #include "opt_inet6.h" -#include "opt_nfs.h" #include __FBSDID("$FreeBSD$"); @@ -671,8 +670,6 @@ nlm_host_destroy(struct nlm_host *host) free(host, M_NLM); } -#ifdef NFSCLIENT - /* * Thread start callback for client lock recovery */ @@ -695,8 +692,6 @@ nlm_client_recovery_start(void *arg) kthread_exit(); } -#endif - /* * This is called when we receive a host state change notification. We * unlock any active locks owned by the host. When rpc.lockd is @@ -735,7 +730,6 @@ nlm_host_notify(struct nlm_host *host, i lf_clearremotesys(host->nh_sysid); host->nh_state = newstate; -#ifdef NFSCLIENT /* * If we have any remote locks for this host (i.e. it * represents a remote NFS server that our local NFS client @@ -750,7 +744,6 @@ nlm_host_notify(struct nlm_host *host, i kthread_add(nlm_client_recovery_start, host, curproc, &td, 0, 0, "NFS lock recovery for %s", host->nh_caller_name); } -#endif } /* @@ -1479,10 +1472,8 @@ nlm_server_main(int addr_count, char **a enum clnt_stat stat; struct nlm_host *host, *nhost; struct nlm_waiting_lock *nw; -#ifdef NFSCLIENT vop_advlock_t *old_nfs_advlock; vop_reclaim_t *old_nfs_reclaim; -#endif int v4_used; #ifdef INET6 int v6_used; @@ -1583,20 +1574,16 @@ nlm_server_main(int addr_count, char **a NLM_DEBUG(1, "NLM: local NSM state is %d\n", smstat.state); nlm_nsm_state = smstat.state; -#ifdef NFSCLIENT old_nfs_advlock = nfs_advlock_p; nfs_advlock_p = nlm_advlock; old_nfs_reclaim = nfs_reclaim_p; nfs_reclaim_p = nlm_reclaim; -#endif svc_run(pool); error = 0; -#ifdef NFSCLIENT nfs_advlock_p = old_nfs_advlock; nfs_reclaim_p = old_nfs_reclaim; -#endif out: if (pool) From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 14:29: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 0374E1065672; Wed, 7 Oct 2009 14:29:50 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCD808FC1B; Wed, 7 Oct 2009 14:29: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 n97ETm9b086925; Wed, 7 Oct 2009 14:29:48 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97ETmS3086922; Wed, 7 Oct 2009 14:29:48 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200910071429.n97ETmS3086922@svn.freebsd.org> From: Stanislav Sedov Date: Wed, 7 Oct 2009 14:29: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: r197837 - 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: Wed, 07 Oct 2009 14:29:50 -0000 Author: stas Date: Wed Oct 7 14:29:48 2009 New Revision: 197837 URL: http://svn.freebsd.org/changeset/base/197837 Log: - Give a name to the host coalescing bug fix WDMA mode register bit instead of using hardcoded value in the code. Obtained from: OpenBSD Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 7 14:14:05 2009 (r197836) +++ head/sys/dev/bge/if_bge.c Wed Oct 7 14:29:48 2009 (r197837) @@ -1789,7 +1789,7 @@ bge_blockinit(struct bge_softc *sc) /* Enable host coalescing bug fix. */ if (BGE_IS_5755_PLUS(sc)) - val |= 1 << 29; + val |= BGE_WDMAMODE_STATUS_TAG_FIX; /* Turn on write DMA state machine */ CSR_WRITE_4(sc, BGE_WDMA_MODE, val); Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Wed Oct 7 14:14:05 2009 (r197836) +++ head/sys/dev/bge/if_bgereg.h Wed Oct 7 14:29:48 2009 (r197837) @@ -1431,6 +1431,7 @@ #define BGE_WDMAMODE_PCI_FIFOOREAD_ATTN 0x00000100 #define BGE_WDMAMODE_LOCREAD_TOOBIG 0x00000200 #define BGE_WDMAMODE_ALL_ATTNS 0x000003FC +#define BGE_WDMAMODE_STATUS_TAG_FIX 0x20000000 /* Write DMA status register */ #define BGE_WDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 15:40: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 35889106566B; Wed, 7 Oct 2009 15:40:05 +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 0AABE8FC1D; Wed, 7 Oct 2009 15:40: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 n97Fe4Jc088965; Wed, 7 Oct 2009 15:40:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97Fe4xN088962; Wed, 7 Oct 2009 15:40:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200910071540.n97Fe4xN088962@svn.freebsd.org> From: Alexander Motin Date: Wed, 7 Oct 2009 15:40: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: r197838 - in head/sys/dev: ahci siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 15:40:05 -0000 Author: mav Date: Wed Oct 7 15:40:04 2009 New Revision: 197838 URL: http://svn.freebsd.org/changeset/base/197838 Log: On command timeout handle frozen command first, to not run it inside XXX_end_transaction(). Submitted by: avg Modified: head/sys/dev/ahci/ahci.c head/sys/dev/siis/siis.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed Oct 7 14:29:48 2009 (r197837) +++ head/sys/dev/ahci/ahci.c Wed Oct 7 15:40:04 2009 (r197838) @@ -1259,15 +1259,16 @@ ahci_timeout(struct ahci_slot *slot) if (!ch->readlog) xpt_freeze_simq(ch->sim, ch->numrslots); - /* Handle command with timeout. */ - ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT); - /* Handle the rest of commands. */ + /* Handle frozen command. */ if (ch->frozen) { union ccb *fccb = ch->frozen; ch->frozen = NULL; fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; xpt_done(fccb); } + /* Handle command with timeout. */ + ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT); + /* Handle the rest of commands. */ for (i = 0; i < ch->numslots; i++) { /* Do we have a running request on slot? */ if (ch->slot[i].state < AHCI_SLOT_RUNNING) Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Wed Oct 7 14:29:48 2009 (r197837) +++ head/sys/dev/siis/siis.c Wed Oct 7 15:40:04 2009 (r197838) @@ -982,15 +982,16 @@ device_printf(dev, "%s is %08x ss %08x r if (!ch->readlog) xpt_freeze_simq(ch->sim, ch->numrslots); - /* Handle command with timeout. */ - siis_end_transaction(&ch->slot[slot->slot], SIIS_ERR_TIMEOUT); - /* Handle the rest of commands. */ + /* Handle frozen command. */ if (ch->frozen) { union ccb *fccb = ch->frozen; ch->frozen = NULL; fccb->ccb_h.status = CAM_REQUEUE_REQ | CAM_RELEASE_SIMQ; xpt_done(fccb); } + /* Handle command with timeout. */ + siis_end_transaction(&ch->slot[slot->slot], SIIS_ERR_TIMEOUT); + /* Handle the rest of commands. */ for (i = 0; i < SIIS_MAX_SLOTS; i++) { /* Do we have a running request on slot? */ if (ch->slot[i].state < SIIS_SLOT_RUNNING) From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 15: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 6FE621065672; Wed, 7 Oct 2009 15:41:30 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44E6C8FC17; Wed, 7 Oct 2009 15: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 n97FfUrs089114; Wed, 7 Oct 2009 15:41:30 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97FfU9G089113; Wed, 7 Oct 2009 15:41:30 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910071541.n97FfU9G089113@svn.freebsd.org> From: Joe Marcus Clarke Date: Wed, 7 Oct 2009 15:41:30 +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: r197839 - stable/7/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 15:41:30 -0000 Author: marcus (doc,ports committer) Date: Wed Oct 7 15:41:30 2009 New Revision: 197839 URL: http://svn.freebsd.org/changeset/base/197839 Log: Record mergeinfo data for r197681. Approved by: kib Modified: stable/7/lib/libc/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 19:50: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 AE38D106568B; Wed, 7 Oct 2009 19:50:14 +0000 (UTC) (envelope-from zml@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92BBE8FC1D; Wed, 7 Oct 2009 19:50: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 n97JoEtX097727; Wed, 7 Oct 2009 19:50:14 GMT (envelope-from zml@svn.freebsd.org) Received: (from zml@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97JoECb097724; Wed, 7 Oct 2009 19:50:14 GMT (envelope-from zml@svn.freebsd.org) Message-Id: <200910071950.n97JoECb097724@svn.freebsd.org> From: Zachary Loafman Date: Wed, 7 Oct 2009 19:50: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: r197840 - head/sys/nlm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 19:50:14 -0000 Author: zml Date: Wed Oct 7 19:50:14 2009 New Revision: 197840 URL: http://svn.freebsd.org/changeset/base/197840 Log: Handle GRANTED_RES messages more gracefully: Send along a grant cookie to reference the lock, look up the grant cookie when the GRANTED_RES comes back. Properly handle the case of an error on the grant. Add a short expiration window so that granted locks are not freed immediately. Approved by: dfr (mentor) MFC after: 2 weeks Modified: head/sys/nlm/nlm.h head/sys/nlm/nlm_prot_impl.c head/sys/nlm/nlm_prot_server.c Modified: head/sys/nlm/nlm.h ============================================================================== --- head/sys/nlm/nlm.h Wed Oct 7 15:41:30 2009 (r197839) +++ head/sys/nlm/nlm.h Wed Oct 7 19:50:14 2009 (r197840) @@ -49,6 +49,12 @@ extern struct timeval nlm_zero_tv; extern int nlm_nsm_state; /* + * Make a struct netobj. + */ +extern void nlm_make_netobj(struct netobj *dst, caddr_t srt, + size_t srcsize, struct malloc_type *type); + +/* * Copy a struct netobj. */ extern void nlm_copy_netobj(struct netobj *dst, struct netobj *src, @@ -193,6 +199,12 @@ extern int nlm_do_granted(nlm4_testargs struct svc_req *rqstp, CLIENT **rpcp); /* + * Implementation for the granted result RPC. The client may reject the granted + * message, in which case we need to handle it appropriately. + */ +extern void nlm_do_granted_res(nlm4_res *argp, struct svc_req *rqstp); + +/* * Free all locks associated with the hostname argp->name. */ extern void nlm_do_free_all(nlm4_notify *argp); Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Wed Oct 7 15:41:30 2009 (r197839) +++ head/sys/nlm/nlm_prot_impl.c Wed Oct 7 19:50:14 2009 (r197840) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -77,6 +78,11 @@ MALLOC_DEFINE(M_NLM, "NLM", "Network Loc #define NLM_IDLE_PERIOD 5 /* + * We only look for GRANTED_RES messages for a little while. + */ +#define NLM_EXPIRE_TIMEOUT 10 + +/* * Support for sysctl vfs.nlm.sysid */ SYSCTL_NODE(_vfs, OID_AUTO, nlm, CTLFLAG_RW, NULL, "Network Lock Manager"); @@ -204,6 +210,7 @@ struct nlm_async_lock { struct nlm_host *af_host; /* (c) host which is locking */ CLIENT *af_rpc; /* (c) rpc client to send message */ nlm4_testargs af_granted; /* (c) notification details */ + time_t af_expiretime; /* (c) notification time */ }; TAILQ_HEAD(nlm_async_lock_list, nlm_async_lock); @@ -237,7 +244,9 @@ struct nlm_host { enum nlm_host_state nh_monstate; /* (l) local NSM monitoring state */ time_t nh_idle_timeout; /* (s) Time at which host is idle */ struct sysctl_ctx_list nh_sysctl; /* (c) vfs.nlm.sysid nodes */ + uint32_t nh_grantcookie; /* (l) grant cookie counter */ struct nlm_async_lock_list nh_pending; /* (l) pending async locks */ + struct nlm_async_lock_list nh_granted; /* (l) granted locks */ struct nlm_async_lock_list nh_finished; /* (l) finished async locks */ }; TAILQ_HEAD(nlm_host_list, nlm_host); @@ -247,6 +256,25 @@ static uint32_t nlm_next_sysid = 1; / static void nlm_host_unmonitor(struct nlm_host *); +struct nlm_grantcookie { + uint32_t ng_sysid; + uint32_t ng_cookie; +}; + +static inline uint32_t +ng_sysid(struct netobj *src) +{ + + return ((struct nlm_grantcookie *)src->n_bytes)->ng_sysid; +} + +static inline uint32_t +ng_cookie(struct netobj *src) +{ + + return ((struct nlm_grantcookie *)src->n_bytes)->ng_cookie; +} + /**********************************************************************/ /* @@ -281,6 +309,19 @@ nlm_uninit(void *dummy) SYSUNINIT(nlm_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, nlm_uninit, NULL); /* + * Create a netobj from an arbitrary source. + */ +void +nlm_make_netobj(struct netobj *dst, caddr_t src, size_t srcsize, + struct malloc_type *type) +{ + + dst->n_len = srcsize; + dst->n_bytes = malloc(srcsize, type, M_WAITOK); + memcpy(dst->n_bytes, src, srcsize); +} + +/* * Copy a struct netobj. */ void @@ -288,11 +329,10 @@ nlm_copy_netobj(struct netobj *dst, stru struct malloc_type *type) { - dst->n_len = src->n_len; - dst->n_bytes = malloc(src->n_len, type, M_WAITOK); - memcpy(dst->n_bytes, src->n_bytes, src->n_len); + nlm_make_netobj(dst, src->n_bytes, src->n_len, type); } + /* * Create an RPC client handle for the given (address,prog,vers) * triple using UDP. @@ -518,8 +558,10 @@ nlm_lock_callback(void *arg, int pending struct nlm_async_lock *af = (struct nlm_async_lock *) arg; struct rpc_callextra ext; - NLM_DEBUG(2, "NLM: async lock %p for %s (sysid %d) granted\n", - af, af->af_host->nh_caller_name, af->af_host->nh_sysid); + NLM_DEBUG(2, "NLM: async lock %p for %s (sysid %d) granted," + " cookie %d:%d\n", af, af->af_host->nh_caller_name, + af->af_host->nh_sysid, ng_sysid(&af->af_granted.cookie), + ng_cookie(&af->af_granted.cookie)); /* * Send the results back to the host. @@ -556,16 +598,12 @@ nlm_lock_callback(void *arg, int pending } /* - * Move this entry to the nh_finished list. Someone else will - * free it later - its too hard to do it here safely without - * racing with cancel. - * - * XXX possibly we should have a third "granted sent but not - * ack'ed" list so that we can re-send the granted message. + * Move this entry to the nh_granted list. */ + af->af_expiretime = time_uptime + NLM_EXPIRE_TIMEOUT; mtx_lock(&af->af_host->nh_lock); TAILQ_REMOVE(&af->af_host->nh_pending, af, af_link); - TAILQ_INSERT_TAIL(&af->af_host->nh_finished, af, af_link); + TAILQ_INSERT_TAIL(&af->af_host->nh_granted, af, af_link); mtx_unlock(&af->af_host->nh_lock); } @@ -635,11 +673,23 @@ nlm_cancel_async_lock(struct nlm_async_l } static void -nlm_free_finished_locks(struct nlm_host *host) +nlm_check_expired_locks(struct nlm_host *host) { struct nlm_async_lock *af; + time_t uptime = time_uptime; mtx_lock(&host->nh_lock); + while ((af = TAILQ_FIRST(&host->nh_granted)) != NULL + && uptime >= af->af_expiretime) { + NLM_DEBUG(2, "NLM: async lock %p for %s (sysid %d) expired," + " cookie %d:%d\n", af, af->af_host->nh_caller_name, + af->af_host->nh_sysid, ng_sysid(&af->af_granted.cookie), + ng_cookie(&af->af_granted.cookie)); + TAILQ_REMOVE(&host->nh_granted, af, af_link); + mtx_unlock(&host->nh_lock); + nlm_free_async_lock(af); + mtx_lock(&host->nh_lock); + } while ((af = TAILQ_FIRST(&host->nh_finished)) != NULL) { TAILQ_REMOVE(&host->nh_finished, af, af_link); mtx_unlock(&host->nh_lock); @@ -722,7 +772,7 @@ nlm_host_notify(struct nlm_host *host, i nlm_cancel_async_lock(af); } mtx_unlock(&host->nh_lock); - nlm_free_finished_locks(host); + nlm_check_expired_locks(host); /* * The host just rebooted - trash its locks. @@ -799,7 +849,9 @@ nlm_create_host(const char* caller_name) host->nh_vers = 0; host->nh_state = 0; host->nh_monstate = NLM_UNMONITORED; + host->nh_grantcookie = 1; TAILQ_INIT(&host->nh_pending); + TAILQ_INIT(&host->nh_granted); TAILQ_INIT(&host->nh_finished); TAILQ_INSERT_TAIL(&nlm_hosts, host, nh_link); @@ -1834,7 +1886,7 @@ nlm_do_test(nlm4_testargs *argp, nlm4_te NLM_DEBUG(3, "nlm_do_test(): caller_name = %s (sysid = %d)\n", host->nh_caller_name, host->nh_sysid); - nlm_free_finished_locks(host); + nlm_check_expired_locks(host); sysid = host->nh_sysid; nlm_convert_to_fhandle_t(&fh, &argp->alock.fh); @@ -1939,7 +1991,7 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_re nlm_host_notify(host, argp->state); } - nlm_free_finished_locks(host); + nlm_check_expired_locks(host); sysid = host->nh_sysid; nlm_convert_to_fhandle_t(&fh, &argp->alock.fh); @@ -1968,6 +2020,7 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_re if (argp->block) { struct nlm_async_lock *af; CLIENT *client; + struct nlm_grantcookie cookie; /* * First, make sure we can contact the host's NLM. @@ -1993,6 +2046,10 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_re break; } } + if (!af) { + cookie.ng_sysid = host->nh_sysid; + cookie.ng_cookie = host->nh_grantcookie++; + } mtx_unlock(&host->nh_lock); if (af) { CLNT_RELEASE(client); @@ -2011,6 +2068,8 @@ nlm_do_lock(nlm4_lockargs *argp, nlm4_re * We use M_RPC here so that we can xdr_free the thing * later. */ + nlm_make_netobj(&af->af_granted.cookie, + (caddr_t)&cookie, sizeof(cookie), M_RPC); af->af_granted.exclusive = argp->exclusive; af->af_granted.alock.caller_name = strdup(argp->alock.caller_name, M_RPC); @@ -2111,7 +2170,7 @@ nlm_do_cancel(nlm4_cancargs *argp, nlm4_ NLM_DEBUG(3, "nlm_do_cancel(): caller_name = %s (sysid = %d)\n", host->nh_caller_name, host->nh_sysid); - nlm_free_finished_locks(host); + nlm_check_expired_locks(host); sysid = host->nh_sysid; nlm_convert_to_fhandle_t(&fh, &argp->alock.fh); @@ -2200,7 +2259,7 @@ nlm_do_unlock(nlm4_unlockargs *argp, nlm NLM_DEBUG(3, "nlm_do_unlock(): caller_name = %s (sysid = %d)\n", host->nh_caller_name, host->nh_sysid); - nlm_free_finished_locks(host); + nlm_check_expired_locks(host); sysid = host->nh_sysid; nlm_convert_to_fhandle_t(&fh, &argp->alock.fh); @@ -2257,6 +2316,7 @@ nlm_do_granted(nlm4_testargs *argp, nlm4 nlm_copy_netobj(&result->cookie, &argp->cookie, M_RPC); result->stat.stat = nlm4_denied; + KFAIL_POINT_CODE(DEBUG_FP, nlm_deny_grant, goto out); mtx_lock(&nlm_global_lock); TAILQ_FOREACH(nw, &nlm_waiting_locks, nw_link) { @@ -2275,6 +2335,8 @@ nlm_do_granted(nlm4_testargs *argp, nlm4 } } mtx_unlock(&nlm_global_lock); + +out: if (rpcp) *rpcp = nlm_host_get_rpc(host, TRUE); nlm_host_release(host); @@ -2282,6 +2344,65 @@ nlm_do_granted(nlm4_testargs *argp, nlm4 } void +nlm_do_granted_res(nlm4_res *argp, struct svc_req *rqstp) +{ + struct nlm_host *host = NULL; + struct nlm_async_lock *af = NULL; + int error; + + if (argp->cookie.n_len != sizeof(struct nlm_grantcookie)) { + NLM_DEBUG(1, "NLM: bogus grant cookie"); + goto out; + } + + host = nlm_find_host_by_sysid(ng_sysid(&argp->cookie)); + if (!host) { + NLM_DEBUG(1, "NLM: Unknown host rejected our grant"); + goto out; + } + + mtx_lock(&host->nh_lock); + TAILQ_FOREACH(af, &host->nh_granted, af_link) + if (ng_cookie(&argp->cookie) == + ng_cookie(&af->af_granted.cookie)) + break; + if (af) + TAILQ_REMOVE(&host->nh_granted, af, af_link); + mtx_unlock(&host->nh_lock); + + if (!af) { + NLM_DEBUG(1, "NLM: host %s (sysid %d) replied to our grant " + "with unrecognized cookie %d:%d", host->nh_caller_name, + host->nh_sysid, ng_sysid(&argp->cookie), + ng_cookie(&argp->cookie)); + goto out; + } + + if (argp->stat.stat != nlm4_granted) { + af->af_fl.l_type = F_UNLCK; + error = VOP_ADVLOCK(af->af_vp, NULL, F_UNLCK, &af->af_fl, F_REMOTE); + if (error) { + NLM_DEBUG(1, "NLM: host %s (sysid %d) rejected our grant " + "and we failed to unlock (%d)", host->nh_caller_name, + host->nh_sysid, error); + goto out; + } + + NLM_DEBUG(5, "NLM: async lock %p rejected by host %s (sysid %d)", + af, host->nh_caller_name, host->nh_sysid); + } else { + NLM_DEBUG(5, "NLM: async lock %p accepted by host %s (sysid %d)", + af, host->nh_caller_name, host->nh_sysid); + } + + out: + if (af) + nlm_free_async_lock(af); + if (host) + nlm_host_release(host); +} + +void nlm_do_free_all(nlm4_notify *argp) { struct nlm_host *host, *thost; Modified: head/sys/nlm/nlm_prot_server.c ============================================================================== --- head/sys/nlm/nlm_prot_server.c Wed Oct 7 15:41:30 2009 (r197839) +++ head/sys/nlm/nlm_prot_server.c Wed Oct 7 19:50:14 2009 (r197840) @@ -671,6 +671,7 @@ bool_t nlm4_granted_res_4_svc(nlm4_res *argp, void *result, struct svc_req *rqstp) { + nlm_do_granted_res(argp, rqstp); return (FALSE); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 20:09: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 E0285106566B; Wed, 7 Oct 2009 20:09:26 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 4C97A8FC13; Wed, 7 Oct 2009 20:09:25 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 57CD745E8F; Wed, 7 Oct 2009 22:09:24 +0200 (CEST) Received: from localhost (chello087206049004.chello.pl [87.206.49.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 374E945C89; Wed, 7 Oct 2009 22:09:19 +0200 (CEST) Date: Wed, 7 Oct 2009 22:09:18 +0200 From: Pawel Jakub Dawidek To: Kip Macy Message-ID: <20091007200918.GC2049@garage.freebsd.pl> References: <200910062140.n96LeoDG064737@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JgQwtEuHJzHdouWu" Content-Disposition: inline In-Reply-To: <200910062140.n96LeoDG064737@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 Subject: Re: svn commit: r197816 - 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: Wed, 07 Oct 2009 20:09:27 -0000 --JgQwtEuHJzHdouWu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 06, 2009 at 09:40:50PM +0000, Kip Macy wrote: > Author: kmacy > Date: Tue Oct 6 21:40:50 2009 > New Revision: 197816 > URL: http://svn.freebsd.org/changeset/base/197816 >=20 > Log: > Prevent paging pressure from draining arc too much > - always drain arc if above arc_c_max - never drain arc if arc is below= arc_c_max Below arc_c_min, right? Thanks for working on this. > + if (arc_size <=3D arc_c_min) > + return (0); --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --JgQwtEuHJzHdouWu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKzPVuForvXbEpPzQRAin9AKCA1pRPIQRLCCpJE9AOvDLEW1OReACfUHl/ eh9SP1XmcthWNyMSPrAgXeA= =g534 -----END PGP SIGNATURE----- --JgQwtEuHJzHdouWu-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 20:20: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 77F93106568F; Wed, 7 Oct 2009 20:20:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9C88FC12; Wed, 7 Oct 2009 20:20: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 n97KKqTL098340; Wed, 7 Oct 2009 20:20:52 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97KKqPx098336; Wed, 7 Oct 2009 20:20:52 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910072020.n97KKqPx098336@svn.freebsd.org> From: Robert Watson Date: Wed, 7 Oct 2009 20:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197841 - in head: lib/libc/gen lib/libc/sys 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, 07 Oct 2009 20:20:52 -0000 Author: rwatson Date: Wed Oct 7 20:20:51 2009 New Revision: 197841 URL: http://svn.freebsd.org/changeset/base/197841 Log: Add a new errno, ENOTCAPABLE, to be returned when a process requests an operation on a file descriptor that is not authorized by the descriptor's capability flags. MFC after: 1 month Sponsored by: Google Modified: head/lib/libc/gen/errlst.c head/lib/libc/sys/intro.2 head/sys/sys/errno.h Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Wed Oct 7 19:50:14 2009 (r197840) +++ head/lib/libc/gen/errlst.c Wed Oct 7 20:20:51 2009 (r197841) @@ -150,5 +150,6 @@ const char *const sys_errlist[] = { "Multihop attempted", /* 90 - EMULTIHOP */ "Link has been severed", /* 91 - ENOLINK */ "Protocol error", /* 92 - EPROTO */ + "Capabilities insufficient", /* 93 - ENOTCAPABLE */ }; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); Modified: head/lib/libc/sys/intro.2 ============================================================================== --- head/lib/libc/sys/intro.2 Wed Oct 7 19:50:14 2009 (r197840) +++ head/lib/libc/sys/intro.2 Wed Oct 7 20:20:51 2009 (r197841) @@ -456,6 +456,9 @@ The specified extended attribute does no .It Er 88 EDOOFUS Em "Programming error" . A function or API is being abused in a way which could only be detected at run-time. +.It Er 93 ENOTCAPABLE Em "Capabilities insufficient" . +An operation on a capability file descriptor requires greater privilege than +the capability allows. .El .Sh DEFINITIONS .Bl -tag -width Ds Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Wed Oct 7 19:50:14 2009 (r197840) +++ head/sys/sys/errno.h Wed Oct 7 20:20:51 2009 (r197841) @@ -174,7 +174,11 @@ __END_DECLS #define EPROTO 92 /* Protocol error */ #ifndef _POSIX_SOURCE -#define ELAST 92 /* Must be equal largest errno */ +#define ENOTCAPABLE 93 /* Capabilities insufficient */ +#endif /* _POSIX_SOURCE */ + +#ifndef _POSIX_SOURCE +#define ELAST 93 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 20:54: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 8485810656B4; Wed, 7 Oct 2009 20:54:07 +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 73D468FC28; Wed, 7 Oct 2009 20:54: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 n97Ks7g2099064; Wed, 7 Oct 2009 20:54:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97Ks7EB099062; Wed, 7 Oct 2009 20:54:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910072054.n97Ks7EB099062@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 7 Oct 2009 20:54: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: r197842 - 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: Wed, 07 Oct 2009 20:54:07 -0000 Author: pjd Date: Wed Oct 7 20:54:07 2009 New Revision: 197842 URL: http://svn.freebsd.org/changeset/base/197842 Log: Fix white-spaces. MFC after: 3 days 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 Wed Oct 7 20:20:51 2009 (r197841) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Oct 7 20:54:07 2009 (r197842) @@ -433,7 +433,7 @@ vdev_geom_open_by_guid(vdev_t *vd) if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; buf = kmem_alloc(len, KM_SLEEP); - + snprintf(buf, len, "/dev/%s", cp->provider->name); spa_strfree(vd->vdev_path); vd->vdev_path = buf; @@ -663,11 +663,11 @@ static void vdev_geom_io_done(zio_t *zio) { - /* - * If the device returned ENXIO, then attempt we should verify if GEOM - * provider has been removed. If this is the case, then we trigger an - * asynchronous removal of the device. - */ + /* + * If the device returned ENXIO, then attempt we should verify if GEOM + * provider has been removed. If this is the case, then we trigger an + * asynchronous removal of the device. + */ if (zio->io_error == ENXIO) { vdev_t *vd = zio->io_vd; vdev_geom_ctx_t *ctx; From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 20:56: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 40EAF1065694; Wed, 7 Oct 2009 20:56:16 +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 304A58FC12; Wed, 7 Oct 2009 20:56: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 n97KuGDh099152; Wed, 7 Oct 2009 20:56:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97KuGfc099150; Wed, 7 Oct 2009 20:56:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910072056.n97KuGfc099150@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 7 Oct 2009 20:56: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: r197843 - 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: Wed, 07 Oct 2009 20:56:16 -0000 Author: pjd Date: Wed Oct 7 20:56:15 2009 New Revision: 197843 URL: http://svn.freebsd.org/changeset/base/197843 Log: On FreeBSD it is enough to report provider removal when orphan event is received, we don't have to do it on every ENXIO error in I/O path. Solaris has no GEOM so they have to handle it in a less clean way. MFC after: 3 days 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 Wed Oct 7 20:54:07 2009 (r197842) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Oct 7 20:56:15 2009 (r197843) @@ -662,26 +662,6 @@ sendreq: static void vdev_geom_io_done(zio_t *zio) { - - /* - * If the device returned ENXIO, then attempt we should verify if GEOM - * provider has been removed. If this is the case, then we trigger an - * asynchronous removal of the device. - */ - if (zio->io_error == ENXIO) { - vdev_t *vd = zio->io_vd; - vdev_geom_ctx_t *ctx; - struct g_provider *pp = NULL; - - ctx = vd->vdev_tsd; - if (ctx != NULL && ctx->gc_consumer != NULL) - pp = ctx->gc_consumer->provider; - - if (pp == NULL || (pp->flags & G_PF_ORPHAN)) { - vd->vdev_remove_wanted = B_TRUE; - spa_async_request(zio->io_spa, SPA_ASYNC_REMOVE); - } - } } vdev_ops_t vdev_geom_ops = { From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 21:05: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 DB957106568D; Wed, 7 Oct 2009 21:05:40 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0B408FC08; Wed, 7 Oct 2009 21:05: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 n97L5eMi099573; Wed, 7 Oct 2009 21:05:40 GMT (envelope-from marcus@svn.freebsd.org) Received: (from marcus@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97L5eZH099572; Wed, 7 Oct 2009 21:05:40 GMT (envelope-from marcus@svn.freebsd.org) Message-Id: <200910072105.n97L5eZH099572@svn.freebsd.org> From: Joe Marcus Clarke Date: Wed, 7 Oct 2009 21:05:40 +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: r197846 - stable/6/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 21:05:41 -0000 Author: marcus (doc,ports committer) Date: Wed Oct 7 21:05:40 2009 New Revision: 197846 URL: http://svn.freebsd.org/changeset/base/197846 Log: Record merginfo data for r197681. Approved by: kib Modified: stable/6/lib/libc/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 21:14: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 00E6B106566B; Wed, 7 Oct 2009 21:14:46 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB3FE8FC23; Wed, 7 Oct 2009 21:14: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 n97LEjjb099865; Wed, 7 Oct 2009 21:14:45 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97LEjH3099863; Wed, 7 Oct 2009 21:14:45 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200910072114.n97LEjH3099863@svn.freebsd.org> From: Edwin Groothuis Date: Wed, 7 Oct 2009 21:14: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: r197847 - head/usr.bin/locale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 21:14:46 -0000 Author: edwin Date: Wed Oct 7 21:14:45 2009 New Revision: 197847 URL: http://svn.freebsd.org/changeset/base/197847 Log: Add the comment "(FreeBSD only)" to the altmonth_x keywords MFC after: 1 week Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Wed Oct 7 21:05:40 2009 (r197846) +++ head/usr.bin/locale/locale.c Wed Oct 7 21:14:45 2009 (r197847) @@ -190,18 +190,18 @@ struct _kwinfo { { "abmon_10", 1, LC_TIME, ABMON_10, "" }, { "abmon_11", 1, LC_TIME, ABMON_11, "" }, { "abmon_12", 1, LC_TIME, ABMON_12, "" }, - { "altmon_1", 1, LC_TIME, ALTMON_1, "" }, - { "altmon_2", 1, LC_TIME, ALTMON_2, "" }, - { "altmon_3", 1, LC_TIME, ALTMON_3, "" }, - { "altmon_4", 1, LC_TIME, ALTMON_4, "" }, - { "altmon_5", 1, LC_TIME, ALTMON_5, "" }, - { "altmon_6", 1, LC_TIME, ALTMON_6, "" }, - { "altmon_7", 1, LC_TIME, ALTMON_7, "" }, - { "altmon_8", 1, LC_TIME, ALTMON_8, "" }, - { "altmon_9", 1, LC_TIME, ALTMON_9, "" }, - { "altmon_10", 1, LC_TIME, ALTMON_10, "" }, - { "altmon_11", 1, LC_TIME, ALTMON_11, "" }, - { "altmon_12", 1, LC_TIME, ALTMON_12, "" }, + { "altmon_1", 1, LC_TIME, ALTMON_1, "(FreeBSD only)" }, + { "altmon_2", 1, LC_TIME, ALTMON_2, "(FreeBSD only)" }, + { "altmon_3", 1, LC_TIME, ALTMON_3, "(FreeBSD only)" }, + { "altmon_4", 1, LC_TIME, ALTMON_4, "(FreeBSD only)" }, + { "altmon_5", 1, LC_TIME, ALTMON_5, "(FreeBSD only)" }, + { "altmon_6", 1, LC_TIME, ALTMON_6, "(FreeBSD only)" }, + { "altmon_7", 1, LC_TIME, ALTMON_7, "(FreeBSD only)" }, + { "altmon_8", 1, LC_TIME, ALTMON_8, "(FreeBSD only)" }, + { "altmon_9", 1, LC_TIME, ALTMON_9, "(FreeBSD only)" }, + { "altmon_10", 1, LC_TIME, ALTMON_10, "(FreeBSD only)" }, + { "altmon_11", 1, LC_TIME, ALTMON_11, "(FreeBSD only)" }, + { "altmon_12", 1, LC_TIME, ALTMON_12, "(FreeBSD only)" }, { "era", 1, LC_TIME, ERA, "(unavailable)" }, { "era_d_fmt", 1, LC_TIME, ERA_D_FMT, "(unavailable)" }, { "era_d_t_fmt", 1, LC_TIME, ERA_D_T_FMT, "(unavailable)" }, From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 22:21: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 2EAF51065694; Wed, 7 Oct 2009 22:21:54 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2058FC1A; Wed, 7 Oct 2009 22:21: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 n97MLsCv001296; Wed, 7 Oct 2009 22:21:54 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97MLsfX001294; Wed, 7 Oct 2009 22:21:54 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200910072221.n97MLsfX001294@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 7 Oct 2009 22:21: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: r197848 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2009 22:21:54 -0000 Author: jilles Date: Wed Oct 7 22:21:53 2009 New Revision: 197848 URL: http://svn.freebsd.org/changeset/base/197848 Log: Clarify quoting of word in ${v=word} in sh(1). Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Wed Oct 7 21:14:45 2009 (r197847) +++ head/bin/sh/sh.1 Wed Oct 7 22:21:53 2009 (r197848) @@ -1227,6 +1227,9 @@ In all cases, the final value of .Ar parameter is substituted. +Quoting inside +.Ar word +does not prevent field splitting or pathname expansion. Only variables, not positional parameters or special parameters, can be assigned in this way. From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 23:01: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 F0EDB106568D; Wed, 7 Oct 2009 23:01:31 +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 DFAE68FC34; Wed, 7 Oct 2009 23:01: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 n97N1VOV002075; Wed, 7 Oct 2009 23:01:31 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97N1VI6002073; Wed, 7 Oct 2009 23:01:31 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200910072301.n97N1VI6002073@svn.freebsd.org> From: Xin LI Date: Wed, 7 Oct 2009 23:01: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: r197849 - head/tools/regression/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 23:01:32 -0000 Author: delphij Date: Wed Oct 7 23:01:31 2009 New Revision: 197849 URL: http://svn.freebsd.org/changeset/base/197849 Log: Fix build on amd64. PR: misc/139409 Submitted by: gk Modified: head/tools/regression/tmpfs/h_tools.c Modified: head/tools/regression/tmpfs/h_tools.c ============================================================================== --- head/tools/regression/tmpfs/h_tools.c Wed Oct 7 22:21:53 2009 (r197848) +++ head/tools/regression/tmpfs/h_tools.c Wed Oct 7 23:01:31 2009 (r197849) @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -250,10 +251,10 @@ statvfs_main(int argc, char **argv) return EXIT_FAILURE; } - (void)printf("f_bsize=%llu\n", buf.f_bsize); - (void)printf("f_blocks=%llu\n", buf.f_blocks); - (void)printf("f_bfree=%llu\n", buf.f_bfree); - (void)printf("f_files=%llu\n", buf.f_files); + (void)printf("f_bsize=%ju\n", (uintmax_t)buf.f_bsize); + (void)printf("f_blocks=%ju\n", (uintmax_t)buf.f_blocks); + (void)printf("f_bfree=%ju\n", (uintmax_t)buf.f_bfree); + (void)printf("f_files=%ju\n", (uintmax_t)buf.f_files); return EXIT_SUCCESS; } From owner-svn-src-all@FreeBSD.ORG Wed Oct 7 23:17: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 0E27A106566B; Wed, 7 Oct 2009 23:17:16 +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 F092A8FC19; Wed, 7 Oct 2009 23: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 n97NHFpS002395; Wed, 7 Oct 2009 23:17:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97NHFKL002393; Wed, 7 Oct 2009 23:17:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200910072317.n97NHFKL002393@svn.freebsd.org> From: Xin LI Date: Wed, 7 Oct 2009 23:17: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: r197850 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 07 Oct 2009 23:17:16 -0000 Author: delphij Date: Wed Oct 7 23:17:15 2009 New Revision: 197850 URL: http://svn.freebsd.org/changeset/base/197850 Log: Add a special workaround to handle UIO_NOCOPY case. This fixes data corruption observed when sendfile() is being used. PR: kern/127213 Submitted by: gk MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Oct 7 23:01:31 2009 (r197849) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Oct 7 23:17:15 2009 (r197850) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -428,15 +430,72 @@ tmpfs_setattr(struct vop_setattr_args *v } /* --------------------------------------------------------------------- */ +static int +tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, + vm_offset_t offset, size_t tlen, struct uio *uio) +{ + vm_page_t m; + int error; + + VM_OBJECT_LOCK(tobj); + vm_object_pip_add(tobj, 1); + m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | + VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); + if (m->valid != VM_PAGE_BITS_ALL) { + if (vm_pager_has_page(tobj, idx, NULL, NULL)) { + error = vm_pager_get_pages(tobj, &m, 1, 0); + if (error != 0) { + printf("tmpfs get pages from pager error [read]\n"); + goto out; + } + } else + vm_page_zero_invalid(m, TRUE); + } + VM_OBJECT_UNLOCK(tobj); + error = uiomove_fromphys(&m, offset, tlen, uio); + VM_OBJECT_LOCK(tobj); +out: + vm_page_lock_queues(); + vm_page_unwire(m, TRUE); + vm_page_unlock_queues(); + vm_page_wakeup(m); + vm_object_pip_subtract(tobj, 1); + VM_OBJECT_UNLOCK(tobj); + + return (error); +} + +static __inline int +tmpfs_nocacheread_buf(vm_object_t tobj, vm_pindex_t idx, + vm_offset_t offset, size_t tlen, void *buf) +{ + struct uio uio; + struct iovec iov; + + uio.uio_iovcnt = 1; + uio.uio_iov = &iov; + iov.iov_base = buf; + iov.iov_len = tlen; + + uio.uio_offset = 0; + uio.uio_resid = tlen; + uio.uio_rw = UIO_READ; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_td = curthread; + + return (tmpfs_nocacheread(tobj, idx, offset, tlen, &uio)); +} static int tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) { + struct sf_buf *sf; vm_pindex_t idx; vm_page_t m; vm_offset_t offset; off_t addr; size_t tlen; + char *ma; int error; addr = uio->uio_offset; @@ -461,33 +520,30 @@ lookupvpg: vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); return (error); + } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + if (vm_page_sleep_if_busy(m, FALSE, "tmfsmr")) + goto lookupvpg; + vm_page_busy(m); + VM_OBJECT_UNLOCK(vobj); + sched_pin(); + sf = sf_buf_alloc(m, SFB_CPUPRIVATE); + ma = (char *)sf_buf_kva(sf); + error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen, + ma + offset); + if (error == 0) { + uio->uio_offset += tlen; + uio->uio_resid -= tlen; + } + sf_buf_free(sf); + sched_unpin(); + VM_OBJECT_LOCK(vobj); + vm_page_wakeup(m); + VM_OBJECT_UNLOCK(vobj); + return (error); } VM_OBJECT_UNLOCK(vobj); nocache: - VM_OBJECT_LOCK(tobj); - vm_object_pip_add(tobj, 1); - m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | - VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - if (m->valid != VM_PAGE_BITS_ALL) { - if (vm_pager_has_page(tobj, idx, NULL, NULL)) { - error = vm_pager_get_pages(tobj, &m, 1, 0); - if (error != 0) { - printf("tmpfs get pages from pager error [read]\n"); - goto out; - } - } else - vm_page_zero_invalid(m, TRUE); - } - VM_OBJECT_UNLOCK(tobj); - error = uiomove_fromphys(&m, offset, tlen, uio); - VM_OBJECT_LOCK(tobj); -out: - vm_page_lock_queues(); - vm_page_unwire(m, TRUE); - vm_page_unlock_queues(); - vm_page_wakeup(m); - vm_object_pip_subtract(tobj, 1); - VM_OBJECT_UNLOCK(tobj); + error = tmpfs_nocacheread(tobj, idx, offset, tlen, uio); return (error); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 09:03: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 20D8D106566B; Thu, 8 Oct 2009 09:03:05 +0000 (UTC) (envelope-from snb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC7F8FC19; Thu, 8 Oct 2009 09:03: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 n989345h017464; Thu, 8 Oct 2009 09:03:04 GMT (envelope-from snb@svn.freebsd.org) Received: (from snb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98934BO017462; Thu, 8 Oct 2009 09:03:04 GMT (envelope-from snb@svn.freebsd.org) Message-Id: <200910080903.n98934BO017462@svn.freebsd.org> From: Sean Nicholas Barkas Date: Thu, 8 Oct 2009 09:03:04 +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: r197852 - in stable/7/sys: . ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 09:03:05 -0000 Author: snb Date: Thu Oct 8 09:03:04 2009 New Revision: 197852 URL: http://svn.freebsd.org/changeset/base/197852 Log: MFC r193375, r194387, r195003: Add vm_lowmem event handler for dirhash. This will cause dirhashes to be deleted when the system is low on memory. This ought to allow an increase to vfs.ufs.dirhash_maxmem on machines that have lots of memory, without degrading performance by having too much memory reserved for dirhash when other things need it. The default value for dirhash_maxmem is being kept at 2MB for now, though. Approved by: dwmalone (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/ufs/ufs/dirhash.h stable/7/sys/ufs/ufs/ufs_dirhash.c Modified: stable/7/sys/ufs/ufs/dirhash.h ============================================================================== --- stable/7/sys/ufs/ufs/dirhash.h Thu Oct 8 00:22:42 2009 (r197851) +++ stable/7/sys/ufs/ufs/dirhash.h Thu Oct 8 09:03:04 2009 (r197852) @@ -105,6 +105,8 @@ struct dirhash { int dh_onlist; /* true if on the ufsdirhash_list chain */ + time_t dh_lastused; /* time the dirhash was last read or written*/ + /* Protected by ufsdirhash_mtx. */ TAILQ_ENTRY(dirhash) dh_list; /* chain of all dirhashes */ }; Modified: stable/7/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_dirhash.c Thu Oct 8 00:22:42 2009 (r197851) +++ stable/7/sys/ufs/ufs/ufs_dirhash.c Thu Oct 8 09:03:04 2009 (r197852) @@ -49,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -81,6 +83,13 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_m static int ufs_dirhashcheck = 0; SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_docheck, CTLFLAG_RW, &ufs_dirhashcheck, 0, "enable extra sanity tests"); +static int ufs_dirhashlowmemcount = 0; +SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_lowmemcount, CTLFLAG_RD, + &ufs_dirhashlowmemcount, 0, "number of times low memory hook called"); +static int ufs_dirhashreclaimage = 5; +SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_reclaimage, CTLFLAG_RW, + &ufs_dirhashreclaimage, 0, + "max time in seconds of hash inactivity before deletion in low VM events"); static int ufsdirhash_hash(struct dirhash *dh, char *name, int namelen); @@ -90,6 +99,7 @@ static int ufsdirhash_findslot(struct di doff_t offset); static doff_t ufsdirhash_getprev(struct direct *dp, doff_t offset); static int ufsdirhash_recycle(int wanted); +static void ufsdirhash_lowmem(void); static void ufsdirhash_free_locked(struct inode *ip); static uma_zone_t ufsdirhash_zone; @@ -387,6 +397,7 @@ ufsdirhash_build(struct inode *ip) dh->dh_seqopt = 0; dh->dh_seqoff = 0; dh->dh_score = DH_SCOREINIT; + dh->dh_lastused = time_second; /* * Use non-blocking mallocs so that we will revert to a linear @@ -563,6 +574,9 @@ ufsdirhash_lookup(struct inode *ip, char /* Update the score. */ if (dh->dh_score < DH_SCOREMAX) dh->dh_score++; + + /* Update last used time. */ + dh->dh_lastused = time_second; DIRHASHLIST_UNLOCK(); vp = ip->i_vnode; @@ -805,6 +819,9 @@ ufsdirhash_add(struct inode *ip, struct dh->dh_hused++; DH_ENTRY(dh, slot) = offset; + /* Update last used time. */ + dh->dh_lastused = time_second; + /* Update the per-block summary info. */ ufsdirhash_adjfree(dh, offset, -DIRSIZ(0, dirp)); ufsdirhash_release(dh); @@ -1144,6 +1161,44 @@ ufsdirhash_getprev(struct direct *dirp, } /* + * Delete the given dirhash and reclaim its memory. Assumes that + * ufsdirhash_list is locked, and leaves it locked. Also assumes + * that dh is locked. Returns the amount of memory freed. + */ +static int +ufsdirhash_destroy(struct dirhash *dh) +{ + doff_t **hash; + u_int8_t *blkfree; + int i, mem, narrays; + + KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); + + /* Remove it from the list and detach its memory. */ + TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); + dh->dh_onlist = 0; + hash = dh->dh_hash; + dh->dh_hash = NULL; + blkfree = dh->dh_blkfree; + dh->dh_blkfree = NULL; + narrays = dh->dh_narrays; + mem = dh->dh_memreq; + dh->dh_memreq = 0; + + /* Unlock dirhash and free the detached memory. */ + ufsdirhash_release(dh); + for (i = 0; i < narrays; i++) + DIRHASH_BLKFREE(hash[i]); + free(hash, M_DIRHASH); + free(blkfree, M_DIRHASH); + + /* Account for the returned memory. */ + ufs_dirhashmem -= mem; + + return (mem); +} + +/* * Try to free up `wanted' bytes by stealing memory from existing * dirhashes. Returns zero with list locked if successful. */ @@ -1151,9 +1206,6 @@ static int ufsdirhash_recycle(int wanted) { struct dirhash *dh; - doff_t **hash; - u_int8_t *blkfree; - int i, mem, narrays; DIRHASHLIST_LOCK(); dh = TAILQ_FIRST(&ufsdirhash_list); @@ -1171,36 +1223,61 @@ ufsdirhash_recycle(int wanted) dh = TAILQ_NEXT(dh, dh_list); continue; } - KASSERT(dh->dh_hash != NULL, ("dirhash: NULL hash on list")); - /* Remove it from the list and detach its memory. */ - TAILQ_REMOVE(&ufsdirhash_list, dh, dh_list); - dh->dh_onlist = 0; - hash = dh->dh_hash; - dh->dh_hash = NULL; - blkfree = dh->dh_blkfree; - dh->dh_blkfree = NULL; - narrays = dh->dh_narrays; - mem = dh->dh_memreq; - dh->dh_memreq = 0; + ufsdirhash_destroy(dh); - /* Unlock everything, free the detached memory. */ - ufsdirhash_release(dh); - DIRHASHLIST_UNLOCK(); - for (i = 0; i < narrays; i++) - DIRHASH_BLKFREE(hash[i]); - FREE(hash, M_DIRHASH); - FREE(blkfree, M_DIRHASH); - - /* Account for the returned memory, and repeat if necessary. */ - DIRHASHLIST_LOCK(); - ufs_dirhashmem -= mem; + /* Repeat if necessary. */ dh = TAILQ_FIRST(&ufsdirhash_list); } /* Success; return with list locked. */ return (0); } +/* + * Callback that frees some dirhashes when the system is low on virtual memory. + */ +static void +ufsdirhash_lowmem() +{ + struct dirhash *dh, *dh_temp; + int memfreed = 0; + /* XXX: this 10% may need to be adjusted */ + int memwanted = ufs_dirhashmem / 10; + + ufs_dirhashlowmemcount++; + + DIRHASHLIST_LOCK(); + /* + * Delete dirhashes not used for more than ufs_dirhashreclaimage + * seconds. If we can't get a lock on the dirhash, it will be skipped. + */ + TAILQ_FOREACH_SAFE(dh, &ufsdirhash_list, dh_list, dh_temp) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + if (time_second - dh->dh_lastused > ufs_dirhashreclaimage) + memfreed += ufsdirhash_destroy(dh); + /* Unlock if we didn't delete the dirhash */ + else + ufsdirhash_release(dh); + } + + /* + * If not enough memory was freed, keep deleting hashes from the head + * of the dirhash list. The ones closest to the head should be the + * oldest. + */ + if (memfreed < memwanted) { + TAILQ_FOREACH_SAFE(dh, &ufsdirhash_list, dh_list, dh_temp) { + if (!sx_try_xlock(&dh->dh_lock)) + continue; + memfreed += ufsdirhash_destroy(dh); + if (memfreed >= memwanted) + break; + } + } + DIRHASHLIST_UNLOCK(); +} + void ufsdirhash_init() @@ -1209,6 +1286,10 @@ ufsdirhash_init() NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&ufsdirhash_mtx, "dirhash list", NULL, MTX_DEF); TAILQ_INIT(&ufsdirhash_list); + + /* Register a callback function to handle low memory signals */ + EVENTHANDLER_REGISTER(vm_lowmem, ufsdirhash_lowmem, NULL, + EVENTHANDLER_PRI_FIRST); } void From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 10:26: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 761A91065676; Thu, 8 Oct 2009 10:26: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 65D848FC13; Thu, 8 Oct 2009 10:26:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n98AQoZO019145; Thu, 8 Oct 2009 10:26:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98AQoEM019144; Thu, 8 Oct 2009 10:26:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200910081026.n98AQoEM019144@svn.freebsd.org> From: Ed Schouten Date: Thu, 8 Oct 2009 10:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197853 - head/sys/teken X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 08 Oct 2009 10:26:50 -0000 Author: ed Date: Thu Oct 8 10:26:49 2009 New Revision: 197853 URL: http://svn.freebsd.org/changeset/base/197853 Log: Discard Device Control Strings and Operating System Commands. These strings often contain things like: - Window titles. - Extended key map functionality. - Color palette switching. We could look at these features in the future (if people consider them to be important enough), but we'd better discard them now. This fixes some artifacts people reported when using TERM=xterm. Reported by: des@, Paul B. Mahol Modified: head/sys/teken/sequences head/sys/teken/teken.c head/sys/teken/teken_subr.h Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Thu Oct 8 09:03:04 2009 (r197852) +++ head/sys/teken/sequences Thu Oct 8 10:26:49 2009 (r197853) @@ -88,6 +88,7 @@ ICH Insert character ^[ [ @ n IL Insert line ^[ [ L n IND Index ^[ D NEL Next line ^[ E +OSC Operating System Command ^[ ] RI Reverse index ^[ M RIS Reset to Initial State ^[ c RM Reset Mode ^[ [ l r Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Thu Oct 8 09:03:04 2009 (r197852) +++ head/sys/teken/teken.c Thu Oct 8 10:26:49 2009 (r197853) @@ -56,6 +56,7 @@ static FILE *df; #define TS_WRAPPED 0x10 /* Next character should be printed on col 0. */ #define TS_8BIT 0x20 /* UTF-8 disabled. */ #define TS_CONS25 0x40 /* cons25 emulation. */ +#define TS_INSTRING 0x80 /* Inside string. */ /* Character that blanks a cell. */ #define BLANK ' ' @@ -176,6 +177,24 @@ static void teken_input_char(teken_t *t, teken_char_t c) { + /* + * There is no support for DCS and OSC. Just discard strings + * until we receive characters that may indicate string + * termination. + */ + if (t->t_stateflags & TS_INSTRING) { + switch (c) { + case '\x1B': + t->t_stateflags &= ~TS_INSTRING; + break; + case '\a': + t->t_stateflags &= ~TS_INSTRING; + return; + default: + return; + } + } + switch (c) { case '\0': break; Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Thu Oct 8 09:03:04 2009 (r197852) +++ head/sys/teken/teken_subr.h Thu Oct 8 10:26:49 2009 (r197853) @@ -425,10 +425,11 @@ teken_subr_delete_line(teken_t *t, unsig } static void -teken_subr_device_control_string(teken_t *t __unused) +teken_subr_device_control_string(teken_t *t) { - teken_printf("device control string???\n"); + teken_printf("Unsupported device control string\n"); + t->t_stateflags |= TS_INSTRING; } static void @@ -744,6 +745,14 @@ teken_subr_next_line(teken_t *t) } static void +teken_subr_operating_system_command(teken_t *t) +{ + + teken_printf("Unsupported operating system command\n"); + t->t_stateflags |= TS_INSTRING; +} + +static void teken_subr_pan_down(teken_t *t, unsigned int nrows) { @@ -1258,7 +1267,10 @@ static void teken_subr_string_terminator(teken_t *t __unused) { - teken_printf("string terminator???\n"); + /* + * Strings are already terminated in teken_input_char() when ^[ + * is inserted. + */ } static void From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 11:07: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 E27E8106566B; Thu, 8 Oct 2009 11:07:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B60248FC08; Thu, 8 Oct 2009 11:07: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 n98B7FTE021079; Thu, 8 Oct 2009 11:07:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98B7FZ9021077; Thu, 8 Oct 2009 11:07:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910081107.n98B7FZ9021077@svn.freebsd.org> From: Robert Watson Date: Thu, 8 Oct 2009 11:07: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: r197854 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 11:07:16 -0000 Author: rwatson Date: Thu Oct 8 11:07:15 2009 New Revision: 197854 URL: http://svn.freebsd.org/changeset/base/197854 Log: Merge r197795 from head to stable/8: In tcp_input(), we acquire a global write lock at first only if a segment is likely to trigger a TCP state change (i.e., FIN/RST/SYN). If we later have to upgrade the lock, we acquire an inpcb reference and drop both global/inpcb locks before reacquiring in-order. In that gap, the connection may transition into TIMEWAIT, so we need to loop back and reevaluate the inpcb after relocking. Reported by: Kamigishi Rei Reviewed by: bz Approved by: re (kib) Modified: 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/sys/netinet/tcp_input.c Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Thu Oct 8 10:26:49 2009 (r197853) +++ stable/8/sys/netinet/tcp_input.c Thu Oct 8 11:07:15 2009 (r197854) @@ -648,6 +648,7 @@ findpcb: * tried to free the inpcb, in which case we need to loop back and * try to find a new inpcb to deliver to. */ +relocked: if (inp->inp_flags & INP_TIMEWAIT) { KASSERT(ti_locked == TI_RLOCKED || ti_locked == TI_WLOCKED, ("%s: INP_TIMEWAIT ti_locked %d", __func__, ti_locked)); @@ -698,7 +699,8 @@ findpcb: * We've identified a valid inpcb, but it could be that we need an * inpcbinfo write lock and have only a read lock. In this case, * attempt to upgrade/relock using the same strategy as the TIMEWAIT - * case above. + * case above. If we relock, we have to jump back to 'relocked' as + * the connection might now be in TIMEWAIT. */ if (tp->t_state != TCPS_ESTABLISHED || (thflags & (TH_SYN | TH_FIN | TH_RST)) != 0 || @@ -720,6 +722,7 @@ findpcb: goto findpcb; } tcp_wlock_relocked++; + goto relocked; } else { ti_locked = TI_WLOCKED; tcp_wlock_upgraded++; From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 11:28: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 687C8106566B; Thu, 8 Oct 2009 11:28:33 +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 55C008FC17; Thu, 8 Oct 2009 11:28: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 n98BSXio021502; Thu, 8 Oct 2009 11:28:33 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98BSWCd021500; Thu, 8 Oct 2009 11:28:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910081128.n98BSWCd021500@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Oct 2009 11:28: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: r197855 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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, 08 Oct 2009 11:28:33 -0000 Author: kib Date: Thu Oct 8 11:28:32 2009 New Revision: 197855 URL: http://svn.freebsd.org/changeset/base/197855 Log: MFC r197662: Do not dereference vp->v_mount without holding vnode lock and checking that the vnode is not reclaimed. Approved by: re (bz) Modified: 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/sys/kern/uipc_syscalls.c Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Thu Oct 8 11:07:15 2009 (r197854) +++ stable/8/sys/kern/uipc_syscalls.c Thu Oct 8 11:28:32 2009 (r197855) @@ -2085,9 +2085,11 @@ retry_space: /* * Get the page from backing store. */ - bsize = vp->v_mount->mnt_stat.f_iosize; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_SHARED | LK_RETRY); + error = vn_lock(vp, LK_SHARED); + if (error != 0) + goto after_read; + bsize = vp->v_mount->mnt_stat.f_iosize; /* * XXXMAC: Because we don't have fp->f_cred @@ -2100,6 +2102,7 @@ retry_space: IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); VOP_UNLOCK(vp, 0); + after_read: VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(obj); vm_page_io_finish(pg); From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 11:36: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 85D751065676; Thu, 8 Oct 2009 11:36:06 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BCEE8FC13; Thu, 8 Oct 2009 11:36: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 n98Ba6HJ021727; Thu, 8 Oct 2009 11:36:06 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98Ba63d021725; Thu, 8 Oct 2009 11:36:06 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200910081136.n98Ba63d021725@svn.freebsd.org> From: Randall Stewart Date: Thu, 8 Oct 2009 11:36: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: r197856 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 11:36:06 -0000 Author: rrs Date: Thu Oct 8 11:36:06 2009 New Revision: 197856 URL: http://svn.freebsd.org/changeset/base/197856 Log: Fix so that round robing stream scheduling works as advertised MFC after: 0 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Oct 8 11:28:32 2009 (r197855) +++ head/sys/netinet/sctp_output.c Thu Oct 8 11:36:06 2009 (r197856) @@ -5602,8 +5602,6 @@ sctp_insert_on_wheel(struct sctp_tcb *st struct sctp_association *asoc, struct sctp_stream_out *strq, int holds_lock) { - struct sctp_stream_out *stre, *strn; - if (holds_lock == 0) { SCTP_TCB_SEND_LOCK(stcb); } @@ -5612,26 +5610,7 @@ sctp_insert_on_wheel(struct sctp_tcb *st /* already on wheel */ goto outof_here; } - stre = TAILQ_FIRST(&asoc->out_wheel); - if (stre == NULL) { - /* only one on wheel */ - TAILQ_INSERT_HEAD(&asoc->out_wheel, strq, next_spoke); - goto outof_here; - } - for (; stre; stre = strn) { - strn = TAILQ_NEXT(stre, next_spoke); - if (stre->stream_no > strq->stream_no) { - TAILQ_INSERT_BEFORE(stre, strq, next_spoke); - goto outof_here; - } else if (stre->stream_no == strq->stream_no) { - /* huh, should not happen */ - goto outof_here; - } else if (strn == NULL) { - /* next one is null */ - TAILQ_INSERT_AFTER(&asoc->out_wheel, stre, strq, - next_spoke); - } - } + TAILQ_INSERT_TAIL(&asoc->out_wheel, strq, next_spoke); outof_here: if (holds_lock == 0) { SCTP_TCB_SEND_UNLOCK(stcb); @@ -7202,8 +7181,6 @@ done_it: if (strq == NULL) { strq = asoc->last_out_stream = TAILQ_FIRST(&asoc->out_wheel); } - /* Save off the last stream */ - asoc->last_out_stream = strq; return (strq); } @@ -7280,7 +7257,9 @@ sctp_fill_outqueue(struct sctp_tcb *stcb bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, net, strq, goal_mtu, frag_point, &locked, &giveup, eeor_mode, &bail); - asoc->last_out_stream = strq; + if (moved_how_much) + asoc->last_out_stream = strq; + if (locked) { asoc->locked_on_sending = strq; if ((moved_how_much == 0) || (giveup) || bail) From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 11:42: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 AD7E51065672; Thu, 8 Oct 2009 11:42:24 +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 9BF8B8FC1E; Thu, 8 Oct 2009 11:42: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 n98BgOPS021908; Thu, 8 Oct 2009 11:42:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98BgOGp021906; Thu, 8 Oct 2009 11:42:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910081142.n98BgOGp021906@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 8 Oct 2009 11:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197857 - in stable/7/sys: . contrib/pf 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, 08 Oct 2009 11:42:24 -0000 Author: kib Date: Thu Oct 8 11:42:24 2009 New Revision: 197857 URL: http://svn.freebsd.org/changeset/base/197857 Log: MFC r197662: Do not dereference vp->v_mount without holding vnode lock and checking that the vnode is not reclaimed. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/uipc_syscalls.c Modified: stable/7/sys/kern/uipc_syscalls.c ============================================================================== --- stable/7/sys/kern/uipc_syscalls.c Thu Oct 8 11:36:06 2009 (r197856) +++ stable/7/sys/kern/uipc_syscalls.c Thu Oct 8 11:42:24 2009 (r197857) @@ -2076,9 +2076,11 @@ retry_space: /* * Get the page from backing store. */ - bsize = vp->v_mount->mnt_stat.f_iosize; vfslocked = VFS_LOCK_GIANT(vp->v_mount); - vn_lock(vp, LK_SHARED | LK_RETRY, td); + error = vn_lock(vp, LK_SHARED, td); + if (error != 0) + goto after_read; + bsize = vp->v_mount->mnt_stat.f_iosize; /* * XXXMAC: Because we don't have fp->f_cred @@ -2091,6 +2093,7 @@ retry_space: IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), td->td_ucred, NOCRED, &resid, td); VOP_UNLOCK(vp, 0, td); + after_read: VFS_UNLOCK_GIANT(vfslocked); VM_OBJECT_LOCK(obj); vm_page_io_finish(pg); From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 15:34: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 BABA71065698; Thu, 8 Oct 2009 15:34:01 +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 A8C398FC25; Thu, 8 Oct 2009 15:34: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 n98FY1JS026336; Thu, 8 Oct 2009 15:34:01 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98FY185026334; Thu, 8 Oct 2009 15:34:01 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200910081534.n98FY185026334@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 8 Oct 2009 15:34: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: r197859 - head/cddl/contrib/opensolaris/lib/libzfs/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: Thu, 08 Oct 2009 15:34:01 -0000 Author: trasz Date: Thu Oct 8 15:34:01 2009 New Revision: 197859 URL: http://svn.freebsd.org/changeset/base/197859 Log: 'aclmode' and 'aclinherit' properties should work as advertised; don't refuse to set them. Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Oct 8 13:57:51 2009 (r197858) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Oct 8 15:34:01 2009 (r197859) @@ -1792,8 +1792,6 @@ zfs_prop_set(zfs_handle_t *zhp, const ch switch (prop) { case ZFS_PROP_SHAREISCSI: case ZFS_PROP_DEVICES: - case ZFS_PROP_ACLMODE: - case ZFS_PROP_ACLINHERIT: case ZFS_PROP_ISCSIOPTIONS: (void) snprintf(errbuf, sizeof (errbuf), "property '%s' not supported on FreeBSD", propname); From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 16: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 4C598106566B; Thu, 8 Oct 2009 16:03:20 +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 3ABE88FC14; Thu, 8 Oct 2009 16: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 n98G3KfR026928; Thu, 8 Oct 2009 16:03:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98G3KxV026926; Thu, 8 Oct 2009 16:03:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910081603.n98G3KxV026926@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 8 Oct 2009 16:03: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: r197860 - head/sys/cddl/compat/opensolaris/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, 08 Oct 2009 16:03:20 -0000 Author: pjd Date: Thu Oct 8 16:03:19 2009 New Revision: 197860 URL: http://svn.freebsd.org/changeset/base/197860 Log: File system owner is when uid matches and jail matches. MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Oct 8 15:34:01 2009 (r197859) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Oct 8 16:03:19 2009 (r197860) @@ -78,12 +78,11 @@ secpolicy_fs_owner(struct mount *mp, str if (zfs_super_owner) { if (cred->cr_uid == mp->mnt_cred->cr_uid && - (!jailed(cred) || - cred->cr_prison == mp->mnt_cred->cr_prison)) { + cred->cr_prison == mp->mnt_cred->cr_prison) { return (0); } } - return (priv_check_cred(cred, PRIV_VFS_MOUNT_OWNER, 0)); + return (EPERM); } /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 16:05: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 A9E2C1065672; Thu, 8 Oct 2009 16:05:17 +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 96E108FC08; Thu, 8 Oct 2009 16:05: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 n98G5HqG027005; Thu, 8 Oct 2009 16:05:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98G5HJY027001; Thu, 8 Oct 2009 16:05:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910081605.n98G5HJY027001@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 8 Oct 2009 16:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197861 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys 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: Thu, 08 Oct 2009 16:05:17 -0000 Author: pjd Date: Thu Oct 8 16:05:17 2009 New Revision: 197861 URL: http://svn.freebsd.org/changeset/base/197861 Log: Allow file system owner to modify system flags if securelevel permits. MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c head/sys/cddl/compat/opensolaris/sys/policy.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Oct 8 16:03:19 2009 (r197860) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Oct 8 16:05:17 2009 (r197861) @@ -358,8 +358,11 @@ secpolicy_fs_mount_clearopts(cred_t *cr, * Check privileges for setting xvattr attributes */ int -secpolicy_xvattr(xvattr_t *xvap, uid_t owner, cred_t *cr, vtype_t vtype) +secpolicy_xvattr(struct vnode *vp, xvattr_t *xvap, uid_t owner, cred_t *cr, + vtype_t vtype) { + if (secpolicy_fs_owner(vp->v_mount, cr) == 0) + return (0); return (priv_check_cred(cr, PRIV_VFS_SYSFLAGS, 0)); } Modified: head/sys/cddl/compat/opensolaris/sys/policy.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/policy.h Thu Oct 8 16:03:19 2009 (r197860) +++ head/sys/cddl/compat/opensolaris/sys/policy.h Thu Oct 8 16:05:17 2009 (r197861) @@ -70,7 +70,8 @@ int secpolicy_setid_setsticky_clear(stru int secpolicy_fs_owner(struct mount *vfsp, struct ucred *cred); int secpolicy_fs_mount(cred_t *cr, vnode_t *mvp, struct mount *vfsp); void secpolicy_fs_mount_clearopts(cred_t *cr, struct mount *vfsp); -int secpolicy_xvattr(xvattr_t *xvap, uid_t owner, cred_t *cr, vtype_t vtype); +int secpolicy_xvattr(struct vnode *vp, xvattr_t *xvap, uid_t owner, + cred_t *cr, vtype_t vtype); #endif /* _KERNEL */ 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 Thu Oct 8 16:03:19 2009 (r197860) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Oct 8 16:05:17 2009 (r197861) @@ -1306,7 +1306,7 @@ zfs_create(vnode_t *dvp, char *name, vat } if (vap->va_mask & AT_XVATTR) { - if ((error = secpolicy_xvattr((xvattr_t *)vap, + if ((error = secpolicy_xvattr(dvp, (xvattr_t *)vap, crgetuid(cr), cr, vap->va_type)) != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -1758,7 +1758,7 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v zf |= ZCILOOK; if (vap->va_mask & AT_XVATTR) - if ((error = secpolicy_xvattr((xvattr_t *)vap, + if ((error = secpolicy_xvattr(dvp, (xvattr_t *)vap, crgetuid(cr), cr, vap->va_type)) != 0) { ZFS_EXIT(zfsvfs); return (error); @@ -4206,12 +4206,6 @@ zfs_freebsd_setattr(ap) if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_NODUMP)) != 0) return (EOPNOTSUPP); /* - * Callers may only modify the file flags on objects they - * have VADMIN rights for. - */ - if ((error = VOP_ACCESS(vp, VADMIN, cred, curthread)) != 0) - return (error); - /* * Unprivileged processes are not permitted to unset system * flags, or modify flags if any system flags are set. * Privileged non-jail processes may not modify system flags @@ -4221,14 +4215,21 @@ zfs_freebsd_setattr(ap) * is non-zero; otherwise, they behave like unprivileged * processes. */ - if (priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0) == 0) { + if (secpolicy_fs_owner(vp->v_mount, cred) == 0 || + priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0) == 0) { if (zflags & (ZFS_IMMUTABLE | ZFS_APPENDONLY | ZFS_NOUNLINK)) { error = securelevel_gt(cred, 0); - if (error) + if (error != 0) return (error); } } else { + /* + * Callers may only modify the file flags on objects they + * have VADMIN rights for. + */ + if ((error = VOP_ACCESS(vp, VADMIN, cred, curthread)) != 0) + return (error); if (zflags & (ZFS_IMMUTABLE | ZFS_APPENDONLY | ZFS_NOUNLINK)) { return (EPERM); From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 17: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 7AA7F106566B; Thu, 8 Oct 2009 17:11:02 +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 68D738FC14; Thu, 8 Oct 2009 17: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 n98HB2x6028250; Thu, 8 Oct 2009 17:11:02 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98HB2eV028248; Thu, 8 Oct 2009 17:11:02 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200910081711.n98HB2eV028248@svn.freebsd.org> From: Stefan Farfeleder Date: Thu, 8 Oct 2009 17:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197862 - stable/7/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 17:11:02 -0000 Author: stefanf Date: Thu Oct 8 17:11:01 2009 New Revision: 197862 URL: http://svn.freebsd.org/changeset/base/197862 Log: Merge r191009. > Parse 'cmd1 && ! cmd2 | cmd3' correctly, the bang should apply to the entire > pipeline cmd2 | cmd3 and not just cmd2. Modified: stable/7/bin/sh/ (props changed) stable/7/bin/sh/parser.c Modified: stable/7/bin/sh/parser.c ============================================================================== --- stable/7/bin/sh/parser.c Thu Oct 8 16:05:17 2009 (r197861) +++ stable/7/bin/sh/parser.c Thu Oct 8 17:11:01 2009 (r197862) @@ -250,6 +250,7 @@ pipeline(void) int negate; negate = 0; + checkkwd = 2; TRACE(("pipeline: entered\n")); while (readtoken() == TNOT) negate = !negate; From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 17:41: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 F1E2A10656A5; Thu, 8 Oct 2009 17:41:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E04988FC15; Thu, 8 Oct 2009 17:41: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 n98HfrrR028815; Thu, 8 Oct 2009 17:41:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98HfrI3028811; Thu, 8 Oct 2009 17:41:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200910081741.n98HfrI3028811@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 8 Oct 2009 17:41: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: r197863 - head/sys/amd64/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: Thu, 08 Oct 2009 17:41:54 -0000 Author: jkim Date: Thu Oct 8 17:41:53 2009 New Revision: 197863 URL: http://svn.freebsd.org/changeset/base/197863 Log: Clean up amd64 suspend/resume code. - Allocate memory for wakeup code after ACPI bus is attached. The early memory allocation hack was inherited from i386 but amd64 does not need it. - Exclude real mode IVT and BDA explicitly. Improve comments about memory allocation and reason for the exclusions. It is a no-op in reality, though. - Remove an unnecessary CLD from wakeup code and re-align. Modified: head/sys/amd64/acpica/acpi_machdep.c head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_machdep.c ============================================================================== --- head/sys/amd64/acpica/acpi_machdep.c Thu Oct 8 17:11:01 2009 (r197862) +++ head/sys/amd64/acpica/acpi_machdep.c Thu Oct 8 17:41:53 2009 (r197863) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include @@ -511,7 +512,6 @@ acpi_machdep_init(device_t dev) sc->acpi_clone = apm_create_clone(sc->acpi_dev_t, sc); clone_setup(&apm_clones); EVENTHANDLER_REGISTER(dev_clone, apm_clone, 0, 1000); - acpi_install_wakeup_handler(sc); if (intr_model != ACPI_INTR_PIC) acpi_SetIntrModel(intr_model); @@ -801,13 +801,20 @@ nexus_acpi_probe(device_t dev) static int nexus_acpi_attach(device_t dev) { + device_t acpi_dev; + int error; nexus_init_resources(); bus_generic_probe(dev); - if (BUS_ADD_CHILD(dev, 10, "acpi", 0) == NULL) + acpi_dev = BUS_ADD_CHILD(dev, 10, "acpi", 0); + if (acpi_dev == NULL) panic("failed to add acpi0 device"); - return (bus_generic_attach(dev)); + error = bus_generic_attach(dev); + if (error == 0) + acpi_install_wakeup_handler(device_get_softc(acpi_dev)); + + return (error); } static device_method_t nexus_acpi_methods[] = { Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Thu Oct 8 17:11:01 2009 (r197862) +++ head/sys/amd64/acpica/acpi_wakecode.S Thu Oct 8 17:41:53 2009 (r197863) @@ -54,18 +54,17 @@ .data /* So we can modify it */ ALIGN_TEXT -wakeup_start: .code16 +wakeup_start: /* * Set up segment registers for real mode, a small stack for * any calls we make, and clear any flags. */ cli /* make sure no interrupts */ - cld mov %cs, %ax /* copy %cs to %ds. Remember these */ mov %ax, %ds /* are offsets rather than selectors */ mov %ax, %ss - movw $PAGE_SIZE - 8, %sp + movw $PAGE_SIZE, %sp xorw %ax, %ax pushw %ax popfw @@ -129,6 +128,7 @@ wakeup_sw32: /* * At this point, we are running in 32 bit legacy protected mode. */ + ALIGN_TEXT .code32 wakeup_32: Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Thu Oct 8 17:11:01 2009 (r197862) +++ head/sys/amd64/acpica/acpi_wakeup.c Thu Oct 8 17:41:53 2009 (r197863) @@ -31,13 +31,11 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include #include #include #include -#include #include #include @@ -46,11 +44,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef SMP #include #include +#include #endif #include @@ -63,10 +61,6 @@ __FBSDID("$FreeBSD$"); /* Make sure the code is less than a page and leave room for the stack. */ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); -#ifndef _SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite -#endif - extern int acpi_resume_beep; extern int acpi_reset_video; @@ -79,7 +73,7 @@ static struct xpcb *stopxpcbs; int acpi_restorecpu(struct xpcb *, vm_offset_t); int acpi_savecpu(struct xpcb *); -static void acpi_alloc_wakeup_handler(void); +static void *acpi_alloc_wakeup_handler(void); static void acpi_stop_beep(void *); #ifdef SMP @@ -322,49 +316,50 @@ out: return (ret); } -static vm_offset_t acpi_wakeaddr; - -static void +static void * acpi_alloc_wakeup_handler(void) { void *wakeaddr; - if (!cold) - return; - /* * Specify the region for our wakeup code. We want it in the low 1 MB - * region, excluding video memory and above (0xa0000). We ask for - * it to be page-aligned, just to be safe. + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), + * and ROM area (0xa0000 and above). The temporary page tables must be + * page-aligned. */ - wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0, 0x9ffff, - PAGE_SIZE, 0ul); + wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0x500, + 0xa0000, PAGE_SIZE, 0ul); if (wakeaddr == NULL) { printf("%s: can't alloc wake memory\n", __func__); - return; + return (NULL); } stopxpcbs = malloc(mp_ncpus * sizeof(*stopxpcbs), M_DEVBUF, M_NOWAIT); if (stopxpcbs == NULL) { contigfree(wakeaddr, 4 * PAGE_SIZE, M_DEVBUF); printf("%s: can't alloc CPU state memory\n", __func__); - return; + return (NULL); } - acpi_wakeaddr = (vm_offset_t)wakeaddr; -} -SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0); + return (wakeaddr); +} void acpi_install_wakeup_handler(struct acpi_softc *sc) { + static void *wakeaddr = NULL; uint64_t *pt4, *pt3, *pt2; int i; - if (acpi_wakeaddr == 0ul) + if (wakeaddr != NULL) + return; + + wakeaddr = acpi_alloc_wakeup_handler(); + if (wakeaddr == NULL) return; - sc->acpi_wakeaddr = acpi_wakeaddr; - sc->acpi_wakephys = vtophys(acpi_wakeaddr); + sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; + sc->acpi_wakephys = vtophys(wakeaddr); bcopy(wakecode, (void *)WAKECODE_VADDR(sc), sizeof(wakecode)); @@ -390,7 +385,7 @@ acpi_install_wakeup_handler(struct acpi_ WAKECODE_FIXUP(wakeup_sfmask, uint64_t, rdmsr(MSR_SF_MASK)); /* Build temporary page tables below realmode code. */ - pt4 = (uint64_t *)acpi_wakeaddr; + pt4 = wakeaddr; pt3 = pt4 + (PAGE_SIZE) / sizeof(uint64_t); pt2 = pt3 + (PAGE_SIZE) / sizeof(uint64_t); From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 18:22: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 BCB57106566B; Thu, 8 Oct 2009 18:22:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id 765BB8FC08; Thu, 8 Oct 2009 18:22:55 +0000 (UTC) Received: by bwz23 with SMTP id 23so96186bwz.43 for ; Thu, 08 Oct 2009 11:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=0bCq4dm42kF+tMdwhxedSJPQoqSRZcmKSMBlkCSEyvA=; b=LPR0q+N06pUQIQiO/r6m2/3VI37KtqxnVQUMcBICzFZh//GMbPgeKT421U9cxqNb7y ItBYhCh+dHRizXAxpWE5z/gK4fzwGD+O+9RGgy9iCuDUC/jbXhZACaKmUDkbkWQ/ji8a Ctjk0ufEZNjSqQERbNDR7m9d+9CmADWWAkjmk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=sHYAfuyyO5erX+bMYhCYVf6mVTN2alAfYuHUmZAc3PsTgt7Q/U4+pyYTleuqx8Omlt YXNNDJHWV3hgWLBL22saiLhOG0hhtaZ3EPyXYJ1vrBozl73fdFD0J166RUgpPseqvJD6 J7t0DZIwgpexJ/SQFD30aJQHRL7oMPTOglL4Y= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.18.137 with SMTP id w9mr489418faa.61.1255026174520; Thu, 08 Oct 2009 11:22:54 -0700 (PDT) In-Reply-To: <200910081741.n98HfrI3028811@svn.freebsd.org> References: <200910081741.n98HfrI3028811@svn.freebsd.org> Date: Thu, 8 Oct 2009 20:22:54 +0200 X-Google-Sender-Auth: af51b4e34bae30c4 Message-ID: <3bbf2fe10910081122t2e23d1cep44846da4a7035227@mail.gmail.com> From: Attilio Rao To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197863 - head/sys/amd64/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: Thu, 08 Oct 2009 18:22:57 -0000 2009/10/8 Jung-uk Kim : > Author: jkim > Date: Thu Oct 8 17:41:53 2009 > New Revision: 197863 > URL: http://svn.freebsd.org/changeset/base/197863 > > Log: > Clean up amd64 suspend/resume code. > @@ -322,49 +316,50 @@ out: > return (ret); > } > > -static vm_offset_t acpi_wakeaddr; > - > -static void > +static void * > acpi_alloc_wakeup_handler(void) > { > void *wakeaddr; > > - if (!cold) > - return; > - > /* > * Specify the region for our wakeup code. We want it in the low 1 MB > - * region, excluding video memory and above (0xa0000). We ask for > - * it to be page-aligned, just to be safe. > + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA > + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), > + * and ROM area (0xa0000 and above). The temporary page tables must be > + * page-aligned. > */ > - wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0, 0x9ffff, > - PAGE_SIZE, 0ul); > + wakeaddr = contigmalloc(4 * PAGE_SIZE, M_DEVBUF, M_NOWAIT, 0x500, > + 0xa0000, PAGE_SIZE, 0ul); > if (wakeaddr == NULL) { > printf("%s: can't alloc wake memory\n", __func__); > - return; > + return (NULL); > } > stopxpcbs = malloc(mp_ncpus * sizeof(*stopxpcbs), M_DEVBUF, M_NOWAIT); > if (stopxpcbs == NULL) { > contigfree(wakeaddr, 4 * PAGE_SIZE, M_DEVBUF); > printf("%s: can't alloc CPU state memory\n", __func__); > - return; > + return (NULL); > } > - acpi_wakeaddr = (vm_offset_t)wakeaddr; > -} > > -SYSINIT(acpiwakeup, SI_SUB_KMEM, SI_ORDER_ANY, acpi_alloc_wakeup_handler, 0); > + return (wakeaddr); > +} > > void > acpi_install_wakeup_handler(struct acpi_softc *sc) > { > + static void *wakeaddr = NULL; > uint64_t *pt4, *pt3, *pt2; > int i; Maybe it was better to have a non-reentrat function here? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 18:59:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D83261065676; Thu, 8 Oct 2009 18:59:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Attilio Rao Date: Thu, 8 Oct 2009 14:59:21 -0400 User-Agent: KMail/1.6.2 References: <200910081741.n98HfrI3028811@svn.freebsd.org> <3bbf2fe10910081122t2e23d1cep44846da4a7035227@mail.gmail.com> In-Reply-To: <3bbf2fe10910081122t2e23d1cep44846da4a7035227@mail.gmail.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200910081459.22441.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197863 - head/sys/amd64/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: Thu, 08 Oct 2009 18:59:31 -0000 2009/10/8 Jung-uk Kim : On Thursday 08 October 2009 02:22 pm, Attilio Rao wrote: > > void > > acpi_install_wakeup_handler(struct acpi_softc *sc) > > { > > + static void *wakeaddr = NULL; > > uint64_t *pt4, *pt3, *pt2; > > int i; > > Maybe it was better to have a non-reentrat function here? It won't re-enter here because we cannot detach ACPI bus ATM. It is just a safety belt for the distant(?) future. ;-) Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 19:45: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 D4C74106568D; Thu, 8 Oct 2009 19:45:37 +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 C3B848FC13; Thu, 8 Oct 2009 19:45: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 n98Jjbnk031266; Thu, 8 Oct 2009 19:45:37 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98Jjbrd031264; Thu, 8 Oct 2009 19:45:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200910081945.n98Jjbrd031264@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 8 Oct 2009 19:45: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: r197867 - head/cddl/contrib/opensolaris/lib/libzfs/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: Thu, 08 Oct 2009 19:45:37 -0000 Author: trasz Date: Thu Oct 8 19:45:37 2009 New Revision: 197867 URL: http://svn.freebsd.org/changeset/base/197867 Log: Properly mark ZFS properties which are not changeable under FreeBSD. Reviewed by: pjd Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Oct 8 18:55:12 2009 (r197866) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Oct 8 19:45:37 2009 (r197867) @@ -1790,9 +1790,14 @@ zfs_prop_set(zfs_handle_t *zhp, const ch /* We don't support those properties on FreeBSD. */ switch (prop) { - case ZFS_PROP_SHAREISCSI: case ZFS_PROP_DEVICES: + case ZFS_PROP_ZONED: + case ZFS_PROP_SHAREISCSI: case ZFS_PROP_ISCSIOPTIONS: + case ZFS_PROP_XATTR: + case ZFS_PROP_VSCAN: + case ZFS_PROP_NBMAND: + case ZFS_PROP_SHARESMB: (void) snprintf(errbuf, sizeof (errbuf), "property '%s' not supported on FreeBSD", propname); ret = zfs_error(hdl, EZFS_PERM, errbuf); From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 20:33: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 6F1F61065694; Thu, 8 Oct 2009 20:33:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F8E28FC0C; Thu, 8 Oct 2009 20: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 n98KXCo8032356; Thu, 8 Oct 2009 20:33:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98KXC8O032354; Thu, 8 Oct 2009 20:33:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200910082033.n98KXC8O032354@svn.freebsd.org> From: Michael Tuexen Date: Thu, 8 Oct 2009 20: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: r197868 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2009 20:33:13 -0000 Author: tuexen Date: Thu Oct 8 20:33:12 2009 New Revision: 197868 URL: http://svn.freebsd.org/changeset/base/197868 Log: Use correct arguments when calling SCTP_RTALLOC(). Approved by: rrs (mentor) MFC after: 0 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Oct 8 19:45:37 2009 (r197867) +++ head/sys/netinet/sctp_output.c Thu Oct 8 20:33:12 2009 (r197868) @@ -3570,7 +3570,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_free_ifa(_lsrc); } else { ip->ip_src = over_addr->sin.sin_addr; - SCTP_RTALLOC((&ro->ro_rt), vrf_id); + SCTP_RTALLOC(ro, vrf_id); } } if (port) { @@ -3924,7 +3924,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_free_ifa(_lsrc); } else { lsa6->sin6_addr = over_addr->sin6.sin6_addr; - SCTP_RTALLOC((&ro->ro_rt), vrf_id); + SCTP_RTALLOC(ro, vrf_id); } (void)sa6_recoverscope(sin6); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 8 20: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 412401065693; Thu, 8 Oct 2009 20:58:10 +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 2F3D28FC08; Thu, 8 Oct 2009 20: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 n98KwASI032854; Thu, 8 Oct 2009 20:58:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n98KwA2W032852; Thu, 8 Oct 2009 20:58:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200910082058.n98KwA2W032852@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 8 Oct 2009 20:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197869 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci 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: Thu, 08 Oct 2009 20:58:10 -0000 Author: bz Date: Thu Oct 8 20:58:09 2009 New Revision: 197869 URL: http://svn.freebsd.org/changeset/base/197869 Log: MFC r197727: Put #ifdef INET around parts of the FLOWTABLE code, to unbreak nooptions INET kernel builds. Approved by: re (kib) Modified: 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/sys/net/route.c Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Thu Oct 8 20:33:12 2009 (r197868) +++ stable/8/sys/net/route.c Thu Oct 8 20:58:09 2009 (r197869) @@ -1162,6 +1162,7 @@ rtrequest1_fib(int req, struct rt_addrin /* XXX * "flow-table" only support IPv4 at the moment. */ +#ifdef INET if (dst->sa_family == AF_INET) { rn = rnh->rnh_matchaddr(dst, rnh); if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { @@ -1203,6 +1204,7 @@ rtrequest1_fib(int req, struct rt_addrin } } #endif +#endif /* XXX mtu manipulation will be done in rnh_addaddr -- itojun */ rn = rnh->rnh_addaddr(ndst, netmask, rnh, rt->rt_nodes); @@ -1224,7 +1226,9 @@ rtrequest1_fib(int req, struct rt_addrin } #ifdef FLOWTABLE else if (rt0 != NULL) { +#ifdef INET flowtable_route_flush(V_ip_ft, rt0); +#endif RTFREE(rt0); } #endif From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 09: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 5C83E1065670; Fri, 9 Oct 2009 09:18:23 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3008B8FC1A; Fri, 9 Oct 2009 09: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 n999INYp048146; Fri, 9 Oct 2009 09:18:23 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n999IN5o048144; Fri, 9 Oct 2009 09:18:23 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200910090918.n999IN5o048144@svn.freebsd.org> From: Robert Watson Date: Fri, 9 Oct 2009 09:18:23 +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: r197895 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 09:18:23 -0000 Author: rwatson Date: Fri Oct 9 09:18:22 2009 New Revision: 197895 URL: http://svn.freebsd.org/changeset/base/197895 Log: Merge r197814 from head to stable/8: Remove tcp_input lock statistics; these are intended for debugging only and are not intended to ship in 8.0 as they dirty additional cache lines in a performance-critical per-packet path. Approved by: re (kib, bz) Modified: 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/sys/netinet/tcp_input.c Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Fri Oct 9 09:12:19 2009 (r197894) +++ stable/8/sys/netinet/tcp_input.c Fri Oct 9 09:18:22 2009 (r197895) @@ -180,26 +180,6 @@ int tcp_read_locking = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, read_locking, CTLFLAG_RW, &tcp_read_locking, 0, "Enable read locking strategy"); -int tcp_rlock_atfirst; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, rlock_atfirst, CTLFLAG_RD, - &tcp_rlock_atfirst, 0, ""); - -int tcp_wlock_atfirst; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_wlock_atfirst, CTLFLAG_RD, - &tcp_wlock_atfirst, 0, ""); - -int tcp_wlock_upgraded; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_upgraded, CTLFLAG_RD, - &tcp_wlock_upgraded, 0, ""); - -int tcp_wlock_relocked; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_relocked, CTLFLAG_RD, - &tcp_wlock_relocked, 0, ""); - -int tcp_wlock_looped; -SYSCTL_INT(_net_inet_tcp, OID_AUTO, wlock_looped, CTLFLAG_RD, - &tcp_wlock_looped, 0, ""); - VNET_DEFINE(struct inpcbhead, tcb); VNET_DEFINE(struct inpcbinfo, tcbinfo); #define tcb6 tcb /* for KAME src sync over BSD*'s */ @@ -505,11 +485,9 @@ tcp_input(struct mbuf *m, int off0) tcp_read_locking == 0) { INP_INFO_WLOCK(&V_tcbinfo); ti_locked = TI_WLOCKED; - tcp_wlock_atfirst++; } else { INP_INFO_RLOCK(&V_tcbinfo); ti_locked = TI_RLOCKED; - tcp_rlock_atfirst++; } findpcb: @@ -662,15 +640,11 @@ relocked: ti_locked = TI_WLOCKED; INP_WLOCK(inp); if (in_pcbrele(inp)) { - tcp_wlock_looped++; inp = NULL; goto findpcb; } - tcp_wlock_relocked++; - } else { + } else ti_locked = TI_WLOCKED; - tcp_wlock_upgraded++; - } } INP_INFO_WLOCK_ASSERT(&V_tcbinfo); @@ -717,16 +691,12 @@ relocked: ti_locked = TI_WLOCKED; INP_WLOCK(inp); if (in_pcbrele(inp)) { - tcp_wlock_looped++; inp = NULL; goto findpcb; } - tcp_wlock_relocked++; goto relocked; - } else { + } else ti_locked = TI_WLOCKED; - tcp_wlock_upgraded++; - } } INP_INFO_WLOCK_ASSERT(&V_tcbinfo); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 09: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 2BCBA1065672; Fri, 9 Oct 2009 09:30:00 +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 1B6338FC13; Fri, 9 Oct 2009 09:30: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 n999U0gl048393; Fri, 9 Oct 2009 09:30:00 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n999Txp5048391; Fri, 9 Oct 2009 09:29:59 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910090929.n999Txp5048391@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 9 Oct 2009 09:29: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: r197896 - head/sys/cam/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: Fri, 09 Oct 2009 09:30:00 -0000 Author: pjd Date: Fri Oct 9 09:29:59 2009 New Revision: 197896 URL: http://svn.freebsd.org/changeset/base/197896 Log: Export disk serial numbers for adaX disks. Reviewed by: mav MFC after: 3 days Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Fri Oct 9 09:18:22 2009 (r197895) +++ head/sys/cam/ata/ata_da.c Fri Oct 9 09:29:59 2009 (r197896) @@ -721,6 +721,8 @@ adaregister(struct cam_periph *periph, v softc->disk->d_flags = 0; if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; + strlcpy(softc->disk->d_ident, cgd->serial_num, + MIN(sizeof(softc->disk->d_ident), cgd->serial_num_len + 1)); adasetgeom(periph, cgd); softc->disk->d_sectorsize = softc->params.secsize; From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 09:38: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 BB828106568D; Fri, 9 Oct 2009 09:38:57 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAE238FC17; Fri, 9 Oct 2009 09:38: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 n999cv9W048603; Fri, 9 Oct 2009 09:38:57 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n999cvok048601; Fri, 9 Oct 2009 09:38:57 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910090938.n999cvok048601@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 9 Oct 2009 09:38:57 +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: r197897 - vendor/openpam/dist/doc/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2009 09:38:57 -0000 Author: des Date: Fri Oct 9 09:38:57 2009 New Revision: 197897 URL: http://svn.freebsd.org/changeset/base/197897 Log: Merge upstream r421: grammar nit in pam.conf(5). Modified: vendor/openpam/dist/doc/man/pam.conf.5 Modified: vendor/openpam/dist/doc/man/pam.conf.5 ============================================================================== --- vendor/openpam/dist/doc/man/pam.conf.5 Fri Oct 9 09:29:59 2009 (r197896) +++ vendor/openpam/dist/doc/man/pam.conf.5 Fri Oct 9 09:38:57 2009 (r197897) @@ -109,7 +109,7 @@ will be failure regardless of the succes .It Cm requisite If this module succeeds, the result of the chain will be success unless a later module fails. -If it module fails, the chain is broken and the result is failure. +If the module fails, the chain is broken and the result is failure. .It Cm sufficient If this module succeeds, the chain is broken and the result is success. From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 09:42: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 060881065676; Fri, 9 Oct 2009 09:42:23 +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 E85438FC1C; Fri, 9 Oct 2009 09:42: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 n999gM39048738; Fri, 9 Oct 2009 09:42:22 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n999gMb5048731; Fri, 9 Oct 2009 09:42:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200910090942.n999gMb5048731@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 9 Oct 2009 09:42: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: r197898 - in head/sys/geom: concat label part shsec stripe uzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2009 09:42:23 -0000 Author: pjd Date: Fri Oct 9 09:42:22 2009 New Revision: 197898 URL: http://svn.freebsd.org/changeset/base/197898 Log: If provider is open for writing when we taste it, skip it for classes that depend on on-disk metadata. This was we won't attach to providers that are used by other classes. For example we don't want to configure partitions on da0 if it is part of gmirror, what we really want is partitions on mirror/foo. During regular work it works like this: if provider is open for writing a class receives the spoiled event from GEOM and detaches, once provider is closed the taste event is send again and class can rediscover its metadata if it is still there. This doesn't work that way when new class arrives, because GEOM gives all existing providers for it to taste, also those open for writing. Classes have to decided on their own if they want to deal with such providers (eg. geom_dev) or not (classes modified by this commit). Reported by: des, Oliver Lehmann Tested by: des, Oliver Lehmann Discussed with: phk, marcel Reviewed by: marcel MFC after: 3 days Modified: head/sys/geom/concat/g_concat.c head/sys/geom/label/g_label.c head/sys/geom/part/g_part.c head/sys/geom/shsec/g_shsec.c head/sys/geom/stripe/g_stripe.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Fri Oct 9 09:38:57 2009 (r197897) +++ head/sys/geom/concat/g_concat.c Fri Oct 9 09:42:22 2009 (r197898) @@ -599,6 +599,10 @@ g_concat_taste(struct g_class *mp, struc g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); g_topology_assert(); + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + G_CONCAT_DEBUG(3, "Tasting %s.", pp->name); gp = g_new_geomf(mp, "concat:taste"); Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Fri Oct 9 09:38:57 2009 (r197897) +++ head/sys/geom/label/g_label.c Fri Oct 9 09:42:22 2009 (r197898) @@ -271,6 +271,10 @@ g_label_taste(struct g_class *mp, struct G_LABEL_DEBUG(2, "Tasting %s.", pp->name); + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + if (strcmp(pp->geom->class->name, mp->name) == 0) return (NULL); Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Oct 9 09:38:57 2009 (r197897) +++ head/sys/geom/part/g_part.c Fri Oct 9 09:42:22 2009 (r197898) @@ -1459,6 +1459,10 @@ g_part_taste(struct g_class *mp, struct G_PART_TRACE((G_T_TOPOLOGY, "%s(%s,%s)", __func__, mp->name, pp->name)); g_topology_assert(); + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + /* * Create a GEOM with consumer and hook it up to the provider. * With that we become part of the topology. Optain read access Modified: head/sys/geom/shsec/g_shsec.c ============================================================================== --- head/sys/geom/shsec/g_shsec.c Fri Oct 9 09:38:57 2009 (r197897) +++ head/sys/geom/shsec/g_shsec.c Fri Oct 9 09:42:22 2009 (r197898) @@ -638,6 +638,10 @@ g_shsec_taste(struct g_class *mp, struct g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); g_topology_assert(); + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + G_SHSEC_DEBUG(3, "Tasting %s.", pp->name); gp = g_new_geomf(mp, "shsec:taste"); Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Fri Oct 9 09:38:57 2009 (r197897) +++ head/sys/geom/stripe/g_stripe.c Fri Oct 9 09:42:22 2009 (r197898) @@ -912,6 +912,10 @@ g_stripe_taste(struct g_class *mp, struc g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); g_topology_assert(); + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + G_STRIPE_DEBUG(3, "Tasting %s.", pp->name); gp = g_new_geomf(mp, "stripe:taste"); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Fri Oct 9 09:38:57 2009 (r197897) +++ head/sys/geom/uzip/g_uzip.c Fri Oct 9 09:42:22 2009 (r197898) @@ -363,6 +363,11 @@ g_uzip_taste(struct g_class *mp, struct g_trace(G_T_TOPOLOGY, "g_uzip_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); + + /* Skip providers that are already open for writing. */ + if (pp->acw > 0) + return (NULL); + buf = NULL; /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 09:42: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 D796E106568D; Fri, 9 Oct 2009 09:42:58 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C71DE8FC1E; Fri, 9 Oct 2009 09:42: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 n999gwkK048802; Fri, 9 Oct 2009 09:42:58 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n999gwAG048800; Fri, 9 Oct 2009 09:42:58 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910090942.n999gwAG048800@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 9 Oct 2009 09:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197899 - in head/contrib/openpam: . doc/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2009 09:42:58 -0000 Author: des Date: Fri Oct 9 09:42:58 2009 New Revision: 197899 URL: http://svn.freebsd.org/changeset/base/197899 Log: Merge upstream r421: grammar nit in pam.conf(5). Modified: head/contrib/openpam/ (props changed) head/contrib/openpam/doc/man/pam.conf.5 Modified: head/contrib/openpam/doc/man/pam.conf.5 ============================================================================== --- head/contrib/openpam/doc/man/pam.conf.5 Fri Oct 9 09:42:22 2009 (r197898) +++ head/contrib/openpam/doc/man/pam.conf.5 Fri Oct 9 09:42:58 2009 (r197899) @@ -109,7 +109,7 @@ will be failure regardless of the succes .It Cm requisite If this module succeeds, the result of the chain will be success unless a later module fails. -If it module fails, the chain is broken and the result is failure. +If the module fails, the chain is broken and the result is failure. .It Cm sufficient If this module succeeds, the chain is broken and the result is success. From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 10: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 443681065670; Fri, 9 Oct 2009 10:03:42 +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 3389C8FC0C; Fri, 9 Oct 2009 10: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 n99A3gHt050170; Fri, 9 Oct 2009 10:03:42 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99A3gmU050168; Fri, 9 Oct 2009 10:03:42 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091003.n99A3gmU050168@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 10: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: r197900 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 10:03:42 -0000 Author: brueffer Date: Fri Oct 9 10:03:41 2009 New Revision: 197900 URL: http://svn.freebsd.org/changeset/base/197900 Log: Improved one-line description of this module (taken from NOTES). Modified: head/share/man/man4/lindev.4 Modified: head/share/man/man4/lindev.4 ============================================================================== --- head/share/man/man4/lindev.4 Fri Oct 9 09:42:58 2009 (r197899) +++ head/share/man/man4/lindev.4 Fri Oct 9 10:03:41 2009 (r197900) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm lindev -.Nd the lindev module +.Nd Linux-specific pseudo devices support .Sh SYNOPSIS To compile this collection of linux-specific pseudo devices into the kernel, place the following line in your kernel configuration file: From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 13:25: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 47EA51065679; Fri, 9 Oct 2009 13:25:46 +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 361208FC13; Fri, 9 Oct 2009 13:25: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 n99DPkvb054063; Fri, 9 Oct 2009 13:25:46 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99DPkRS054062; Fri, 9 Oct 2009 13:25:46 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091325.n99DPkRS054062@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 13:25: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: r197902 - in stable/8/sbin/geom: . class/nop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2009 13:25:46 -0000 Author: brueffer Date: Fri Oct 9 13:25:45 2009 New Revision: 197902 URL: http://svn.freebsd.org/changeset/base/197902 Log: MFC: r197274 Fix the example, -w is the right switch for write failure probability. Approved by: re (kib) Modified: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/nop/gnop.8 Modified: stable/8/sbin/geom/class/nop/gnop.8 ============================================================================== --- stable/8/sbin/geom/class/nop/gnop.8 Fri Oct 9 10:13:18 2009 (r197901) +++ stable/8/sbin/geom/class/nop/gnop.8 Fri Oct 9 13:25:45 2009 (r197902) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2006 +.Dd September 17, 2009 .Dt GNOP 8 .Os .Sh NAME @@ -147,9 +147,9 @@ Exit status is 0 on success, and 1 if th .Sh EXAMPLES The following example shows how to create a transparent provider for disk .Pa /dev/da0 -with 50% failure probability, and how to destroy it. +with 50% write failure probability, and how to destroy it. .Bd -literal -offset indent -gnop create -v -f 50 da0 +gnop create -v -w 50 da0 gnop destroy -v da0.nop .Ed .Pp From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 13:31: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 469EC1065672; Fri, 9 Oct 2009 13:31: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 351CF8FC19; Fri, 9 Oct 2009 13:31: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 n99DVbII054205; Fri, 9 Oct 2009 13:31:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99DVbhL054203; Fri, 9 Oct 2009 13:31:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091331.n99DVbhL054203@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 13:31: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: r197903 - stable/8/sbin/mksnap_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 13:31:37 -0000 Author: brueffer Date: Fri Oct 9 13:31:36 2009 New Revision: 197903 URL: http://svn.freebsd.org/changeset/base/197903 Log: MFC: r197275 Fix an xref. Approved by: re (kib) Modified: stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mksnap_ffs/mksnap_ffs.8 Modified: stable/8/sbin/mksnap_ffs/mksnap_ffs.8 ============================================================================== --- stable/8/sbin/mksnap_ffs/mksnap_ffs.8 Fri Oct 9 13:25:45 2009 (r197902) +++ stable/8/sbin/mksnap_ffs/mksnap_ffs.8 Fri Oct 9 13:31:36 2009 (r197903) @@ -69,7 +69,7 @@ mount -o ro /dev/md0 /mnt/ .Sh SEE ALSO .Xr chmod 2 , .Xr chown 8 , -.Xr mdconfig 8, +.Xr mdconfig 8 , .Xr mount 8 .Sh CAVEATS The disk full situation is not handled gracefully and may From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 13:36: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 3F2FD10656C4; Fri, 9 Oct 2009 13:36: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 2D5478FC21; Fri, 9 Oct 2009 13:36: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 n99DaE6u054347; Fri, 9 Oct 2009 13:36:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99DaEdb054345; Fri, 9 Oct 2009 13:36:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091336.n99DaEdb054345@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 13:36:14 +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: r197904 - 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: Fri, 09 Oct 2009 13:36:16 -0000 Author: brueffer Date: Fri Oct 9 13:36:14 2009 New Revision: 197904 URL: http://svn.freebsd.org/changeset/base/197904 Log: MFC: r197276 Correct a sysctl name. Approved by: re (kib) Modified: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/acpi_panasonic.4 Modified: stable/8/share/man/man4/acpi_panasonic.4 ============================================================================== --- stable/8/share/man/man4/acpi_panasonic.4 Fri Oct 9 13:31:36 2009 (r197903) +++ stable/8/share/man/man4/acpi_panasonic.4 Fri Oct 9 13:36:14 2009 (r197904) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 11, 2004 +.Dd September 17, 2009 .Dt ACPI_PANASONIC 4 i386 .Os .Sh NAME @@ -144,7 +144,7 @@ The following MIBs are available: The maximum level of brightness. The value is read only and automatically set according to hardware model. -.It Va hw.acpi.panasonic.lcd_brightness_max +.It Va hw.acpi.panasonic.lcd_brightness_min The minimum level of brightness. The value is read only and automatically set according to hardware model. From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 13:41: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 1D47B106568D; Fri, 9 Oct 2009 13:41:54 +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 023A18FC0A; Fri, 9 Oct 2009 13:41:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n99DfrKT054518; Fri, 9 Oct 2009 13:41:53 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99DfrNE054503; Fri, 9 Oct 2009 13:41:53 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091341.n99DfrNE054503@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 13:41: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: r197905 - stable/8/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: Fri, 09 Oct 2009 13:41:54 -0000 Author: brueffer Date: Fri Oct 9 13:41:53 2009 New Revision: 197905 URL: http://svn.freebsd.org/changeset/base/197905 Log: MFC: r197300 Various mdoc, spelling etc fixes. Approved by: re (kib) Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/ieee80211.9 stable/8/share/man/man9/ieee80211_amrr.9 stable/8/share/man/man9/ieee80211_beacon.9 stable/8/share/man/man9/ieee80211_bmiss.9 stable/8/share/man/man9/ieee80211_crypto.9 stable/8/share/man/man9/ieee80211_ddb.9 stable/8/share/man/man9/ieee80211_input.9 stable/8/share/man/man9/ieee80211_node.9 stable/8/share/man/man9/ieee80211_output.9 stable/8/share/man/man9/ieee80211_proto.9 stable/8/share/man/man9/ieee80211_radiotap.9 stable/8/share/man/man9/ieee80211_regdomain.9 stable/8/share/man/man9/ieee80211_scan.9 stable/8/share/man/man9/ieee80211_vap.9 Modified: stable/8/share/man/man9/ieee80211.9 ============================================================================== --- stable/8/share/man/man9/ieee80211.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -225,7 +225,7 @@ Allocate and initialize a structure. This method cannot sleep. The default method allocates zero'd memory using -.Xr malloc 9. +.Xr malloc 9 . Drivers should override this method to allocate extended storage for their own needs. Memory allocated by the driver must be tagged with @@ -301,7 +301,7 @@ This method is called immediately after and must initiate the work to scan a channel and schedule a timer to advance to the next channel in the scan list. This callback is done in a sleepable context. -The default method handles active scan work (e.g. sending ProbRequest +The default method handles active scan work (e.g. sending ProbeRequest frames), and schedules a call to .Xr ieee80211_scan_next 9 according to the maximum dwell time for the channel. @@ -558,4 +558,4 @@ Device supports Reduced Inter Frame Spac .Xr ieee80211_send_action 9 , .Xr ieee80211_radiotap_attach 9 , .Xr ifnet 9 , -.Xr malloc 9 . +.Xr malloc 9 Modified: stable/8/share/man/man9/ieee80211_amrr.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_amrr.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_amrr.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -191,4 +191,4 @@ Drivers that poll a device to retrieve s (instead or in addition). .Sh SEE ALSO .Xr ieee80211 9 , -.Xr ieee80211_output 9 , +.Xr ieee80211_output 9 Modified: stable/8/share/man/man9/ieee80211_beacon.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_beacon.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_beacon.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -112,4 +112,4 @@ Staggering beacon frames is usually supe about eight vaps, at which point the overhead becomes significant and the channel becomes noticeably busy anyway. .Sh SEE ALSO -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: stable/8/share/man/man9/ieee80211_bmiss.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_bmiss.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_bmiss.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -86,6 +86,6 @@ Note that software beacon miss handling it can be used in any operating mode where beacons from a peer station are received. .Sh SEE ALSO -.Xr ieee80211 9 , -.Xr ieee80211_vap 9 , .Xr wpa_supplicant 8 , +.Xr ieee80211 9 , +.Xr ieee80211_vap 9 Modified: stable/8/share/man/man9/ieee80211_crypto.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_crypto.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_crypto.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -65,10 +65,10 @@ .\" .Ft int .Fo ieee80211_crypto_newkey -.Fa "struct ieee80211vap * -.Fa "int cipher -.Fa "int flags -.Fa "struct ieee80211_key * +.Fa "struct ieee80211vap *" +.Fa "int cipher" +.Fa "int flags" +.Fa "struct ieee80211_key *" .Fc .\" .Ft int @@ -141,7 +141,7 @@ so it can reclaim resources. .Pp Crypto modules can notify the system of two events. When a packet replay event is recognized -.Fn ieee80111_notify_replay_failure +.Fn ieee80211_notify_replay_failure can be used to signal the event. When a .Dv TKIP @@ -256,4 +256,4 @@ when receive traffic is active. .Xr ioctl 2 , .Xr wlan_ccmp 4 , .Xr wlan_tkip 4 , -.Xr wlan_wep 4 . +.Xr wlan_wep 4 Modified: stable/8/share/man/man9/ieee80211_ddb.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_ddb.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_ddb.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -54,7 +54,7 @@ This is especially important because wir built for embedded environments where cross-machine or post-mortem debugging facilities like .Xr kgdb 1 -infeasible. +are infeasible. .Pp The most commonly used command is .Bd -literal -offset indent @@ -69,4 +69,4 @@ and data structures in the system. .Sh SEE ALSO .Xr ddb 4 , -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: stable/8/share/man/man9/ieee80211_input.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_input.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_input.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -113,4 +113,4 @@ Otherwise the values are made available (with the rssi presented as a filtered average over the last ten values and the noise floor the last reported value). .Sh SEE ALSO -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: stable/8/share/man/man9/ieee80211_node.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_node.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_node.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -248,4 +248,4 @@ then a normal lookup is done without a t .Sh SEE ALSO .Xr ddb 9 .Xr ieee80211 9 , -.Xr ieee80211_proto 9 , +.Xr ieee80211_proto 9 Modified: stable/8/share/man/man9/ieee80211_output.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_output.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_output.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -47,9 +47,9 @@ .\" .Ft void .Fo ieee80211_process_callback -.Fa struct ieee80211_node * -.Fa struct mbuf * -.Fa int +.Fa "struct ieee80211_node *" +.Fa "struct mbuf *" +.Fa "int" .Fc .Sh DESCRIPTION The @@ -101,7 +101,7 @@ Similarly, .Nm net80211 handles activities such as background scanning and power save mode, frames will not be sent to a driver unless it is operating on the -BSS channel will +BSS channel with .Dq full power . .Pp All frames passed to a driver for transmit hold a reference to a Modified: stable/8/share/man/man9/ieee80211_proto.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_proto.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_proto.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -119,7 +119,7 @@ and .Vt ic_bsschan are guaranteed to be usable. .It Dv IEEE80211_S_CSA -Channel Switch Annoucememnt (CSA) is pending. +Channel Switch Announcement (CSA) is pending. This state is reached only from .Dv IEEE80211_S_RUN when either a CSA is received from an access point (in station mode) @@ -229,11 +229,11 @@ handled by or, in the case of card eject or vap destroy, work will be initiated outside the driver. .Sh SEE ALSO -.Xr ioctl 2 +.Xr ioctl 2 , +.Xr wpa_supplicant 8 , .Xr ieee80211 9 , -.Xr ifnet 9 +.Xr ifnet 9 , .Xr taskqueue 9 -.Xr wpa_supplicant 8 .Sh HISTORY The state machine concept was part of the original .Nm ieee80211 Modified: stable/8/share/man/man9/ieee80211_radiotap.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_radiotap.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_radiotap.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -198,11 +198,11 @@ RF noise power at the antenna, in decibe .\"power as unitless distance from maximum power set at factory calibration. .\"0 indicates maximum transmit power. .\"Monotonically nondecreasing with lower power levels. -\.".It Dv IEEE80211_RADIOTAP_DB_TX_ATTENUATION -\."This field contains a single unsigned 16-bit value, expressing transmit -\."power as decibel distance from maximum power set at factory calibration. -\."0 indicates maximum transmit power. -\."Monotonically nondecreasing with lower power levels. +.\".It Dv IEEE80211_RADIOTAP_DB_TX_ATTENUATION +.\"This field contains a single unsigned 16-bit value, expressing transmit +.\"power as decibel distance from maximum power set at factory calibration. +.\"0 indicates maximum transmit power. +.\"Monotonically nondecreasing with lower power levels. .It Dv IEEE80211_RADIOTAP_DBM_TX_POWER Transmit power expressed as decibels from a 1mW reference. This field is a single signed 8-bit value. @@ -223,9 +223,9 @@ This field contains a single unsigned 8- RF noise power at the antenna, in decibels difference from an arbitrary, fixed reference. .It Dv IEEE80211_RADIOTAP_XCHANNEL -This field containts four values: a 32-bit unsigned bitmap of +This field contains four values: a 32-bit unsigned bitmap of flags that describe the channel attributes, a 16-bit unsigned -freqeuncy in MHz (typically the channel center), an 8-bit +frequency in MHz (typically the channel center), an 8-bit unsigned IEEE channel number, and a signed 8-bit value that holds the maximum regulatory transmit power cap in .5 dBm (8 bytes total). @@ -237,10 +237,10 @@ This property supersedes .Dv IEEE80211_RADIOTAP_CHANNEL and is the only way to completely express all channel attributes and the -mapping between channel freqeuncy and IEEE channel number. +mapping between channel frequency and IEEE channel number. .El .Sh EXAMPLES -Radiotap receive definitions for the Intersil Prims driver: +Radiotap receive definitions for the Intersil Prism driver: .Bd -literal -offset indent #define WI_RX_RADIOTAP_PRESENT \\ ((1 << IEEE80211_RADIOTAP_TSFT) \\ @@ -298,7 +298,6 @@ definitions first appeared in .\" .Sh AUTHORS .An -nosplit -.Pp The original version of this manual page was written by .An Bruce M. Simpson Aq bms@FreeBSD.org and Modified: stable/8/share/man/man9/ieee80211_regdomain.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_regdomain.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_regdomain.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -112,7 +112,7 @@ routine. This should be done whenever the channel table contents are modified. .Pp The -.Fn ieee80211_alloc_countrie +.Fn ieee80211_alloc_countryie function allocates an information element as specified by 802.11h. Because this is expensive to generate it is cached in .Vt ic_countryie @@ -140,4 +140,4 @@ The exact rules by which to operate are .Sh SEE ALSO .Xr regdomain 5 , .Xr ifconfig 8 , -.Xr ieee80211 9 . +.Xr ieee80211 9 Modified: stable/8/share/man/man9/ieee80211_scan.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_scan.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_scan.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -347,4 +347,4 @@ request. .Sh SEE ALSO .Xr ioctl 2 , .Xr ieee80211 9 . -.Xr ieee80211_proto 9 . +.Xr ieee80211_proto 9 Modified: stable/8/share/man/man9/ieee80211_vap.9 ============================================================================== --- stable/8/share/man/man9/ieee80211_vap.9 Fri Oct 9 13:36:14 2009 (r197904) +++ stable/8/share/man/man9/ieee80211_vap.9 Fri Oct 9 13:41:53 2009 (r197905) @@ -151,4 +151,4 @@ that beacon are stopped before stopping .Sh SEE ALSO .Xr ieee80211 9 , .Xr ifnet 9 , -.Xr malloc 9 . +.Xr malloc 9 From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 13:46: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 8CC2B1065676; Fri, 9 Oct 2009 13:46:55 +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 7A9E48FC16; Fri, 9 Oct 2009 13:46: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 n99Dktu1054668; Fri, 9 Oct 2009 13:46:55 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99Dktnl054666; Fri, 9 Oct 2009 13:46:55 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091346.n99Dktnl054666@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 13:46: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: r197906 - stable/8/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: Fri, 09 Oct 2009 13:46:55 -0000 Author: brueffer Date: Fri Oct 9 13:46:55 2009 New Revision: 197906 URL: http://svn.freebsd.org/changeset/base/197906 Log: MFC: r197310 Fix mdoc, typos, contractions. Approved by: re (kib) Modified: stable/8/share/man/man9/ (props changed) stable/8/share/man/man9/fail.9 Modified: stable/8/share/man/man9/fail.9 ============================================================================== --- stable/8/share/man/man9/fail.9 Fri Oct 9 13:41:53 2009 (r197905) +++ stable/8/share/man/man9/fail.9 Fri Oct 9 13:46:55 2009 (r197906) @@ -37,7 +37,6 @@ .Nm KFAIL_POINT_GOTO , .Nm fail_point , .Nm DEBUG_FP -. .Nd fail points .Sh SYNOPSIS .In sys/fail.h @@ -79,7 +78,7 @@ is derived from the .Fn return value set in the sysctl MIB. See -.Sx SYSCTL SETTINGS +.Sx SYSCTL VARIABLES below. .Pp The remaining @@ -100,7 +99,6 @@ is the equivalent of .Sy KFAIL_POINT_CODE(..., { error_var = RETURN_VALUE; goto label;}) .El -.Pp .Sh SYSCTL VARIABLES The .Fn KFAIL_POINT_* @@ -108,28 +106,28 @@ macros add sysctl MIBs where specified. Many base kernel MIBs can be found in the .Sy debug.fail_point tree (referenced in code by -.Sy DEBUG_FP -). +.Sy DEBUG_FP ) . .Pp The sysctl variable may be set using the following grammar: .Pp +.Bd -literal :: ( "->" )* -.Pp + :: ( ( "%") | ( "*" ) )* [ "(" ")" ] -.Pp + :: [ "." ] | "." -.Pp + :: "off" | "return" | "sleep" | "panic" | "break" | "print" +.Ed .Pp -The -argument specifies which action to take: +The argument specifies which action to take: .Bl -tag -width ".Dv return" .It Sy off Take no action (does not trigger fail point code) @@ -158,13 +156,13 @@ is evaluated before the count, i.e. "2%5 but only 5 times total". .Pp The operator -> can be used to express cascading terms. -If you specify ->, it means that if doesn't -'execute', is evaluated. +If you specify ->, it means that if does not +.Ql execute , + is evaluated. For the purpose of this operator, the return() and print() operators are the only types that cascade. A return() term only cascades if the code executes, and a print() term only cascades when passed a non-zero argument. -.Pp .Sh EXAMPLES .Bl -tag .It Sy sysctl debug.fail_point.foobar="2.1%return(5)" @@ -175,7 +173,7 @@ with RETURN_VALUE set to 5. 2/100ths of the time, execute .Fa code with RETURN_VALUE set to 5. -If that doesn't happen, 5% of the time execute +If that does not happen, 5% of the time execute .Fa code with RETURN_VALUE set to 22. .It Sy sysctl debug.fail_point.foobar="5*return(5)->0.1%return(22)" @@ -186,9 +184,8 @@ Return 5 for 1 in 1000 executions, but o .It Sy sysctl debug.fail_point.foobar="1%*sleep(50)" 1/100th of the time, sleep 50ms. .El -.Pp .Sh CAVEATS -It's easy to shoot yourself in the foot by setting fail points too +It is easy to shoot yourself in the foot by setting fail points too aggressively or setting too many in combination. For example, forcing .Fn malloc @@ -201,7 +198,6 @@ Currently, .Fn fail_point_eval does not verify whether the context is appropriate for calling .Fn msleep . -.Pp .Sh AUTHORS .An -nosplit This manual page was written by From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 13:52: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 A33D21065670; Fri, 9 Oct 2009 13:52:49 +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 901968FC26; Fri, 9 Oct 2009 13:52: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 n99DqnLb054850; Fri, 9 Oct 2009 13:52:49 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99DqnGF054847; Fri, 9 Oct 2009 13:52:49 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200910091352.n99DqnGF054847@svn.freebsd.org> From: Christian Brueffer Date: Fri, 9 Oct 2009 13:52: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: r197907 - in stable/8: lib/libc lib/libc/gen lib/libc/stdio lib/libc/stdtime lib/libc/string lib/libc/sys 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, 09 Oct 2009 13:52:49 -0000 Author: brueffer Date: Fri Oct 9 13:52:49 2009 New Revision: 197907 URL: http://svn.freebsd.org/changeset/base/197907 Log: MFC: r197312 Fix setfib(1) section number. Approved by: re (kib) Modified: stable/8/lib/libc/ (props changed) stable/8/lib/libc/gen/ (props changed) stable/8/lib/libc/stdio/asprintf.c (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/string/ffsll.c (props changed) stable/8/lib/libc/string/flsll.c (props changed) stable/8/lib/libc/string/wcpcpy.c (props changed) stable/8/lib/libc/string/wcpncpy.c (props changed) stable/8/lib/libc/sys/setfib.2 stable/8/sbin/ipfw/ (props changed) stable/8/sbin/ipfw/ipfw.8 Modified: stable/8/lib/libc/sys/setfib.2 ============================================================================== --- stable/8/lib/libc/sys/setfib.2 Fri Oct 9 13:46:55 2009 (r197906) +++ stable/8/lib/libc/sys/setfib.2 Fri Oct 9 13:52:49 2009 (r197907) @@ -67,8 +67,8 @@ if the .Fa fib argument is greater than the current system maximum. .Sh SEE ALSO -.Xr setsockopt 2 , -.Xr setfib 8 +.Xr setfib 1 , +.Xr setsockopt 2 .Sh STANDARDS The .Fn setfib Modified: stable/8/sbin/ipfw/ipfw.8 ============================================================================== --- stable/8/sbin/ipfw/ipfw.8 Fri Oct 9 13:46:55 2009 (r197906) +++ stable/8/sbin/ipfw/ipfw.8 Fri Oct 9 13:52:49 2009 (r197907) @@ -869,7 +869,7 @@ The packet is tagged so as to use the FI .Ar fibnum in any subsequent forwarding decisions. Initially this is limited to the values 0 through 15, see -.Xr setfib 8 . +.Xr setfib 1 . Processing continues at the next rule. .It Cm reass Queue and reassemble ip fragments. From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 15:51: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 B4347106568F; Fri, 9 Oct 2009 15:51:40 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A24B88FC0A; Fri, 9 Oct 2009 15:51: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 n99Fpeg1057496; Fri, 9 Oct 2009 15:51:40 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99Fpe3Z057493; Fri, 9 Oct 2009 15:51:40 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200910091551.n99Fpe3Z057493@svn.freebsd.org> From: Attilio Rao Date: Fri, 9 Oct 2009 15:51: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: r197910 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 15:51:40 -0000 Author: attilio Date: Fri Oct 9 15:51:40 2009 New Revision: 197910 URL: http://svn.freebsd.org/changeset/base/197910 Log: atomic_cmpset_barr_* was added in order to cope with compilers willing to specify their own version of atomic_cmpset_* which could have been different than the membar version. Right now, however, FreeBSD is bound mostly to GCC-like compilers and it is desired to add new support and compat shim mostly when there is a real necessity, in order to avoid too much compatibility bloats. In this optic, bring back atomic_cmpset_{acq, rel}_* to be the same as atomic_cmpset_* and unwind the atomic_cmpset_barr_* introduction. Requested by: jhb Reviewed by: jhb Tested by: Giovanni Trematerra Modified: head/sys/amd64/include/atomic.h head/sys/i386/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Fri Oct 9 14:31:29 2009 (r197909) +++ head/sys/amd64/include/atomic.h Fri Oct 9 15:51:40 2009 (r197910) @@ -78,8 +78,6 @@ void atomic_##NAME##_barr_##TYPE(volatil int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src); int atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src); -int atomic_cmpset_barr_int(volatile u_int *dst, u_int exp, u_int src); -int atomic_cmpset_barr_long(volatile u_long *dst, u_long exp, u_long src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); u_long atomic_fetchadd_long(volatile u_long *p, u_long v); @@ -131,33 +129,47 @@ struct __hack * Returns 0 on failure, non-zero on success */ -#define DEFINE_CMPSET_GEN(NAME, TYPE, OP) \ -static __inline int \ -atomic_cmpset_##NAME(volatile u_##TYPE *dst, u_##TYPE exp, u_##TYPE src)\ -{ \ - u_char res; \ - \ - __asm __volatile( \ - " " MPLOCKED " " \ - " " OP " %2,%1 ; " \ - " sete %0 ; " \ - "1: " \ - "# atomic_cmpset_##NAME" \ - : "=a" (res), /* 0 */ \ - "=m" (*dst) /* 1 */ \ - : "r" (src), /* 2 */ \ - "a" (exp), /* 3 */ \ - "m" (*dst) /* 4 */ \ - : "memory"); \ - \ - return (res); \ -} \ -struct __hack +static __inline int +atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) +{ + u_char res; + + __asm __volatile( + " " MPLOCKED " " + " cmpxchgl %2,%1 ; " + " sete %0 ; " + "1: " + "# atomic_cmpset_int" + : "=a" (res), /* 0 */ + "=m" (*dst) /* 1 */ + : "r" (src), /* 2 */ + "a" (exp), /* 3 */ + "m" (*dst) /* 4 */ + : "memory"); + + return (res); +} + +static __inline int +atomic_cmpset_long(volatile u_long *dst, u_long exp, u_long src) +{ + u_char res; -DEFINE_CMPSET_GEN(int, int, "cmpxchgl"); -DEFINE_CMPSET_GEN(long, long, "cmpxchgq"); -DEFINE_CMPSET_GEN(barr_int, int, "cmpxchgl"); -DEFINE_CMPSET_GEN(barr_long, long, "cmpxchgq"); + __asm __volatile( + " " MPLOCKED " " + " cmpxchgq %2,%1 ; " + " sete %0 ; " + "1: " + "# atomic_cmpset_long" + : "=a" (res), /* 0 */ + "=m" (*dst) /* 1 */ + : "r" (src), /* 2 */ + "a" (exp), /* 3 */ + "m" (*dst) /* 4 */ + : "memory"); + + return (res); +} /* * Atomically add the value of v to the integer pointed to by p and return @@ -358,8 +370,8 @@ u_long atomic_readandclear_long(volatile #define atomic_add_rel_int atomic_add_barr_int #define atomic_subtract_acq_int atomic_subtract_barr_int #define atomic_subtract_rel_int atomic_subtract_barr_int -#define atomic_cmpset_acq_int atomic_cmpset_barr_int -#define atomic_cmpset_rel_int atomic_cmpset_barr_int +#define atomic_cmpset_acq_int atomic_cmpset_int +#define atomic_cmpset_rel_int atomic_cmpset_int #define atomic_set_acq_long atomic_set_barr_long #define atomic_set_rel_long atomic_set_barr_long @@ -369,8 +381,8 @@ u_long atomic_readandclear_long(volatile #define atomic_add_rel_long atomic_add_barr_long #define atomic_subtract_acq_long atomic_subtract_barr_long #define atomic_subtract_rel_long atomic_subtract_barr_long -#define atomic_cmpset_acq_long atomic_cmpset_barr_long -#define atomic_cmpset_rel_long atomic_cmpset_barr_long +#define atomic_cmpset_acq_long atomic_cmpset_long +#define atomic_cmpset_rel_long atomic_cmpset_long /* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Fri Oct 9 14:31:29 2009 (r197909) +++ head/sys/i386/include/atomic.h Fri Oct 9 15:51:40 2009 (r197910) @@ -77,7 +77,6 @@ void atomic_##NAME##_##TYPE(volatile u_# void atomic_##NAME##_barr_##TYPE(volatile u_##TYPE *p, u_##TYPE v) int atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src); -int atomic_cmpset_barr_int(volatile u_int *dst, u_int exp, u_int src); u_int atomic_fetchadd_int(volatile u_int *p, u_int v); #define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ @@ -130,62 +129,55 @@ struct __hack #ifdef CPU_DISABLE_CMPXCHG -#define DEFINE_CMPSET_GEN(NAME) \ -static __inline int \ -atomic_cmpset_##NAME(volatile u_int *dst, u_int exp, u_int src)\ -{ \ - u_char res; \ - \ - __asm __volatile( \ - " pushfl ; " \ - " cli ; " \ - " cmpl %3,%4 ; " \ - " jne 1f ; " \ - " movl %2,%1 ; " \ - "1: " \ - " sete %0 ; " \ - " popfl ; " \ - "# atomic_cmpset_##NAME" \ - : "=q" (res), /* 0 */ \ - "=m" (*dst) /* 1 */ \ - : "r" (src), /* 2 */ \ - "r" (exp), /* 3 */ \ - "m" (*dst) /* 4 */ \ - : "memory"); \ - \ - return (res); \ -} \ -struct __hack +static __inline int +atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) +{ + u_char res; + + __asm __volatile( + " pushfl ; " + " cli ; " + " cmpl %3,%4 ; " + " jne 1f ; " + " movl %2,%1 ; " + "1: " + " sete %0 ; " + " popfl ; " + "# atomic_cmpset_int" + : "=q" (res), /* 0 */ + "=m" (*dst) /* 1 */ + : "r" (src), /* 2 */ + "r" (exp), /* 3 */ + "m" (*dst) /* 4 */ + : "memory"); + + return (res); +} #else /* !CPU_DISABLE_CMPXCHG */ -#define DEFINE_CMPSET_GEN(NAME) \ -static __inline int \ -atomic_cmpset_##NAME(volatile u_int *dst, u_int exp, u_int src)\ -{ \ - u_char res; \ - \ - __asm __volatile( \ - " " MPLOCKED " " \ - " cmpxchgl %2,%1 ; " \ - " sete %0 ; " \ - "1: " \ - "# atomic_cmpset_##NAME" \ - : "=a" (res), /* 0 */ \ - "=m" (*dst) /* 1 */ \ - : "r" (src), /* 2 */ \ - "a" (exp), /* 3 */ \ - "m" (*dst) /* 4 */ \ - : "memory"); \ - \ - return (res); \ -} \ -struct __hack +static __inline int +atomic_cmpset_int(volatile u_int *dst, u_int exp, u_int src) +{ + u_char res; -#endif /* CPU_DISABLE_CMPXCHG */ + __asm __volatile( + " " MPLOCKED " " + " cmpxchgl %2,%1 ; " + " sete %0 ; " + "1: " + "# atomic_cmpset_int" + : "=a" (res), /* 0 */ + "=m" (*dst) /* 1 */ + : "r" (src), /* 2 */ + "a" (exp), /* 3 */ + "m" (*dst) /* 4 */ + : "memory"); + + return (res); +} -DEFINE_CMPSET_GEN(int); -DEFINE_CMPSET_GEN(barr_int); +#endif /* CPU_DISABLE_CMPXCHG */ /* * Atomically add the value of v to the integer pointed to by p and return @@ -307,14 +299,6 @@ atomic_cmpset_long(volatile u_long *dst, (u_int)src)); } -static __inline int -atomic_cmpset_barr_long(volatile u_long *dst, u_long exp, u_long src) -{ - - return (atomic_cmpset_barr_int((volatile u_int *)dst, (u_int)exp, - (u_int)src)); -} - static __inline u_long atomic_fetchadd_long(volatile u_long *p, u_long v) { @@ -390,8 +374,8 @@ u_long atomic_readandclear_long(volatile #define atomic_add_rel_int atomic_add_barr_int #define atomic_subtract_acq_int atomic_subtract_barr_int #define atomic_subtract_rel_int atomic_subtract_barr_int -#define atomic_cmpset_acq_int atomic_cmpset_barr_int -#define atomic_cmpset_rel_int atomic_cmpset_barr_int +#define atomic_cmpset_acq_int atomic_cmpset_int +#define atomic_cmpset_rel_int atomic_cmpset_int #define atomic_set_acq_long atomic_set_barr_long #define atomic_set_rel_long atomic_set_barr_long @@ -401,8 +385,8 @@ u_long atomic_readandclear_long(volatile #define atomic_add_rel_long atomic_add_barr_long #define atomic_subtract_acq_long atomic_subtract_barr_long #define atomic_subtract_rel_long atomic_subtract_barr_long -#define atomic_cmpset_acq_long atomic_cmpset_barr_long -#define atomic_cmpset_rel_long atomic_cmpset_barr_long +#define atomic_cmpset_acq_long atomic_cmpset_long +#define atomic_cmpset_rel_long atomic_cmpset_long /* Operations on 8-bit bytes. */ #define atomic_set_8 atomic_set_char From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 16:08: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 62D0A10656A6; Fri, 9 Oct 2009 16:08:13 +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 33CEE8FC30; Fri, 9 Oct 2009 16:08:13 +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 D3B9546B1A; Fri, 9 Oct 2009 12:08:12 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 080628A025; Fri, 9 Oct 2009 12:08:12 -0400 (EDT) From: John Baldwin To: Alan Cox Date: Fri, 9 Oct 2009 10:29:03 -0400 User-Agent: KMail/1.9.7 References: <200910041853.n94IrAf7082338@svn.freebsd.org> <4ACA0F09.2010808@FreeBSD.org> <4ACAF96C.6070204@cs.rice.edu> In-Reply-To: <4ACAF96C.6070204@cs.rice.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910091029.04442.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 09 Oct 2009 12:08:12 -0400 (EDT) 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=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: Alan Cox , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197750 - 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: Fri, 09 Oct 2009 16:08:13 -0000 On Tuesday 06 October 2009 4:01:48 am Alan Cox wrote: > John Baldwin wrote: > > > > Do you care what is in the padding in this case or more about just > > having each mutex on a separate cache line? __aligned() is fine if > > you don't mind the padding getting reused for something else. > > > > Yes, I care. I would also like to prevent the placement of the heads of > the active, inactive, and hold queues (vm_page_queues[]) in the same > cache line as the free page queue mutex. Hmm, ok. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 19:30: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 C7F4B106568B; Fri, 9 Oct 2009 19:30:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B76C68FC15; Fri, 9 Oct 2009 19:30: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 n99JUNlE061869; Fri, 9 Oct 2009 19:30:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n99JUNbc061867; Fri, 9 Oct 2009 19:30:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200910091930.n99JUNbc061867@svn.freebsd.org> From: Michael Tuexen Date: Fri, 9 Oct 2009 19:30: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: r197914 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2009 19:30:23 -0000 Author: tuexen Date: Fri Oct 9 19:30:23 2009 New Revision: 197914 URL: http://svn.freebsd.org/changeset/base/197914 Log: Do not include vnet.h twice. Approved by: rrs (mentor) MFC after: 3 days Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Fri Oct 9 19:23:12 2009 (r197913) +++ head/sys/netinet/sctp_os_bsd.h Fri Oct 9 19:30:23 2009 (r197914) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 20:10: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 7F4FE10656C6; Fri, 9 Oct 2009 20:10:25 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail2.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADFC8FC0A; Fri, 9 Oct 2009 20:10:25 +0000 (UTC) Received: from pavillion-dv6425us.myhome.westell.com (pool-72-81-39-115.phlapa.east.verizon.net [72.81.39.115]) by mail2.asahi-net.or.jp (Postfix) with ESMTP id A794E8024E; Sat, 10 Oct 2009 04:49:27 +0900 (JST) Date: Fri, 9 Oct 2009 15:49:24 -0400 From: Yoshihiro Ota To: Xin LI Message-Id: <20091009154924.689f21e1.ota@j.email.ne.jp> In-Reply-To: <200910072317.n97NHFKL002393@svn.freebsd.org> References: <200910072317.n97NHFKL002393@svn.freebsd.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.12.11; i386-portbld-freebsd7.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ota@j.email.ne.jp, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197850 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2009 20:10:25 -0000 Could someone explain what was the cause and why this fixes the issue? When I read it, it looked like that a vm object could be in 2 locations and one of them looked the cause of the problem. But I couldn't figure out thereafter. Thanks, Hiro On Wed, 7 Oct 2009 23:17:15 +0000 (UTC) Xin LI wrote: > Author: delphij > Date: Wed Oct 7 23:17:15 2009 > New Revision: 197850 > URL: http://svn.freebsd.org/changeset/base/197850 > > Log: > Add a special workaround to handle UIO_NOCOPY case. This fixes data > corruption observed when sendfile() is being used. > > PR: kern/127213 > Submitted by: gk > MFC after: 2 weeks > > Modified: > head/sys/fs/tmpfs/tmpfs_vnops.c > > Modified: head/sys/fs/tmpfs/tmpfs_vnops.c > ============================================================================== > --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Oct 7 23:01:31 2009 (r197849) > +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Oct 7 23:17:15 2009 (r197850) > @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > #include > #include > @@ -428,15 +430,72 @@ tmpfs_setattr(struct vop_setattr_args *v > } > > /* --------------------------------------------------------------------- */ > +static int > +tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, > + vm_offset_t offset, size_t tlen, struct uio *uio) > +{ > + vm_page_t m; > + int error; > + > + VM_OBJECT_LOCK(tobj); > + vm_object_pip_add(tobj, 1); > + m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | > + VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); > + if (m->valid != VM_PAGE_BITS_ALL) { > + if (vm_pager_has_page(tobj, idx, NULL, NULL)) { > + error = vm_pager_get_pages(tobj, &m, 1, 0); > + if (error != 0) { > + printf("tmpfs get pages from pager error [read]\n"); > + goto out; > + } > + } else > + vm_page_zero_invalid(m, TRUE); > + } > + VM_OBJECT_UNLOCK(tobj); > + error = uiomove_fromphys(&m, offset, tlen, uio); > + VM_OBJECT_LOCK(tobj); > +out: > + vm_page_lock_queues(); > + vm_page_unwire(m, TRUE); > + vm_page_unlock_queues(); > + vm_page_wakeup(m); > + vm_object_pip_subtract(tobj, 1); > + VM_OBJECT_UNLOCK(tobj); > + > + return (error); > +} > + > +static __inline int > +tmpfs_nocacheread_buf(vm_object_t tobj, vm_pindex_t idx, > + vm_offset_t offset, size_t tlen, void *buf) > +{ > + struct uio uio; > + struct iovec iov; > + > + uio.uio_iovcnt = 1; > + uio.uio_iov = &iov; > + iov.iov_base = buf; > + iov.iov_len = tlen; > + > + uio.uio_offset = 0; > + uio.uio_resid = tlen; > + uio.uio_rw = UIO_READ; > + uio.uio_segflg = UIO_SYSSPACE; > + uio.uio_td = curthread; > + > + return (tmpfs_nocacheread(tobj, idx, offset, tlen, &uio)); > +} > > static int > tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) > { > + struct sf_buf *sf; > vm_pindex_t idx; > vm_page_t m; > vm_offset_t offset; > off_t addr; > size_t tlen; > + char *ma; > int error; > > addr = uio->uio_offset; > @@ -461,33 +520,30 @@ lookupvpg: > vm_page_wakeup(m); > VM_OBJECT_UNLOCK(vobj); > return (error); > + } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { > + if (vm_page_sleep_if_busy(m, FALSE, "tmfsmr")) > + goto lookupvpg; > + vm_page_busy(m); > + VM_OBJECT_UNLOCK(vobj); > + sched_pin(); > + sf = sf_buf_alloc(m, SFB_CPUPRIVATE); > + ma = (char *)sf_buf_kva(sf); > + error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen, > + ma + offset); > + if (error == 0) { > + uio->uio_offset += tlen; > + uio->uio_resid -= tlen; > + } > + sf_buf_free(sf); > + sched_unpin(); > + VM_OBJECT_LOCK(vobj); > + vm_page_wakeup(m); > + VM_OBJECT_UNLOCK(vobj); > + return (error); > } > VM_OBJECT_UNLOCK(vobj); > nocache: > - VM_OBJECT_LOCK(tobj); > - vm_object_pip_add(tobj, 1); > - m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | > - VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); > - if (m->valid != VM_PAGE_BITS_ALL) { > - if (vm_pager_has_page(tobj, idx, NULL, NULL)) { > - error = vm_pager_get_pages(tobj, &m, 1, 0); > - if (error != 0) { > - printf("tmpfs get pages from pager error [read]\n"); > - goto out; > - } > - } else > - vm_page_zero_invalid(m, TRUE); > - } > - VM_OBJECT_UNLOCK(tobj); > - error = uiomove_fromphys(&m, offset, tlen, uio); > - VM_OBJECT_LOCK(tobj); > -out: > - vm_page_lock_queues(); > - vm_page_unwire(m, TRUE); > - vm_page_unlock_queues(); > - vm_page_wakeup(m); > - vm_object_pip_subtract(tobj, 1); > - VM_OBJECT_UNLOCK(tobj); > + error = tmpfs_nocacheread(tobj, idx, offset, tlen, uio); > > return (error); > } > _______________________________________________ > 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" From owner-svn-src-all@FreeBSD.ORG Fri Oct 9 20:59: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 9ECC5106566B; Fri, 9 Oct 2009 20:59:07 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id 800D98FC1E; Fri, 9 Oct 2009 20:59:06 +0000 (UTC) Received: by bwz23 with SMTP id 23so908704bwz.43 for ; Fri, 09 Oct 2009 13:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=unyegRTtwxSw7jnjLBKkzw2MdOavlkAkzIsP17jQtFc=; b=q3lutsMdx/qEMZTv4fzveZ6xZAA1cOGnNuglt3oZlQ1AN9fypUxIobErKfsT9EKz9h L/ESiD7bcQ3U2K6mCqmfA3WoT+8u2sxEL4foow8aUfInRr0aC4nITEFQKkCigXayuTPd MYZX0yISGvaCNXteOWs2C25wzFfPmxTse89/Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=FWCTs7BwrbdHehuyeMCW8OvG/xk6AmFQ3uNs+JDFQwrScNNOs9BBM85oVhDYXBzmFk /gDfCEwt8zhQGWjTNarNw80ie0eVSJvmaFDSrm1cUsMM/2uvWzTNYRTwWDGw7f0O0MkT u1ehc/Kk8QzSvb9zIaaKWpJRZXPLoUNI54d7A= Received: by 10.204.32.75 with SMTP id b11mr768228bkd.94.1255121945069; Fri, 09 Oct 2009 13:59:05 -0700 (PDT) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id p17sm2386439fka.12.2009.10.09.13.59.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Oct 2009 13:59:04 -0700 (PDT) Date: Fri, 9 Oct 2009 23:58:42 +0300 From: Gleb Kurtsou To: Yoshihiro Ota Message-ID: <20091009205842.GA3808@tops> References: <200910072317.n97NHFKL002393@svn.freebsd.org> <20091009154924.689f21e1.ota@j.email.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20091009154924.689f21e1.ota@j.email.ne.jp> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r197850 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 09 Oct 2009 20:59:07 -0000 On (09/10/2009 15:49), Yoshihiro Ota wrote: > Could someone explain what was the cause and why this fixes the issue? > > When I read it, it looked like that a vm object could be in 2 locations > and one of them looked the cause of the problem. > But I couldn't figure out thereafter. kern_sendfile performs vm_page_grab which allocates a new page if not found. Then it calls VOP_READ with UIO_NOCOPY. The page itself is getting filled by bio routines, because it has no valid bits set (looks like allocbuf handles this case during buffer allocation). Both zfs and tmpfs do not use buffer management routines for io, that's why sendfile should be handled separately. There's also comment about this case in zfs: http://fxr.watson.org/fxr/source/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c?im=excerpts#L451 The patch does "real read" from swap backed storage (tobj) into that page. > > Thanks, > Hiro > > On Wed, 7 Oct 2009 23:17:15 +0000 (UTC) > Xin LI wrote: > > > Author: delphij > > Date: Wed Oct 7 23:17:15 2009 > > New Revision: 197850 > > URL: http://svn.freebsd.org/changeset/base/197850 > > > > Log: > > Add a special workaround to handle UIO_NOCOPY case. This fixes data > > corruption observed when sendfile() is being used. > > > > PR: kern/127213 > > Submitted by: gk > > MFC after: 2 weeks > > > > Modified: > > head/sys/fs/tmpfs/tmpfs_vnops.c > > > > Modified: head/sys/fs/tmpfs/tmpfs_vnops.c > > ============================================================================== > > --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Oct 7 23:01:31 2009 (r197849) > > +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Oct 7 23:17:15 2009 (r197850) > > @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > +#include > > +#include > > #include > > #include > > #include > > @@ -428,15 +430,72 @@ tmpfs_setattr(struct vop_setattr_args *v > > } > > > > /* --------------------------------------------------------------------- */ > > +static int > > +tmpfs_nocacheread(vm_object_t tobj, vm_pindex_t idx, > > + vm_offset_t offset, size_t tlen, struct uio *uio) > > +{ > > + vm_page_t m; > > + int error; > > + > > + VM_OBJECT_LOCK(tobj); > > + vm_object_pip_add(tobj, 1); > > + m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | > > + VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); > > + if (m->valid != VM_PAGE_BITS_ALL) { > > + if (vm_pager_has_page(tobj, idx, NULL, NULL)) { > > + error = vm_pager_get_pages(tobj, &m, 1, 0); > > + if (error != 0) { > > + printf("tmpfs get pages from pager error [read]\n"); > > + goto out; > > + } > > + } else > > + vm_page_zero_invalid(m, TRUE); > > + } > > + VM_OBJECT_UNLOCK(tobj); > > + error = uiomove_fromphys(&m, offset, tlen, uio); > > + VM_OBJECT_LOCK(tobj); > > +out: > > + vm_page_lock_queues(); > > + vm_page_unwire(m, TRUE); > > + vm_page_unlock_queues(); > > + vm_page_wakeup(m); > > + vm_object_pip_subtract(tobj, 1); > > + VM_OBJECT_UNLOCK(tobj); > > + > > + return (error); > > +} > > + > > +static __inline int > > +tmpfs_nocacheread_buf(vm_object_t tobj, vm_pindex_t idx, > > + vm_offset_t offset, size_t tlen, void *buf) > > +{ > > + struct uio uio; > > + struct iovec iov; > > + > > + uio.uio_iovcnt = 1; > > + uio.uio_iov = &iov; > > + iov.iov_base = buf; > > + iov.iov_len = tlen; > > + > > + uio.uio_offset = 0; > > + uio.uio_resid = tlen; > > + uio.uio_rw = UIO_READ; > > + uio.uio_segflg = UIO_SYSSPACE; > > + uio.uio_td = curthread; > > + > > + return (tmpfs_nocacheread(tobj, idx, offset, tlen, &uio)); > > +} > > > > static int > > tmpfs_mappedread(vm_object_t vobj, vm_object_t tobj, size_t len, struct uio *uio) > > { > > + struct sf_buf *sf; > > vm_pindex_t idx; > > vm_page_t m; > > vm_offset_t offset; > > off_t addr; > > size_t tlen; > > + char *ma; > > int error; > > > > addr = uio->uio_offset; > > @@ -461,33 +520,30 @@ lookupvpg: > > vm_page_wakeup(m); > > VM_OBJECT_UNLOCK(vobj); > > return (error); > > + } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { > > + if (vm_page_sleep_if_busy(m, FALSE, "tmfsmr")) > > + goto lookupvpg; > > + vm_page_busy(m); > > + VM_OBJECT_UNLOCK(vobj); > > + sched_pin(); > > + sf = sf_buf_alloc(m, SFB_CPUPRIVATE); > > + ma = (char *)sf_buf_kva(sf); > > + error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen, > > + ma + offset); > > + if (error == 0) { > > + uio->uio_offset += tlen; > > + uio->uio_resid -= tlen; > > + } > > + sf_buf_free(sf); > > + sched_unpin(); > > + VM_OBJECT_LOCK(vobj); > > + vm_page_wakeup(m); > > + VM_OBJECT_UNLOCK(vobj); > > + return (error); > > } > > VM_OBJECT_UNLOCK(vobj); > > nocache: > > - VM_OBJECT_LOCK(tobj); > > - vm_object_pip_add(tobj, 1); > > - m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | > > - VM_ALLOC_ZERO | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); > > - if (m->valid != VM_PAGE_BITS_ALL) { > > - if (vm_pager_has_page(tobj, idx, NULL, NULL)) { > > - error = vm_pager_get_pages(tobj, &m, 1, 0); > > - if (error != 0) { > > - printf("tmpfs get pages from pager error [read]\n"); > > - goto out; > > - } > > - } else > > - vm_page_zero_invalid(m, TRUE); > > - } > > - VM_OBJECT_UNLOCK(tobj); > > - error = uiomove_fromphys(&m, offset, tlen, uio); > > - VM_OBJECT_LOCK(tobj); > > -out: > > - vm_page_lock_queues(); > > - vm_page_unwire(m, TRUE); > > - vm_page_unlock_queues(); > > - vm_page_wakeup(m); > > - vm_object_pip_subtract(tobj, 1); > > - VM_OBJECT_UNLOCK(tobj); > > + error = tmpfs_nocacheread(tobj, idx, offset, tlen, uio); > > > > return (error); > > } > > _______________________________________________ > > 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" > _______________________________________________ > 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" From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 03:32: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 E223D1065676; Sat, 10 Oct 2009 03:32:46 +0000 (UTC) (envelope-from eri@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D18C38FC18; Sat, 10 Oct 2009 03:32: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 n9A3WkBb071803; Sat, 10 Oct 2009 03:32:46 GMT (envelope-from eri@svn.freebsd.org) Received: (from eri@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9A3Wkkm071801; Sat, 10 Oct 2009 03:32:46 GMT (envelope-from eri@svn.freebsd.org) Message-Id: <200910100332.n9A3Wkkm071801@svn.freebsd.org> From: Ermal Luçi Date: Sat, 10 Oct 2009 03:32: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: r197928 - head/sys/modules/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, 10 Oct 2009 03:32:47 -0000 Author: eri Date: Sat Oct 10 03:32:46 2009 New Revision: 197928 URL: http://svn.freebsd.org/changeset/base/197928 Log: Fix typo which has survived amazingly long! Approved by: mlaier(mentor) MFC after: 3 days Modified: head/sys/modules/pf/Makefile Modified: head/sys/modules/pf/Makefile ============================================================================== --- head/sys/modules/pf/Makefile Sat Oct 10 01:47:27 2009 (r197927) +++ head/sys/modules/pf/Makefile Sat Oct 10 03:32:46 2009 (r197928) @@ -28,7 +28,7 @@ opt_bpf.h: # pflog can be loaded as a module, have the additional checks turned on opt_pf.h: echo "#define DEV_PF 1" > ${.TARGET} - echo "#define DEF_PFLOG 1" >> ${.TARGET} + echo "#define DEV_PFLOG 1" >> ${.TARGET} .endif .include From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 13:59: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 9A1D6106566B; Sat, 10 Oct 2009 13:59:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81F588FC13; Sat, 10 Oct 2009 13:59: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 n9ADxJ9E083950; Sat, 10 Oct 2009 13:59:19 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ADxJBl083948; Sat, 10 Oct 2009 13:59:19 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200910101359.n9ADxJBl083948@svn.freebsd.org> From: Michael Tuexen Date: Sat, 10 Oct 2009 13:59: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: r197929 - 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: Sat, 10 Oct 2009 13:59:19 -0000 Author: tuexen Date: Sat Oct 10 13:59:18 2009 New Revision: 197929 URL: http://svn.freebsd.org/changeset/base/197929 Log: Correct include order as indicated by bz. Approved by: re (mentor) MFC after: 3 days Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sat Oct 10 03:32:46 2009 (r197928) +++ head/sys/netinet/sctp_os_bsd.h Sat Oct 10 13:59:18 2009 (r197929) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -77,8 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #ifdef IPSEC #include #include From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 14:10: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 9B9D81065679; Sat, 10 Oct 2009 14:10:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id 543948FC1F; Sat, 10 Oct 2009 14:10:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 8A7E441C6BB; Sat, 10 Oct 2009 16:10:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id QXaekqzfLoQQ; Sat, 10 Oct 2009 16:10:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 0714A41C66F; Sat, 10 Oct 2009 16:10:06 +0200 (CEST) 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 DACC94448E6; Sat, 10 Oct 2009 14:09:13 +0000 (UTC) Date: Sat, 10 Oct 2009 14:09:13 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Michael Tuexen In-Reply-To: <200910101359.n9ADxJBl083948@svn.freebsd.org> Message-ID: <20091010140858.T5956@maildrop.int.zabbadoz.net> References: <200910101359.n9ADxJBl083948@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: r197929 - 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: Sat, 10 Oct 2009 14:10:08 -0000 On Sat, 10 Oct 2009, Michael Tuexen wrote: > Author: tuexen > Date: Sat Oct 10 13:59:18 2009 > New Revision: 197929 > URL: http://svn.freebsd.org/changeset/base/197929 > > Log: > Correct include order as indicated by bz. > > Approved by: re (mentor) s,re,rrs, ? > MFC after: 3 days > > Modified: > head/sys/netinet/sctp_os_bsd.h > > Modified: head/sys/netinet/sctp_os_bsd.h > ============================================================================== > --- head/sys/netinet/sctp_os_bsd.h Sat Oct 10 03:32:46 2009 (r197928) > +++ head/sys/netinet/sctp_os_bsd.h Sat Oct 10 13:59:18 2009 (r197929) > @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include > #include > @@ -77,8 +78,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#include > - > #ifdef IPSEC > #include > #include > -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 14:56: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 22F9D1065672; Sat, 10 Oct 2009 14:56:35 +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 128948FC1A; Sat, 10 Oct 2009 14:56: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 n9AEuYp5085112; Sat, 10 Oct 2009 14:56:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AEuYIC085111; Sat, 10 Oct 2009 14:56:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910101456.n9AEuYIC085111@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 14:56: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: r197930 - 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: Sat, 10 Oct 2009 14:56:35 -0000 Author: kib Date: Sat Oct 10 14:56:34 2009 New Revision: 197930 URL: http://svn.freebsd.org/changeset/base/197930 Log: Postpone dropping fp till both kq_global and kqueue mutexes are unlocked. fdrop() closes file descriptor when reference count goes to zero. Close method for vnodes locks the vnode, resulting in "sleepable after non-sleepable". For pipes, pipe mutex is before kqueue lock, causing LOR. Reported and tested by: pho MFC after: 2 weeks Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Oct 10 13:59:18 2009 (r197929) +++ head/sys/kern/kern_event.c Sat Oct 10 14:56:34 2009 (r197930) @@ -1025,13 +1025,13 @@ findkn: /* knote is in the process of changing, wait for it to stablize. */ if (kn != NULL && (kn->kn_status & KN_INFLUX) == KN_INFLUX) { + KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); + kq->kq_state |= KQ_FLUXWAIT; + msleep(kq, &kq->kq_lock, PSOCK | PDROP, "kqflxwt", 0); if (fp != NULL) { fdrop(fp, td); fp = NULL; } - KQ_GLOBAL_UNLOCK(&kq_global, haskqglobal); - kq->kq_state |= KQ_FLUXWAIT; - msleep(kq, &kq->kq_lock, PSOCK | PDROP, "kqflxwt", 0); goto findkn; } From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 15:27: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 01E941065670; Sat, 10 Oct 2009 15:27:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id 8C45D8FC4D; Sat, 10 Oct 2009 15:27:09 +0000 (UTC) Received: from [192.168.1.100] (p5481DBC0.dip.t-dialin.net [84.129.219.192]) by mail-n.franken.de (Postfix) with ESMTP id 47C571C0B4607; Sat, 10 Oct 2009 17:27:08 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes From: Michael Tuexen In-Reply-To: <20091010140858.T5956@maildrop.int.zabbadoz.net> Date: Sat, 10 Oct 2009 17:27:07 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <200910101359.n9ADxJBl083948@svn.freebsd.org> <20091010140858.T5956@maildrop.int.zabbadoz.net> To: Bjoern A. Zeeb X-Mailer: Apple Mail (2.1076) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197929 - 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: Sat, 10 Oct 2009 15:27:10 -0000 On Oct 10, 2009, at 4:09 PM, Bjoern A. Zeeb wrote: > On Sat, 10 Oct 2009, Michael Tuexen wrote: > >> Author: tuexen >> Date: Sat Oct 10 13:59:18 2009 >> New Revision: 197929 >> URL: http://svn.freebsd.org/changeset/base/197929 >> >> Log: >> Correct include order as indicated by bz. >> >> Approved by: re (mentor) > > s,re,rrs, ? Sorry, rrs... Best regards Michael > > >> MFC after: 3 days >> >> Modified: >> head/sys/netinet/sctp_os_bsd.h >> >> Modified: head/sys/netinet/sctp_os_bsd.h >> = >> = >> = >> = >> = >> = >> = >> = >> = >> ===================================================================== >> --- head/sys/netinet/sctp_os_bsd.h Sat Oct 10 03:32:46 2009 (r197928) >> +++ head/sys/netinet/sctp_os_bsd.h Sat Oct 10 13:59:18 2009 (r197929) >> @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -77,8 +78,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> -#include >> - >> #ifdef IPSEC >> #include >> #include >> > > -- > Bjoern A. Zeeb It will not break if you know what you are > doing. > From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 15:27: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 3CA521065694; Sat, 10 Oct 2009 15:27:11 +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 12BD48FC14; Sat, 10 Oct 2009 15:27: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 n9AFRAsL085647; Sat, 10 Oct 2009 15:27:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AFRAwQ085645; Sat, 10 Oct 2009 15:27:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910101527.n9AFRAwQ085645@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 15:27: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: r197931 - 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: Sat, 10 Oct 2009 15:27:11 -0000 Author: kib Date: Sat Oct 10 15:27:10 2009 New Revision: 197931 URL: http://svn.freebsd.org/changeset/base/197931 Log: Calculate relocation base for the main object, and apply the relocation adjustment for all virtual addresses encoded into the ELF structures of it. PIE binary could and should be loaded at non-zero mapbase. For sym_zero pseudosymbol used as a return value from find_symdef() for undefined weak symbols, st_value also should be adjusted, since _rtld_bind corrects symbol values by relocbase. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Oct 10 14:56:34 2009 (r197930) +++ head/libexec/rtld-elf/rtld.c Sat Oct 10 15:27:10 2009 (r197931) @@ -474,6 +474,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ /* Initialize a fake symbol for resolving undefined weak references. */ sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE); sym_zero.st_shndx = SHN_UNDEF; + sym_zero.st_value = -(uintptr_t)obj_main->relocbase; if (!libmap_disable) libmap_disable = (bool)lm_init(libmap_override); @@ -991,26 +992,26 @@ digest_phdr(const Elf_Phdr *phdr, int ph obj = obj_new(); for (ph = phdr; ph < phlimit; ph++) { - switch (ph->p_type) { + if (ph->p_type != PT_PHDR) + continue; - case PT_PHDR: - if ((const Elf_Phdr *)ph->p_vaddr != phdr) { - _rtld_error("%s: invalid PT_PHDR", path); - return NULL; - } - obj->phdr = (const Elf_Phdr *) ph->p_vaddr; - obj->phsize = ph->p_memsz; - break; + obj->phdr = phdr; + obj->phsize = ph->p_memsz; + obj->relocbase = (caddr_t)phdr - ph->p_vaddr; + break; + } + + for (ph = phdr; ph < phlimit; ph++) { + switch (ph->p_type) { case PT_INTERP: - obj->interp = (const char *) ph->p_vaddr; + obj->interp = (const char *)(ph->p_vaddr + obj->relocbase); break; case PT_LOAD: if (nsegs == 0) { /* First load segment */ obj->vaddrbase = trunc_page(ph->p_vaddr); - obj->mapbase = (caddr_t) obj->vaddrbase; - obj->relocbase = obj->mapbase - obj->vaddrbase; + obj->mapbase = obj->vaddrbase + obj->relocbase; obj->textsize = round_page(ph->p_vaddr + ph->p_memsz) - obj->vaddrbase; } else { /* Last load segment */ @@ -1021,7 +1022,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph break; case PT_DYNAMIC: - obj->dynamic = (const Elf_Dyn *) ph->p_vaddr; + obj->dynamic = (const Elf_Dyn *)(ph->p_vaddr + obj->relocbase); break; case PT_TLS: @@ -1029,7 +1030,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph obj->tlssize = ph->p_memsz; obj->tlsalign = ph->p_align; obj->tlsinitsize = ph->p_filesz; - obj->tlsinit = (void*) ph->p_vaddr; + obj->tlsinit = (void*)(ph->p_vaddr + obj->relocbase); break; } } From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 15:28: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 98EEE1065697; Sat, 10 Oct 2009 15:28:52 +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 88ABF8FC14; Sat, 10 Oct 2009 15:28: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 n9AFSqFZ085712; Sat, 10 Oct 2009 15:28:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AFSqDs085710; Sat, 10 Oct 2009 15:28:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910101528.n9AFSqDs085710@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 15:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197932 - 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: Sat, 10 Oct 2009 15:28:52 -0000 Author: kib Date: Sat Oct 10 15:28:52 2009 New Revision: 197932 URL: http://svn.freebsd.org/changeset/base/197932 Log: Do not map segments of zero length. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Oct 10 15:27:10 2009 (r197931) +++ head/sys/kern/imgact_elf.c Sat Oct 10 15:28:52 2009 (r197932) @@ -635,7 +635,8 @@ __elfN(load_file)(struct proc *p, const } for (i = 0, numsegs = 0; i < hdr->e_phnum; i++) { - if (phdr[i].p_type == PT_LOAD) { /* Loadable segment */ + if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) { + /* Loadable segment */ prot = 0; if (phdr[i].p_flags & PF_X) prot |= VM_PROT_EXECUTE; @@ -764,6 +765,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i for (i = 0; i < hdr->e_phnum; i++) { switch (phdr[i].p_type) { case PT_LOAD: /* Loadable segment */ + if (phdr[i].p_memsz == 0) + break; prot = 0; if (phdr[i].p_flags & PF_X) prot |= VM_PROT_EXECUTE; From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 15:31: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 4C2C21065670; Sat, 10 Oct 2009 15:31:25 +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 2A2C88FC13; Sat, 10 Oct 2009 15:31: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 n9AFVPl6085803; Sat, 10 Oct 2009 15:31:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AFVOLI085794; Sat, 10 Oct 2009 15:31:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910101531.n9AFVOLI085794@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 15:31: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: r197933 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/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: Sat, 10 Oct 2009 15:31:25 -0000 Author: kib Date: Sat Oct 10 15:31:24 2009 New Revision: 197933 URL: http://svn.freebsd.org/changeset/base/197933 Log: Define architectural load bases for PIE binaries. Addresses were selected by looking at the bases used for non-relocatable executables by gnu ld(1), and adjusting it slightly. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time Modified: head/sys/amd64/include/elf.h head/sys/arm/include/elf.h head/sys/i386/include/elf.h head/sys/ia64/include/elf.h head/sys/mips/include/elf.h head/sys/powerpc/include/elf.h head/sys/sparc64/include/elf.h head/sys/sun4v/include/elf.h Modified: head/sys/amd64/include/elf.h ============================================================================== --- head/sys/amd64/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/amd64/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -106,4 +106,10 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_X86_64 #define ELF_TARG_VER 1 +#if __ELF_WORD_SIZE == 32 +#define ET_DYN_LOAD_ADDR 0x01001000 +#else +#define ET_DYN_LOAD_ADDR 0x01021000 +#endif + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/arm/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -97,4 +97,7 @@ __ElfType(Auxinfo); * value. */ #define MAGIC_TRAMP_NUMBER 0x5c000003 + +#define ET_DYN_LOAD_ADDR 0x12000 + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/i386/include/elf.h ============================================================================== --- head/sys/i386/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/i386/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -105,4 +105,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_386 #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x01001000 + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/ia64/include/elf.h ============================================================================== --- head/sys/ia64/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/ia64/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -141,4 +141,6 @@ __ElfType(Auxinfo); #define DT_IA_64_PLT_RESERVE 0x70000000 +#define ET_DYN_LOAD_ADDR 0x2500000000000000 + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/mips/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -250,4 +250,6 @@ __ElfType(Auxinfo); #define AT_COUNT 16 /* Count of defined aux entry types. */ +#define ET_DYN_LOAD_ADDR 0x0120000 + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/powerpc/include/elf.h ============================================================================== --- head/sys/powerpc/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/powerpc/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -96,4 +96,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH EM_PPC #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x01010000 + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/sparc64/include/elf.h ============================================================================== --- head/sys/sparc64/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/sparc64/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -97,4 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x150000000 + #endif /* !_MACHINE_ELF_H_ */ Modified: head/sys/sun4v/include/elf.h ============================================================================== --- head/sys/sun4v/include/elf.h Sat Oct 10 15:28:52 2009 (r197932) +++ head/sys/sun4v/include/elf.h Sat Oct 10 15:31:24 2009 (r197933) @@ -97,4 +97,6 @@ __ElfType(Auxinfo); #define ELF_TARG_MACH ELF_ARCH #define ELF_TARG_VER 1 +#define ET_DYN_LOAD_ADDR 0x150000000 + #endif /* !_MACHINE_ELF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 15:33: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 98BC5106568B; Sat, 10 Oct 2009 15:33:01 +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 6DED38FC38; Sat, 10 Oct 2009 15:33: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 n9AFX1Fw085872; Sat, 10 Oct 2009 15:33:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AFX1Gq085870; Sat, 10 Oct 2009 15:33:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910101533.n9AFX1Gq085870@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 15:33: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: r197934 - 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: Sat, 10 Oct 2009 15:33:01 -0000 Author: kib Date: Sat Oct 10 15:33:01 2009 New Revision: 197934 URL: http://svn.freebsd.org/changeset/base/197934 Log: Map PIE binaries at non-zero base address. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Oct 10 15:31:24 2009 (r197933) +++ head/sys/kern/imgact_elf.c Sat Oct 10 15:33:01 2009 (r197934) @@ -688,7 +688,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i u_long text_size = 0, data_size = 0, total_size = 0; u_long text_addr = 0, data_addr = 0; u_long seg_size, seg_addr; - u_long addr, entry = 0, proghdr = 0; + u_long addr, et_dyn_addr, entry = 0, proghdr = 0; int32_t osrel = 0; int error = 0, i; const char *interp = NULL, *newinterp = NULL; @@ -736,9 +736,12 @@ __CONCAT(exec_, __elfN(imgact))(struct i hdr->e_ident[EI_OSABI]); return (ENOEXEC); } - if (hdr->e_type == ET_DYN && - (brand_info->flags & BI_CAN_EXEC_DYN) == 0) - return (ENOEXEC); + if (hdr->e_type == ET_DYN) { + if ((brand_info->flags & BI_CAN_EXEC_DYN) == 0) + return (ENOEXEC); + et_dyn_addr = ET_DYN_LOAD_ADDR; + } else + et_dyn_addr = 0; sv = brand_info->sysvec; if (interp != NULL && brand_info->interp_newpath != NULL) newinterp = brand_info->interp_newpath; @@ -786,7 +789,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i if ((error = __elfN(load_section)(vmspace, imgp->object, phdr[i].p_offset, - (caddr_t)(uintptr_t)phdr[i].p_vaddr, + (caddr_t)(uintptr_t)phdr[i].p_vaddr + et_dyn_addr, phdr[i].p_memsz, phdr[i].p_filesz, prot, sv->sv_pagesize)) != 0) return (error); @@ -800,11 +803,12 @@ __CONCAT(exec_, __elfN(imgact))(struct i if (phdr[i].p_offset == 0 && hdr->e_phoff + hdr->e_phnum * hdr->e_phentsize <= phdr[i].p_filesz) - proghdr = phdr[i].p_vaddr + hdr->e_phoff; + proghdr = phdr[i].p_vaddr + hdr->e_phoff + + et_dyn_addr; - seg_addr = trunc_page(phdr[i].p_vaddr); + seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr); seg_size = round_page(phdr[i].p_memsz + - phdr[i].p_vaddr - seg_addr); + phdr[i].p_vaddr + et_dyn_addr - seg_addr); /* * Is this .text or .data? We can't use @@ -826,7 +830,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i phdr[i].p_memsz)) { text_size = seg_size; text_addr = seg_addr; - entry = (u_long)hdr->e_entry; + entry = (u_long)hdr->e_entry + et_dyn_addr; } else { data_size = seg_size; data_addr = seg_addr; @@ -834,7 +838,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i total_size += seg_size; break; case PT_PHDR: /* Program header table info */ - proghdr = phdr[i].p_vaddr; + proghdr = phdr[i].p_vaddr + et_dyn_addr; break; default: break; From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 18:24: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 73CCB1065672; Sat, 10 Oct 2009 18:24:54 +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 5FBB38FC08; Sat, 10 Oct 2009 18:24: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 n9AIOs34089152; Sat, 10 Oct 2009 18:24:54 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AIOscH089148; Sat, 10 Oct 2009 18:24:54 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200910101824.n9AIOscH089148@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 10 Oct 2009 18:24: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: r197938 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/uart dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2009 18:24:54 -0000 Author: marcel Date: Sat Oct 10 18:24:54 2009 New Revision: 197938 URL: http://svn.freebsd.org/changeset/base/197938 Log: MFC change 197721: Fix RTS/CTS flow control, broken by the TTY overhaul. The new TTY interface is fairly simple WRT dealing with flow control, but needed 2 new RX buffer functions with "get-char-from-buf" separated from "advance-buf-pointer" so that the pointer could be advanced only when ttydisc_rint() succeeded. Approved by: re (kib) Modified: 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/uart/uart_bus.h stable/8/sys/dev/uart/uart_core.c stable/8/sys/dev/uart/uart_tty.c stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus.h ============================================================================== --- stable/8/sys/dev/uart/uart_bus.h Sat Oct 10 17:56:18 2009 (r197937) +++ stable/8/sys/dev/uart/uart_bus.h Sat Oct 10 18:24:54 2009 (r197938) @@ -96,6 +96,7 @@ struct uart_softc { int sc_opened:1; /* This UART is open for business. */ int sc_polled:1; /* This UART has no interrupts. */ int sc_txbusy:1; /* This UART is transmitting. */ + int sc_isquelch:1; /* This UART has input squelched. */ struct uart_devinfo *sc_sysdev; /* System device (or NULL). */ @@ -141,6 +142,8 @@ int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); int uart_bus_sysdev(device_t dev); +void uart_sched_softih(struct uart_softc *, uint32_t); + int uart_tty_attach(struct uart_softc *); int uart_tty_detach(struct uart_softc *); void uart_tty_intr(void *arg); @@ -175,6 +178,28 @@ uart_rx_get(struct uart_softc *sc) } static __inline int +uart_rx_next(struct uart_softc *sc) +{ + int ptr; + + ptr = sc->sc_rxget; + if (ptr == sc->sc_rxput) + return (-1); + ptr += 1; + sc->sc_rxget = (ptr < sc->sc_rxbufsz) ? ptr : 0; + return (0); +} + +static __inline int +uart_rx_peek(struct uart_softc *sc) +{ + int ptr; + + ptr = sc->sc_rxget; + return ((ptr == sc->sc_rxput) ? -1 : sc->sc_rxbuf[ptr]); +} + +static __inline int uart_rx_put(struct uart_softc *sc, int xc) { int ptr; Modified: stable/8/sys/dev/uart/uart_core.c ============================================================================== --- stable/8/sys/dev/uart/uart_core.c Sat Oct 10 17:56:18 2009 (r197937) +++ stable/8/sys/dev/uart/uart_core.c Sat Oct 10 18:24:54 2009 (r197938) @@ -91,7 +91,7 @@ uart_getrange(struct uart_class *uc) * Schedule a soft interrupt. We do this on the 0 to !0 transition * of the TTY pending interrupt status. */ -static void +void uart_sched_softih(struct uart_softc *sc, uint32_t ipend) { uint32_t new, old; Modified: stable/8/sys/dev/uart/uart_tty.c ============================================================================== --- stable/8/sys/dev/uart/uart_tty.c Sat Oct 10 17:56:18 2009 (r197937) +++ stable/8/sys/dev/uart/uart_tty.c Sat Oct 10 18:24:54 2009 (r197938) @@ -166,27 +166,6 @@ uart_tty_outwakeup(struct tty *tp) if (sc == NULL || sc->sc_leaving) return; - /* - * Handle input flow control. Note that if we have hardware support, - * we don't do anything here. We continue to receive until our buffer - * is full. At that time we cannot empty the UART itself and it will - * de-assert RTS for us. In that situation we're completely stuffed. - * Without hardware support, we need to toggle RTS ourselves. - */ - if ((tp->t_termios.c_cflag & CRTS_IFLOW) && !sc->sc_hwiflow) { -#if 0 - /*if ((tp->t_state & TS_TBLOCK) && - (sc->sc_hwsig & SER_RTS)) - UART_SETSIG(sc, SER_DRTS); - else */ if (/*!(tp->t_state & TS_TBLOCK) &&*/ - !(sc->sc_hwsig & SER_RTS)) - UART_SETSIG(sc, SER_DRTS|SER_RTS); -#endif - /* XXX: we should use inwakeup to implement this! */ - if (!(sc->sc_hwsig & SER_RTS)) - UART_SETSIG(sc, SER_DRTS|SER_RTS); - } - if (sc->sc_txbusy) return; @@ -195,6 +174,23 @@ uart_tty_outwakeup(struct tty *tp) UART_TRANSMIT(sc); } +static void +uart_tty_inwakeup(struct tty *tp) +{ + struct uart_softc *sc; + + sc = tty_softc(tp); + if (sc == NULL || sc->sc_leaving) + return; + + if (sc->sc_isquelch) { + if ((tp->t_termios.c_cflag & CRTS_IFLOW) && !sc->sc_hwiflow) + UART_SETSIG(sc, SER_DRTS|SER_RTS); + sc->sc_isquelch = 0; + uart_sched_softih(sc, SER_INT_RXREADY); + } +} + static int uart_tty_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) { @@ -252,9 +248,9 @@ uart_tty_param(struct tty *tp, struct te UART_SETSIG(sc, SER_DDTR | SER_DTR); /* Set input flow control state. */ if (!sc->sc_hwiflow) { - /* if ((t->c_cflag & CRTS_IFLOW) && (tp->t_state & TS_TBLOCK)) + if ((t->c_cflag & CRTS_IFLOW) && sc->sc_isquelch) UART_SETSIG(sc, SER_DRTS); - else */ + else UART_SETSIG(sc, SER_DRTS | SER_RTS); } else UART_IOCTL(sc, UART_IOCTL_IFLOW, (t->c_cflag & CRTS_IFLOW)); @@ -294,8 +290,8 @@ uart_tty_intr(void *arg) tty_lock(tp); if (pend & SER_INT_RXREADY) { - while (!uart_rx_empty(sc) /* && !(tp->t_state & TS_TBLOCK)*/) { - xc = uart_rx_get(sc); + while (!uart_rx_empty(sc) && !sc->sc_isquelch) { + xc = uart_rx_peek(sc); c = xc & 0xff; if (xc & UART_STAT_FRAMERR) err |= TRE_FRAMING; @@ -303,7 +299,13 @@ uart_tty_intr(void *arg) err |= TRE_OVERRUN; if (xc & UART_STAT_PARERR) err |= TRE_PARITY; - ttydisc_rint(tp, c, err); + if (ttydisc_rint(tp, c, err) != 0) { + sc->sc_isquelch = 1; + if ((tp->t_termios.c_cflag & CRTS_IFLOW) && + !sc->sc_hwiflow) + UART_SETSIG(sc, SER_DRTS); + } else + uart_rx_next(sc); } } @@ -344,6 +346,7 @@ static struct ttydevsw uart_tty_class = .tsw_open = uart_tty_open, .tsw_close = uart_tty_close, .tsw_outwakeup = uart_tty_outwakeup, + .tsw_inwakeup = uart_tty_inwakeup, .tsw_ioctl = uart_tty_ioctl, .tsw_param = uart_tty_param, .tsw_modem = uart_tty_modem, From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 21:10: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 BBBE91065676; Sat, 10 Oct 2009 21:10:49 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8F008FC0C; Sat, 10 Oct 2009 21:10: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 n9ALAnoI092459; Sat, 10 Oct 2009 21:10:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ALAnSF092458; Sat, 10 Oct 2009 21:10:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200910102110.n9ALAnSF092458@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sat, 10 Oct 2009 21:10: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: r197941 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2009 21:10:49 -0000 Author: des Date: Sat Oct 10 21:10:49 2009 New Revision: 197941 URL: http://svn.freebsd.org/changeset/base/197941 Log: Fix mergeinfo for r196843 (r196518) and r196997 (r196519). Folks, *please* use 'svn merge' instead of applying patches manually! Approved by: re (kib) Modified: 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) From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 21:17: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 B39361065670; Sat, 10 Oct 2009 21:17:30 +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 A2D228FC13; Sat, 10 Oct 2009 21:17: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 n9ALHUO5092619; Sat, 10 Oct 2009 21:17:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ALHUKW092617; Sat, 10 Oct 2009 21:17:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910102117.n9ALHUKW092617@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 21:17: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: r197942 - 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: Sat, 10 Oct 2009 21:17:30 -0000 Author: kib Date: Sat Oct 10 21:17:30 2009 New Revision: 197942 URL: http://svn.freebsd.org/changeset/base/197942 Log: Refine r195509, instead of checking that vnode type is VBAD, that is set quite late in the revocation path, properly verify that vnode is not doomed before calling VOP. Reported and tested by: Harald Schmalzbauer MFC after: 3 days Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Oct 10 21:10:49 2009 (r197941) +++ head/sys/kern/kern_exit.c Sat Oct 10 21:17:30 2009 (r197942) @@ -340,10 +340,10 @@ exit1(struct thread *td, int rv) if (ttyvp != NULL) { sx_xunlock(&proctree_lock); - vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); - if (ttyvp->v_type != VBAD) + if (vn_lock(ttyvp, LK_EXCLUSIVE) == 0) { VOP_REVOKE(ttyvp, REVOKEALL); - VOP_UNLOCK(ttyvp, 0); + VOP_UNLOCK(ttyvp, 0); + } sx_xlock(&proctree_lock); } } From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 21:49: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 D0E84106566B; Sat, 10 Oct 2009 21:49:04 +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 C02318FC1A; Sat, 10 Oct 2009 21:49: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 n9ALn4EP093282; Sat, 10 Oct 2009 21:49:04 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ALn4Br093280; Sat, 10 Oct 2009 21:49:04 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200910102149.n9ALn4Br093280@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sat, 10 Oct 2009 21:49: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: r197945 - head/sys/dev/fdc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2009 21:49:04 -0000 Author: trasz Date: Sat Oct 10 21:49:04 2009 New Revision: 197945 URL: http://svn.freebsd.org/changeset/base/197945 Log: Orphaning provider with EXDEV seems weird; perhaps the author meant ENXIO here? Modified: head/sys/dev/fdc/fdc.c Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Sat Oct 10 21:43:04 2009 (r197944) +++ head/sys/dev/fdc/fdc.c Sat Oct 10 21:49:04 2009 (r197945) @@ -864,7 +864,7 @@ fdc_worker(struct fdc_data *fdc) fd->flags |= FD_NEWDISK; mtx_unlock(&fdc->fdc_mtx); g_topology_lock(); - g_orphan_provider(fd->fd_provider, EXDEV); + g_orphan_provider(fd->fd_provider, ENXIO); fd->fd_provider->flags |= G_PF_WITHER; fd->fd_provider = g_new_providerf(fd->fd_geom, fd->fd_geom->name); From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 22:17: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 3E5021065693; Sat, 10 Oct 2009 22:17:04 +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 2C4618FC1A; Sat, 10 Oct 2009 22:17: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 n9AMH3HW093884; Sat, 10 Oct 2009 22:17:03 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AMH3hU093866; Sat, 10 Oct 2009 22:17:03 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200910102217.n9AMH3hU093866@svn.freebsd.org> From: Doug Barton Date: Sat, 10 Oct 2009 22:17: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: r197947 - in head/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2009 22:17:04 -0000 Author: dougb Date: Sat Oct 10 22:17:03 2009 New Revision: 197947 URL: http://svn.freebsd.org/changeset/base/197947 Log: In regards to the "Starting foo:" type messages at boot time, create and employ a more generic solution, and use it in the individual rc.d scripts that also have an $rc_quiet test: 1. Add check_startmsgs() to rc.subr. 2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute variations of [ -z "$rc_quiet" ] with check_startmsgs 3. In savecore add a trailing '.' to the end of the message to make it more consistent with other scripts. 4. In newsyslog remove a : before the terminal '.' since we do not expect there to be anything printed out in between to make it more consistent. 5. In the following scripts change "quotes" to 'quotes' where no variables exist in the message: savecore pf newsyslog 6. In the following scripts substitute if/then/fi for the simpler (and more consistent) check_startmsgs &&: faith stf 7. In the following scripts separate the "Starting foo:" from the terminal '.' to make them more consistent: moused hostname pf 8. In nfsclient move the message to its own line to avoid a style bug 9. In pf rc_quiet does not apply to the _stop method, so remove the test there. 10. In motd add 'quotes' around the terminal '.' for consistency Modified: head/etc/rc.d/bgfsck head/etc/rc.d/cleartmp head/etc/rc.d/faith head/etc/rc.d/fsck head/etc/rc.d/hostid head/etc/rc.d/hostname head/etc/rc.d/ldconfig head/etc/rc.d/motd head/etc/rc.d/mountcritlocal head/etc/rc.d/moused head/etc/rc.d/netif head/etc/rc.d/newsyslog head/etc/rc.d/nfsclient head/etc/rc.d/pf head/etc/rc.d/savecore head/etc/rc.d/stf head/etc/rc.subr Modified: head/etc/rc.d/bgfsck ============================================================================== --- head/etc/rc.d/bgfsck Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/bgfsck Sat Oct 10 22:17:03 2009 (r197947) @@ -31,7 +31,7 @@ bgfsck_start () bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds" fi if [ -z "${rc_force}" ]; then - [ -z "${rc_quiet}" ] && echo "${bgfsck_msg}." + check_startmsgs && echo "${bgfsck_msg}." fi (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \ Modified: head/etc/rc.d/cleartmp ============================================================================== --- head/etc/rc.d/cleartmp Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/cleartmp Sat Oct 10 22:17:03 2009 (r197947) @@ -25,7 +25,7 @@ cleartmp_start() ${tmp}/.ICE-unix ${tmp}/.font-unix" if checkyesno ${rcvar1}; then - [ -z "${rc_quiet}" ] && echo "Clearing ${tmp}." + check_startmsgs && echo "Clearing ${tmp}." # This is not needed for mfs, but doesn't hurt anything. # Things to note: @@ -44,7 +44,7 @@ cleartmp_start() elif checkyesno clear_tmp_X; then # Remove X lock files, since they will prevent you from # restarting X. Remove other X related directories. - [ -z "${rc_quiet}" ] && echo "Clearing ${tmp} (X related)." + check_startmsgs && echo "Clearing ${tmp} (X related)." rm -rf ${tmp}/.X[0-9]-lock ${x11_socket_dirs} fi if checkyesno clear_tmp_X; then Modified: head/etc/rc.d/faith ============================================================================== --- head/etc/rc.d/faith Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/faith Sat Oct 10 22:17:03 2009 (r197947) @@ -39,9 +39,7 @@ faith_up() route change -inet6 ${prefix} -prefixlen ${prefixlen} \ -ifp faith0 done - if [ -z "${rc_quiet}" ]; then - ifconfig faith0 - fi + check_startmsgs && ifconfig faith0 ;; esac } Modified: head/etc/rc.d/fsck ============================================================================== --- head/etc/rc.d/fsck Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/fsck Sat Oct 10 22:17:03 2009 (r197947) @@ -23,7 +23,7 @@ fsck_start() # During fsck ignore SIGQUIT trap : 3 - [ -z "${rc_quiet}" ] && echo "Starting file system checks:" + check_startmsgs && echo "Starting file system checks:" if checkyesno background_fsck; then fsck -F -p else Modified: head/etc/rc.d/hostid ============================================================================== --- head/etc/rc.d/hostid Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/hostid Sat Oct 10 22:17:03 2009 (r197947) @@ -49,9 +49,9 @@ hostid_set() # Set both kern.hostuuid and kern.hostid. # - [ -z "${rc_quiet}" ] && echo "Setting hostuuid: ${uuid}." + check_startmsgs && echo "Setting hostuuid: ${uuid}." ${SYSCTL_W} kern.hostuuid="${uuid}" >/dev/null - [ -z "${rc_quiet}" ] && echo "Setting hostid: ${id}." + check_startmsgs && echo "Setting hostid: ${id}." ${SYSCTL_W} kern.hostid=${id} >/dev/null } Modified: head/etc/rc.d/hostname ============================================================================== --- head/etc/rc.d/hostname Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/hostname Sat Oct 10 22:17:03 2009 (r197947) @@ -72,8 +72,9 @@ hostname_start() # All right, it is safe to invoke hostname(1) now. # - [ -z "${rc_quiet}" ] && echo "Setting hostname: ${hostname}." + check_startmsgs && echo -n "Setting hostname: ${hostname}" /bin/hostname "${hostname}" + check_startmsgs && echo '.' } load_rc_config $name Modified: head/etc/rc.d/ldconfig ============================================================================== --- head/etc/rc.d/ldconfig Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/ldconfig Sat Oct 10 22:17:03 2009 (r197947) @@ -36,7 +36,7 @@ ldconfig_start() _LDC="${_LDC} ${i}" fi done - [ -z "${rc_quiet}" ] && echo 'ELF ldconfig path:' ${_LDC} + check_startmsgs && echo 'ELF ldconfig path:' ${_LDC} ${ldconfig} -elf ${_ins} ${_LDC} case `sysctl -n hw.machine_arch` in @@ -55,7 +55,7 @@ ldconfig_start() _LDC="${_LDC} ${i}" fi done - [ -z "${rc_quiet}" ] && + check_startmsgs && echo '32-bit compatibility ldconfig path:' ${_LDC} ${ldconfig} -32 -m ${_ins} ${_LDC} ;; @@ -72,8 +72,7 @@ ldconfig_start() _LDC="${_LDC} ${i}" fi done - [ -z "${rc_quiet}" ] && - echo 'a.out ldconfig path:' ${_LDC} + check_startmsgs && echo 'a.out ldconfig path:' ${_LDC} ${ldconfig} -aout ${_ins} ${_LDC} ;; esac Modified: head/etc/rc.d/motd ============================================================================== --- head/etc/rc.d/motd Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/motd Sat Oct 10 22:17:03 2009 (r197947) @@ -22,7 +22,7 @@ motd_start() # Must be done *before* interactive logins are possible # to prevent possible race conditions. # - [ -z "${rc_quiet}" ] && echo -n 'Updating motd:' + check_startmsgs && echo -n 'Updating motd:' if [ ! -f /etc/motd ]; then install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd fi @@ -42,7 +42,7 @@ motd_start() } rm -f $T - [ -z "${rc_quiet}" ] && echo . + check_startmsgs && echo '.' } load_rc_config $name Modified: head/etc/rc.d/mountcritlocal ============================================================================== --- head/etc/rc.d/mountcritlocal Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/mountcritlocal Sat Oct 10 22:17:03 2009 (r197947) @@ -28,7 +28,7 @@ mountcritlocal_start() esac # Mount everything except nfs filesystems. - [ -z "${rc_quiet}" ] && echo -n 'Mounting local file systems:' + check_startmsgs && echo -n 'Mounting local file systems:' mount_excludes='no' for i in ${netfs_types}; do fstype=${i%:*} @@ -37,7 +37,7 @@ mountcritlocal_start() mount_excludes=${mount_excludes%,} mount -a -t ${mount_excludes} err=$? - [ -z "${rc_quiet}" ] && echo '.' + check_startmsgs && echo '.' case ${err} in 0) Modified: head/etc/rc.d/moused ============================================================================== --- head/etc/rc.d/moused Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/moused Sat Oct 10 22:17:03 2009 (r197947) @@ -51,8 +51,9 @@ moused_start() mytype="$moused_type" fi - [ -z "${rc_quiet}" ] && echo -n "Starting ${ms} moused." + check_startmsgs && echo -n "Starting ${ms} moused" /usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${pidarg} + check_startmsgs && echo '.' mousechar_arg= case ${mousechar_start} in Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/netif Sat Oct 10 22:17:03 2009 (r197947) @@ -143,7 +143,7 @@ network_common() ;; esac echo "${_str} Network:${_ok}." - if [ -z "${rc_quiet}" ]; then + if check_startmsgs; then for ifn in ${_ok}; do /sbin/ifconfig ${ifn} done Modified: head/etc/rc.d/newsyslog ============================================================================== --- head/etc/rc.d/newsyslog Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/newsyslog Sat Oct 10 22:17:03 2009 (r197947) @@ -17,9 +17,9 @@ stop_cmd=":" newsyslog_start() { - [ -z "${rc_quiet}" ] && echo -n "Creating and/or trimming log files:" + check_startmsgs && echo -n 'Creating and/or trimming log files' ${command} ${rc_flags} - [ -z "${rc_quiet}" ] && echo "." + check_startmsgs && echo '.' } load_rc_config $name Modified: head/etc/rc.d/nfsclient ============================================================================== --- head/etc/rc.d/nfsclient Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/nfsclient Sat Oct 10 22:17:03 2009 (r197947) @@ -22,7 +22,8 @@ nfsclient_start() # if [ -n "${nfs_access_cache}" ]; then - [ -z "${rc_quiet}" ] && echo "NFS access cache time=${nfs_access_cache}" + check_startmsgs && + echo "NFS access cache time=${nfs_access_cache}" if ! sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null; then warn "failed to set access cache timeout" fi Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/pf Sat Oct 10 22:17:03 2009 (r197947) @@ -25,19 +25,21 @@ required_modules="pf" pf_start() { - [ -z "${rc_quiet}" ] && echo "Enabling pf." + check_startmsgs && echo -n 'Enabling pf' $pf_program -F all > /dev/null 2>&1 $pf_program -f "$pf_rules" $pf_flags if ! $pf_program -s info | grep -q "Enabled" ; then $pf_program -e fi + check_startmsgs && echo '.' } pf_stop() { if $pf_program -s info | grep -q "Enabled" ; then - [ -z "${rc_quiet}" ] && echo "Disabling pf." + echo -n 'Disabling pf' $pf_program -d + echo '.' fi } Modified: head/etc/rc.d/savecore ============================================================================== --- head/etc/rc.d/savecore Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/savecore Sat Oct 10 22:17:03 2009 (r197947) @@ -69,7 +69,7 @@ savecore_start() ${crashinfo_program} -d ${dumpdir} fi else - [ -z "${rc_quiet}" ] && echo "No core dumps found" + check_startmsgs && echo 'No core dumps found.' fi } Modified: head/etc/rc.d/stf ============================================================================== --- head/etc/rc.d/stf Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.d/stf Sat Oct 10 22:17:03 2009 (r197947) @@ -53,9 +53,8 @@ stf_up() ifconfig stf0 create >/dev/null 2>&1 ifconfig stf0 inet6 2002:${ipv4_in_hexformat}:${stf_interface_ipv6_slaid:-0}:${stf_interface_ipv6_ifid} \ prefixlen ${stf_prefixlen} - if [ -z "${rc_quiet}" ]; then - /sbin/ifconfig stf0 - fi + check_startmsgs && /sbin/ifconfig stf0 + # disallow packets to malicious 6to4 prefix route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Oct 10 21:56:39 2009 (r197946) +++ head/etc/rc.subr Sat Oct 10 22:17:03 2009 (r197947) @@ -398,6 +398,20 @@ wait_for_pids() } # +# check_startmsgs +# If rc_quiet is set (usually as a result of using faststart at +# boot time) check if rc_startmsgs is enabled. +# +check_startmsgs() +{ + if [ -n "$rc_quiet" ]; then + checkyesno rc_startmsgs + else + return 0 + fi +} + +# # run_rc_command argument # Search for argument in the list of supported commands, which is: # "start stop restart rcvar status poll ${extra_commands}" @@ -708,13 +722,7 @@ run_rc_command() # setup the full command to run # - _show_startmsgs=1 - if [ -n "${rc_quiet}" ]; then - if ! checkyesno rc_startmsgs; then - unset _show_startmsgs - fi - fi - [ -n "$_show_startmsgs" ] && echo "Starting ${name}." + check_startmsgs && echo "Starting ${name}." if [ -n "$_chroot" ]; then _doit="\ ${_nice:+nice -n $_nice }\ From owner-svn-src-all@FreeBSD.ORG Sat Oct 10 22:29: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 BB0B91065670; Sat, 10 Oct 2009 22:29:34 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8F078FC15; Sat, 10 Oct 2009 22:29: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 n9AMTYhf094210; Sat, 10 Oct 2009 22:29:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9AMTYoQ094207; Sat, 10 Oct 2009 22:29:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200910102229.n9AMTYoQ094207@svn.freebsd.org> From: Rui Paulo Date: Sat, 10 Oct 2009 22:29: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: r197948 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 10 Oct 2009 22:29:34 -0000 Author: rpaulo Date: Sat Oct 10 22:29:34 2009 New Revision: 197948 URL: http://svn.freebsd.org/changeset/base/197948 Log: Atheros EEPROM version 4K. This version is mostly based on version 1.4. This is needed by the upcoming AR9285 support. Information on the layout gathered from Linux ath9k. Not yet connected to the build. Tested by: Eugeny Dzhurinsky Added: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c (contents, props changed) head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h (contents, props changed) Added: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Sat Oct 10 22:29:34 2009 (r197948) @@ -0,0 +1,404 @@ +/* + * Copyright (c) 2009 Rui Paulo + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * Copyright (c) 2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_eeprom_v14.h" +#include "ah_eeprom_v4k.h" + +static HAL_STATUS +v4kEepromGet(struct ath_hal *ah, int param, void *val) +{ +#define CHAN_A_IDX 0 +#define CHAN_B_IDX 1 +#define IS_VERS(op, v) ((pBase->version & AR5416_EEP_VER_MINOR_MASK) op (v)) + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader; + const BASE_EEP4K_HEADER *pBase = &ee->ee_base.baseEepHeader; + uint32_t sum; + uint8_t *macaddr; + int i; + + switch (param) { + case AR_EEP_NFTHRESH_5: + *(int16_t *)val = pModal[0].noiseFloorThreshCh[0]; + return HAL_OK; + case AR_EEP_NFTHRESH_2: + *(int16_t *)val = pModal[1].noiseFloorThreshCh[0]; + return HAL_OK; + case AR_EEP_MACADDR: /* Get MAC Address */ + sum = 0; + macaddr = val; + for (i = 0; i < 6; i++) { + macaddr[i] = pBase->macAddr[i]; + sum += pBase->macAddr[i]; + } + if (sum == 0 || sum == 0xffff*3) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad mac address %s\n", + __func__, ath_hal_ether_sprintf(macaddr)); + return HAL_EEBADMAC; + } + return HAL_OK; + case AR_EEP_REGDMN_0: + return pBase->regDmn[0]; + case AR_EEP_REGDMN_1: + return pBase->regDmn[1]; + case AR_EEP_OPCAP: + return pBase->deviceCap; + case AR_EEP_OPMODE: + return pBase->opCapFlags; + case AR_EEP_RFSILENT: + return pBase->rfSilent; + case AR_EEP_OB_5: + return pModal[CHAN_A_IDX].ob; + case AR_EEP_DB_5: + return pModal[CHAN_A_IDX].db; + case AR_EEP_OB_2: + return pModal[CHAN_B_IDX].ob; + case AR_EEP_DB_2: + return pModal[CHAN_B_IDX].db; + case AR_EEP_TXMASK: + return pBase->txMask; + case AR_EEP_RXMASK: + return pBase->rxMask; + case AR_EEP_RXGAIN_TYPE: + return AR5416_EEP_RXGAIN_ORIG; + case AR_EEP_TXGAIN_TYPE: + return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? + pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; +#if 0 + case AR_EEP_OL_PWRCTRL: + HALASSERT(val == AH_NULL); + return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; +#endif + case AR_EEP_AMODE: + HALASSERT(val == AH_NULL); + return pBase->opCapFlags & AR5416_OPFLAGS_11A ? + HAL_OK : HAL_EIO; + case AR_EEP_BMODE: + case AR_EEP_GMODE: + HALASSERT(val == AH_NULL); + return pBase->opCapFlags & AR5416_OPFLAGS_11G ? + HAL_OK : HAL_EIO; + case AR_EEP_32KHZCRYSTAL: + case AR_EEP_COMPRESS: + case AR_EEP_FASTFRAME: /* XXX policy decision, h/w can do it */ + case AR_EEP_WRITEPROTECT: /* NB: no write protect bit */ + HALASSERT(val == AH_NULL); + /* fall thru... */ + case AR_EEP_MAXQCU: /* NB: not in opCapFlags */ + case AR_EEP_KCENTRIES: /* NB: not in opCapFlags */ + return HAL_EIO; + case AR_EEP_AES: + case AR_EEP_BURST: + case AR_EEP_RFKILL: + case AR_EEP_TURBO5DISABLE: + case AR_EEP_TURBO2DISABLE: + HALASSERT(val == AH_NULL); + return HAL_OK; + case AR_EEP_ANTGAINMAX_2: + *(int8_t *) val = ee->ee_antennaGainMax[1]; + return HAL_OK; + case AR_EEP_ANTGAINMAX_5: + *(int8_t *) val = ee->ee_antennaGainMax[0]; + return HAL_OK; + default: + HALASSERT(0); + return HAL_EINVAL; + } +#undef IS_VERS +#undef CHAN_A_IDX +#undef CHAN_B_IDX +} + +static HAL_BOOL +v4kEepromSet(struct ath_hal *ah, int param, int v) +{ + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + + switch (param) { + case AR_EEP_ANTGAINMAX_2: + ee->ee_antennaGainMax[1] = (int8_t) v; + return HAL_OK; + case AR_EEP_ANTGAINMAX_5: + ee->ee_antennaGainMax[0] = (int8_t) v; + return HAL_OK; + } + return HAL_EINVAL; +} + +static HAL_BOOL +v4kEepromDiag(struct ath_hal *ah, int request, + const void *args, uint32_t argsize, void **result, uint32_t *resultsize) +{ + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + + switch (request) { + case HAL_DIAG_EEPROM: + *result = &ee->ee_base; + *resultsize = sizeof(ee->ee_base); + return AH_TRUE; + } + return AH_FALSE; +} + +/* Do structure specific swaps if Eeprom format is non native to host */ +static void +eepromSwap(struct ar5416eeprom_4k *ee) +{ + uint32_t integer, i; + uint16_t word; + MODAL_EEP4K_HEADER *pModal; + + /* convert Base Eep header */ + word = __bswap16(ee->baseEepHeader.length); + ee->baseEepHeader.length = word; + + word = __bswap16(ee->baseEepHeader.checksum); + ee->baseEepHeader.checksum = word; + + word = __bswap16(ee->baseEepHeader.version); + ee->baseEepHeader.version = word; + + word = __bswap16(ee->baseEepHeader.regDmn[0]); + ee->baseEepHeader.regDmn[0] = word; + + word = __bswap16(ee->baseEepHeader.regDmn[1]); + ee->baseEepHeader.regDmn[1] = word; + + word = __bswap16(ee->baseEepHeader.rfSilent); + ee->baseEepHeader.rfSilent = word; + + word = __bswap16(ee->baseEepHeader.blueToothOptions); + ee->baseEepHeader.blueToothOptions = word; + + word = __bswap16(ee->baseEepHeader.deviceCap); + ee->baseEepHeader.deviceCap = word; + + /* convert Modal Eep header */ + pModal = &ee->modalHeader; + + /* XXX linux/ah_osdep.h only defines __bswap32 for BE */ + integer = __bswap32(pModal->antCtrlCommon); + pModal->antCtrlCommon = integer; + + for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) { + integer = __bswap32(pModal->antCtrlChain[i]); + pModal->antCtrlChain[i] = integer; + } + + for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) { + word = __bswap16(pModal->spurChans[i].spurChan); + pModal->spurChans[i].spurChan = word; + } +} + +static uint16_t +v4kEepromGetSpurChan(struct ath_hal *ah, int ix, HAL_BOOL is2GHz) +{ + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + + HALASSERT(0 <= ix && ix < AR5416_EEPROM_MODAL_SPURS); + HALASSERT(is2GHz); + return ee->ee_base.modalHeader.spurChans[ix].spurChan; +} + +/************************************************************************** + * fbin2freq + * + * Get channel value from binary representation held in eeprom + * RETURNS: the frequency in MHz + */ +static uint16_t +fbin2freq(uint8_t fbin, HAL_BOOL is2GHz) +{ + /* + * Reserved value 0xFF provides an empty definition both as + * an fbin and as a frequency - do not convert + */ + if (fbin == AR5416_BCHAN_UNUSED) + return fbin; + return (uint16_t)((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin)); +} + +/* + * Copy EEPROM Conformance Testing Limits contents + * into the allocated space + */ +/* USE CTLS from chain zero */ +#define CTL_CHAIN 0 + +static void +v4kEepromReadCTLInfo(struct ath_hal *ah, HAL_EEPROM_v4k *ee) +{ + RD_EDGES_POWER *rep = ee->ee_rdEdgesPower; + int i, j; + + HALASSERT(AR5416_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES); + + for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR5416_4K_NUM_CTLS; i++) { + for (j = 0; j < NUM_EDGES; j ++) { + /* XXX Confirm this is the right thing to do when an invalid channel is stored */ + if (ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) { + rep[j].rdEdge = 0; + rep[j].twice_rdEdgePower = 0; + rep[j].flag = 0; + } else { + rep[j].rdEdge = fbin2freq( + ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel, + (ee->ee_base.ctlIndex[i] & CTL_MODE_M) != CTL_11A); + rep[j].twice_rdEdgePower = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_POWER); + rep[j].flag = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_FLAG) != 0; + } + } + rep += NUM_EDGES; + } + ee->ee_numCtls = i; + HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM, + "%s Numctls = %u\n",__func__,i); +} + +/* + * Reclaim any EEPROM-related storage. + */ +static void +v4kEepromDetach(struct ath_hal *ah) +{ + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + + ath_hal_free(ee); + AH_PRIVATE(ah)->ah_eeprom = AH_NULL; +} + +#define owl_get_eep_ver(_ee) \ + (((_ee)->ee_base.baseEepHeader.version >> 12) & 0xF) +#define owl_get_eep_rev(_ee) \ + (((_ee)->ee_base.baseEepHeader.version) & 0xFFF) + +HAL_STATUS +ath_hal_v4kEepromAttach(struct ath_hal *ah) +{ +#define NW(a) (sizeof(a) / sizeof(uint16_t)) + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + uint16_t *eep_data, magic; + HAL_BOOL need_swap; + u_int w, off, len; + uint32_t sum; + + HALASSERT(ee == AH_NULL); + + if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s Error reading Eeprom MAGIC\n", __func__); + return HAL_EEREAD; + } + HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", + __func__, magic); + if (magic != AR5416_EEPROM_MAGIC) { + HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n"); + return HAL_EEMAGIC; + } + + ee = ath_hal_malloc(sizeof(HAL_EEPROM_v4k)); + if (ee == AH_NULL) { + /* XXX message */ + return HAL_ENOMEM; + } + + eep_data = (uint16_t *)&ee->ee_base; + for (w = 0; w < NW(struct ar5416eeprom_4k); w++) { + off = owl_eep_start_loc + w; /* NB: AP71 starts at 0 */ + if (!ath_hal_eepromRead(ah, off, &eep_data[w])) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s eeprom read error at offset 0x%x\n", + __func__, off); + return HAL_EEREAD; + } + } + /* Convert to eeprom native eeprom endian format */ + if (isBigEndian()) { + for (w = 0; w < NW(struct ar5416eeprom_4k); w++) + eep_data[w] = __bswap16(eep_data[w]); + } + + /* + * At this point, we're in the native eeprom endian format + * Now, determine the eeprom endian by looking at byte 26?? + */ + need_swap = ((ee->ee_base.baseEepHeader.eepMisc & AR5416_EEPMISC_BIG_ENDIAN) != 0) ^ isBigEndian(); + if (need_swap) { + HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM, + "Byte swap EEPROM contents.\n"); + len = __bswap16(ee->ee_base.baseEepHeader.length); + } else { + len = ee->ee_base.baseEepHeader.length; + } + len = AH_MIN(len, sizeof(struct ar5416eeprom_4k)) / sizeof(uint16_t); + + /* Apply the checksum, done in native eeprom format */ + /* XXX - Need to check to make sure checksum calculation is done + * in the correct endian format. Right now, it seems it would + * cast the raw data to host format and do the calculation, which may + * not be correct as the calculation may need to be done in the native + * eeprom format + */ + sum = 0; + for (w = 0; w < len; w++) { + sum ^= eep_data[w]; + } + /* Check CRC - Attach should fail on a bad checksum */ + if (sum != 0xffff) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "Bad EEPROM checksum 0x%x (Len=%u)\n", sum, len); + return HAL_EEBADSUM; + } + + if (need_swap) + eepromSwap(&ee->ee_base); /* byte swap multi-byte data */ + + /* swap words 0+2 so version is at the front */ + magic = eep_data[0]; + eep_data[0] = eep_data[2]; + eep_data[2] = magic; + + HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM, + "%s Eeprom Version %u.%u\n", __func__, + owl_get_eep_ver(ee), owl_get_eep_rev(ee)); + + /* NB: must be after all byte swapping */ + if (owl_get_eep_ver(ee) != AR5416_EEP_VER) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "Bad EEPROM version 0x%x\n", owl_get_eep_ver(ee)); + return HAL_EEBADSUM; + } + + v4kEepromReadCTLInfo(ah, ee); /* Get CTLs */ + + AH_PRIVATE(ah)->ah_eeprom = ee; + AH_PRIVATE(ah)->ah_eeversion = ee->ee_base.baseEepHeader.version; + AH_PRIVATE(ah)->ah_eepromDetach = v4kEepromDetach; + AH_PRIVATE(ah)->ah_eepromGet = v4kEepromGet; + AH_PRIVATE(ah)->ah_eepromSet = v4kEepromSet; + AH_PRIVATE(ah)->ah_getSpurChan = v4kEepromGetSpurChan; + AH_PRIVATE(ah)->ah_eepromDiag = v4kEepromDiag; + return HAL_OK; +#undef NW +} Added: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Sat Oct 10 22:29:34 2009 (r197948) @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2009 Rui Paulo + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * Copyright (c) 2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef _AH_EEPROM_V4K_H_ +#define _AH_EEPROM_V4K_H_ + +#include "ah_eeprom.h" +#include "ah_eeprom_v14.h" + +#undef owl_eep_start_loc +#ifdef __LINUX_ARM_ARCH__ /* AP71 */ +#define owl_eep_start_loc 0 +#else +#define owl_eep_start_loc 64 +#endif + +// 16-bit offset location start of calibration struct +#define AR5416_4K_EEP_START_LOC 64 +#define AR5416_4K_NUM_2G_CAL_PIERS 3 +#define AR5416_4K_NUM_2G_CCK_TARGET_POWERS 3 +#define AR5416_4K_NUM_2G_20_TARGET_POWERS 3 +#define AR5416_4K_NUM_2G_40_TARGET_POWERS 3 +#define AR5416_4K_NUM_CTLS 12 +#define AR5416_4K_NUM_BAND_EDGES 4 +#define AR5416_4K_NUM_PD_GAINS 2 +#define AR5416_4K_PD_GAINS_IN_MASK 4 +#define AR5416_4K_PD_GAIN_ICEPTS 5 +#define AR5416_4K_MAX_CHAINS 1 + +/* + * NB: The format in EEPROM has words 0 and 2 swapped (i.e. version + * and length are swapped). We reverse their position after reading + * the data into host memory so the version field is at the same + * offset as in previous EEPROM layouts. This makes utilities that + * inspect the EEPROM contents work without looking at the PCI device + * id which may or may not be reliable. + */ +typedef struct BaseEepHeader4k { + uint16_t version; /* NB: length in EEPROM */ + uint16_t checksum; + uint16_t length; /* NB: version in EEPROM */ + uint8_t opCapFlags; + uint8_t eepMisc; + uint16_t regDmn[2]; + uint8_t macAddr[6]; + uint8_t rxMask; + uint8_t txMask; + uint16_t rfSilent; + uint16_t blueToothOptions; + uint16_t deviceCap; + uint32_t binBuildNumber; + uint8_t deviceType; + uint8_t txGainType; /* high power tx gain table support */ +} __packed BASE_EEP4K_HEADER; // 32 B + +typedef struct ModalEepHeader4k { + uint32_t antCtrlChain[AR5416_4K_MAX_CHAINS]; // 12 + uint32_t antCtrlCommon; // 4 + int8_t antennaGainCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t switchSettling; // 1 + uint8_t txRxAttenCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t rxTxMarginCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t adcDesiredSize; // 1 + int8_t pgaDesiredSize; // 1 + uint8_t xlnaGainCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t txEndToXpaOff; // 1 + uint8_t txEndToRxOn; // 1 + uint8_t txFrameToXpaOn; // 1 + uint8_t thresh62; // 1 + uint8_t noiseFloorThreshCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t xpdGain; // 1 + uint8_t xpd; // 1 + int8_t iqCalICh[AR5416_4K_MAX_CHAINS]; // 1 + int8_t iqCalQCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t pdGainOverlap; // 1 + uint8_t ob; // 1 + uint8_t db; // 1 + uint8_t xpaBiasLvl; // 1 +#if 0 + uint8_t pwrDecreaseFor2Chain; // 1 + uint8_t pwrDecreaseFor3Chain; // 1 -> 48 B +#endif + uint8_t txFrameToDataStart; // 1 + uint8_t txFrameToPaOn; // 1 + uint8_t ht40PowerIncForPdadc; // 1 + uint8_t bswAtten[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t bswMargin[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t swSettleHt40; // 1 + uint8_t xatten2Db[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t xatten2Margin[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t ob_ch1; // 1 -> ob and db become chain specific from AR9280 + uint8_t db_ch1; // 1 + uint8_t flagBits; // 1 +#define AR5416_EEP_FLAG_USEANT1 0x01 /* +1 configured antenna */ +#define AR5416_EEP_FLAG_FORCEXPAON 0x02 /* force XPA bit for 5G */ +#define AR5416_EEP_FLAG_LOCALBIAS 0x04 /* enable local bias */ +#define AR5416_EEP_FLAG_FEMBANDSELECT 0x08 /* FEM band select used */ +#define AR5416_EEP_FLAG_XLNABUFIN 0x10 +#define AR5416_EEP_FLAG_XLNAISEL 0x60 +#define AR5416_EEP_FLAG_XLNAISEL_S 5 +#define AR5416_EEP_FLAG_XLNABUFMODE 0x80 + uint8_t miscBits; // [0..1]: bb_tx_dac_scale_cck + uint16_t xpaBiasLvlFreq[3]; // 6 + uint8_t futureModal[2]; // 2 + + SPUR_CHAN spurChans[AR5416_EEPROM_MODAL_SPURS]; // 20 B +} __packed MODAL_EEP4K_HEADER; // == 68 B + +typedef struct CalCtlData4k { + CAL_CTL_EDGES ctlEdges[AR5416_4K_MAX_CHAINS][AR5416_4K_NUM_BAND_EDGES]; +} __packed CAL_CTL_DATA_4K; + +typedef struct calDataPerFreq4k { + uint8_t pwrPdg[AR5416_4K_NUM_PD_GAINS][AR5416_4K_PD_GAIN_ICEPTS]; + uint8_t vpdPdg[AR5416_4K_NUM_PD_GAINS][AR5416_4K_PD_GAIN_ICEPTS]; +} __packed CAL_DATA_PER_FREQ_4K; + +struct ar5416eeprom_4k { + BASE_EEP4K_HEADER baseEepHeader; // 32 B + uint8_t custData[20]; // 20 B + MODAL_EEP4K_HEADER modalHeader; // 68 B + uint8_t calFreqPier2G[AR5416_4K_NUM_2G_CAL_PIERS]; + CAL_DATA_PER_FREQ_4K calPierData2G[AR5416_4K_MAX_CHAINS][AR5416_4K_NUM_2G_CAL_PIERS]; + CAL_TARGET_POWER_LEG calTargetPowerCck[AR5416_4K_NUM_2G_CCK_TARGET_POWERS]; + CAL_TARGET_POWER_LEG calTargetPower2G[AR5416_4K_NUM_2G_20_TARGET_POWERS]; + CAL_TARGET_POWER_HT calTargetPower2GHT20[AR5416_4K_NUM_2G_20_TARGET_POWERS]; + CAL_TARGET_POWER_HT calTargetPower2GHT40[AR5416_4K_NUM_2G_40_TARGET_POWERS]; + uint8_t ctlIndex[AR5416_4K_NUM_CTLS]; + CAL_CTL_DATA_4K ctlData[AR5416_4K_NUM_CTLS]; + uint8_t padding; +} __packed; + +typedef struct { + struct ar5416eeprom_4k ee_base; +#define NUM_EDGES 8 + uint16_t ee_numCtls; + RD_EDGES_POWER ee_rdEdgesPower[NUM_EDGES*AR5416_4K_NUM_CTLS]; + /* XXX these are dynamically calculated for use by shared code */ + int8_t ee_antennaGainMax[2]; +} HAL_EEPROM_v4k; +#endif /* _AH_EEPROM_V4K_H_ */